TiledTensor / TiledCUDA

TiledCUDA is a highly efficient kernel template library designed to elevate CUDA C’s level of abstraction for processing tiles.
MIT License
159 stars 10 forks source link

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

Closed haruhi55 closed 7 months ago

haruhi55 commented 7 months ago

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

https://github.com/TiledTensor/TiledCUDA/blob/cf22ba1df7fd23e2114d853e6de0dba6c30a9626/CMakeLists.txt#L3-L5

I think this is a hotfix to bypass the below compiling issue as solution listed in this issue https://github.com/NVlabs/instant-ngp/issues/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?

KuangjuX commented 7 months ago

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 commented 7 months ago

Sure. I can fix it in the next PR.