[Solved] Using your GPU to compile code

#1

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

0 Likes

#2

No, it is not possible.

0 Likes

#3

May I know what in terms of technicality?

0 Likes

#4

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:

1 Like

#5

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.

0 Likes

#6

I believe https://www.youtube.com/watch?v=_zZ1VLjG4Rc 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.

0 Likes

#7

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

0 Likes