Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to FindCUDAToolkit.cmake #24034

Closed
SomeoneSerge opened this issue Jul 20, 2023 · 1 comment · Fixed by #23021 or opencv/opencv_contrib#3400
Closed

Migrate to FindCUDAToolkit.cmake #24034

SomeoneSerge opened this issue Jul 20, 2023 · 1 comment · Fixed by #23021 or opencv/opencv_contrib#3400
Milestone

Comments

@SomeoneSerge
Copy link

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

@cudawarped
Copy link
Contributor

I think because OpenCV used FindCUDA for both genrating the build files for CUDA code and accessing the CUDA Toolkit it would be difficult to just use FindCUDAToolkit without enabling CUDA as a first class language.

In #23021 and opencv/opencv_contrib#3400 I started the process of moving to CUDA as a first class language which includes using FindCUDAToolkit.

It would be great if you could check if this works for you and if CUDAToolkit_ROOT can except a list of paths when passed to OpenCV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants