Home Knowledge Base GPU Virtual Memory and Memory Management

GPU Virtual Memory and Memory Management is the system software and hardware infrastructure that provides address translation, demand paging, and memory protection for GPU computations — enabling unified virtual addressing (UVA) across CPU and GPU, memory oversubscription (GPU programs accessing more memory than physically available on the GPU), and coherent shared memory between CPU and GPU through hardware page fault handling, fundamentally simplifying GPU programming for large-dataset workloads.

Traditional GPU Memory Model

Before unified memory, programmers explicitly managed two separate address spaces: 1. Allocate on CPU: malloc() or new 2. Allocate on GPU: cudaMalloc() 3. Copy CPU→GPU: cudaMemcpy(dst_gpu, src_cpu, size, HostToDevice) 4. Launch kernel on GPU data 5. Copy GPU→CPU: cudaMemcpy(dst_cpu, src_gpu, size, DeviceToHost)

This explicit management is error-prone, verbose, and prevents data structures with pointers from being shared between CPU and GPU (pointers are address-space-specific).

Unified Virtual Addressing (UVA)

CUDA 4.0+ provides a single virtual address space shared by CPU and all GPUs:

Managed Memory (cudaMallocManaged)

CUDA Unified Memory allocates memory accessible by both CPU and GPU:

GPU Page Fault Hardware

NVIDIA Pascal and later GPUs include a hardware page fault handler:

Memory Oversubscription

GPU physical memory is limited (24-80 GB). With page faults, GPU programs can address more memory than physically available — excess pages are evicted to CPU memory and fetched on demand. Enables running problems larger than GPU memory without manual data management. Performance degrades gracefully with oversubscription ratio.

Multi-GPU Memory

GPU Virtual Memory and Memory Management is the system infrastructure that evolves GPU programming from explicit buffer management to transparent shared memory — enabling the programming simplicity of unified addressing while providing the hardware mechanisms for efficient data migration between CPU and GPU memory.

gpu memory management unifiedvirtual memory gpucuda managed memorygpu page faultmemory oversubscription gpu

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.