Now I know this isnt a thread about compute but could someone lay out the advantages of GPU Compute for me?
If its used how exactly does that help devs? I know it frees up CPU processes, but what exactly are the kinds of things that can be done with it?
In the beginning the CPU was the brains of the computer. It was versatile and it needed to be because it had to do all the work. Then along the way we decided that we wanted computers to make pretty pictures too. Well that involved some specialized math and being that the CPU was so versatile, it took up those responsibilities too although not very well. Eventually the need for prettier pictures won out and we realized that we could help the CPU out by having a GPU do the work of creating the pretty pictures instead.
So why is the GPU so much better at making pictures? Well as it turns out, the computing necessary to make pictures is much more limited than what the "I can do anything" CPU does. So designers made chips that only did those few things, but did them very very well.
It also turns out that making a pretty picture is very different than running arbitrary code. The picture can be broken up into smaller and smaller sections, and each section can be worked on independently. So given that the GPU required limited computing capabilities, the designers could make that part smaller, but then duplicate it many many times. So the GPU has limited computing complexity, but what it can do it can do very quickly. On top of that, it can do multiple versions of those computations at the same time.
Unfortunately, traditional code requires the complex coding found in the CPU, and it is very difficult to break it down into independent parts that all can be run at the same time. Well that was until GPU Compute came along. Certain problems that the CPU is used to solving, can be broken down so that they resemble the same kinds of tasks that the GPU does to create graphics. When you do that, you can feed those tasks to the GPU instead of the CPU which has two effects:
- There is one less thing that the CPU has to do so it has time to do other stuff
- The GPU is really good at what it does. It will chew through the tasks you give it like a beaver through a No.2 pencil.
The three big things I've heard that you can offload to the GPU are...
- Physics
- AI, Pathfinding
- Computing directional sound effects