AnsweredAssumed Answered

CL_INVALID_WORK_GROUP_SIZE in OpenCV v4.0.1

Question asked by zohan Lin on Apr 9, 2020
Latest reply on Apr 16, 2020 by zohan Lin

Hello,

My board is i.MX6Q.

I used Yocto 4.9.88(rock 2.4) BSP and updated its OpenCV to v4.0.1(from imx-yocto-L4.14.98_2.3.0), then I enabled python3, OpenCL, dnn and text.

Finally, I built it successfully. 

But I tested the source code as below

import cv2
img = cv2.UMat(cv2.imread("image.jpg", cv2.IMREAD_COLOR))
imgUMat = cv2.UMat(img)
gray = cv2.cvtColor(imgUMat, cv2.COLOR_BGR2GRAY)
gray = cv2.GaussianBlur(gray, (7, 7), 1.5)
gray = cv2.Canny(gray, 0, 50)

cv2.imwrite('test.jpg',img)
cv2.imwrite('test_UMat.jpg' , imgUMat)

 

it reported an error from OpenCL

[ WARN:0] Using world accessible cache directory. This may be not secure: /var/tmp/
OpenCL error CL_INVALID_WORK_GROUP_SIZE (-54) during call: clEnqueueNDRangeKernel('row_filter_C1_D0', dims=2, globalsize=128x528x1, localsize=16x16x1) sync=false
[ 1] 25: FMA_MUL temp(322).dp.x, 2.000000, temp(319).dp.x

 

I checked the OpenCL

root@imx6qsabresd:/usr/opencv_test# opencv_version --opencl
4.0.1
OpenCL Platforms:
Vivante OpenCL Platform
iGPU: Vivante OpenCL Device GC2000.5108.0000 (OpenCL 1.1 )
Current OpenCL device:
Type = iGPU
Name = Vivante OpenCL Device GC2000.5108.0000
Version = OpenCL 1.1
Driver version = OpenCL 1.1 V6.2.4.p1.150331
Address bits = 32
Compute units = 4
Max work group size = 1024
Local memory size = 1 KB
Max memory allocation size = 32 MB
Double support = No
Host unified memory = Yes
Device extensions:
cl_khr_byte_addressable_store
cl_khr_gl_sharing
Has AMD Blas = No
Has AMD Fft = No
Preferred vector width char = 4
Preferred vector width short = 4
Preferred vector width int = 4
Preferred vector width long = 0
Preferred vector width float = 4
Preferred vector width double = 0

Could anyone tell me what happened and how to fix it?

 

Thanks a lot.

Outcomes