1. Overview
In the current DRM codebase, GPU memory management is handled by several cooperating mechanisms: GEM represents objects, TTM manages placement and migration among multiple memory domains, dma-buf handles cross-device sharing, drm_gpuvm manages GPU virtual addresses, and drm_gpusvm supports an address space shared by the CPU and GPU. On first encountering this code, it can be difficult to see why these mechanisms coexist and how they relate. They were not all produced by a single design effort; over more than two decades, they were introduced in stages to solve problems specific to each period. Understanding this evolution is a prerequisite for understanding their design tradeoffs.
This section reviews DRM’s evolution from its entry into the kernel in 1999 to the present.
DRM’s evolution can be divided roughly into three phases: graphics display, graphics rendering, and heterogeneous computing and AI. Each phase has a dominant problem, and new mechanisms were introduced to address it. The phases overlap in time; the years and versions below refer to when the corresponding mechanisms were merged into the mainline kernel. Figure 1.2.1 summarizes the main goals, key mechanisms, and hardware background of the three phases.

Figure 1.2.1. Three phases in the evolution of the DRM subsystem
2. Phase One: Graphics Display (approximately 1999–2009)
In the late 1990s, graphics display on Linux was handled by the user-space X Server, which directly read and wrote GPU registers to set display modes and draw images. To obtain sufficient performance, 3D applications wanted to bypass the X Server and submit rendering commands directly to the GPU. This is called direct rendering. It introduced a new problem: if several processes operated on the same GPU, something had to arbitrate their access and prevent one process from corrupting another’s data. This was the central problem of the first phase.
DRM entered the kernel to solve precisely that problem, first appearing in Linux 2.3.18 in 1999. Its responsibilities were limited in this period: arbitrate access to the GPU, treat the X Server as the master device that authenticates other clients, and manage the DMA buffers used to carry commands to the GPU.
Display mode setting was still performed by the X Server’s user-space driver through direct register access. That created a series of problems: the X Server had to run as root; switching between the console and the graphical environment caused display flicker; suspend and resume depended on user-space cooperation; and a kernel crash could not be shown on the screen. Linux 2.6.29 merged Kernel Mode Setting (KMS) in 2009, moving mode setting into the kernel and modeling display hardware with objects such as CRTC, encoder, and connector. The kernel thus became the sole entry point for GPU access.
Key mechanisms of this phase: the DRM core (device-access arbitration), the master/client authentication model, and KMS.
3. Phase Two: Graphics Rendering (approximately 2008–2020)
With the spread of programmable shaders, 3D applications needed to manage much more data: vertices, textures, shader programs, and render targets. Each is a block of memory that the GPU must access. There are many such objects, they live for long periods, and they must cross process boundaries—for example, when an application hands rendered results to a compositor for display. Early DRM provided only simple DMA buffers, which could not meet these requirements. The main problem of this phase was GPU-memory allocation, sharing, and synchronization.
3.1 GEM
Linux 2.6.28 merged GEM (Graphics Execution Manager) in 2008 with the Intel i915 driver. GEM represents each block of GPU memory as an object referenced from user space by an integer handle. The object’s contents are stored in a shmem file and can be swapped out when memory is tight.
Referencing objects by integer handle rather than file descriptor was deliberate. The comment at the beginning of drivers/gpu/drm/drm_gem.c explains that the designers had originally hoped to use struct file, but at the time a process had only about 1,024 open files by default, whereas an application might need tens of thousands of objects. Large numbers of high-valued file descriptors would also burden select() in the X Server and many GL applications. GEM therefore uses its own integer handles to emulate file descriptors while retaining a struct file inside each object, leaving open the possibility of transitioning to real file descriptors later.
3.2 TTM
GEM targeted Intel integrated graphics, which has no discrete VRAM; all memory comes from system memory. GPUs with discrete VRAM must answer a different question: should a block of memory reside in VRAM or system memory, and how should it be moved out when VRAM runs short? Linux 2.6.31 merged TTM (Translation Table Manager) with the radeon driver in 2009. TTM manages placement and migration among multiple memory domains. GEM and TTM are not mutually exclusive: the current struct ttm_buffer_object embeds a struct drm_gem_object, so it still presents a GEM object to user space.
3.3 Sharing
GPU memory must be shared not only between processes but also between devices—for example, passing a frame captured by a camera to the GPU for processing and then to a display controller for output. Linux 3.3 introduced dma-buf in 2012, providing a common in-kernel mechanism for device drivers to share buffers as file descriptors. Linux 3.4 then added PRIME, which converts between GEM handles and dma-buf file descriptors. Linux 3.12 introduced render nodes in 2013, separating rendering privileges from mode-setting privileges.
3.4 Synchronization
GPUs execute commands asynchronously. Before the CPU or another device accesses a block of memory, it needs to know whether the GPU has finished using it. Linux 3.11 introduced the reservation object in 2013 for cross-device buffer locking. Linux 3.17 introduced fences in 2014 to represent the completion of asynchronous operations and allowed reservation objects to carry them. Parties accessing the same buffer can then wait for one another automatically, an approach called implicit synchronization. These mechanisms were later renamed dma_fence in Linux 4.10 and dma_resv in Linux 5.4. Explicit synchronization—passing synchronization objects explicitly in user space—is provided by sync_file (Linux 4.7) and drm_syncobj (Linux 4.13).
3.5 Scheduling and Generalization
As concurrent GPU work increased, scheduling also required a common solution. The amdgpu driver originally carried its own GPU scheduler; Linux 4.16 moved it into DRM as the shared drm_sched framework in 2018. The same generalization occurred in memory management: Linux 5.2 added the GEM shmem helper in 2019, consolidating nearly identical shmem-backing code from several integrated-graphics drivers.
Key mechanisms of this phase: GEM, TTM, dma-buf and PRIME, dma-fence and dma_resv, syncobj, and the GPU scheduler.
4. Phase Three: Heterogeneous Computing and AI (2020 to present)
GPUs have long been used for general-purpose computing: Linux 3.19 merged amdkfd in 2015 to provide compute support for AMD’s Heterogeneous System Architecture (HSA); Linux 4.2 merged the amdgpu driver that same year. However, framework-level mechanisms driven by compute workloads appeared mostly after 2020. As compute and AI became central DRM workloads, the principal problem shifted to managing GPU virtual addresses and unifying CPU and GPU address spaces.
4.1 GPU Virtual Address Management
In the traditional relocation model, the kernel chooses where a buffer is placed in GPU address space at each submission. Vulkan sparse resources instead require user space to bind arbitrary portions of a buffer to specified GPU virtual addresses. This driver interface is commonly called VM_BIND. The kernel must therefore be able to split and merge existing mappings. Linux 6.6 introduced the GPU virtual-address manager drm_gpuva_mgr in 2023; beginning with Linux 6.7, it was renamed drm_gpuvm. The comment in drivers/gpu/drm/drm_gpuvm.c explains that splitting and merging mappings is necessary for Vulkan Sparse Memory Bindings.
4.2 A Shared Address Space Between CPU and GPU
Compute programming models want the GPU to use process virtual addresses directly so that memory allocated by malloc() can be passed to the GPU without copying. Linux 4.14 introduced Heterogeneous Memory Management (HMM) in the memory-management subsystem in 2017, allowing device drivers to mirror process page tables and migrate pages to device memory. Linux 5.14 merged AMD’s HMM-based Shared Virtual Memory (SVM) implementation in 2021. Intel Xe, merged in Linux 6.8 in 2024, likewise requires SVM.
Separate SVM implementations in each driver caused substantial duplication. Linux 6.15 introduced drm_gpusvm and the drm_pagemap interface for describing device memory in 2025. Linux 6.17 moved migration-related implementation from drm_gpusvm to drm_pagemap. Based on MMU notifiers and HMM, drm_gpusvm tracks CPU page-table changes and migrates pages on demand between system memory and VRAM, consolidating code that can be shared by multiple drivers into the framework.
Key mechanisms of this phase: HMM, drm_gpuvm and VM_BIND, drm_pagemap, and drm_gpusvm.
5. Comparison of the Three Phases
The scenarios, main problems, and key mechanisms of the three phases are compared below.
| Dimension | Graphics Display | Graphics Rendering | Heterogeneous Computing and AI |
|---|---|---|---|
| Main scenario | Desktop display, X11 | 3D games, CAD, composited desktop | General-purpose computing, AI training and inference |
| Main problem | Safe multi-process GPU access | GPU-memory allocation, sharing, and synchronization | GPU virtual-address management and unified CPU/GPU address spaces |
| Memory representation | DMA buffers | GEM objects (BOs) | BOs plus process virtual-address ranges |
| GPU addressing | Physical addresses (through GART) | GPU virtual addresses managed by the driver | User-bound GPU virtual addresses (VM_BIND), shared with the CPU |
| Synchronization | DRM hardware locks | dma_fence, dma_resv, syncobj | The above plus MMU notifiers |
| Typical capacity | Megabyte scale | Gigabyte scale | Tens of gigabytes |
| Representative mechanisms | DRM core, KMS | GEM, TTM, dma-buf, drm_sched | drm_gpuvm, HMM, drm_gpusvm |
6. Drivers of Evolution
This evolution is driven by three factors.
Hardware. GPUs evolved from fixed-function pipelines to programmable shaders and then to general-purpose compute cores. VRAM capacity grew from megabytes to tens of gigabytes. Interconnects evolved from AGP to PCIe, then to NVLink, Infinity Fabric, and other high-speed interconnects.
Applications. The main workloads shifted from office and basic graphics in the 2000s to 3D games and professional rendering in the 2010s, and then to deep learning and large models in the 2020s.
Programming interfaces. Vulkan 1.0, released in 2016, gave applications explicit control of memory management and introduced sparse resources. Heterogeneous programming models such as CUDA, ROCm/HIP, SYCL, and OpenCL drove demand for a unified virtual address space between CPU and GPU.
Changes in all three areas ultimately translated into changes in how the kernel manages GPU memory.
7. Kernel Versions in Which the Mechanisms Were Merged
The years and kernel versions in which the mechanisms discussed here were merged are shown in Figure 1.2.2.

Figure 1.2.2. Timeline of mechanism mergers into the kernel
The timeline shows that most mechanisms related to objects, sharing, synchronization, and scheduling were merged between 2008 and 2019, while common frameworks for GPU virtual addresses and shared virtual memory appeared mostly after 2023.