Opencv crash in CUDA code with multi-threads

I am using OpenCV GPU module for processing the video streams and having crash when trying to execute more than 2 parallel processing threads on GPU using OpenCV.

Is it possible for you to answer my following question or refer to someone from OpenCV group who can help me out on this issue?

I am doing object detection from video stream usig cascadeclassifer_gpu.detectmultiscale function. There are no crashes with one thread. My environment is Windows 7, Visual Studio 2012, CUDA 5.5, and Opencv 2.4.6

When I try to run multiple processing threads on GPU from the CPU. I have the following crashs in my program.

//-----------------------------------------------------------------------------------

OpenCV Error: Gpu API call (NCV Assertion Failed: cudaError_t=30, file=C:/opencv-2.4.6/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu, line=1206) in unknown function, file C:\opencv-2.4.6\modules\gpu\src\cascadeclassifier.cpp, line 173

*ERROR Line from OpenCV code: * static void NCVDebugOutputHandler(const std::string &msg) { CV_Error(CV_GpuApiCallError, msg.c_str()); }

//-----------------------------------------------------------------------------------

Error Code: -217

Error Description: C:\Users\Abdullah\Downloads\opencv-2.4.6\modules\gpu\src\casc adeclassifier.cpp:173: error: (-217) NCV Assertion Failed: cudaError_t=30, file= C:/opencv-2.4.6/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu, line=1206

ERROR Line from OpenCV code: ncvAssertCUDAReturn(cudaStreamSynchronize(cuStream), NCV_CUDA_ERROR);

//-----------------------------------------------------------------------------------

Error DescrOpenCV Error: Gpu API call (unknown error) in unknown function, file C:\opencv-2.4.6\modules\core\src\gpumat.cpp, line 1415

ERROR Function from OpenCV code: *
void mallocPitch(void* devPtr, size_t* step, size_t width, size_t height) const {
cudaSafeCall( cudaMallocPitch(devPtr, step, width, height) );
}

//-----------------------------------------------------------------------------------

I ma using Windows/PThreads to spawn multiple-threads on the GPU. Each thread is independent of the others. It is processing a separate video file and loads its own cascadeclassifier.

I am facing these issues for last 3 months and could not find a solution for it. Could any body from development team help me out for these crashes?

I have asked these crashing issues at OpenCV answers forum and did not get a reply.

All of the reported crashes occur when I try to run multiple processing threads on GPU from the CPU.I use Windows/PThreads to spawn multiple-threads on the GPU. Each thread is independent of the others. It is processing a separate video file and loads its own cascadeclassifier. It will be nice to have answer of all or some of these questions:

  1. http://answers.opencv.org/question/36913/occasional-crash-in/
  2. http://answers.opencv.org/question/36602/multi-threading-support-in-opencv-gpu-module/
  3. http://answers.opencv.org/question/36601/cascadeclassifier_gpu-with-cvgpustream/
  4. http://answers.opencv.org/question/35170/gpu-threads-count-from-opencv-gpu-module/
  5. http://answers.opencv.org/question/35943/gpu-real-time-monitoring-in-windows-7/
  6. http://answers.opencv.org/question/34949/debug-cuda-code-from-opencv/
  7. http://answers.opencv.org/question/34609/profiling-multi-threaded-opencv-gpu-module/
  8. http://answers.opencv.org/question/34383/cuda-streams-in-opencv/
  9. http://answers.opencv.org/question/34576/opencv-gpu-module-exceptions-from-its-cuda/
  10. http://answers.opencv.org/question/34572/cudaerrorcudartunloading-in-opencv-gpu-module/