Diagram deck
Nvidia CUDA in 100 Seconds
1. CUDA at a Glance: From Graphics Chip to AI Workhorse
Maps Section 1, "What Is CUDA?": the 2007 NVIDIA platform that turned the GPU from a graphics-only engine into the parallel computer behind AI training.
A GPU was a graphics appliance: its thousands of cores spent every frame drawing game scenes, and running general-purpose math on them meant fighting the graphics pipeline for scraps of compute.
CUDA is the bridge from "GPU equals video games" to "GPU equals AI at scale" - one kernel launch at a time.
2. CPU vs. GPU: Two Kinds of Cores
Contrasts Section 2, "Why GPUs Are Built for Parallel Work": the same operation over millions of pixels runs faster on 16,000+ simple GPU cores than on 24 powerful CPU cores.
A 1080p frame is over 2 million pixels, and at 60 FPS every one may be recomputed each frame - a firehose of matrix multiplication and vector transforms that has to happen in parallel.
CPU
Intel Core i9
24
cores
- Each core is large and powerful.
- Very different tasks, handled one at a time.
- Versatile: runs whatever you throw at it.
GPU
NVIDIA RTX 4090
16,000+
cores
- Thousands of small, simple cores.
- One operation, executed on every pixel at once.
- Throughput measured in teraflops.
A GPU is not one faster brain - it is thousands of smaller ones running the same math at once. CUDA exists to point all of those cores at real computing problems.
3. Host and Device: The Five-Step CUDA Flow
Sequences Section 3, "How CUDA Works: Host, Device, and Execution": the handshake between the host CPU and the device GPU - kernel first, data over, launch, execute, results back. Step through it below.
Click any step to jump to it. Steps before the current one are complete.
4. Grid, Blocks, and Threads: Inside a Kernel Launch
Zooms into Section 4, "Building Your First CUDA Application": what add<<<1, 256>>> launches on the device - one block of 256 threads, each computing its own index.
Every thread works out which element it owns - hover a term to see what it means:
blockIdx.x
Which block the thread lives in. The demo launches one block, so this is 0 for every thread.
blockDim.x
How many threads each block holds. The launch asks for 256, so this is 256.
threadIdx.x
The thread's position inside its block: 0 to 255. Multiplying and adding yields a unique index per thread.
C[index] = A[index] + B[index];
256 threads run the kernel at once, each adding the pair of elements at its own index. cudaDeviceSynchronize() then pauses the host until every thread has finished.
cudaMallocManaged allocates A, B, and C so the CPU and GPU share them - the demo skips the explicit copy steps from the general flow and reads the result straight back on the host.
The triple-bracket configuration decides how parallel a launch is - one block of 256 threads here, but grids scale to many blocks. Getting that shape right is the core skill for optimizing multi-dimensional structures like deep-learning tensors.