0
\$\begingroup\$

I was always told that if a task can be parrarelized, I should put it on the GPU for better performance. Although this is defenetly true for computer GPUs, I was wondering if the mobile GPUs were so bad that it was actually more performant to use CPU whenever possible (p.s. I'm talikng about more common phones, not flagship gaming phone or anything fancy)

\$\endgroup\$
3
  • \$\begingroup\$ Any question of the form "should I use CPU or GPU" will always have contingencies. It would be unsurprising if there were some at least some attempts to parallelize work on the GPU that actually pessimize performance vs a better CPU implementation, or vice versa, on at least some hardware. Whether that applies to a case you care about is not something we can answer in general: you'll need to exhibit a specific case you care about. \$\endgroup\$
    – DMGregory
    Apr 29, 2022 at 22:40
  • \$\begingroup\$ Maybe, but on average, is it still true that I should try to use the GPU for parallization on mobile? Because the same criticisim can be said of Computers and I still see this recommendation everywhere. \$\endgroup\$
    – Gyoo
    Apr 29, 2022 at 22:43
  • \$\begingroup\$ If you can demonstrate a case where you experience a pessimization, we can help you fix that specific case. Anything else is empty speculation. "Some internet rando said it's fine on average" does not help you whatsoever if the case you want to implement in your game happens to be one of those that departs from the average. I've offered the best answer I can for you below, but it's vague, because the particulars of what you're trying to do really could go either way. \$\endgroup\$
    – DMGregory
    Apr 29, 2022 at 23:29

1 Answer 1

0
\$\begingroup\$

As far as I understand it, the main bottleneck on mobile GPUs these days is memory bandwidth. They're designed to work on a tile at a time, using a small but very fast on-chip cache to hold the data for just the current tile. Then once the tile is done, they write it out to slower shared memory. That write out or read back from shared memory tends to be the slowest part.

So, if the workload you have in mind can be divided into "small" chunks where all the working data you need fits in cache, and you only need to pull in or output a "small" amount of data to shared RAM at only "a few" well-defined phases of the calculation, you "could" see a substantial win from moving it to GPU.

But all those words in scare quotes depend sensitively on the particulars of your use case: what kinds of data, what workloads, what target hardware, how much / how frequently, etc., as well as how busy the CPU/GPU and the RAM connection are with everything else your game is doing. So we can't boil this down to a simple rule of thumb. The only way to know the answer to any performance question for sure is to build a test and profile it, to measure what real results you get.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .