During the 80’s and 90’s, computers were commercialized and slowly made their way into people’s homes and got used more and more in businesses. The internet started out, the first online businesses sprouted up.
That meant the chip manufacturers were very busy developing the next generations of CPUs. At first, that meant increasing the *clock speed*: the number of instructions a CPU can handle per second. Around 2004, they ran into a problem though: once they got to around 4 GHz (4 billion instructions per second), they started having a very hard time to get their CPUs working reliably when increasing the speed even more. So they had to find other ways of getting more performance out of the computers they were making.
They briefly experimented with installing 2 CPUs in 1 computer, but that also had all sorts of trouble, mostly related to syncing data between the two. The alternative they came up with, was to integrate 2 CPUs *on the same chip*. That’s what we call a core today.
Now, what is the difference between CPUs and GPUs? A CPU is a chip that can handle all sorts of different tasks: it can do math, it can read and write to/from your hard disk, it can handle data from the internet, it can process the input from your mouse and keyboard, etc. It does a lot of stuff. That also means it’s some really complex machinery, which constrains the number of cores you can fit on a single chip. You could in theory make the chips bigger, but that means all the signals have to travel farther, getting you back into that data syncing problem. Power efficiency is also a big factor. This all means that you usually see CPUs with 2, 4 or 8 cores these days.
GPUs on the other hand have 1 specific goal: drawing graphics. You give them some *textures*, the actual images you want to draw, and the positions and shapes you want them drawn in, and the GPU will do all the math required to figure out the color for each pixel on the screen. That math is not very hard, but you need to do it for millions of pixels, ideally 60 times per seconds. That’s why your CPU struggles with this task: it just can’t handle that number of instructions. A GPU on the other hand, often contains 100s or 1000s of cores, allowing it to perform an incredible amount of math every second. These cores are much simpler than those in a CPU because they only have to do 1 thing.
My favorite description was that a CPU is like having someone with a PhD per core. A gpu is like having an army of millions of kindergarteners. Want to do complex math on a lot of data? Hand it to the 8 PhDs. Want to fill in a bunch of tiny spots with a different color? Pitch it to the kindergarteners.
Edit: haha, glad you all enjoyed this description as much as I did.
The basic unit of each is called a “datapath”. Given an instruction, a datapath will load data from memory, do a bit of math on it, write it back to memory. In both, the datapath can run multiple instructions in parallel, but in slight different ways. In a CPU, the goal is to optimize through put, to have the most instructions in a sequence completed. Imagine it a CPU trying to do multiple steps in a recipe at once to get it done as fast as possible. In a GPU, the datapath runs the same instruction over multiple sets of data at once. This lets it do complex mathematical operations, such as matrix multiplication, for large sets really quickly. Since most 3d-graphics and machine learning problems transform into a giant number of matrix multiplications, GPU tend to get used for these. CPU can do one specific thing that GPU’s are not good at: branching. When there is a choice that has to be made, the CPU decides which path to take.
Latest Answers