d3d12: flush GPU fault trace on device loss and mark raytracing commands #424
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/424"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-28T22:23:38Z.
Summary
When
TUXBOX_TRACE_GPU_FAULT=1is enabled, two gaps made GPU resets hard to attribute:GetDeviceRemovedReason()every 1 second. When a GPU reset causesUINT64_MAX/DXGI_ERROR_DEVICE_REMOVEDon a submission or publication thread (or a MODE1 reset takes down the desktop/compositor), the process can abort before the next 1-second tick, printing nothing fromgpu_trace.gpu_trace::flush_on_device_lost(why)(guarded by anAtomicBoolso the report logs once) and invoked it immediately whensubmit.rsorpublication.rsobservesUINT64_MAXor a device-removed HRESULT (0x887A0005/0x887A0006/0x887A0007), before returning the error to the title.0 unfinished commands of N recorded), so an empty trace is distinguishable from a trace that failed to flush.gpu_trace::aroundpreviously covered draws and dispatches, leaving raytracing work invisible during faults.BuildRaytracingAccelerationStructure(build_as), guest-memory rehydration builds (rehydrate_as),CopyRaytracingAccelerationStructure(copy_as),EmitRaytracingAccelerationStructurePostbuildInfo(postbuild_as), TLAS instance fixup (instance_fixup), andDispatchRays(dispatch_rays) withgpu_trace::aroundwhenTUXBOX_TRACE_GPU_FAULT=1is set (zero overhead when disabled).#403/#409investigation: on RADV, a faulting BLAS build can occasionally complete with garbage data and hang later on another ring; marking both raytracing commands and graphics/compute draws covers direct build hangs as well as downstream traversal hangs.Tested
Run the checks relevant to this change.
TUXBOX_TRACE_GPU_FAULT=1device-loss flushing requires an actual GPU device reset; verified live during ProjectScarlett GPU fault debugging on#403where it immediately reported unfinishedbuild_asand mesh-draw commands onUINT64_MAX/DEVICE_REMOVED, and verified no regression across all Lanes raytracing and D3D12 fixtures)GPU, driver and backend:
1002:73bf, RADV NAVI21, Mesa 26.3.1, Linux 7.3.6,GE-Proton11-14)1002:164e, RADV RAPHAEL_MENDOCINO, Mesa 26.3.1, Linux 7.3.6,GE-Proton11-14)Commands run and their results:
Checks
No
evidence/JSON files were modified.