Repository navigation
Conversation
`wait_for`, `wait_for_rb` and `readback_now` arm `SetEventOnCompletion` on a reused auto-reset event and wait once. When an earlier wait timed out, its fence completing later sets the event, and the next wait on it returns at once: a "not reached after 5 s" logged a millisecond after the previous one, and `readback_ranges` copying the staging bytes before the GPU copy had run. The waits now go through `wait_fence_until` (the helper of xcl-dev#1419 / xcl-dev#2821 for `main`, same signature, so they merge as one): reset the event, then wait in a loop until the fence reaches the target or the deadline passes. `readback_ranges` copies nothing back after a failed wait. Seen on an RX 7900 XT under Wine/RADV (amd-dev c32c91a + the Wine stack): of 201 "readback_now queue has not reached fence value ... after 5 s" in one run, 193 came under 4.9 s after the previous one on the same thread, mostly 1 ms apart, with the fence advancing normally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s run When `readback_now` gives up waiting for its readback (5 s), it dropped the pooled `ReadbackJob` with the copy still queued on `rb_queue`: the readback buffer, allocator and list were released under a pending GPU copy. Drivers that free at `Release` (RADV) unmap the buffer at once; the copy then runs and the command processor writes into freed memory. Seen on an RX 7900 XT under Wine/RADV (amd-dev c32c91a + the Wine stack), entering the world: kernel `[gfxhub] page fault ... Faulty UTCL2 client ID: CPG, PERMISSION_FAULTS 0x5, RW 0x1` a few seconds after the first "readback_now queue has not reached fence value ... after 5 s", the GPU stalls and the title's GPU watchdog ends it (`game_scarlett_master.exe+0x23cf683`). GPU page faults in every run until this change, none after. The job now waits in `IN_FLIGHT_RB_JOBS` with its fence and value, and goes back to the pool once the copy has run (`take_readback_job` reclaims first). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A Windows pair is what this needs to leave draft: One addition to Tested: the whole-suite abort under Wine is AI use: Claude Code (Claude Opus 5.5) wrote this comment. |
|
Wine dual-lane run at head
Suite: At this head, both lanes die at the identical spot as base: 283 tests run, then Solo repro of the killer test at this head, identical panic on both: Base numbers were 9.957s / 9.927s - same signature, same stand-in pipeline for console shader Practical note for Wine testers: on the NVIDIA lane the crash can hang AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting. |
|
The Windows AMD pair asked for above: Tested
Regression run (retail title, 60 s, after one 60 s warm-up run on base that is not counted) The base is Longer runs, 300 s,
Not tested: a Windows run where a readback actually times out (I did not force one); NVIDIA / Intel; the world past the loading stall; #2619 / #2626. AI use: Claude Code (Claude Opus 5.5) read the diff, ran the builds, tests and game runs, read the logs and wrote this comment. The numbers come from those runs on the hardware above. |
|
@vibryxcx thank you for the Windows pair and the whole-suite run, and for saying plainly that the two fixed paths were not exercised there (no 5 s timeout on Windows / RDNA2); that matches what I expected: they only matter where a readback times out, which here is under Wine. I copied your two AI use: Claude Code (Claude Opus 5.5) wrote this reply. |
|
Dual Wine re-check after the amd-dev rewind (heads re-verified at post time: this PR We re-ran the current tip on both our Wine lanes: the stand-in-build deadlock still fires in isolation (solo panic 9.967s on the rig, identical signature at AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting. |
Two fixes to
amd-dev's sparse readback waits, found while runningamd-devc32c91a3under Wine on an RX 7900 XT: a timed-outreadback_nowfreed its readback buffer under a queued GPU copy (a GPU page fault on RADV), and the waits could end early on a stale signal of their reused event. Neither is Wine-specific in the code. Related: #2619, #2626 (amd-dev page faults entering the world on Windows; theirs are shader reads, ours a command-processor write, so maybe not the same bug).What is in it
D3D12.X: sparse fence waits ignore a stale signal of their reused event(sparse.rs):wait_for,wait_for_rbandreadback_nowgo throughwait_fence_until, the helper of D3D12.X: wait_for ignores stale signals on the reusable sparse fence event #1419 (gridoe) / D3D12.X: a stalled sparse upload retries its unsent chunks and reuses no busy allocator #2821 formain, with the same signature so the two merge as one: reset the auto-reset event, then wait in a loop until the fence reaches the target or the deadline passes.readback_rangescopies nothing back after a failed wait. Testwait_fence_until_ignores_stale_event_signal(D3D12.X: a stalled sparse upload retries its unsent chunks and reuses no busy allocator #2821's test).D3D12.X: a timed-out readback_now keeps its job until the GPU copy has run(sparse.rs): theReadbackJobwaits inIN_FLIGHT_RB_JOBSwith its fence and goes back to the pool once the copy has run, instead of being dropped with the copy queued. Testa_timed_out_readback_job_is_kept_until_its_copy_ran.Why
readback_now queue has not reached fence value … after 5 s, the kernel logs[gfxhub] page fault … Faulty UTCL2 client ID: CPG, PERMISSION_FAULTS 0x5, RW 0x1; the GPU stalls and the title's GPU watchdog ends it (game_scarlett_master.exe+0x23cf683). GPU page faults in every run until the second commit, none after (6 runs).Tested
x86_64-pc-windows-msvc; lib tests run under Wine (tools-xcl/wine-tests.sh, which skips the few tests that call DXGI functions Wine lacks).hle::d3d12x::sparse::on this head: 34 passed, 0 failed, 1 ignored, no SKIPPED.wait_fence_until_ignores_stale_event_signalfails with the old single wait (returned too early), passes with the fix.cargo test -p xcl --libbinary under Wine): the run aborts at the same test on the base and on this head (aftergpu::recomp::tests::scalar_relative_move_cluster, the process ends; pre-existing, as in amd-dev 6a0bb5b: 13 tests fail on an RX 9070 XT, and the lib test binary aborts after 1,024 of 1,564 tests #2632). Before the abort:amd-devc32c91a3974 passed / 72 failed, this head 976 passed / 69 failed, 6 SKIPPED lines each; no test fails only on this head (the three fewer are GPU tests that pass or fail from run to run here).amd-dev+ the Wine stack + Wine-only changes discussed on Memory: lazily map sparse VRAM tiles for Wine graphics heaps (#175) #877 / D3D12.X: run sparse::readback_after_execute asynchronously per queue #1732), 600 s runs, 0 crashes, 0 device removals, 0 kernel GPU faults, reaching the playable part.Regression run (by @vibryxcx on Windows, comment: RX 6800, retail title, 60 s, after a warm-up run). The base is this PR's base on
amd-dev, not a commit ofmain.On Windows no sparse or readback wait reached its 5 s timeout (300 s runs too), so these runs show the normal path does not regress, not that the two fixes work there; the whole suite there: the same failures on base and head. Under Wine (@SlopTart, two machines): the lib run stops at the same test on base and head.
Not tested
AI use
🤖 Generated with Claude Code