-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
cuda 13.0 compatibility #27636
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
cuda 13.0 compatibility #27636
Conversation
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.
Have you checked when cudaDeviceGetTexture1DLinearMaxWidth
and all the device attributes returned by cudaDeviceGetAttribute
were introduced in case you need to add CUDA_VERSION checks?
All calls should be wrapped with cudaSafeCall( )
modules/core/src/cuda_info.cpp
Outdated
cudaError_t clockRateErr = cudaDeviceGetAttribute(&clockRate, cudaDevAttrClockRate, dev); | ||
if (clockRateErr == cudaSuccess) | ||
{ | ||
printf(" GPU Clock Speed: %.2f GHz\n", prop.clockRate * 1e-6f); |
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.
modules\core\src\cuda_info.cpp(951): error C2039: 'clockRate': is not a member of 'cudaDeviceProp'
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.
Fixed
modules/core/src/cuda_info.cpp
Outdated
@@ -531,7 +537,10 @@ int cv::cuda::DeviceInfo::maxTexture1D() const | |||
#ifndef HAVE_CUDA | |||
throw_no_cuda(); | |||
#else | |||
return deviceProps().get(device_id_)->maxTexture1D; |
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.
maxTexture1DLinear
has been depreciated not maxTexture1D
See
opencv\modules\core\src\cuda_info.cpp(566): error C2039: 'maxTexture1DLinear': is not a member of 'cudaDeviceProp'
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.
Yep, I messed that up. Thanks for pointing it out. Fixed.
I went through cuda documentation. |
It looks like this was added in CUDA Toolkit 11.1.0? |
You are right. Would you prefer the cuda version check to be for when it was deprecated or when the function was introduced? |
I think when depreciated as you have it will work. |
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.
LGTM 👍
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.
Issue
CUDA 13 deprecated some fields, resulting in build failures with CUDA 13. This updates to use the replacement API.
The reference to the deprecated features is here: https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#id6
Testing
This was testing by building on the following configurations:
OS: Ubuntu 24.04
CUDA: 12.9, 13.0