NNPOps icon indicating copy to clipboard operation
NNPOps copied to clipboard

Error building with CUDA

Open peastman opened this issue 2 years ago • 5 comments

If I try to enable building CUDA, CMake fails with this error:

 CMake Error at CMakeLists.txt:8 (enable_language):
   Language 'CUDA' is currently being enabled.  Recursive call not allowed.

I tried removing the call to enable_language(CUDA), but then it fails with the errors,

 CMake Error: Cannot determine link language for target "TestCudaANISymmetryFunctions".
 CMake Error: CMake can not determine linker language for target: TestCudaANISymmetryFunctions
 CMake Error: Cannot determine link language for target "TestCudaCFConv".
 CMake Error: CMake can not determine linker language for target: TestCudaCFConv

peastman avatar Mar 17 '22 21:03 peastman

Do you get this following the instructions (https://github.com/openmm/NNPOps#build--install)?

I have never seen such error. My wild guess is that cmake is interfering with another build configuration.

raimis avatar Mar 18 '22 10:03 raimis

Do you get this following the instructions (https://github.com/openmm/NNPOps#build--install)?

It's basically the same. I can't follow those instructions exactly because I'm building in an existing environment I used to build OpenMM, etc. I'll keep investigating.

peastman avatar Mar 18 '22 17:03 peastman

I tried exactly following the instructions, and it failed with

CMake Error at /home/peastman/miniconda3/envs/nnpops2/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:90 (message):
  Your installed Caffe2 version uses CUDA but I cannot find the CUDA
  libraries.  Please set the proper CUDA prefixes and / or install CUDA.

To make it work, I need to manually set both CUDA_SDK_ROOT_DIR and CUDA_TOOLKIT_ROOT_DIR in CMake. That also fixes the other problem above.

peastman avatar Mar 18 '22 23:03 peastman

Is this still a problem, @peastman ? When installing CUDA from conda, sometimes I need to export CUDA_HOME=$CONDA_PREFIX for CMake to found it.

RaulPPelaez avatar Mar 02 '23 12:03 RaulPPelaez

I don't know. I just tried creating a new environment and building with the instructions in the README and it worked. I don't know what's different though, whether it comes from a change to this repo, a different version of CMake, a different version of CUDA, or something else.

peastman avatar Mar 02 '23 21:03 peastman