What Is a GPU? How Graphics Processors Handle Parallel Work
By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.
A GPU, or graphics processing unit, is a processor designed to perform many similar calculations in parallel. It was built around graphics work, but modern GPUs are also used for scientific computing, video processing, and machine learning.
What the GPU does when it draws
A screen image contains many pixels, shapes, textures, colours, and lighting calculations. Rendering a 3D scene can require the same kind of mathematical operation to be repeated across huge numbers of vertices and pixels. A GPU is well suited to this because it contains many smaller processing units that can work on large batches of similar tasks at the same time.
In a game, the CPU may handle general logic such as input, rules, artificial intelligence, and coordination. The GPU receives graphics-related work and processes geometry, shading, textures, and other visual data before producing frames for the display. The exact division changes by program, but the basic pattern is a useful starting point.
This parallel design is the core answer to what a GPU is. A GPU is not simply a faster version of a CPU. It is optimised for a different style of work, especially jobs that can be divided into many similar calculations.
GPU vs CPU is about different strengths
A CPU usually has fewer, more flexible cores designed to handle varied instructions, branching decisions, and general-purpose tasks with low latency. A GPU has many more simpler execution units and gains speed when a workload can be split across them. That makes the two processors complementary rather than interchangeable.
A task with many independent calculations can benefit greatly from a GPU. A task that depends on a long chain of decisions, where each step must wait for the previous result, may fit a CPU better. Software design matters because parallel hardware only helps when the program can organise work in a parallel way.
When learning about GPUs, avoid judging performance from one number alone. Core counts across different GPU designs are not directly comparable, and memory capacity does not tell the whole story. Architecture, memory bandwidth, clock behaviour, power limits, software support, and the workload all matter.
Why GPUs are used beyond games
The same parallel structure useful for graphics can accelerate other calculations. Scientists use GPUs for simulations, image analysis, and numerical models. Video software can use them for effects and encoding. Machine-learning systems often use GPUs because training and running neural networks involves large amounts of matrix and vector math that can be processed in parallel.
GPUs may be integrated into the same chip package as a CPU or installed as a separate graphics card with its own memory. Integrated graphics can be efficient for everyday tasks, while dedicated GPUs usually provide more processing power and memory bandwidth for demanding workloads.
Memory is especially important in graphics. Textures, frame data, geometry, and working results need to be stored close to the GPU. If a workload needs more graphics memory than is available, performance can drop or the program may need to reduce detail. A useful way to revise a GPU is to ask whether a task contains thousands of similar pieces that can be worked on together. If it does, a GPU may be a good fit. If the task is mostly sequential control and varied logic, the CPU may remain more important.
From graphics cards to AI engines
Early graphics hardware was built to do fixed jobs, such as drawing triangles and applying textures, in a set order. In 1999 Nvidia marketed its GeForce 256 as the first GPU, popularising the term. In the early 2000s graphics chips gained programmable shaders, small programs that let developers decide how each vertex and pixel was calculated. Researchers soon noticed that this programmable parallel hardware could be pointed at non-graphics problems by disguising their data as images, an awkward but effective trick known as general-purpose GPU computing.
In 2007 Nvidia released CUDA, a platform that let programmers write general-purpose code for its GPUs without pretending their work was graphics. Scientific users adopted it for simulations and data analysis. A turning point came in 2012, when a neural network called AlexNet, trained on two consumer graphics cards, won a major image recognition competition by a wide margin. That result helped convince researchers that GPUs could make large neural networks practical, and much of the recent growth of machine learning has been built on that foundation.
Lockstep groups and the cost of if statements
The scale of graphics work explains why GPUs are built the way they are. A 1920 by 1080 screen has about 2.07 million pixels. At 60 frames a second, that is roughly 124 million pixel colours to work out every second, before counting the geometry, lighting and effects behind each one. Crucially, every pixel runs the same small program, called a shader, on different data. GPUs exploit this by grouping threads into bundles, typically of 32 or 64 depending on the design, that carry out the same instruction at the same moment, which saves the hardware needed to fetch and decode instructions separately.
This lockstep design has a cost when code branches. Suppose a shader says that pixels in shadow follow one calculation and lit pixels follow another. If a bundle contains both kinds, the GPU cannot send its threads down different paths at once. It runs the first path with the lit threads idle, then the second with the shadowed threads idle, so the bundle takes as long as both paths together. Programmers call this divergence. It is one reason code that runs well on a CPU can crawl on a GPU, and why GPU programmers try to arrange work so that neighbouring threads make the same decisions.
Rasterising triangles versus tracing rays
Most real-time graphics use a method called rasterisation. Every object in a scene is built from triangles, often millions of them. The GPU first works out where each triangle's corners land on the flat screen, then finds which pixels each triangle covers and runs a shader to colour them. A separate memory area called a depth buffer records how far away the nearest surface is at every pixel, so a wall drawn later does not paint over a character standing in front of it. Rasterisation is fast, but shadows and reflections have to be approximated with clever tricks.
Ray tracing takes the opposite approach. For each pixel, it follows a ray of light backwards from the camera into the scene, finds what the ray hits, then sends further rays towards lights and reflective surfaces. This produces natural shadows, reflections and soft lighting, and makers of animated films and visual effects rely heavily on it, accepting that a single frame may take hours to compute. Since 2018, consumer graphics cards have included dedicated hardware for testing where rays meet triangles. Games usually combine the two methods, tracing a limited number of rays and using denoising and AI upscaling to fill in the rest.
The takeaway
A GPU is a processor designed for highly parallel work, especially graphics calculations that can be repeated across many pixels or data points. GPUs complement CPUs rather than replace them. Their ability to process many similar operations at once also makes them valuable for video, science, and machine learning.