Hi - I’m new to C++ and CUDA, and am following this guide: An Even Easier Introduction to CUDA | NVIDIA Technical Blog
I have the latest CUDA (12.2) and LLVM (17.0.1) installed, on Windows. I receive this error when compiling:
clang++: error: cannot find libdevice for sm_35; provide path to different CUDA installation via '--cuda-path', or pass '-nocudalib' to build without linking with libdevice
I have the env var CUDA_PATH and CUDA_PATH_V12_2 set to the appropriate directory, as set by CUDA’s installer automatically. If I pass
--cuda-path as an argument, I get the same error, plus this error:
clang++: error: unsupported option '--cuda-path
How would you approach this? Thank you.
Edit: It appears the solution is to use
nvcc instead of gcc++, and to add
Microsoft Visual Studio/2022/Comunity/VC/Tools/MSVC/14.xxx/bin/Hostx64/x64 to the path.