D3D12.X: a timed-out UMA import check keeps what the GPU still uses #578
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!578
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/578/head"
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?
@pablogonz12 on GitHub · 2026-11-24 02:01 UTC · original
pablogonz12:d3d12x-uma-check-in-flight→main· +10 −2 · 1 files · 1 commits · merged 2026-11-25 01:06 UTCcheck_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– #530,gpu_nonfused_mad_and_mac_prevent_fma_contraction– #472,xma2_source_voice_decodes_and_manages_lifetime,pe::tests::parses_own_test_binary_tls– #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
@H0UNDZER0 on GitHub · 2026-11-24 02:40 UTC · original
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.
9fb0363ba81db5103181a302dc67398c87fce77a, this PR's head as is (on its base508a0c7), release build.cargo build --release --workspace --locked: OK, the same singlefetch_updatewarning asmain.cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4: twice on the RTX 5080, the default adapter (the second with--show-output), and once withXCL_ADAPTER=radeonand--show-output: 680 passed, 0 failed, 41 ignored each time. The base508a0c7gives the same 680 / 0 / 41 on the RTX 5080.SKIPPED: on the RTX 5080 the usual 2,gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64); on the Radeon none.check_uma_importran 4 times on each adapter, every timeUMA import check: ok, 1 window(s): 21–46 ms on the RTX 5080, 2–5 ms on the Radeon. So the 2 s timeout this PR changes was not reached; these runs show the normal path is unchanged on Windows.Not tested
main. At the time of the run that was9ce2070;git merge-treeshowed no conflict.scripts/smoke.ps1.AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2)
@JoaoPauluu on GitHub · 2026-11-24 03:34 UTC · original
Test report: #578 on Linux with NVIDIA (proprietary driver): the same fault, and the PR fixes it
The 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
mainthe freed objects give an NVIDIA MMU fault, and the title never starts. With this PR there is no fault and the title runs.Setup
experimental-11.0-20261112(wine-11.0), vkd3d-proton v3.1 + the patch from #257, DXVK from Proton, DXC 1.9.2609,DXVK_CONFIG="dxgi.hideNvidiaGpu = False"x86_64-pc-windows-gnu(mingw-w64-gcc 16.2.0), release buildsscripts/linux/smoke.shfrom #257 (XCL_NETWORK=0)508a0c7and this PR's head9fb0363. For the forced runs, each had line 270 ofreal.rschanged locally from2000to0ms (not part of the PR), as in the description.Forced timeout (0 ms wait), 3 runs each, alternating
508a0c7+ 0 msNVRM: Xid 31 … MMU Fault: ENGINE CE0 HUBCLIENT_CE1 faulted @ 0x0_2aa00000. Fault is of type FAULT_PTE ACCESS_TYPE_VIRT_WRITE, 3 of 3D3D12.X: backend 'real', no DirectStorage request, thenXCL_RUN_SECONDS: 60 s – ending the title (0 frames shown, 0 PresentX calls)9fb0363+ 0 mscheck not run: GPU fence still pending after 0 msGCVM_L2_PROTECTION_FAULTin the description. On NVIDIA it doesn't remove the device; instead the title's start-up stops right there.smoke.shprinted no block for these runs. The log has nogpu:line, so agrepin the script fails underset -o pipefailand it exits without output (the same limitation #464's author worked around). The numbers above are from XCL's log andjournalctl -k.exit: killed (no exit): XCL ended the title at 60 s (935 frames shown), and the process ended at 75 s, past the 15 s grace. The other two exited0x0.Without forcing (the real 2000 ms wait): the check passes in about 4 ms on this driver (
UMA import check: ok, 1 window(s), 4104 µson the base,4219 µson the PR), against 1.29–1.35 s on RADV in the description. So on NVIDIA's driver the timeout is unlikely to be hit by itself, but when it is, the fault is the same.(
peak commit: 0 MBis XCL reading 0 MB committed under Wine, see #257; it is not caused by this PR.)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.
@raylitebull on GitHub · 2026-11-25 00:56 UTC · original
Diff check on
9fb0363:(queue, alloc, list, fence, readback)alive viamem::forgeton a timed-outcheck_uma_importavoids freeing resources still referenced by an in-flight GPU copy (preventing RADV/driver faults on slow first imports).Radeon iGPU+ RADV) and NVIDIA (RTX 5080Windows + Linux), withPR descriptionpassing.Next step to unblock merge: Please rebase onto current
mainso CI runsBuild and test (Windows, no GPU)on the head.@pablogonz12 on GitHub · 2026-11-25 01:11 UTC · original
On the rebase: this head (
9fb0363) already hasBuild and test (Windows, no GPU)pass (run 45309319094, 2m34s) andPR descriptionpass, and the branch is MERGEABLE against current main. I keep published branches un-rebased, but if you want a fresh CI run on top of main I can merge main into it (a merge commit, no force-push); that push changes runtime code, so I would redoscripts/smoke.ps1on the new head before asking for review again. Not done yet: our GPU queue is busy right now, so no smoke number today.