Is it possible to remove the hard-coded path of cuda compiler in cmake?
haruhi55 opened this issue · comments
When I look into the current way to set the path of Cuda compiler as listed below:
Lines 3 to 5 in cf22ba1
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?
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.
Sure. I can fix it in the next PR.