Diagnosing DirectX 12 GPU Crashes with DRED
This article examines how Device Removed Extended Data (DRED) assists developers in debugging DirectX 12 GPU hangs and crashes. When games or real-time applications encounter fatal GPU errors, DRED captures vital post-mortem diagnostic data—specifically command execution breadcrumbs and page fault allocations—transforming ambiguous device removal events into actionable debugging information.
When a GPU crash occurs in DirectX 12, the runtime typically returns
a generic DXGI_ERROR_DEVICE_REMOVED or
DXGI_ERROR_DEVICE_HUNG error code. Historically, these
errors provided virtually no insight into which specific draw call,
dispatch, or memory access caused the hardware failure. DRED was
introduced to eliminate this blind spot by recording detailed runtime
context directly on the GPU timeline and preserving it in system memory
for post-mortem analysis.
DRED provides two primary diagnostic capabilities:
1. Auto-Breadcrumbs
Auto-breadcrumbs track the execution progress of GPU command lists. DRED automatically injects markers (breadcrumbs) into command queues before and after individual operations such as draws, dispatches, copies, and resource barriers.
When the GPU hangs or triggers a Timeout Detection and Recovery (TDR) event, DRED reads the remaining breadcrumbs to determine the exact point of failure. It provides:
- The specific command list and queue that failed.
- The exact draw or dispatch call that was in flight at the moment of the crash.
- A historical timeline of completed commands leading up to the failure.
2. GPU Page Fault Reporting
A significant percentage of device removals are caused by invalid memory access, such as reading unmapped virtual addresses, accessing freed resources, or buffer overflows. DRED captures hardware page fault data and correlates the faulted virtual address (VA) with the application's resource allocations.
When a page fault occurs, DRED outputs:
- The exact virtual address that triggered the fault.
- A list of existing allocations that match or neighbor the faulted address.
- A list of recently freed allocations that previously occupied the faulted space (helping identify use-after-free bugs).
- The resource creation call stacks and internal debug names, making it easy to identify the exact textures or buffers involved.
By preserving this execution and memory telemetry without requiring heavy external profiling tools, DRED allows developers to diagnose complex GPU crashes directly from user crash dumps and internal test builds.