Skip to content

Migrate to FindCUDAToolkit.cmake  #24034

@SomeoneSerge

Description

@SomeoneSerge

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions