-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
add MATCH_CUDA_MINOR_VERSION, resolve #26965 #26966
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
base: 4.x
Are you sure you want to change the base?
Changes from all commits
097512e
a50e182
1fe33b7
455fb87
815fc45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
set(OpenCV_COMPUTE_CAPABILITIES "@OpenCV_CUDA_CC@") | ||
|
||
set(OpenCV_CUDA_VERSION "@CUDA_VERSION_STRING@") | ||
set(OpenCV_CUDA_VERSION_MIN "@CUDA_VERSION_MIN@") | ||
set(OpenCV_CUDA_VERSION_MAX "@CUDA_VERSION_MAX@") | ||
set(OpenCV_USE_CUBLAS "@HAVE_CUBLAS@") | ||
set(OpenCV_USE_CUFFT "@HAVE_CUFFT@") | ||
set(OpenCV_USE_NVCUVID "@HAVE_NVCUVID@") | ||
|
@@ -10,10 +12,10 @@ set(OpenCV_CUDNN_VERSION "@CUDNN_VERSION@") | |
set(OpenCV_USE_CUDNN "@HAVE_CUDNN@") | ||
|
||
if(NOT CUDA_FOUND) | ||
find_host_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED) | ||
find_host_package(CUDA ${OpenCV_CUDA_VERSION_MIN} EXACT REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From CMake documentation:
The option is redundant for the case with softer case, if minor version is included. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as I tested: |
||
else() | ||
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION) | ||
message(FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}") | ||
if(CUDA_VERSION_STRING VERSION_GREATER_EQUAL OpenCV_CUDA_VERSION_MAX OR CUDA_VERSION_STRING VERSION_LESS OpenCV_CUDA_VERSION_MIN) | ||
message(FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the version >=${OpenCV_CUDA_VERSION_MIN} <{OpenCV_CUDA_VERSION_MAX} or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}") | ||
endif() | ||
endif() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose for the case when
match_minor
is off use range major.minor...major+1.0. NVidia may introduce backward compatible change, but not forward compatible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is why the match_minor by default is ON. But the user can choose to ignore minor version.
Personally, I never encounter API incompatibility during minor version update. The case the application breaks due to cuda toolkit update is the PTX, which is actually a problem of system maintenance: you simply should not update cuda toolkit without update driver.
Other kind of breakage is due to bugs introduced in each minor version, but then it is not API breakage, the library still be able to link to whatever minor version. If one knows some version give out wrong executing result they on should just choose a different version when he compile his code, as library provider we should not care.