Selecting OpenCL device?

322 views
Skip to first unread message

subo...@gmail.com

unread,
Jun 25, 2015, 4:23:32 PM6/25/15
to tesser...@googlegroups.com
Hello,

I've been playing around with the OpenCL option for Tesseract.  It appears on very first runs, it profiles the system and tries to determine which is the fastest compute device and uses that device for future runs.  Is there a way to manually select the device for tesseract to run on?  Eg.  what if I want to run it using the regular cpu and not the gpu which tesseract automatically chooses?    Like a lot of OpenCL programs, there should be a way to specify on the command line which device the user would like to run the application on.


Any help or advice greatly appreciated.  Thank you.

Tom Morris

unread,
Jun 26, 2015, 5:18:31 PM6/26/15
to tesser...@googlegroups.com
On Thursday, June 25, 2015 at 4:23:32 PM UTC-4, subo...@gmail.com wrote:
I've been playing around with the OpenCL option for Tesseract.  It appears on very first runs, it profiles the system and tries to determine which is the fastest compute device and uses that device for future runs.  Is there a way to manually select the device for tesseract to run on?  Eg.  what if I want to run it using the regular cpu and not the gpu which tesseract automatically chooses? 

I've never played with OpenCL, but from glancing at the source code there appear to be two environment variables which can be used to control behavior:

TESSERACT_OPENCL_DEVICE - the number of the device which will be used to override any automatic selection
SC_OPENCLCPU - if defined causes the CPU to be used in preference to the GPU 

Tom

subo...@gmail.com

unread,
Jun 27, 2015, 2:41:07 PM6/27/15
to tesser...@googlegroups.com
Thanks Tom!  I knew there had to be an easier way of just setting some flags or something like that rather than trying to modify the source.  I'll try these out and let you know of the results.
Reply all
Reply to author
Forward
0 new messages