Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I also left the same lengthy comment which follows inside the code itself, since it might be useful also for other ports (we should think about integrating it inside vcpkg sources maybe, or propose a fix to CMake upstream)
CMake looks for nvcc only in
PATH
andCUDACXX
env vars for the Ninja generator. Since we filter path on vcpkg andCUDACXX
env var is not set by CUDA installer on Windows, CMake cannot find CUDA when using Ninja generator, so we need to manually enlight it if necessary (https://gitlab.kitware.com/cmake/cmake/issues/19173). Otherwise we could just disable Ninja and use MSBuild, but unfortunately CUDA installer does not integrate with some distributions of MSBuild (like the ones inside Build Tools), making CUDA unavailable otherwise in those cases, which we want to avoidAlso, ninja is faster, so it's the best choice :)
edit: this comment is valid only for new CMake first class CUDA integration (
enable_language(CUDA)
). Oldfind_package(CUDA)
has many tricks under its belt to be able to find CUDA in our cases, which is why for now it was not a common problem (I think darknet is the only port as of now using the new CMake first class CUDA integration 🥇 )