Cmake problem

Hi. I use WSL2 with Ubuntu 18.04 LTS. I installed the WSL geforce nvidia driver 510.06 on windows 11. I have also installed the latest cuda sdk 11.5 - update 1. For my windows/linux cross platform application I use cmake. This works fine for windows, but on linux I have an issue to get cmake working. I use gcc 7.5.

After installing the CUDA sdk I saw one issue:
sudo ldconfig gives me:
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

in cmake I include cuda with these lines:
find_package(CUDAToolkit 11.5 REQUIRED )
include_directories (SYSTEM ${CUDAToolkit_INCLUDE_DIRS})

which results in this output:
1> [CMake] – Unable to find cudart library.
1> [CMake] CMake Error at /usr/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
1> [CMake] Could NOT find CUDAToolkit (missing: CUDA_CUDART) (found suitable version
1> [CMake] “11.5.119”, minimum required is “11.5”)
1> [CMake] Call Stack (most recent call first):
1> [CMake] /usr/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
1> [CMake] /usr/local/share/cmake-3.22/Modules/FindCUDAToolkit.cmake:814 (find_package_handle_standard_args)

So cmake seems to see the correct cuda installation - but it also doesn’t find CUDA_CUDART.

Anyone sees the same issues? Any idea what I’m doing wrong here?

Thanks,
Daniel

1 Like