Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Profiling multi threaded OpenCV GPU module application

Dear All,

I am trying to run a multi-threaded application using OpenCV GPU module. The application is developed in Visual Studio 2012 professionl + CUDA 5.5 + OpenCV 2.4.6 and uses pthreads for multi-threading. I built OpenCV 2.4.6 for this environment.

My application executes with two threads and there are no exceptions. I start getting a number of CUDA related exceptions with 3 or more than three threads.

I create a thread for each video stream. Read video stream into buffers and start analysing the video frames one after the other on GPU. Below is how analysis is done:

(for all video frames) { 1) Read video frame from buffer 2) Copy one video frame to GPU 3) Perform analysis 4) Download the results }

I am having problems with OpenCV GPU module implementation (see below). Does anybody know how to profile CUDA code from within OpenCV module?

Alternatively, Can anybody suggest an alternate implementation?

Regards, Tariq

On Wed, Jun 4, 2014 at 3:12 PM, [email protected] [email protected] wrote:

Dear all,

I am trying to run a multi-threaded application using OpenCV GPU module. The application is developed in Visual Studio 2012 professionl + CUDA 5.5 + OpenCV 2.4.6 and uses pthreads for multi-threading. I built OpenCV 2.4.6 for this environment.

My application executes with two threads and there are no exceptions. I start getting a number of CUDA related exceptions with 3 or more that three threads.

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

OpenCV Error: Gpu API call (unspecified launch failure) in unknown function, file C:\opencv-2.4.6\modules\core\src\gpumat.cpp, line 1196

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

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

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

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

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

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

cudaError_t=4 = cudaErrorLaunchFailure

Any help is appreciated.

Profiling multi threaded OpenCV GPU module application

Dear All,

I am trying to run a multi-threaded application using OpenCV GPU module. The application is developed in Visual Studio 2012 professionl + CUDA 5.5 + OpenCV 2.4.6 and uses pthreads for multi-threading. I built OpenCV 2.4.6 for this environment.

My application executes with two threads and there are no exceptions. I start getting a number of CUDA related exceptions with 3 or more than three threads.

I create a thread for each video stream. Read video stream into buffers and start analysing the video frames one after the other on GPU. Below is how analysis is done:

(for all video frames) { frames)

{

   1) Read video frame from buffer
      2) Copy one video frame to GPU
      3) Perform analysis
      4) Download  the results 
results

}

I am having problems with OpenCV GPU module implementation (see below). Does anybody know how to profile CUDA code from within OpenCV module?

Alternatively, Can anybody suggest an alternate implementation?

Regards, Tariq

On Wed, Jun 4, 2014 at 3:12 PM, [email protected] [email protected] wrote:

Dear all,

I am trying to run a multi-threaded application using OpenCV GPU module. The application is developed in Visual Studio 2012 professionl + CUDA 5.5 + OpenCV 2.4.6 and uses pthreads for multi-threading. I built OpenCV 2.4.6 for this environment.

My application executes with two threads and there are no exceptions. I start getting a number of CUDA related exceptions with 3 or more that three threads.

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

OpenCV Error: Gpu API call (unspecified launch failure) in unknown function, file C:\opencv-2.4.6\modules\core\src\gpumat.cpp, line 1196

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

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

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

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

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

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

cudaError_t=4 = cudaErrorLaunchFailure

Any help is appreciated.