Raghav
Raghav

Reputation: 570

Error while using Tesseract with OpenCL option enabled

I am using Tesseract with OpenCL option enabled in my project. While executing the GetUTF8Text() method, I am getting the following error:

DS] Profile read from file (tesseract_opencl_profile_devices.dat).
[DS] Device[1] 1:Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz score is 14049349632.000000
[DS] Device[2] 1:HD Graphics 5000 score is 14049349632.000000
[DS] Device[3] 0:(null) score is 21474836480.000000
[DS] Selected Device[1]: "Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz" (OpenCL)
OpenCL error code is -54 at   when clEnqueueNDRangeKernel kernel_HistogramRectAllChannels .
OpenCL error code is -54 at   when clEnqueueNDRangeKernel kernel_HistogramRectAllChannelsReduction .
OpenCL error code is -54 at   when clEnqueueNDRangeKernel kernel_ThresholdRectToPix .
OpenCL error code is -54 at   when clEnqueueNDRangeKernel kernel_HistogramRectAllChannels .
OpenCL error code is -54 at   when clEnqueueNDRangeKernel kernel_HistogramRectAllChannelsReduction .

Version of libraries used:

tesseract 3.04.00
 leptonica-1.71
  zlib 1.2.5

 OpenCL info:
  Found 1 platforms.
  Platform name: Apple.
  Version: OpenCL 1.2 (Dec 14 2014 22:29:47).
  Found 2 devices.
    Device 1 name: Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz.
    Device 2 name: HD Graphics 5000.

Has anyone faced this issue before?

Upvotes: 0

Views: 463

Answers (1)

jprice
jprice

Reputation: 9925

It looks like Tessaract enqueues kernels with a work-group size of 16x16, which is a fairly typical tile-size for image processing on GPUs. However, Apple's OpenCL implementation for CPUs has a limitation that work-group sizes can only be one-dimensional (i.e. the second dimension must be 1), and therefore this work-group size will be invalid. The error code you are getting (-54) corresponds to CL_INVALID_WORK_GROUP_SIZE.

If you can get Tesseract to run on the GPU instead (HD Graphics 5000), you should be OK.

Upvotes: 1

Related Questions