UMA: cap the coherent window at RAM/8 below 24 GB of RAM #3068
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3068"
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 RodrigoTorreao on 2026-11-27T19:52:27Z.
What is in it
The coherent window is pinned in system RAM (Windows counts it as the process's shared GPU memory). On 16 GB machines its default 4 GiB leaves the title paging.
coherent_hint_fornow caps it at an eighth of physical RAM (at least 1 GiB) when the machine has less than 24 GB. With 24 GB or more nothing changes.XCL_COHERENT_MBstill wins over the cap.XCL_COHERENT_AUTO_CAP=0turns the cap off.Tested
RX 6750 XT 12 GB, 16 GB RAM, Windows 11 26200, driver 32.0.21045.29003. The retail title ran on Series X (
anaconda) with a warm cache andXCL_PREPARE=0, 8 minutes per side, with A pressed automatically. GPU memory comes from Windows' per-process counters.623d02eThe average shared memory stays about the same because VRAM over-commit spills into shared memory. The gain is free RAM: the title stops pushing the machine to 0 MB available.
On
amd-dev, the same cap skips about 2 % of two-pass ExecuteIndirect draws whose arguments fall outside the smaller window (bind.rs, reported in #2996). Onmainthat path does not exist, and 0 draws were skipped.Regression run
Same title,
XCL_PREPARE=0, separate empty caches.mainran with its ownscripts/smoke.ps1.main
6089122a:This PR:
Frames are 86 % of main's, and peak commit is 103 %. Both runs hold 60 presents per 2 s at the end, so the frame gap comes from startup timing.
Full suite (
cargo test --workspace --no-fail-fast -- --test-threads=4):The one failure is
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, and it fails on both sides. The first PR suite run also failed the 3e2etests becausexcl_testtitle.exehad not been built in that target dir. Aftercargo build --workspace,e2epasses 4/4.Not tested
AI use
Code, measurements and text were made with Claude Code (Claude Opus 5.5). I reviewed the change and ran every test on the hardware above.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by RodrigoTorreao on 2026-11-27T22:37:33Z.
Help wanted: test reports from machines with less than 24 GB of RAM, on any GPU.
The change only acts below 24 GB of RAM. With 24 GB or more it is a no-op, which is also worth confirming.
mainand this branch. Run the same title on each for the same time, with a warm cache andXCL_PREPARE=0.console code so far: ... coherent X/Y MBshould show Y ≈ RAM/8 on this branch (4095 onmain).XCL_COHERENT_AUTO_CAP=0on this branch should matchmain.AI-assisted (Claude Code with Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-27T23:38:34Z.
Wine A/B across the RAM line: the RAM/8 cap does not change either
uma_driverred.We run xcl's CPU-side suite under Wine on two machines that sit on opposite sides of your 24 GB threshold:
Tested
Baseline
mainat2c717a04and this PR headabf7e177(exact sha checked against the API at run time), same worktree per machine,cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu:::2c717a04grooming..., xma2 (FAudio)abf7e1772c717a04write_buffer_immediate...,failed_restore...,grooming..., xma2abf7e177Solo runs of the two uma tests, 3 each, same trees:
grooming_leaves_a_window_under_1_gib_only_its_hole: FAILED 3/3 on both lanes on both trees, identical signatureuma_driver.rs:349:9,left: Some(1), right: Some(0)(rig geometry line stillhole 0x7fffde000000, stretch 0x8fff0000..0xbfff0000).failed_restore_stops_before_importing_an_unbacked_window: FAILED 3/3 on both lanes on both trees. 16 GB box keeps its signatureuma_driver.rs:304:9,left: Some(1), right: Some(130088963); the 96 GB rig keepsleft: 0, right: 20381696.What this adds
The cap is live on the 16 GB lane (2 GiB window by your own table) and neither red moves at all: same asserts, same values, same failure counts in-suite and in solos. So on Wine these two reds are not coherent-window-sizing reds - the cap helps real titles page less, but the test failures survive it. If you expected one of the Wine reports in #2977 to be fixed by this PR, it will not be, on either RAM side.
Separate observation while baselining (not caused by this PR): on the 96 GB rig,
failed_restore...is green in-suite at2c717a04(it was red in-suite at06f90c19) but still fails solo 3/3, now fast (1.5-1.7 s instead of 6-8 s). That flip landed somewhere in the evening merge wave (#3043DXIL release is the suspect, not bisected). The 16 GB box is red both in-suite and solo throughout.Not tested
Native Windows. Real title runs / paging behavior under the cap.
XCL_COHERENT_MB/XCL_COHERENT_AUTO_CAP=0overrides. RDNA4.AI use
Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T02:26:40Z.
I found a test-isolation issue on exact head
abf7e177804f2ae7daac44d19e6b0fa081def6c0. The PR documentsXCL_COHERENT_AUTO_CAP=0as the opt-out, and the cap function correctly returnsNonewith it set. However, the stock unit test assumes it is unset.Using one freshly built exact-head test binary in separate processes, I ran
gpu::uma::auto_cap_tests::low_ram_machines_get_an_eighth_of_their_ram:XCL_COHERENT_AUTO_CAP=0: 1 failed, actualNoneversus expectedSome(2147483648).Only the initial process environment differed. Passing the enabled/disabled choice into the calculation (with a separate opt-out assertion) would make the test deterministic without mutating shared process environment. This is a test failure under a supported setting; I did not observe a production memory failure or run a title.
AI use: OpenAI Codex with GPT-6.2 Astra ran the checks; Codex reviewed and prepared this report.