DRED: a device lost under asynchronous submission (the default) reports the fault address and breadcrumbs too #214
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!214
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-214"
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?
@MamaLeVrai on GitHub · 2026-11-25 23:56 UTC · original
MamaLeVrai:dred-async→main· +75 −18 · 2 files · 2 commits · openWith
VICTORY_D3D12_DRED=1in a diagnostics build, a device loss prints the faulting address and the breadcrumbs only on the synchronous path. Asynchronous submission is the default (VICTORY_ASYNC_SUBMIT), and there a loss prints onlyhost GPU device gone reason=…, so the DRED data that was asked for is never read.Where.
Host::execute_innerchecksGetDeviceRemovedReasonand callsfail(… removal_data(runs) …)only after it has waited for a submission (host.rs, afterslow host submission). An asynchronous submission signals its fence andcontinues before that point. The loss is then first seen when making a list or an upload/shared buffer fails, andwait_if_removedlogs only the reason.My two runs on an RX 6950 XT (RDNA2) that ended in
0x887A0007ran asynchronously and logged only the reason. (#151 was on01aadd1, before asynchronous submission was the default, and did get breadcrumbs, though no fault address.) Note: in my two runs DRED was not switched on either, so they only show where the report would be missing, not what it would say.The change. When DRED is on,
wait_if_removedaddsHost::removal_datato its line, over the lists of the submissions still in flight (in_flight, throughtry_lock; if it is held, over none). If those lists are already reaped,removal_datastill gives the page-fault address and allocations and each list's breadcrumb progress, without the pipelines. Without DRED nothing changes.Checked.
cargo clippy --release -p victory-gpu --no-deps, with and without--features diagnostics, builds with no new warning. I have not been able to make a device loss on purpose to see the new line; I have not run the game with it.AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 23:56 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
@adrianmjim on GitHub · 2026-11-26 19:52 UTC · original
Tested on native Windows 11 (26300) with an RX 7900 XT (driver 32.0.32029.2010) and with WARP. Head
9d1f4c4, base4f62c2a.Tests:
cargo test -p victory-gpu --lib, with and without--features diagnostics, 8 runs each, alternating with base. The only failures were in watch, pipeline::library, frame and queue, which this PR does not touch, and the same tests also fail on base. Other heavy jobs were running on the machine at the same time.Report path, checked with a local-only test (diagnostics build,
VICTORY_D3D12_DRED=1) that callsID3D12Device5::RemoveDeviceand thenshared_buffer:host GPU device gone reason=Err(0x887A0005 ...) layer=None dred=; breadcrumbs (done/count, list) [](reason shortened). Base prints the same line withoutdred. WARP and the 7900 XT give the same result.RemoveDevice, even with a list held behind an unsignalledqueue.Waitand left inin_flight. So I could not check the list mapping this way.RemoveDevice,queue.Signalstill returns S_OK andfence.GetCompletedValue()returnsu64::MAX, on both adapters. So the nextreap_completed(fromwait_fenceordrain_in_flight_locked) pops every in-flight entry, andin_flightcan already be empty when a buffer creation fails.new_list()also fails afterRemoveDevice. Its callers in list.rs (lines 296 and 395) only logno host command listand do not callwait_if_removed. Only a failed upload or shared buffer creation prints the new line.A possible hang (found by reading the code, not reproduced, because it needs a real page fault):
shadow::find_copyholdsBUFFERS(shadow.rs:2387) when it callsh.shared_buffer(2411).shadow::looseholdsLOOSE(2496) when it callsh.shared_buffer(2509).wait_if_removedcallsremoval_data_in_flight, thenremoval_data, thenshadow::near(host.rs:1710).nearlocksBUFFERSandLOOSEagain on the same thread, insideONCE.call_once.std::sync::Mutexis not reentrant, so that thread hangs. Other threads that reachwait_if_removedblock on theOnce. A synchronous submission that then sees the removal callsremoval_data, and sonear, beforefail(), and blocks on the same locks. So the run would hang instead of logging the reason.try_lockinshadow::near, or skip the title-memory lookup on this path.Not tested: a real device hang or page fault, and the game.
@MamaLeVrai on GitHub · 2026-11-26 23:28 UTC · original
Thanks, @adrianmjim, the hang you found by reading is real. I fixed it in
7d0c446(pushed to this PR).shadow::nearnow takes each table (BUFFERS,LOOSE,SPARSE, its aliases,DIRECT) withtry_lock. A table that is held, by this thread or another, is left out, and the line says which:(in use on this thread or another, not looked at: buffers). A poisoned lock is still read.shadow::tests::near_leaves_out_a_table_this_thread_holdsholdsBUFFERSon the test thread, callsnear, and checks the note. Against the previousnearthe same test hangs (killed after 60 s withhas been running for over 60 seconds). With the fix it passes at once.cargo test --release -p victory-gpu --lib(RX 6950 XT): 113 passed, 1 failed, 4 ignored. The failure islist::tests::lists_are_cut_at_waits_that_follow_work, which fails on base in release and is fixed by #210. Clippy reports nothing new in the changed lines.On your other points: I agree the empty breadcrumbs under
RemoveDeviceand thein_flightalready reaped (fence atu64::MAX) limit what this path can show. Also, thenew_list()callers in list.rs only log, so a failed upload or shared buffer is still the main place the line comes from. This PR does not change that.AI-assisted (Claude Code); no game data.
@adrianmjim on GitHub · 2026-11-26 23:31 UTC · original
Thanks @MamaLeVrai. Taking each table with
try_lockand saying which one was left out is the right trade for a diagnostic path that may run while the faulting thread holds a lock. A test that hangs on the old code and passes at once on the new one is about as direct as it gets. Nothing else from me on this one.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.