system
Given the following post, respond as if you're commenting on Reddit:
human
What makes GPUs so much faster at some things than CPUs, what are those some things, and why not use GPUs for everything?

I understand that GPUs can be exponentially faster at calculating certain things compared to CPUs.  For instance, bitcoin mining, graphical games and some BOINC applications run much faster on GPUs.  

Why not use GPUs for everything?  What can a CPU do well that a GPU can't?  CPUs usually have an instruction set, so which instructions can a CPU do than a GPU cannot?

Thanks!
gpt
GPUs are faster for 2 reasons:

* they are much simpler cores (missing features see below) and thus smaller and more can fit

* GPUs do not try to maximize IPC (instructions per clock); in other words they suck at single thread sequential execution of instructions, only problems that can be efficiently multithreaded are suitable for GPUs

* they are SIMD machines. When you compare a proper AVX CPU implementation of an algorithm with a GPU implementation, the performance difference of GPUs already is more reasonable. When compared to a simple CPU implementation that does not take advantage of 256bit wide data words with AVX, the performance difference to GPUs appears much larger, because SIMD is really a requirement for proper GPU algorithms while it is not the most commonplace approach taken with CPU code - comparisons are usually between unoptimized CPU code and optimized GPU code and the performance difference is thus exaggerated.

There is a large set of features that is geared towards single thread IPC throughput in CPUs (the reason for that is that most programs are single threaded):

* out of order execution (including register renaming, data dependency conflict detection, ...)

* branch prediction

Then there are a boatload of features in CPUs that make them suitable to run a modern operating system:

* interrupts

* multiple privilege levels

* sophisticated virtual memory management

* connectivity to a more complex set of support chips on the mainboard

* virtualization

Each core on a GPU is in essence a very simple SIMD CPU core. Because they lack sophisticated management functions they could not execute a modern operating system. Because programs for GPUs are harder to write they are not used for everything. Because most code executed on a CPU is hardly performance critical GPUs are not used for everything.

When we are talking about straightforward parallel code that is performance critical to the application then GPUs are used for almost everything; if the programmer takes the little extra time to do it right. They are for example used for everything graphics related. They are used for almost everything in the high performance computing community.

The sheer amount of code that a computer executes that is not really performance critical is way larger than the really critical parts, so when you want comfort and do not care about speed then a CPU is just much quicker to program.