GPU Architecture Basics
A GPU (Graphics Processing Unit) contains thousands of small parallel processors optimised for floating-point math and data-parallel tasks. Originally designed to transform and colour polygons for 3D games, modern GPUs are general-purpose accelerators running neural networks, scientific simulations and video encoding — sometimes faster than any CPU.
Parallel Architecture: Why GPUs Are Different
A CPU has a few powerful cores with large caches, branch predictors and out-of-order execution — optimised for single-threaded latency. A GPU has thousands of simpler cores (CUDA cores on NVIDIA, Stream Processors on AMD) grouped into Streaming Multiprocessors / Compute Units. These cores execute the same instruction on many data items simultaneously (SIMT — Single Instruction, Multiple Threads). This trade-off makes GPUs poor at serial, branchy code but exceptional at parallel workloads like transforming 2 million vertices or running 10,000 matrix multiplications at once.
- ▸RTX 4090: 16,384 CUDA cores in 128 Streaming Multiprocessors. Each SM has 128 cores.
- ▸GPU clock speeds (1.5–3.0 GHz) are much lower than CPUs, but thousands of cores compensate.
- ▸GPU memory bandwidth (GDDR6X RTX 4090: 1 TB/s) far exceeds CPU-RAM bandwidth (~96 GB/s DDR5).
The Rendering Pipeline
Traditional rasterization rendering works in stages: (1) Vertex shaders transform 3D geometry into 2D screen coordinates. (2) Geometry shaders (optional) can emit new geometry. (3) Rasterization converts triangle edges into pixel fragments covering the screen area. (4) Fragment/pixel shaders calculate the final colour of each pixel, applying textures, lighting and effects. (5) The output merger blends pixels and resolves depth. Modern GPUs use a unified shader model — the same shader cores run all stages, allowing the driver to balance workloads dynamically.
| Stage | Input | Output | Runs on |
|---|---|---|---|
| Vertex Shader | 3D vertices | 2D clip-space vertices | Shader cores |
| Rasterization | 2D triangles | Screen-space pixel fragments | Fixed-function HW |
| Pixel Shader | Pixel fragments | Coloured pixels | Shader cores |
| Output Merger | Coloured pixels | Final framebuffer | Fixed-function HW |
Ray Tracing and RT Cores
Ray tracing simulates light physically: rays are cast from the camera through each pixel, bounced around the scene and evaluated for colour. It produces photo-realistic reflections, shadows and global illumination that rasterization approximates poorly. The expensive step is testing each ray against millions of scene triangles to find intersections. NVIDIA RTX and AMD RDNA2+ GPUs include dedicated RT Cores (BVH traversal units) that accelerate this test in hardware. DLSS / FSR upscaling compensates for the performance cost by rendering at a lower resolution and using AI or spatial algorithms to reconstruct a higher-resolution image.
- ▸BVH (Bounding Volume Hierarchy) is a tree structure grouping triangles so the GPU can quickly narrow down which triangles a ray might hit.
- ▸Full path tracing (Cyberpunk 2077 "Overdrive") uses RT for all lighting — extremely demanding, requires DLSS or FSR to run at playable frame rates.
- ▸RTX 4090 has 128 third-gen RT Cores; AMD RX 7900 XTX has 96 second-gen ray accelerators.
Tensor Cores and AI Acceleration
Neural network inference involves huge matrix multiplications (multiply two matrices element-wise and sum). Tensor Cores are fixed-function units that perform 4×4 or 8×8 matrix multiply-accumulate operations in one instruction — far faster than general-purpose shader cores for this workload. NVIDIA RTX 4090 has 512 fourth-gen Tensor Cores achieving ~1.3 PFLOPS (FP8). They power DLSS 3 (frame generation), RTX Video Super Resolution, and local AI inference for tools like Stable Diffusion and Whisper transcription.