Tesseract GPU: it does not use one
0%
GPU busy while Tesseract read 10 pages
The GPU stayed at 0%
| What ran | Mean | Max |
|---|---|---|
| Idle | 0% | 0% |
| Tesseract, 10 pages | 0% | 0% |
| PyTorch on the GPU | 62% | 94% |
The meter is the GPU's own counter in ioreg, read every half second. The PyTorch row is our check that it sees real GPU work.
Tesseract ran as one thread: one page took 3.7 s, and 2.95 s of CPU time.
OpenCL was the only GPU code
Old Tesseract had experimental OpenCL code for thresholding and line finding. The text recognizer never ran on it. Tesseract 5.4.0 removed it in June 2024.
We built 5.3.4, the last release with it:
| Device | Words | Time |
|---|---|---|
| Its own pick: the CPU | 1,876 | 38 s |
| GPU forced, 2 runs | 1,876 | 42 to 44 s |
| CPU forced | 1,876 | 38 s |
Its first run scored both devices and picked the CPU: 0.26 against 0.93 for the GPU, lower is faster. That CPU test printed errors, but our timed runs agree.
Forced onto the GPU, it gave the same text, and the meter, read every half second, still showed 0%.
Leave dotproduct on auto
Tesseract picks SIMD code for its dot products at start: NEON on Apple Silicon, AVX2 and others on PCs.
| dotproduct | fast | best |
|---|---|---|
| auto, the default | 45 | 64 |
| neon | 39 | 59 |
| accelerate | 39 | 58 |
| native | not run | 156 |
| std:: |
not run | 242 |
| generic | 67 | 244 |
Each column gave the same text in every row. On a Mac, auto and neon run the same code, so their gap is noise. Plain C++ (generic) was 1.5 times slower with fast, 3.8 times with best.
To see which SIMD code your build found, and to try a value:
tesseract --version | grep Found
tesseract page.jpg out -c dotproduct=generic
Ours printed "Found NEON".
More speed: more processes, or a GPU engine
Homebrew's Tesseract has no OpenMP, so one process uses one core. To use more cores, run one process per page, as in our batch script.
| Engine | Words | Time |
|---|---|---|
| Tesseract 5.5.4, one process | 1,878 | 45 s |
| EasyOCR, Mac GPU | 1,670 | 39 s |
| EasyOCR, CPU, 2 threads | 1,670 | 369 s |
The EasyOCR rows come from our EasyOCR test, run on another day. The GPU was 9 times faster than 2 CPU threads, and Tesseract still found more words.
Same 10 pages, one scorer
The 10 pages are proofread Wikisource scans, 1,955 words in all. The score is true words found in order, with exact case and punctuation.
How we ran it
- Tesseract 5.5.4 from Homebrew, with --psm 3.
- An Apple M5 Max with 18 cores, on macOS 26.6.
- One process at a time, at low priority, while other jobs ran, so times are rough. auto and neon run the same code.
- The GPU meter is "Device Utilization %" from ioreg -c IOAccelerator: 10 s idle, the 42 s Tesseract run, and 8 s of PyTorch matrix math.
- tessdata_best eng is the 15.4 MB model from the tessdata_best repository.
- Tesseract 5.3.4 built from its source tag with CMake and -DENABLE_OPENCL=ON.
- That build found 1,876 words, and Homebrew's found 1,878.
- Licenses: Tesseract and its models are Apache-2.0. Our Actor installs them in its own image.
Scanned pages to text, no install
Run it yourself. Our Apify Actor reads PDF, PNG, JPEG, WEBP and TIFF for $0.006 a page, with nothing to install. Its code found 1,879 of these 1,955 words.
Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free.
Questions people ask
Does Tesseract support CUDA?
No. The Tesseract 5.5.4 source has no CUDA code, and no OpenCL code since 5.4.0. It runs on the CPU only.
Does pytesseract use the GPU?
No. pytesseract 0.3.13 starts the tesseract program for each call, and that program runs on the CPU.
Does tesseract.js use the GPU?
No. tesseract.js 7.0.0 runs Tesseract as WebAssembly, which runs on the CPU. Its core package has six builds: plain, SIMD and relaxed SIMD, two of each.
Does OMP_THREAD_LIMIT change anything on a Mac?
Not with Homebrew's Tesseract 5.5.4: it has no OpenMP. One page took the same CPU time with and without OMP_THREAD_LIMIT=4.
How do I make Tesseract faster without a GPU?
Keep dotproduct on auto, use the tessdata_fast models, and run one Tesseract process per page.