For most of everyday use of computers (emails, listening to music, watching videos, uploading photos, browsing news website, etc.) all you need is a computer with enough memory (or RAM) and a fast enough processor (or CPU). But when you want to play games or edit videos, you need a GPU. What’s a GPU? How is it different from a CPU? Why do we need it?
It’s all about computations
The fundamental task of a computer is to carry out computations. Sometimes, the number crunching is obvious: your computer is updating some cells in a spreadsheet. Other times, the number crunching is not obvious: your computer is showing a video of a cat jumping in a box. But even for these less obviously computational tasks, it’s all about crunching numbers.
That’s because of digitalisation: the cat video is represented as numbers – also called digits, from where we get digital, digitalisation, etc. With digitalisation, images, sounds, videos, games, texts, animations, slideshows, even programs are represented as numbers. And so, with digitalisation, displaying an image, playing a sound, etc. is all a matter of fetching the numbers in storage, crunching them, and sending the result to peripherals like screens and speakers.
Different sorts of computations
Digital things are represented by numbers. But digital things are widely different! Hence, their representations are widely different. For example, a text can be easily represented as simple sequence of characters whereas an image can be easily represented as a 2-dimensional table of pixels. A direct consequence is that the kind of crunching necessary to process digital things varies widely.
The CPU of a computer is designed for flexibility: it can carry any kind of computation. But that flexibility has a price: performance. A CPU is good in that it can carry any task that a computer can tackle, but it is quite slow for some tasks.
The GPU of a computer (if it has any) is designed for a specific kind of computation: graphics! The Graphical Processing Unit (the complete name for GPU) can generate, resize, distort, blur, re-colourise, etc. an image. Because it is designed for these tasks only, the GPU has single-purpose circuitry that makes it faster than the CPU.
Think of it like an all-terrain bike vs a racing bike. The former can go everywhere: through mud and rocky patches. The latter can only go on roads, but it can go much faster.
When does speed matter?
The advantage of the GPU is speed. But the speed difference doesn’t really matter for everyday use. You don’t need to refresh the image on screen very often when you are reading emails or browsing a photo gallery.
On the other hand, when you are playing a fast paced game, you need about 50 or 60 images every seconds. Speed matters.