-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Migrate to FindCUDAToolkit.cmake #24034
Description
Describe the feature and motivation
NVIDIA considers FindCUDA.cmake (find_package(CUDA)) deprecated: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/#importing-tarballs-into-cmake. The common approach to consume cudatoolkit today is to use FindCUDAToolkit.cmake (find_package(CUDAToolkit COMPONENTS cudart cublas ...)).
Aside from FindCUDA being obsolete, there are notable differences between the modules: e.g. FindCUDAToolkit.cmake allows its CUDAToolkit_ROOT variable to take the form of a list of paths, and this way it supports splayed installations of cudatoolkit, where different components (cudart, cublas, ...) may reside in different prefixes (as is the case e.g. in nixpkgs)
Other big sci-comp projects are also moving away from FindCUDA, e.g. pytorch/pytorch#76082
Thanks!
Additional context
No response