Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building with CUDA #53

Open
peastman opened this issue Mar 17, 2022 · 5 comments
Open

Error building with CUDA #53

peastman opened this issue Mar 17, 2022 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@peastman
Copy link
Member

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
@raimis
Copy link
Contributor

raimis commented Mar 18, 2022

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 raimis added the help wanted Extra attention is needed label Mar 18, 2022
@peastman
Copy link
Member Author

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
Copy link
Member Author

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.

@RaulPPelaez
Copy link
Contributor

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.

@peastman
Copy link
Member Author

peastman commented Mar 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants