No history yet

How do GPUs work?

Welcome! I am excited to explore the world of GPUs with you. Before we dive into how they handle massive graphics and complex AI calculations, it helps to know where we are starting from.

To help me tailor this explanation, what is your current understanding of computer hardware? Are you familiar with basic components like the CPU or RAM, or are you starting from scratch?

I know a bit! I understand what a CPU and RAM basically do.

The Brains vs. The Brawn

Since you already know what a CPU and RAM do, you have a perfect head start! Let's think of your CPU as an incredibly brilliant, world-class . If you give this mathematician a highly complex, sequential problem, they'll solve it lightning-fast. But what happens if you hand them a giant bucket containing one million incredibly simple addition problems? Even though they are geniuses, they can still only write down one answer at a time, making the task take all day.

This is exactly where the (Graphics Processing Unit) comes in. Instead of one brilliant mathematician, a GPU is like an army of thousands of elementary school students. Individually, they aren't smart enough to solve advanced calculus, but they all know basic arithmetic. If you split those one million simple math problems among them, they can solve them all simultaneously in a fraction of a second. That is the core of parallel processing.

A split-screen structural comparison showing a CPU with 4 heavy, complex gear cores next to a GPU with a massive parallel grid of 64 simple plus-sign cores.

I've started creating an interactive visualization above to show you this core architectural difference in action. While the CPU excels at jumping quickly between different tasks (like running your operating system, handling web traffic, and writing to disk), the GPU is a highly specialized monster designed to crunch massive blocks of simple numbers all at once.

Continue to why graphics need parallel processing

Let's pull back the curtain on how a modern video game or 3D film is actually built, and why trying to render it on a sequential CPU would turn your screen into a slideshow.

The Geometry of a Virtual World

Every 3D object you see on a screen—whether it is a rugged cowboy hat, a futuristic spaceship, or a blade of grass—is made up of thousands, sometimes millions, of tiny triangles. These triangles are defined by points in 3D space called . To turn these mathematical coordinates into a picture on your flat monitor, the computer has to run complex geometric formulas on every single vertex to calculate exactly where it should land on your screen as you move your camera.
Because each vertex is entirely independent of its neighbors, you do not need to calculate them in order. Calculating where Vertex A lands has absolutely zero impact on where Vertex B lands. This makes 3D rendering what computer scientists call an embarrassingly parallel problem.

A 3D perspective cube wireframe with its eight vertices simultaneously highlighted to represent parallel GPU thread calculations, showing the projected 2D coordinates for each vertex.

Once those vertices are mapped, the GPU those triangles, slicing them up into millions of tiny dots called pixels. For a standard 1080p screen, that is over 2 million pixels; for a 4K screen, it is more than 8 million pixels. To make the scene look real, the GPU must calculate the lighting, shadow, and color for every single one of those millions of pixels, up to 120 times a second. Trying to compute those millions of pixels one by one with a CPU's few cores would take forever, but a GPU can assign a tiny hardware thread to handle each pixel simultaneously.

Make me a diagram of the rendering pipeline

I'd love to show you how this all fits together! To visualize this pipeline, we have to look at the exact journey raw 3D data takes to become a fully rendered frame on your monitor.

DIAG
Generating your diagram…
I've queued up a diagram to show you this step-by-step translation from geometry to pixels. At the start, the stage manipulates the coordinates of our triangles in 3D space, which is why your character moves smoothly when you press a key. Then, once the triangles are projected onto a flat 2D plane, the rasterizer slices them up. Finally, the runs calculations for every single pixel to determine its final color based on light sources, shadows, and textures. Because these shaders run simultaneously on thousands of different data points, the GPU's unique hardware architecture makes this lightning-fast.

Explain rasterization again

Rasterization is the ultimate bridge where abstract geometry becomes a physical picture, and it is easiest to visualize if you think of it like .

Imagine you have a piece of fine screen mesh laying over a drawing of a simple triangle. The mesh represents your screen's pixel grid, and the drawing underneath represents the 3D vector triangle calculating in the math.

To display this triangle on your screen, the GPU has to decide which specific holes in that mesh need to have color squirted through them. It looks at every single pixel coordinate and asks a binary question: "Is this pixel center inside the boundaries of our triangle?" If yes, that pixel gets activated. If no, it stays blank.

A side-by-side comparison of a vector triangle and its rasterized pixel representation.

Once this stencil is applied, we are left with a blocky, pixelated version of our triangle. This is where the magic of parallel processing really shines.

Because the GPU's rasterizer splits the shape into millions of independent pixels, the GPU does not need to color them one at a time. It assigns a tiny, simple core to run a on each active pixel simultaneously, calculating lighting, texture, and shadows in one massive, unified burst. This is how your graphics card can draw incredibly complex, lifelike scenes in real-time.