-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 #2833
Comments
Yeah, we will update eventually. We are on cmake 3.8 right now and that's a feature only in 3.17 or newer. Lots of dlib users update their tooling slowly, so dlib has to update slowly too :| |
Would it make sense to have branch logic for these 2 cases? Namely
Maybe another option would be to vendor cc @robertmaynard (in case you have thoughts/suggestions here) |
I like the idea of introducing FindCUDAToolkit.cmake support earlier. I find branching preferable to vendoring because it's a risk of divergence. E.g. pytorch vendors a copy, but their API already deviates from kitware's (the former doesn't accept lists in |
Replacing This kind of change makes it harder to support switching between pre and post 3.17. I would recommend making a clean break when possible, especially given that CMake 3.27 introduces a policy to remove CMake does offer |
See conda-forge/dlib-feedstock#83 for a patch that uses FindCUDAToolkit.cmake (more specifically, https://github.com/conda-forge/dlib-feedstock/blob/cf9148326a7ad74c1dd519c2d3d5dc2912f9697c/recipe/use_new_cudatoolkit.patch) |
Yeah if it can just branch on cmake version without being a big mess that would be cool. I personally have newer cmake on my system. Maybe we could start to require cmake 3.17 for dlib. It bothers me though that, for example, Ubuntu 22.04 then wouldn't work with its version of cmake and I know plenty of people are still on stuff that old. Is this a big deal to not have the newer thing right now? |
CUDA12 is (as far as I know) not supported with the old FindCUDA. |
Ubuntu 22.04 provides CMake 3.22. The upside is for 20.04 and 22.04 the |
Uh, yeah, alright. I've come around. It's not like people have to pull the latest dlib if they are on an old OS anyway and it would be real convenient for multiple reasons to upgrade CMake. So one of you want to put up a PR that switches to cleaner cuda cmake rules and uses cmake 3.17? :) |
I don't have the capacity at the moment, but basically everything required is in https://github.com/conda-forge/dlib-feedstock/blob/cf9148326a7ad74c1dd519c2d3d5dc2912f9697c/recipe/use_new_cudatoolkit.patch (just needs a bump of the cmake_minimum_version). |
Well, I mean, is it really all in that patch? Seems like you are saying
it's not if it takes time? :)
…On Tue, Jan 16, 2024 at 11:59 PM Tobias Fischer ***@***.***> wrote:
I don't have the capacity at the moment, but basically everything required
is in
https://github.com/conda-forge/dlib-feedstock/blob/cf9148326a7ad74c1dd519c2d3d5dc2912f9697c/recipe/use_new_cudatoolkit.patch
(just needs a bump of the cmake_minimum_version).
—
Reply to this email directly, view it on GitHub
<#2833 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPYFR3MKTFNBWYJUJJMEUDYO5LDDAVCNFSM6AAAAAA2RU64ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJUHE2DGMZYG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Yes, it’s all in the patch except for setting the correct minimum cmake version |
I did have a branch at some point in the past that cleaned up all of dlib's cmake stuff including CUDA. I can try to revive that at some point. |
Yeah. I think I'm fine with switching the required version of cmake to a higher version. So if there is some good stuff to be had by doing that then send me a PR :) |
Main idea
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 itsCUDAToolkit_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 sci-comp projects are moving away from
FindCUDA.cmake
too, e.g. pytorch/pytorch#76082Thanks!
Anything else?
No response
The text was updated successfully, but these errors were encountered: