D3D12.X: XMemVirtualAlloc GPU heaps go to the coherent window again #3369
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3369"
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?
Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-29T10:43:15Z.
Refs #3360.
If
108cbafarouted these heaps to the sparse windows on purpose, please close this PR (see the open question in #3360). I could not tell from its commit message, so this is the fix for the case where it was not intended.108cbafa("kernelx: decode XMemVirtualAlloc XMemFlags and refine graphics protection handling") makesxmem_virtual_alloc_flagsaddMEM_GRAPHICSto everyXMemVirtualAllocthat has the XMemFlags graphics bit. The title's GPU heaps (four commits, about 4.4 GB, with GPU-accessiblePAGE_GRAPHICS_*protections) then take theMEM_GRAPHICS->sparse::allocbranch ofVirtualAllocand never reach the GPU-heap branch that puts them in the coherent window. On an 8 GB card that is video memory for every tile plus the CPU's copy (over the DXGI budget, with warnings), while the coherent window, still committed at its size stored from earlier runs, stays almost empty (64 of 4095 MB used; 3998 of 4095 MB before the commit). Peak commit in the 60 s smoke goes from 20.3 GB (merge-base2c717a04) to 25 GB, which is why every PR measured on the newamd-devfailspr_check.py's 1.25x commit rule.What is in it
kernelx.rs:xmem_virtual_alloc_flagstakes the protection; a commit (MEM_COMMIT) with a GPU-accessiblePAGE_GRAPHICS_*protection and only the XMemFlags graphics bit gets noMEM_GRAPHICS, so it takes the GPU-heap path again (coherent window, or the sparse windows withXCL_COHERENT_HEAPS=sparse). Reservations,PAGE_GRAPHICS_NOACCESS-only commits and legacyXALLOC_ATTRIBUTESmemory types keepMEM_GRAPHICS, and the rest of108cbafais unchanged.Tested
AMD RX 6650 XT 8 GB, Ryzen 7 5700X, Windows 11,
rustc 1.100.0, head23d0f365.cargo test --lib hle::kernelx -- --test-threads=1: 86 passed, 0 failed, 1 ignored.amd-devf33df5a7: peak commit 25,028 MB (1,429 frames; a second run 25,412 MB, 1,407 frames). With this change: 13,569 MB, 1,662 frames, no device removals, no crashes (blocks below).Regression run
Both 60 s runs with
scripts/smoke.ps1 -Seconds 60,XCL_PREPARE=0, same title and card, compute pipeline cache warmed withxcl pso-precompile --used. Firstmaind8bd9a38, then this PR's head.Not tested
AI use