build(opencv): build CUDA as a first-class language - #67
Merged
Merged
Conversation
The legacy FindCUDA path probes nvcc itself, ignoring the toolchain's CMAKE_CUDA_* settings, which forced three workarounds: a hand-fed CUDA_ARCH_BIN, the -allow-unsupported-compiler override passed twice, and skipping the python bindings in static builds where the legacy path's bare linker names (cublas, cudnn) broke the cv2 module link. With ENABLE_CUDA_FIRST_CLASS_LANGUAGE the toolchain files supply the architectures, the host compiler, and the override through the standard machinery, and all three workarounds retire.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #66. OpenCV's legacy FindCUDA path probes nvcc itself and ignores the toolchain's
CMAKE_CUDA_*settings, which forced three workarounds there:CUDA_ARCH_BIN=7.5,8.0(the arch autodetection came back empty on GPU-less runners with clang 22 as host compiler),-allow-unsupported-compilerpassed twice through legacy variables,cublas,cudnn) reached ninja as file dependencies and broke the cv2 module link.With
ENABLE_CUDA_FIRST_CLASS_LANGUAGE=ONthe toolchain files supply the architectures, the host compiler, and the override through the standardCMAKE_CUDA_*machinery, and all three workarounds retire. The flag had been OFF only because the recipe froze OpenCV's then-default when its option surface was first enumerated, not from any adverse experience with the first-class path.