FindCUDAToolkit: cannot find cudart on Ubuntu 22.04 with system packages when using conda
I am using CMake 3.26.4 on Ubuntu 22.04. I have installed the CUDA toolkit from the Ubuntu package nvidia-cuda-toolkit
.
nvcc
is installed and available from the system path:
$ which nvcc
/usr/bin/nvcc
libcudart is also installed:
$ find /usr/lib -name "libcudart*"
/usr/lib/x86_64-linux-gnu/libcudart.so
/usr/lib/x86_64-linux-gnu/libcudart_static.a
/usr/lib/x86_64-linux-gnu/libcudart.so.11.5.117
/usr/lib/x86_64-linux-gnu/libcudart.so.11.0
Yet, when find_package(CUDAToolkit REQUIRED)
is used, CMake fails finding libcudart:
-- Unable to find cudart library.
CMake Error at /home/antoine/mambaforge/envs/pyarrow/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find CUDAToolkit (missing: CUDA_CUDART) (found version
"11.5.119")
Call Stack (most recent call first):
/home/antoine/mambaforge/envs/pyarrow/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/home/antoine/mambaforge/envs/pyarrow/share/cmake-3.26/Modules/FindCUDAToolkit.cmake:918 (find_package_handle_standard_args)
src/arrow/gpu/CMakeLists.txt:41 (find_package)
Edited by Antoine Pitrou