You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Continuing the work started in #26820, this corrects a bug in checking for deprecated capabilities: CMake's MATCHES operator accepts a regex and the value provided was not properly escaped. This results in configuration failing when specifying CUDA_ARCH_BIN containing the capability 100 (that's 10.0), since the . in the regex 1.0 will match the middle zero in 100. Example failure:
opencv> -- CUDA: Using CUDA_ARCH_BIN=100opencv> CMake Error at cmake/OpenCVDetectCUDAUtils.cmake:314 (message):opencv> CUDA: 1.0 compute capability is not supported - exclude it from ARCH/PTXopencv> list and re-run CMakeopencv> Call Stack (most recent call first):opencv> cmake/OpenCVDetectCUDAUtils.cmake:317 (ocv_wipeout_deprecated_cc)opencv> cmake/OpenCVDetectCUDALanguage.cmake:78 (ocv_set_cuda_arch_bin_and_ptx)opencv> cmake/OpenCVFindLibsPerf.cmake:44 (include)opencv> CMakeLists.txt:800 (include)
This PR rewrites the relevant check to use CMake's IN_LIST operator, and additionally checks against normalized versions of the capabilities with dots removed.
Although, perhaps those capabilities are old enough now that this check can be removed entirely?
@asmorkalov This is a nice feature enhancement as the current behaviour is confusing. According to the outdated documentation the compute capability should be specified with a dot. e.g. -DCUDA_ARCH_BIN=10.0, which still works, however
This is confusing because the output from CMake is
-- NVIDIA GPU arch: 100
This does not work when CUDA is a first class language, i.e. -DCMAKE_CUDA_ARCHITECTURES=10.0 fails.
I've tested this fix with the depreciated FindCUDA (-DCUDA_ARCH_BIN=100) and with CUDA as a first class language (both -DCUDA_ARCH_BIN=100 and -DCMAKE_CUDA_ARCHITECTURES=100) and the configuration works.
Note: This routine to wipeout compute capabilities 10 and 21 is outdated and highly dependant on the CUDA toolkit used.
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
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.
Continuing the work started in #26820, this corrects a bug in checking for deprecated capabilities: CMake's
MATCHESoperator accepts a regex and the value provided was not properly escaped. This results in configuration failing when specifyingCUDA_ARCH_BINcontaining the capability100(that's10.0), since the.in the regex1.0will match the middle zero in100. Example failure:This PR rewrites the relevant check to use CMake's
IN_LISToperator, and additionally checks against normalized versions of the capabilities with dots removed.Although, perhaps those capabilities are old enough now that this check can be removed entirely?
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.