IMX.6 Quad Opencl CL_INVALID_GLOBAL_WORK_SIZE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX.6 Quad Opencl CL_INVALID_GLOBAL_WORK_SIZE

1,210 Views
kylebartush
Contributor I

I am trying to utilize the gpu on a phyflex-imx6 board to speed up some image processing. I am getting an error code of -63 if my global work size is too large when invoking a kernel. According to the opencl documentation and the provided vivante headers, this corresponds to a CL_INVALID_GLOBAL_WORK_SIZE error. Which according to documentation should not be returned in the attached example. I have attached an example program and the corresponding output when run on the board.

Original Attachment has been moved to: error_example.c.zip

Original Attachment has been moved to: error_example_results.zip

0 Kudos
3 Replies

759 Views
kylebartush
Contributor I

I'd like to give a small update. The cutoff point for the CL_INVALID_GLOBAL_WORK_SIZE error to be returned is 2^16, or 655356. I have also queried the device info for CL_DEVICE_ADDRESS_BITS, and gotten a value of 32. I'm still confused as to why I am not allowed to use a larger global work size.

0 Kudos

759 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

hi Kyle,

The GLOBAL_WORK_SIZE per dimension cannot exceed 1<<16 with the Vivante driver.

The values specified in global_work_size + corresponding values specified in global_work_offset cannot exceed the range given by the sizeof(size_t) for the device on which the kernel execution will be enqueued. The sizeof(size_t) for a device can be determined using CL_DEVICE_ADDRESS_BITS in the table of OpenCL Device Queries for clGetDeviceInfo. If, for example, CL_DEVICE_ADDRESS_BITS = 32, i.e. the device uses a 32-bit address space, size_t is a 32-bit unsigned integer and global_work_size values must be in the range 1 .. 2^32 - 1. Values outside this range return a CL_OUT_OF_RESOURCES error.

One possible work around is emulating a larger global work size by using 2D global work size can be checked on:

https://blog.visucore.com/2013/3/12/opencl-on-i-mx6

Hope this helps

0 Kudos

759 Views
kylebartush
Contributor I

Hello,

Thank you for the reply. I have also come to the conclusion that the address size cannot exceed 2^16, though through trial and error, not the querying of the device. When I query my device for CL_DEVICE_ADDRESS_BITS, I receive a value of 32. It is also mentioned in the article you linked that he saw the same problem. I can also confirm that using a 2-D kernel for data sets exceeding a size of 2^16 does work (though can make some things much trickier.) 

0 Kudos