Accessing a single GPU from different workers of a parpool thread pool
Show older comments
It used to be conventional wisdom that parfor does not play well together with gpuArray on a single-GPU system because different parpool workers end up competing for the same CPU-GPU communication channel. Is that still true now that there is a distinction between process pools and thread pools? Can it be worthwhile to parfor-parallelize a loop containing gpuArray operations if I have only a single GPU?
Answers (1)
Isha
on 16 Jun 2026
1 vote
Hello,
Yes, the old advice is still mostly true. On a single GPU, parfor + gpuArray usually gives little or no benefit, even with thread pools.
No real GPU parallelism:parfor distributes work across CPU workers; with one GPU, all workers still target the same device, so it doesn’t scale unless you have multiple GPUs. https://www.mathworks.com/help/parallel-computing/run-matlab-functions-on-multiple-gpus.html
Overheads still matter:Parallel pools introduce scheduling and data‑movement overhead, which can offset gains. https://www.mathworks.com/help/parallel-computing/compare-performance-multithreading-processpool.html
Thread pools only reduce CPU overhead:They offer lower data transfer and faster scheduling compared to process pools, but they do not change how many GPUs you have. https://www.mathworks.com/help/parallel-computing/choose-between-thread-based-and-process-based-environments.html
Hope this helps.
1 Comment
Matt J
on 19 Jun 2026 at 20:06
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!