SURF_GPU & thread safety (Bug #3592)


Added by Stephane LADEVIE about 11 years ago. Updated about 11 years ago.


Status:Cancelled Start date:2014-03-04
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:gpu (cuda)
Target version:2.4.9
Affected version:2.4.8 (latest release) Operating System:Linux
Difficulty: HW Platform:x64
Pull request:

Description

When multiple threads call SURF_GPU at the same time, they lead to unexpected and random results. It does not happen if each call is performed sequentially.

The bug seems to come from the operator() because it does not occur anymore if operator call is surrounded by mutex.

Exemple :
-------------- | KO Thread code |
--------------
[...]
cv::gpu::SURF_GPU surf(minHessian, 4, 2, is_extended, 0.01f);
surf(gpu_object, cv::gpu::GpuMat(), gpu_keypoints_object, gpu_descriptors_object);
surf(gpu_scene, cv::gpu::GpuMat(), gpu_keypoints_scene, gpu_descriptors_scene);
[...]

-------------- | OK Thread code |
--------------
[...]
cv::gpu::SURF_GPU surf(minHessian, 4, 2, is_extended, 0.01f);
pthread_mutex_lock(mutex);
surf(gpu_object, cv::gpu::GpuMat(), gpu_keypoints_object, gpu_descriptors_object);
surf(gpu_scene, cv::gpu::GpuMat(), gpu_keypoints_scene, gpu_descriptors_scene);
pthread_mutex_unlock(mutex);
[...]

I'm working on Ubuntu 12.04.4 LTS 64bits with CUDA 5.5.22 (GPU Quadro K4000) and OpenCV 2.4.8 (Linux release version).
It does not seem to come from CUDA or GPU since I test with other gpu functions and I never encountered the problem again.


Associated revisions

Revision 60cedd7a
Added by Vadim Pisarevsky about 10 years ago

Merge pull request #3592 from jet47:cuda-7.0-android

History

Updated by Stephane LADEVIE about 11 years ago

Sorry for the multipost, my browser has messed up.
This bug is the same than #3591 and #3590.

  • Assignee deleted (Vladislav Vinogradov)

Updated by Dinar Ahmatnurov about 11 years ago

  • Status changed from New to Cancelled

Also available in: Atom PDF