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

Is it possible to remove the hard-coded path of cuda compiler in cmake? #18

Closed
haruhi55 opened this issue Apr 24, 2024 · 2 comments · Fixed by #21
Closed

Is it possible to remove the hard-coded path of cuda compiler in cmake? #18

haruhi55 opened this issue Apr 24, 2024 · 2 comments · Fixed by #21
Labels
enhancement New feature or request

Comments

@haruhi55
Copy link
Collaborator

haruhi55 commented Apr 24, 2024

When I look into the current way to set the path of Cuda compiler as listed below:

set(CMAKE_CUDA_ARCHITECTURES 70 75 80 86)
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
set(CUDACXX /usr/local/cuda/bin/nvcc)

I think this is a hotfix to bypass the below compiling issue as solution listed in this issue NVlabs/instant-ngp#747

 ptxas fatal : Value 'sm_30' is not defined for option 'gpu-name'

In my environment, I have a local CUDA installation, which is quite common, instead of the globally installed CUDA. This hard-coded approach initially sets the nvcc compiler to the globally installed CUDA Toolkit, but then find_package(CUDA) overwrites the CUDA compiler based on the environment variable. This approach seems a little awkward.

@KuangjuX Is it necessary to fix this compiling issue by running sudo apt remove nvidia-cuda-toolkit (which I have already done on the testing machine) and keep the CMakeFiles clean?

@haruhi55 haruhi55 added the enhancement New feature or request label Apr 24, 2024
@KuangjuX
Copy link
Member

KuangjuX commented Apr 24, 2024

I agree, it seems that ad-hoc solutions specific to the local machine should not be present in the project. Alternatively, another solution is to set CMAKE_CUDA_COMPILER and CUDACXX as environment variables instead of hardcoding them.

@haruhi55
Copy link
Collaborator Author

Sure. I can fix it in the next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants