wanglimin / dense_flow

OpenCV Implementation of different optical flow algorithms
231 stars 202 forks source link

Gpu API call (unknown error) in mallocPitch #23

Closed shamoqianting closed 6 years ago

shamoqianting commented 6 years ago

I encounter the following problem when I try to extract frames and optical flow images. OpenCV Error: Gpu API call (unknown error) in mallocPitch, file /data1/temporal-segment-networks-master/3rd-party/opencv-2.4.13/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp, line 1134 terminate called after throwing an instance of 'cv::Exception' what(): /data1/temporal-segment-networks-master/3rd-party/opencv-2.4.13/modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp:1134: error: (-217) unknown error in function mallocPitch

Though I delete the build folder and add the line set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -arch compute_37 -code sm_37) to CMakeList.txt file, and then rebuild dense_flow, the problem is still there.

Does anyone solve this without reinstalling cuda? Could anyone help me with this? Thank you very much.

shamoqianting commented 6 years ago

It turns out that nvcc option should also be added while compiling opencv. Problem fixed.