Repository navigation
D3D12.X: a timed-out UMA import check keeps what the GPU still uses - #578
Conversation
check_uma_import waits 2 s for its copy out of the coherent window. When the wait ran out it returned and dropped the queue, allocator, list, fence and readback buffer and freed the probe words, with the copy still on the GPU. vkd3d-proton releases them at once; on RADV the GPU then faults on the freed memory (GCVM_L2_PROTECTION_FAULT, client TCP) and the gfx ring times out: the title's device is removed within its first minute. Under Wine the first use of the 4 GiB imported window can take longer than 2 s (1.3 s when it does not), so this happened in some runs only. On a timeout, what the copy uses is now kept (forgotten, once).
|
Tested on an RTX 5080 and on the Radeon iGPU of the same PC, release build: pass, 680 passed, 0 failed on each. These are Windows runs, next to the Linux / vkd3d-proton runs in the description.
Not tested
AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2) |
Test report: #578 on Linux with NVIDIA (proprietary driver): the same fault, and the PR fixes itThe description covers Linux on RADV and the other report covers Windows. This one is Linux + NVIDIA's proprietary driver, using the same forced-timeout method as the description. On Setup
Forced timeout (0 ms wait), 3 runs each, alternating
Without forcing (the real 2000 ms wait): the check passes in about 4 ms on this driver ( ( Not tested
AI use: Claude Code (Claude Opus 5.5) built the four variants, ran every run above on the machine above and wrote this report. The blocks and log lines are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one. |
|
Diff check on
Next step to unblock merge: Please rebase onto current |
|
On the rebase: this head ( |
check_uma_import(start-up check that the GPU sees CPU writes to the coherent window) waits 2 s for its copy. When the wait ran out it returned and dropped the queue, allocator, command list, fence and readback buffer, and freed the probe words, while the copy was still on the GPU. vkd3d-proton releases those at once, and on RADV the GPU then faults on the freed memory (GCVM_L2_PROTECTION_FAULT, client TCP) and the gfx ring times out, so the title's device is removed (0x887a0005) within its first minute.Under Wine the first GPU use of the 4 GiB imported window is slow (the check took 1.29–1.35 s when it passed), so it ran past 2 s in some runs only: on this machine 2 of 5 retail-title runs on
mainhung this way, and every hang came withUMA import check: check not run: GPU fence still pending after 2000 ms. On Windows the check takes microseconds, which is probably why it was not seen there.What is in it
crates/xcl/src/hle/d3d12x/real.rs: when the check's wait fails, the objects the copy uses are kept (std::mem::forget, once, a few KiB) and the probe words are not freed.Tested
main(508a0c7) + 0 ms: 3 of 3 runs – GPU page fault, ring timeout, device removed.9fb0363) + 0 ms: 3 of 3 runs reachXCL_RUN_SECONDSwith no GPU fault and no device removal.XCL_UMA_CHECK=0) onmain: 4 of 4 runs without a fault.cargo test -p xcl --lib --release --target x86_64-pc-windows-gnu(llvm-mingw), test binary run under Wine with--test-threads=4: this PR andmainboth 634 passed, 6 failed, 21 ignored, the same six (gpu_f64_rootsandgpu_f64_math_random– Recompiler: v_rcp_f64 and v_rsq_f64 keep NaN, infinities and denormals #530,gpu_nonfused_mad_and_mac_prevent_fma_contraction– Recompiler: v_fma_f32 is not fused on AMD's RDNA1 driver (mad() left unfused) #472,xma2_source_voice_decodes_and_manages_lifetime,pe::tests::parses_own_test_binary_tls– TLS: xcl.exe built with MinGW and lld keeps its TLS directory #464,present::tests::window_position_modes), noSKIPPEDlines.real::init(), and failing it needs a copy still in flight when the wait ends; the forced-timeout runs above are the evidence.Regression run
Made with
scripts/linux/smoke.shfrom #257 under Wine (notsmoke.ps1), MSVC builds (cargo xwin), with a local copy of the script in which two lines are changed so that a run which does not reach its end still prints its block (set -euinstead ofset -euo pipefail; thedata:fallback as anif). The title's frame count in 60 s varies a lot between identical runs here (2 to 23); the first pair of runs gave 7 frames for this PR and 14 formain, both without removals or crashes, the second pair is below.Not tested
AI use