WDDM is a Windows driver model that allows multiple programs games desktop video to simultaneously use the GPU by sharing its resources and ensuring system stability without freezes when a driver fails.
WDDM is used in all modern versions of Windows starting with Vista in workstations gaming PCs and laptops as well as in remote desktop environments and Hyper V. It is mandatory for graphics drivers certified by Microsoft and is relevant for GPUs from NVIDIA AMD and Intel.
Typical problems
Driver timeout TDR due to excessively long rendering for example from overclocking or faulty drivers. Other issues include video memory leaks conflicts with games running in windowed mode and increased resource consumption when using applications without hardware acceleration.
How it works
Unlike older models such as XDDM where the driver directly managed and monopolized the GPU WDDM introduces an abstraction layer a video memory manager and command scheduler inside the kernel Dxgkrnl.sys. Applications send commands through DirectX and the WDDM driver converts them into packets. The system scheduler allocates execution time for each program preventing one process from seizing the GPU. Additionally WDDM virtualizes video memory each program is assigned its own address range and real memory pages are paged out to system RAM when needed. If a driver fails for instance due to an infinite shader the graphics card is reset and the crashed program loses its context but the OS continues to run. Similar mechanisms such as IOMMU and virtual memory have long existed for CPUs but WDDM starting with version 1.0 was the first to fully implement them for GPUs.
How WDDM works in detail
- Video memory mode. WDDM manages video memory via the GPU virtual address space. Each process receives isolated buffers preventing collisions. The kernel memory manager VidMm uses a paging mechanism where resources are paged out to system RAM when local video memory is low.
- Command scheduling. VidSch the Video Scheduler manages queues of DMA buffers from different applications. It uses time quantization with a round robin algorithm and real time priorities for windowed rendering. The context latency formula is
T_latency = Σ(queue_length_i) * quantum_i. - VidSch (Windows Graphics Processor Scheduler)
- GPU virtual memory. WDDM implements address remapping via page tables managed by VidMm. Each context is allocated its own GPU VA space. This allows physical memory with 4 KB or 64 KB page sizes to be mapped. The mapping formula is
PDE[Index] -> PTE -> Frame Number. - Interrupt management. The model driver handles GPU interrupts through the DDI Device Driver Interface. It uses MSI Message Signaled Interrupts to reduce latency. Interrupt service time is limited to
T_isr ≤ 100 μs. - Context parallelism model. WDDM introduces hardware queues for different GPU engines 3D compute copy video. Each queue is managed by its own DMA engine. The throughput formula is
Throughput = Σ(Cap_queue_i / T_cycle_i). - Direct memory access DMA. GPU commands are wrapped in DMA buffers which are validated by VidMm before being sent. The scheduler uses a pull model the driver does not start commands on its own. The execution time formula is
T_dma = (S_buffer / Bw_pcie) + T_gpu_exec. - Preemption. WDDM supports three preemption levels packet level primary buffer boundary and instruction level. This allows long running shaders to be stopped to service the GUI. The maximum latency formula is
T_preempt_max = T_save_state + T_restore. - Power management. VidMm interacts with the power management subsystem through D3 states. Adaptive GPU clock reduction is used when queue utilization is low. The power saving formula is
P = C * V^2 * f * Uwhere U is utilization. - Resource sharing. Shared surface mode allows multiple processes to access the same buffer through kernel descriptors. This is implemented with PTEs marked as global. Visibility is provided by a copy on write protection pattern for reading.
- Debug validation DDI validation. WDDM performs strict validation of every incoming DMA packet before passing it to the GPU. It checks buffer boundaries page presence in memory and access privileges. The overhead formula is
C_valid = Σ(chk_i) * kwherek ≈ 150 ns. - Execution time tracing. VidMm uses timestamp queries with 1 μs resolution. The scheduler tracks context timeouts TDR Timeout Detection Recovery. The TDR algorithm is
if T_exec > T_timeout = 2 seconds then reset the adapter. - Multi GPU support. WDDM provides a linked display adapter abstraction for NFTSLI like configurations. The driver itself manages page distribution across physical GPUs. The balancing formula is
Load_i = (Pending_len_i) / Avg(ΣPending_len). - Thread priority mechanism. Each DMA buffer is assigned a priority class from 0 background to 7 real time. The video scheduler uses a multi level queue with absolute priority. The selection formula is
Selected = max{queue[i].priority_over_j}. - CPU GPU cache coherence. WDDM flushes TLBs and GPU L2 caches via commands in the DMA buffer. It uses a coherent memory access domain for pages marked as write combined. The synchronization latency formula is
T_flush = a * log2(size) + b. - Context buffer. Each context stores the saved state of all GPU registers up to 64 KB of data. When switching contexts VidSch loads this buffer via the DMA engine. The switch formula is
T_switch = T_unload_prev + T_load_next. - Virtual multi monitor. WDDM allows one adapter to drive up to 16 independent displays through separate heads. Each head has its own control channel and command FIFO. The total display bandwidth formula is
Bw_display_total = Σ (W_i * H_i * FPS_i * BPP_i). - Memory access error handling. When a GPU VA violation occurs page access without a PTE a page fault exception is raised. VidMm catches it and either pages in the missing page or terminates the context. The recovery lag formula is
T_fault = T_fault_ipi + T_swap. - Memory pinning. WDDM allows a buffer to be pinned in VRAM using a
pin_countbit to prevent it from being paged out to the page file. This is used for primary surface buffers. The capacity formula isΣ(pin_sizes_i) ≤ VRAM_total. - CCD Canonical Display Driver command handling. The model includes a dedicated kernel thread for managing display modes resolution refresh rate HDR. Interaction with VidMm occurs through the present flip idiom replacing the primary buffer at VBlank.
- Scheduler fairness algorithm. VidMm calculates each application weight as the ratio of execution time to commands submitted. Under overload it uses a debt based fairness algorithm
Debt_i = Debt_i + (Exec_i - Quantum_base).
Comparisons of WDDM with similar features
- WDDM vs XDDM XP Display Driver Model. WDDM supports GPU virtualization shared memory and bulk interrupts for window managers whereas XDDM operates synchronously without direct support for multi application rendering providers. XDDM leads to system locks when a driver fails while WDDM isolates the driver reloading it without crashing the entire system.
- WDDM vs Linux DRM Direct Rendering Manager. WDDM is integrated into the Windows kernel with a unified video memory model and GPU scheduler. DRM uses a modular architecture with GEM Graphics Execution Manager and KMS Kernel Mode Setting. DRM requires manual context switching and TTM for memory management while WDDM hides these details behind the DDI.
- KMS (Kernel-Level video mode switching)DRM (GPU access coordination)
- WDDM vs macOS Metal FX proprietary driver layer. WDDM works through the universal DirectX API with a common scheduler and WARP software rendering support. Metal FX relies on exclusive GPU control and explicit command buffers. WDDM allows concurrent execution of DXGI OpenGL and Vulkan under one memory model whereas Metal requires separate buffers.
- WDDM vs Android Gralloc plus HWC. WDDM manages all video memory via paging and a video scheduler including timeout detection TDR. Gralloc allocates buffers while HWC composites layers in the surface manager without full GPU virtualization. WDDM provides desktop GPU application switching similar to SurfaceFlinger with context selection.
- WDDM vs NVIDIA CUDA as a separate driver. WDDM requires a shared memory model with the graphics driver and synchronization via
D3DKMT. CUDA directly manages context and memory through a proprietary driver ignoring Windows scheduler policy. WDDM ensures safe command dispatch whereas CUDA allows non blocking kernel launches increasing the risk of rendering conflicts.
OS and driver support
WDDM (Windows Display Driver Model) implements a strict driver model starting from Windows Vista (WDDM 1.0) to Windows 11 (WDDM 3.x), where the graphics driver is split into user mode (UMD) and kernel mode (KMD) parts. The OS manages video memory and the GPU scheduler through Dxgkrnl.sys and ensures compatibility with Direct3D, requiring the driver to support a specific WDDM version for features such as GPU Virtual Addressing or HW Scheduling.
Security
WDDM enhances isolation through a mandatory virtual video memory model (GPUVA) and hardware context switching, preventing direct driver access to physical pages. Every DMA operation is checked via buffers managed by Dxgkrnl. Starting with WDDM 2.0, support is introduced for virtual machines (GPU-PV) and protected sessions using page boundaries and descriptor validation, eliminating use-after-free vulnerabilities in third party drivers.
Logging
Diagnostics in WDDM are implemented through built in ETW (Event Tracing for Windows) mechanisms, where DxgKrnl generates events for timeout detection and recovery (TDR), command buffer failures, video memory leaks, and context switching errors. The driver passes crash data to Windows subsystem logs (DXGI, DirectX Runtime) via callbacks. Extended GPU dumps can be collected using LiveKd or WPA to analyze packet queues and virtual address states.
Limitations
WDDM introduces strict limitations: support only via DMA buffers and a narrow window for exclusive GPU access (up to 2 seconds before TDR triggers), no real time mode for legacy XPDM drivers, maximum command size, per process video memory quota (via Video Memory Manager), and no way to bypass the scheduler without WHQL certification. Direct writes to GPU registers from user mode are also prohibited, which limits performance in professional OpenGL applications with low level rendering.
History and evolution
WDDM 1.0 (Vista) introduced the video scheduler and TDR. WDDM 1.1 (Windows 7) added Direct3D 11 support and dropped XPDM. WDDM 1.2 (Windows 8) brought stereoscopic rendering and rendering on offloaded adapters. WDDM 1.3 (Windows 8.1) added scalable surfaces. WDDM 2.0 (Windows 10) introduced a hardware accelerated queue model (HWS) and GPU virtualization. WDDM 2.5 (RS2) added HDR and Shader Model 6. WDDM 2.7 (RS5) added DXR ray tracing support. WDDM 3.0 (Windows 11) introduced Mesh Shaders and Sampler Feedback. Versions 3.1 and 3.2 brought optimizations for NVMe over Fabric and improved multi adapter support (Linked Display Adapter).