- Notifications
You must be signed in to change notification settings - Fork5.9k
Stream waits in corners.cu before textures destruction#4052
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
asmorkalov commentedDec 16, 2025
asmorkalov commentedDec 16, 2025
@gagicb Could you add some issue description and why you add the synchronization for non-default stream. Some reference to documentation is useful too. |
gagicb commentedDec 16, 2025
Hi@asmorkalov, Using a texture handle after calling cudaDestroyTextureObject results in undefined behavior.
At step 4, we must guarantee that kernel K launched on stream S has completed and that T is no longer used before it is destroyed. Thats why I added stream synchronization before function return. Relevant description from the CUDA SDK documentation: Best regards, |
d99ad2a intoopencv:4.xUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Using a texture handle after calling cudaDestroyTextureObject results in undefined behavior.
In GFTT/corners, we had the following sequence:
At step 4, we must guarantee that kernel K launched on stream S has completed and that T is no longer used before it is destroyed. Thats why I added stream synchronization before function return.
Relevant description from the CUDA SDK documentation:
https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT__1_gae41ef138ba69d54b91068247f8f6c4e8:~:text=Use%20of%20the%20handle%20after%20this%20call%20is%20undefined%20behavior.
Pull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.