OpenCV Error: Gpu API call (CUBLAS_STATUS_NOT_INITIALIZED

asked 2013-02-13 11:38:54 -0500

pramod gravatar image

Hi all,

I get the following error when i run the function gpu::gemm

OpenCV Error: Gpu API call (CUBLAS_STATUS_NOT_INITIALIZED [Code = 1]) in gemm, file /home/pramod/robot/OpenCV-2.4.0/modules/gpu/src/arithm.cpp, line 133 terminate called after throwing an instance of 'cv::Exception' what(): /home/pramod/robot/OpenCV-2.4.0/modules/gpu/src/arithm.cpp:133: error: (-217) CUBLAS_STATUS_NOT_INITIALIZED [Code = 1] in function gemm

It doesn't produce the error the first time i run gemm function. But when i run it in a loop ( same set of matrices repeated) it gives the above error at some point. I am really clueless why it doesn't produce this error the first time!!

By the way, I have opencv version 2.4.2, cuda tool kit version 4.1. I have enabled CUBLAS while compiling opencv (this i am sure about because gemm function runs first few times giving right results).

Sometimes i also get the following error after many iterations : OpenCV Error: Gpu API call (out of memory) in mallocPitch, file /home/pramod/robot/OpenCV-2.4.0/modules/core/src/gpumat.cpp, line 1263 terminate called after throwing an instance of 'cv::Exception' what(): /home/pramod/robot/OpenCV-2.4.0/modules/core/src/gpumat.cpp:1263: error: (-217) out of memory in function mallocPitch

I am very sure there is no memory leak in my code. I am using a static universal variable that is reused every time.

Thanks a lot in advance for your replies, Regards, Pramod

edit retag flag offensive close merge delete

Comments

Are you you allocating or freeing the memory for each frame? Are you always calling from the same thread?

xaffeine gravatar imagexaffeine ( 2013-02-13 19:20:28 -0500 )edit