Module 12 · A Thousand Tiny Painters

Why have a second kind of processor just for graphics?

Lesson 12.1 · One Genius or a Thousand Helpers?

Jenny · Mark · Sarah

Eight speed demons vs. 256 regular kids.

Jenny gives Mark and Sarah a coloring contest.

Mark gets eight really fast colorers. Sarah gets 256 kids who each color slowly.

The picture is 576 squares, and every square is its own little job. Mark is sure his eight will win. They’re very fast.

The short answer

Because drawing a screen is millions of tiny, identical jobs, and a few brilliant CPU cores can’t keep up with thousands of simple GPU cores doing them all at once. Sarah’s 256 slow kids crushed Mark’s eight fast ones. Mark has asked for a rematch.

Try it yourself

Race a CPU’s few fast cores against a GPU’s many slow ones, coloring the same picture.

CPU: 8 fast cores

8 workers

GPU: 256 simple cores

256 workers

What you just did has a name

A GPU

A GPU, or graphics processing unit, is a processor built with thousands of small, simple cores that all do the same kind of calculation at the same time.

A CPU has a few powerful cores that handle any task, one complicated step after another.

A GPU is worse at complicated one-at-a-time work and far better at doing the same simple thing to millions of pieces of data at once, like coloring every pixel on a screen.

A few more things

CPU vs. GPU

The CPU is the manager who can handle anything. The GPU is a huge team that can only do simple jobs, but all at once. A computer needs both.

Built in or separate

Most laptops have a small GPU built into the processor chip. Gaming PCs add a big separate one, the graphics card, with its own memory and fans.

Phones have them too

Every phone’s main chip includes a GPU. It’s what makes scrolling smooth and games run.

Go deeper

The longer version, if you want it.

Why the cores are so simple

A CPU core spends lots of transistors on cleverness: guessing which way a program will go, juggling instructions out of order, big caches. A GPU skips most of that and spends its transistors on more cores instead.

That trade only works for jobs where every piece is independent and does the same thing. Graphics is the perfect example. Running a word processor is not.

Quick check

What kind of job is a GPU best at?

Let’s take it slower

Picture painting a fence with ten thousand boards. One master painter is fast, but has to do every board. A thousand kids with brushes each do ten boards, slowly, and finish way before the master. But if the job were painting one detailed portrait, the kids would be useless. GPUs are the thousand kids. They’re great at fences.

More examples

1

Scrolling Instagram

Every frame of a smooth scroll is the GPU redrawing millions of pixels. The CPU decides what to show; the GPU paints it.

2

Video calls

Blurring your background on a call is the same small calculation for every pixel, done on the GPU.

Back to the question

So why a second processor for graphics?

Show the answer

Because drawing a screen is millions of tiny, identical jobs, and a few brilliant CPU cores can’t keep up with thousands of simple GPU cores doing them all at once. Sarah’s 256 slow kids crushed Mark’s eight fast ones. Mark has asked for a rematch.

More on this: CPU vs. GPU: what’s the difference?

One last question

Sarah asks what the difference is between a CPU and a GPU. Who nailed it?

Talk Card

Talk Card · 12.1

A CPU is a few geniuses. A GPU is thousands of helpers doing one simple job at once. Drawing a screen needs the helpers.

How Computers Work · pettigrewlab.com/learn

Next lesson