Learn
A1.1.2 | ROLE OF A GPU
01 | WHY A COMPUTER NEEDS GRAPHICS PROCESSING
Imagine turning a corner in a 3D game. The view changes, objects move, light falls on new surfaces and a fresh image must appear on screen. That image is a frame. Producing many new frames every second involves an enormous amount of repeated calculation.
A graphics processing unit, or GPU, is a processor designed to carry out large amounts of suitable work in parallel. It is widely used to produce images, but its processing architecture also makes it useful for tasks such as machine learning and scientific simulation.
The key idea is not simply that a GPU is “a faster CPU”. Its strength is completing many similar calculations across large amounts of data. Whether a GPU helps depends on the structure of the work and the software using it.
By the end of this lesson, you should be able to describe what a GPU does, connect its architecture to parallel work and explain its role in graphics, AI and large simulations.
02 | START WITH PIXELS AND FRAMES
A pixel is an individual picture element in a digital image. Its stored values describe colour or brightness. A frame is one complete image in a sequence, such as the next view of a game world.
A 1920 × 1080 image contains 2,073,600 pixels. At 60 frames per second, the output contains 124,416,000 pixel positions each second. This calculation illustrates the amount of image data involved; it is not a count of GPU instructions. Producing one pixel can require many operations.
Rendering means generating an image from a description of a scene or other image information. In a 3D game, the description includes objects, their positions, a camera view, textures and lights. A texture is image data used to give a surface detail.
The GPU does not simply copy a complete ready-made picture from a game file. It can help calculate how the scene should look from the current viewpoint, then contribute to producing the frame that will be displayed.
03 | SIMILAR WORK ON MANY DIFFERENT VALUES
Suppose you brighten a grayscale photograph. A simple rule could add 40 to each pixel value, limiting the result to 255. A pixel with value 70 becomes 110; a pixel with value 240 becomes 255. Each output uses its own original pixel.
The rule is the same for every pixel, but the input value changes. Many pixels can therefore be processed at the same time. This is data parallelism: applying similar processing to different pieces of data concurrently.
Compare that with an algorithm in which each step needs the result of the previous step. You cannot simply assign all those dependent steps to separate workers and expect them to finish together. Useful parallelism requires suitable work and a correct way to divide it.
Graphics contains many opportunities for parallel work, although real rendering also includes dependencies and coordination. “Many pixels” is a helpful introduction, not a claim that every graphics operation is independent.
04 | THE ARCHITECTURE BEHIND THE ROLE
A GPU contains many arithmetic processing resources organised into groups. Groups of lightweight execution tasks, called threads, carry out calculations using those resources. A thread describes a sequence of execution; it is not a physical component by itself.
In common GPU designs, groups of threads are issued instructions together and operate on different data values. This arrangement suits repeated calculations, such as processing vertices or shading many image fragments. A vertex is a point used to describe geometry. Shading calculates a surface’s appearance.
You may see GPU arithmetic resources described as “cores”. Do not assume one advertised GPU core is equivalent to one complete general-purpose CPU core. GPU terminology and the grouping of resources depend on the manufacturer and architecture.
A GPU also needs registers, caches, scheduling and control resources, and access to memory. Memory bandwidth is the rate at which data can be transferred. Keeping many arithmetic resources busy requires enough data to reach them, not just a large core count.
1 | CPU AND SOFTWARE
Prepare suitable work, supply data and issue commands.
2 | GPU
Schedule groups of tasks across many arithmetic resources.
Registers, caches and memory access support the calculations.
3 | RESULT
A rendered frame, processed image or numerical result becomes available to the application or display process.
Read the numbered stages in order. Commands and data move between processing resources and memory as needed. This is a functional diagram, not a chip layout.
05 | TRY A SMALL PARALLEL IMAGE TASK
This model uses an 8 × 8 grayscale image: 64 pixel calculations. Each completed pixel uses output = minimum(255, input + 40). The two panels calculate exactly the same results.
The first panel completes one pixel per model round. The second completes up to the selected number of pixels per round. Click Next round to see how batching changes the amount of completed work.
These are deliberately invented workers and equal-duration rounds. They do not represent real CPU or GPU clock cycles, core counts or measured performance. A CPU can also perform parallel work. This model isolates the idea of independent calculations, without real transfer costs or scheduling details.
ONE PIXEL PER ROUND
A BATCH PER ROUND
Numbers show completed output values. A dash means that pixel has not yet been processed. Changing the worker count resets both panels.
06 | FROM A 3D SCENE TO A SCREEN IMAGE
A game or design application first has information about a scene, rather than a photograph of its final appearance. Rendering turns that information into an image. The exact pipeline varies, but the following simplified stages show why there is so much mathematical work.
| Stage | What is happening | Why GPU processing helps |
|---|---|---|
| Prepare scene and commands | Application software establishes objects, camera view and rendering work. | The CPU and software arrange work for graphics processing. |
| Transform geometry | Calculations position vertices relative to the camera and projection. | Similar mathematical operations apply across many vertices. |
| Determine image coverage | Rasterisation identifies fragments associated with projected geometry. | Large numbers of candidate fragments can be generated and processed. |
| Shade and combine | Use surface properties, textures, lighting and visibility rules to determine image values. | Similar calculations are repeated across many fragments. |
| Produce a frame | Completed image data is stored for the display process. | The GPU contributes to generating the image; the display presents it. |
A fragment is a candidate contribution to an image pixel. It may be rejected, for example because another surface is in front of it. A fragment and a final displayed pixel are therefore not always the same thing.
Some rendering techniques trace rays through a scene to calculate visibility and lighting. You do not need the detailed algorithms here. In both cases, connect the GPU’s role to large numbers of related calculations, rather than describing it as a device that simply “makes graphics better”.
07 | THE GPU AND CPU WORK TOGETHER
In a game, the CPU may coordinate input, program decisions and the work that must be submitted for rendering. The GPU performs suitable graphics calculations. After the necessary processing and coordination, a completed frame can be presented. The responsibilities depend on the engine and implementation.
The CPU supplies or arranges access to the relevant data and issues work through software interfaces and drivers. A driver is software that allows the operating system and applications to communicate with hardware. The application must also know when results are ready to use.
Delegating work can have a cost. Moving data, launching processing and waiting for results all take time. For a tiny task, the time saved doing arithmetic may be smaller than the coordination overhead.
A basic understanding of cooperation is useful at SL and HL. The detailed architectural comparison between CPU and GPU is the separate HL objective A1.1.3. Here, focus on describing the GPU’s role and why particular workloads suit it.
08 | GPU, GRAPHICS CARD AND MEMORY
The GPU is the processing component. A discrete graphics card is a larger hardware assembly that can include a GPU, dedicated graphics memory, power circuitry and cooling. The GPU and the whole card are related terms, but not identical.
An integrated GPU is built into the same chip or processor package as other processing resources and typically uses shared system memory. A discrete GPU is a separate processing device and commonly has dedicated graphics memory, often called VRAM. Exact arrangements vary.
Graphics memory holds data such as textures, geometry and image buffers. General-purpose GPU workloads can instead use memory for numerical arrays and model parameters. Capacity describes how much can be held; bandwidth describes the rate at which data can move.
More memory alone does not guarantee a faster GPU. The workload, arithmetic resources, memory access, software and available power all affect performance. You should not use one specification as a universal measure of capability.
09 | ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
Machine learning systems use numerical models whose parameters are adjusted using data. Many important operations involve vectors and matrices. A matrix is a rectangular arrangement of numbers; matrix operations involve many related arithmetic calculations.
During training, software repeatedly calculates model outputs, evaluates error and updates parameters. GPUs can accelerate suitable parts of that numerical work by processing many related calculations concurrently. Some designs also include specialised units for particular matrix operations.
Inference means using a trained model to produce an output, such as classifying an image. A GPU can also accelerate suitable inference workloads. Training and inference are different activities, and their hardware requirements depend on the model, precision, batch size and application.
The GPU does not “understand” an image merely because it carries out calculations quickly. The model, training data and software determine how the numerical results are interpreted. Some AI workloads run effectively on CPUs or other accelerators instead.
10 | LARGE SIMULATIONS AND OTHER USES
A simulation represents how a system behaves using a model. A weather model may divide an area into a grid of cells and repeatedly update quantities such as temperature or air movement. Many cells need similar mathematical operations, creating opportunities for GPU acceleration.
The cells are not necessarily independent for the whole simulation. A new value may require neighbouring values from an earlier stage, so software must exchange data and coordinate updates correctly. Parallel processing accelerates suitable work while respecting those dependencies.
Other examples include molecular modelling, image filtering, engineering simulation and scientific visualisation. Rendering a simulation’s picture is a different operation from calculating its physical behaviour; a GPU may assist with either or both.
In robotics, a GPU might help process camera images or train a vision model. This does not mean every sensor reading or simple motor-control decision should be sent to it. Identify the repeated numerical work before deciding the GPU’s role.
11 | DECIDE WHEN THE WORKLOAD FITS
| Workload | What makes it suitable or less suitable? | A clear description |
|---|---|---|
| Brighten a large image | Similar per-pixel work with independently calculated outputs | Many pixel values can be processed concurrently. |
| Train a large neural network | Large quantities of suitable matrix arithmetic | GPU processing can accelerate the model’s numerical operations. |
| Update a scientific grid | Repeated arithmetic with defined data dependencies | Parallel updates and data exchange must be coordinated. |
| Follow a short chain of dependent decisions | Later steps need earlier outcomes; little independent work | The GPU’s large parallel resources may have little useful work. |
| Run a very small calculation | Launch and transfer overhead can outweigh arithmetic savings | GPU acceleration is not automatically worthwhile. |
A GPU’s throughput is the amount of work it completes in a period of time. GPU architecture aims for high throughput on suitable workloads. That does not imply that every individual operation finishes sooner than on a CPU.
When describing suitability, use a chain of reasoning: the workload contains many similar calculations, these can be organised into parallel work, and the GPU has processing resources designed to carry out that work efficiently. Add a limit where relevant.
12 | COMMON MISUNDERSTANDINGS
| Misunderstanding | More accurate statement |
|---|---|
| A GPU is only for connecting a monitor. | It performs graphics processing and can run suitable non-graphics computations. |
| A GPU is faster for everything. | Its benefit depends on the workload, software and coordination costs. |
| One pixel always needs one instruction. | Generating a pixel can involve many operations and candidate fragments. |
| Every pixel on the screen is always processed at exactly the same moment. | Work is scheduled in groups and batches across available resources. |
| GPU cores and CPU cores are directly interchangeable. | The processing resources and terminology describe different designs. |
| More VRAM always means higher speed. | Capacity and processing performance are different properties. |
| Simulation graphics and simulation calculations are the same task. | Drawing the result and calculating the model are distinct workloads. |
13 | BUILD A STRONG DESCRIBE ANSWER
For describe the role of a GPU, provide a clear account of what it does and how its characteristics support that role. Naming gaming, AI and simulation is useful, but the applications need an explanation.
For example: “A GPU carries out large amounts of suitable processing in parallel. During graphics rendering, it performs repeated calculations on geometry and image fragments to help generate frames. Its many arithmetic resources also support numerical tasks such as matrix operations used in machine learning.”
For a specific application, connect the role to that context: “A weather model repeats related calculations across a spatial grid. GPU processing can accelerate suitable updates, while the software coordinates the data dependencies between stages.”
Try describing two applications that do not involve drawing a game. For each, identify the data, the repeated calculation and why useful parallel work exists.
14 | CHECK YOUR UNDERSTANDING
Draw a simple three-stage diagram: application and CPU, GPU processing, then results. Annotate it for a game and again for a machine learning model. Which parts of the data and output change?
Use the image model to predict the round counts with one, four and eight workers. Then explain why those invented results are not evidence that a real GPU is exactly eight times faster than a CPU.
You are ready to move on when you can explain the connection between architecture and workload, rather than relying on “the GPU handles graphics”. Use the Questions tab to practise describing that connection in complete sentences.
Further reading: NVIDIA’s GPU programming guide · Simulation and modelling examples