-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix CUDA texture bugs and replace all instances of CUDA texture references with texture objects #3378
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
Merged
asmorkalov
merged 1 commit into
opencv:4.x
from
cudawarped:replace_texture_ref_with_texture_obj
Dec 20, 2022
Merged
Fix CUDA texture bugs and replace all instances of CUDA texture references with texture objects #3378
asmorkalov
merged 1 commit into
opencv:4.x
from
cudawarped:replace_texture_ref_with_texture_obj
Dec 20, 2022
Conversation
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
d738c38
to
50c6568
Compare
@asmorkalov How to run |
3c83cfd
to
b9c43d2
Compare
4 tasks
asmorkalov
reviewed
Dec 14, 2022
5f0ed82
to
2938ad7
Compare
asmorkalov
approved these changes
Dec 14, 2022
@asmorkalov I've just noticed I missed, lut.cu and left the main texture reference routine in the main repo which is causing issues with CUDA 12.0 (#3390). I'm addressing this now. |
2938ad7
to
fa45dba
Compare
6 tasks
Combination of changes in core and contrib leads to build error. CUDA: 10.2, Ubuntu 18.04.
|
…cts using the existing updated cv::cudev::Texture class. Fixes bugs in cv::cuda::demosaicing, cv::cuda::resize and cv::cuda::HoughSegmentDetector.
fa45dba
to
8a6ea82
Compare
4 tasks
Merged
6 tasks
4 tasks
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.
CUDA texture objects replaced CUDA texture references in the 2012 (CUDA SDK 5.0 toolkit) and could be removed at any time from future SDK releases by Nvidia as they were depreciated in April 2021 (CUDA SDK 11.3).
This PR replaces all instances of texture references with texture objects using the existing updated
cv::cudev::Texture class
.Additionaly it addresses the three bugs below related to incorrect texture usage:
cv::cuda::resize
- currently resize uses texture references if the default stream or no stream is passed. Under these circumstances global texture references are used when multiple threads callcv::cuda::resize
which is unsafe.cv::cuda::demosaicing
- returns incorrect results when passed image ROI's.cv::cuda::HoughSegmentDetector
- passes the existingcv::cudev::Texture
object whose destructor callscudaDestroyTextureObject()
to the CUDA kernel. This can cause the underlyingcudaTextureObject_t
to be destroyed on return from the copy to the stub function before the kernel is launched as described in the Nvidia docs.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.