Repository navigation
D3D12.X: XCL_DRED=1 names the pipeline bound where the GPU faulted - #1592
Conversation
gut0to
left a comment
There was a problem hiding this comment.
AI-assisted review (GPT-6): I verified command-list reset semantics against the D3D12 API contract and traced the label lookup by list pointer.
| pub fn reset(list: *mut c_void) { | ||
| if on() { | ||
| if let Some(m) = MARKS.lock().unwrap().as_mut() { | ||
| m.remove(&(list as usize)); |
There was a problem hiding this comment.
Could labels be retained per recording generation until the corresponding submission completes? D3D12 allows Reset while a command list is still executing. If the old submission faults after this removes its labels and the same pointer has new labels, DRED looks up the old node by that pointer and can report the pipeline from the newer recording. Please retain the old labels until in-flight submissions can no longer reference them. AI-assisted review: I checked the Reset contract and traced the pointer-based DRED lookup.
There was a problem hiding this comment.
Done in 681e0ab: a Reset starts a new recording instead of dropping the old one; a list keeps its last 4, and a DRED node is matched to the newest recording with as many markers as its history. When the old and new recordings have the same marker count it still picks the newer one, so it is a heuristic. The unit test a_fault_in_an_earlier_recording_finds_that_recording covers both cases. (Claude Code with Claude Opus 5.5 made the change.)
Hardware test report — commit
|
|
A data point for using this on the retail title, and a related PR. On an RTX 5080 (driver 621.24, Windows), #1323 names what is in flight without DRED, for stalls rather than device removals. AI use: Claude Code (Claude Opus 5.5) wrote this note from runs on my machine. |
|
Verified PR #1592 at commit Tested
Review notes (confirmed in source)
Not tested
AI use
|
|
Tested the pipeline labels on an RX 7900 XT with DRED enabled during retail world loading. At 189.36 s the driver reported DXGI_ERROR_DEVICE_HUNG. Of 20 reported unfinished lists, one had made progress (14/112 operations), and 18 had pipeline labels. The partially completed list reported CS hash 4401d482ef24797c, which the title shader index identifies as meshlet_culling:CS_BatchCullInitArgs. The first outstanding operation was ClearDepthStencilView. A compute PSO being bound at that point does not establish that its dispatch caused the hang. DRED reported GPU VA 0 and no allocation names. The same run recorded an actual 33-list ExecuteCommandLists call about ten seconds earlier. Local diagnostic changes also prioritized partially completed DRED nodes in the output. This confirms the labels are usable on this AMD path. |
5883e44 to
681e0ab
Compare
|
Thanks for the reviews. All of these are in the new head (squashed into the one commit):
Tested (new head, same machine as in the description: RTX 5070, driver 621.40, Windows 11 Pro 26300, Rust 1.99.1, debug)
AI use: Claude Code (Claude Opus 5.5) made the changes, ran the tests and drafted this reply. |
|
@crosettiremi thanks, that's the first run of this with the title, and the case it was made for: a list stopped part way with a labelled compute pipeline. As you say, the CS bound there doesn't prove its dispatch hung the GPU. It narrows down which shader to look at first, which is what the line is for. I've added a pointer to your run under Not tested in the description, so it's clear that run was yours, on AMD, and not on this head. AI use: Claude Code (Claude Opus 5.5) drafted this reply. |
|
Independent GPU workspace tests and a paired 60 s retail Setup
Workspace tests (
Regression run (
Base ( PR head ( Not tested: triggering an actual GPU fault with AI use: Antigravity ( |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
@LocranKing thank you, that's the smoke pair this PR was missing. I've copied both blocks into Regression run as you posted them, credited to you. AI use: Claude Code (Claude Opus 5.5) drafted this reply. |
DRED's breadcrumbs give the operations a list got through but not which pipeline was bound, so a page fault in a translated shader (the mesh shader faults reported on xcl-dev#541) names no console shader. With XCL_DRED=1, each SetPipelineState XCL records for the title (and ClearState, a list's initial pipeline, a mid-list split's next segment) is followed by a SetMarker, and the pipeline's label (the fnv64 hashes of its console shaders, as in the translation log) is kept per list in order. On an RTX 5070 (driver 621.40, Windows 26300) DRED kept no marker text (breadcrumb contexts empty) and gave the list's debug name but a null pointer, so the markers are counted in the list's operation history and each marked list is named "xcl list 0x...". The title's own markers are counted without a label. DRED's count lagged the GPU there (a fault in the second dispatch left the first one not done), so the labels bound after that operation are logged too. A list may be Reset while an earlier submission of it still runs, so the last 4 recordings of a list are kept and a DRED node is matched to the newest one with as many markers as its history. Labels and marks go with the released pipeline or list.
681e0ab to
c6067a6
Compare
|
Rebased onto That leaves @LocranKing's smoke pair on the old head AI use: Claude Code (Claude Opus 5.5) did the rebase, ran the tests and drafted this comment. |
|
Merged as
AI use: Claude Code (Claude Opus 5.5) read it, ran the tests and wrote this on the maintainer's behalf. |
The device removals reported when the newer retail title loads its world (the mesh shader page faults on #541: an Aftermath dump on an RTX 3070 Ti, DRED on an RX 7900 XT) don't say which translated pipeline faulted.
XCL_DRED=1logs how far each list got, but not what was bound there, and nobody could tell which console shader to look at. With this, the DRED lines name the pipeline by its console shaders' hashes, the samefnv64hashes the translation log uses.How it works, and why not in the simplest way: on this machine DRED kept no marker text (breadcrumb contexts came back empty), and gave the list's debug name but a null
pCommandList. So eachSetPipelineStateXCL records for the title is followed by aSetMarker, XCL keeps the pipeline's label per list in order, and on a removal it counts the marker operations in DRED's history up to where the list stopped. The title's own markers are counted without a label (aSetMarkerhook). Marked lists are namedxcl list 0x…so a node can be matched without its pointer. DRED's count can also lag behind the GPU here: with a fault in the second of two dispatches, it left the first one not done. So the labels bound after that point are printed too. Nothing changes withoutXCL_DRED=1except theSetMarkerhook forwarding the call.What is in it
crates/xcl/src/hle/d3d12x/dred.rs(new): labels per pipeline, markers per list (its last 4 recordings, a DRED node matched to the one with as many markers),bound_at/bound_afterfrom a DRED history,node_list; unit tests for the counting (the title's markers skipped, ops after the stop point), the recording match and the name parsing.crates/xcl/src/hle/d3d12x/real.rs: labels where translated compute, graphics, mesh and VS+GS pipelines are made; a marker incl_set_pipeline_state,ClearStateand afterResetwith an initial state; aSetMarkerhook; labels and marks dropped with a released pipeline or list; the pipeline inlog_device_removed's DRED lines.crates/xcl/src/hle/d3d12x/device_x.rs,list_x.rs: a list created with an initial pipeline, and the next segment of a Wait64 mid-list split, start a recording with it marked.crates/xcl/src/hle/d3d12x/console_list.rs: a replay starts a recording of the PC list (itsSetPipelineStateis the adopted list's, so it is marked there).README.md: whatXCL_DRED=1now logs.What a line looks like (from the check below, shortened):
DRED: list … 2 of 7 operations done, around: …; pipeline bound there: cs e42ba8a014b743b9; bound after it: cs 26e1b0c2aadbe056.Tested
cargo test --workspace -- --test-threads=4onc6067a6(rebased ontomain1d027e5): 963 passed, 0 failed, 43 ignored. The same withXCL_DRED=1set: 963 passed, 0 failed, 43 ignored. SKIPPED: the wave64 cases oflower/lower_dxilandgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64), the f16 and conversion formslower_dxilrefuses in wave32,heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache). On681e0ab, before the rebase: 780 passed, 0 failed, 41 ignored both ways.SetMarker, then a second pipeline dispatched with a root UAV at an unmapped address. The device was removed (0x887A0006). From DRED's historybound_atgave the first pipeline's label andbound_afterthe faulting one's, with the title's marker skipped. DRED reportedPageFaultVA0 for that fault (the address was 0x700000000), so on NVIDIA a DRED page fault "at VA 0" doesn't by itself mean a null address.Regression run
Needs a new pair for this head
c6067a6. It is681e0abrebased ontomain1d027e5, because the PR no longer merged: the only conflict was theXCL_DREDlines inREADME.md, and the code is unchanged. The pair below was run on681e0ab. Run by @LocranKing on an NVIDIA GeForce RTX 3060 Ti, 60 s each,XCL_NETWORK=0, release, copied from their comment as posted:main:
PR:
Not tested
XCL_DRED=1on this head: I did not run one; the smoke pair above is a regression run of the title, not a fault capture. crosettiremi's run on an RX 7900 XT during world loading (a device hang, on an earlier head with local changes) got labels on 18 of 20 unfinished lists, see the comments. Whether it names the mesh pipeline behind the faults on D3D12.X: a console MS in the AS slot is translated as the mesh shader it is #541 is not shown yet.pCommandListor breadcrumb contexts there; the name and the marker count are used either way); Wine / vkd3d-proton.AI use