Proper setup for Windows host machine, WSL2 and Cuda
I have been trying to setup a CLion Cuda project that is opened using the Windows version of CLion and builds, runs and debugs via WSL2.
- So far I have setup a WSL toolchain as described here
- Changed the debugger to use the version of cuda-gdb provided by the Cuda toolkit. Which on my machine is stored at
\usr\local\cuda-12.6\bin\cuda-gdb
- I then opened the project and set the toolchain in CLion. But no matter what I do I am met with the following error:
CMake Error at /usr/share/cmake-3.28/Modules/Internal/CMakeCUDAArchitecturesValidate.cmake:7 (message):
CMAKE_CUDA_ARCHITECTURES must be non-empty if set.
- My CMakeLists does include
set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES native)
to set the architecture. So it shouldn't be empty
The project also uses Conan to handle depenencies, so I use the CMake preset provided by Conan and modify it to use the WSL toolchain. I have tried this setup using VSCode and their WSL extension and this works as intended. So I know the project is valid. I tried the troubleshooting step here which didn't solve my issue and I am unsure what else to try.
请先登录再写评论。