Unlock GPU Performance: Global Memory Access in CUDA

AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.

Why it matters

GPU kernels with strided global memory access waste up to 8x memory bandwidth, so CUDA developers can materially speed up code by coalescing thread access patterns.

Read this as

NVIDIA published a tutorial on how CUDA programs use a GPU's main memory. When 32 threads in a 'warp' (a processing group) read data stored next to each other, the hardware fetches it efficiently; when threads read data far apart, the GPU fetches 32 times more data than needed. The authors measured an 8x bandwidth difference. This affects anyone writing GPU software, from games to AI training.

NVIDIA's developer blog explains that memory access patterns can limit GPU performance by up to 8x, since bandwidth often caps kernel speed. Teams writing CUDA code for AI or simulation lose throughput if threads read memory in strided patterns. The fix costs nothing: reorder indexing so consecutive threads read consecutive elements, and verify with NVIDIA's free Nsight Compute profiler.

The post shows that warps accessing contiguous 4-byte floats need four 32-byte sectors per 128-byte request (1:4 sectors-to-request ratio), while strided access yields a 1:32 ratio and 8x wasted bandwidth. On GH200, profiling with Nsight Compute metrics l1tex__t_sectors_pipe_lsu_mem_global_op_ld.sum and dram__sectors_read.sum quantified the gap; DRAM read throughput hit 290 Gbyte/s uncoalesced versus 160 Gbyte/s coalesced. For row-major 2D matrices, mapping threadIdx.x to the column index preserves coalescing. No hardware generation beyond GH200 or CC 8.9/9.0 devices is covered.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

CUDA NVIDIA Nsight Compute GH200 cudaMalloc Unified Memory

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading