Skip to content

Add D3D12 device removed diagnostics - #241

Open
duckdoom5 wants to merge 4 commits into
NVIDIA-RTX:mainfrom
duckdoom5:d3d12-device-removed-diagnostics
Open

Add D3D12 device removed diagnostics#241
duckdoom5 wants to merge 4 commits into
NVIDIA-RTX:mainfrom
duckdoom5:d3d12-device-removed-diagnostics

Conversation

@duckdoom5

@duckdoom5 duckdoom5 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I was running into some DEVICE_LOST bugs and found this helpful. Thought I'd push it as a PR.
It adds (opt-in) D3D12/Vulkan device fault diagnostics helpers.

  • Use DeviceCreationDesc.deviceFaultInfoLevel to select diags level. (BASIC for just message, VERBOSE to include DRED device state, breadcrumb history, breadcrumb contexts, and page-fault allocation lists.)
  • Use nriReportDeviceFaultInfo() to report device-removed info.

eg.

nri::Result result =_nri.QueueSubmit(queue, submitDesc);
if (result == nri::Result::DEVICE_LOST) {
    nri::nriReportDeviceFaultInfo(device);
}

Partial progress towards #116

@duckdoom5
duckdoom5 force-pushed the d3d12-device-removed-diagnostics branch from f011183 to c175be1 Compare June 23, 2026 11:05
Expose an opt-in helper for enabling D3D12 DRED before device creation and a reporting helper that emits device-removed data through the existing NRI callback interface.

The report includes GetDeviceRemovedReason, DRED device state, breadcrumb history around the last completed operation, breadcrumb contexts, and page-fault allocation lists. Wide DRED debug strings are converted through the existing NRI string utility, and unsupported backends return Result::UNSUPPORTED.
@duckdoom5
duckdoom5 force-pushed the d3d12-device-removed-diagnostics branch from c175be1 to 4a336da Compare June 23, 2026 11:10
@vertver

vertver commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

What about adding "feature level" for crash dump functionality? The first one for example would be just description why it crashed (on Vulkan the VK_KHR_device_fault can be used), and for extended functionality add DRED/vendor-specific extensions? I don't see exposing D3D12-only functionality into public interfaces as a good choice.

@duckdoom5

duckdoom5 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

@vertver Yeah, your comment makes sense. I spend some time to include Vulkan and moved around some code. Hope you like this shape better :)

@duckdoom5
duckdoom5 force-pushed the d3d12-device-removed-diagnostics branch from c050644 to 3f865f0 Compare June 28, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants