[Solved] Using your GPU to compile code

Is it possible to use your GPU instead of your CPU to compile code, that way it is quicker?

No, it is not possible.

May I know what in terms of technicality?

Loosely speaking, GPUs are good at repeating the same work on a lot of independent data, and compilers are not like that at all.

Here's a similar question on Stack Overflow:


Strictly speaking, it is theorically possible to accelerate compilation using GPU, like the case you have literally millions of slightly different hello world programs. In the view of computation, single GPU is conceptually equivalent as millions of dumb and slow processors. So they are really good at boring but huge amount of calculation like mining, but compiler need to perform smart decisions in mostly sequential manner so generally GPUs doesn't help.

I believe Dyalog '18: Co-dfns 2018 – What's New? - YouTube is an APL compiler that runs on the GPU.

I don't know what the slowest part of rust compilation pipeline is, so I can't estimate how much of it can be sped up via GPUs.

The slowest part always be the LLVM part, which is popular for its single-threead-ness.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.