opencv: Arm Mali/OpenCL - OpenCL error CL_OUT_OF_RESOURCES

_update: this bug is specific to Mali Midgard(T8xx\T7xx\T6xx) GPU only. More resent Mali Bifrost(Gxx) series not affected

System information (version)
  • OpenCV => 4.0beta
  • Operating System / Platform => Ubuntu 18.04/arm64
  • Compiler => Ubuntu/Linaro 7.3.0-27
  • OpenCL => OpenCL 1.2 v1.r14p0-01rel0-git(966ed26)
  • GPU => ARM Mali T860(Midgard 4gen)
Detailed description

It is specific bug to arm\mali hardware in OpenCL, which related to limited resources on this mobile device. OpenCL error CL_OUT_OF_RESOURCES (-5) during call: clEnqueueNDRangeKernel('stage1_with_sobel', dims=2, globalsize=4096x4096x1, localsize=32x8x1) sync=false

reducing maxWorkGoupSize_ value of cl::Device from default 256 to 128 (to give more resources to kernel) remove that particular bug in cv::GausianBlur with size 3x3(and may be many more), but bigger parameters, like size ‘5x5’ or other kernel, like described in #11503 issue, still lead to CL_OUT_OF_RESOURCES

I am continue to evaluate another CL-acceletared methods on Arm Mali-t860 to figure out another reasons of CL_OUT_OF_RESOURCES.

Steps to reproduce
#include "opencv2/opencv.hpp"
using namespace cv;
 
int main(int argc, char** argv)
{
    UMat img, gray;
    imread("lena.jpg", IMREAD_COLOR).copyTo(img); //use lena.jpg from CV examples
    cvtColor(img, gray, COLOR_BGR2GRAY);
    GaussianBlur(gray, gray,Size(3, 3), 1.5);
    Canny(gray, gray, 0, 50);   
    return 0;
}

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments