Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assertion failure using TAPI (cv::UMat) with big images

Hi,

I get an assertion failure when using the TAPI (cv::UMat) in the following code:

        for (int i = 0; i < N; ++i) {
            cv::extractChannel(img_vec[i], alpha_vec[i], 3);
            cv::cvtColor(img_vec[i], img_vec[i], CV_BGRA2BGR);
        }

Code is crashing in the fifth iteration, just after running cv::cvtColor(img_vec[i], img_vec[i], CV_BGRA2BGR).

The output message is:

OpenCV Error: Assertion failed (clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0, u->size, alignedPtr.getAlignedPtr(), 0, 0, 0) == CL_SUCCESS) in map, file C:\OpenCV-3.1.0\sources\modules\core\src\ocl.cpp, line 4758

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. terminate called after throwing an instance of 'cv::Exception' what(): C:\OpenCV-3.1.0\sources\modules\core\src\ocl.cpp:4758: error: (-215) clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0, u->size, alignedPtr.getAlignedPtr(), 0, 0, 0) == CL_SUCCESS in function map

It only happens with big images (> 20Mp). The code is working if I don't use the TAPI (cv::Mat) or disabling OpenCL (cv::ocl::setUseOpenCL(false)).

Why is this so? Is there any way to make it work with GPU support?

Assertion failure using TAPI (cv::UMat) with big images

Hi,

I get an assertion failure when using the TAPI (cv::UMat) in the following code:

        for (int i = 0; i < N; ++i) {
            cv::extractChannel(img_vec[i], alpha_vec[i], 3);
            cv::cvtColor(img_vec[i], img_vec[i], CV_BGRA2BGR);
        }

Code is crashing in the fifth iteration, just after running cv::cvtColor(img_vec[i], img_vec[i], CV_BGRA2BGR).

The output message is:

OpenCV Error: Assertion failed (clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0, u->size, alignedPtr.getAlignedPtr(), 0, 0, 0) == CL_SUCCESS) in map, file C:\OpenCV-3.1.0\sources\modules\core\src\ocl.cpp, line 4758

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. terminate called after throwing an instance of 'cv::Exception' what(): C:\OpenCV-3.1.0\sources\modules\core\src\ocl.cpp:4758: error: (-215) clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0, u->size, alignedPtr.getAlignedPtr(), 0, 0, 0) == CL_SUCCESS in function map

It only happens with big images (> 20Mp). 40Mp). The code is working if I don't use the TAPI (cv::Mat) or disabling OpenCL (cv::ocl::setUseOpenCL(false)).

Why is this so? Is there any way to make it work with GPU support?