um: add VICTORY_PAGES=wc, VICTORY_UM_CARD_MB, and opt-in VICTORY_PAGE_YIELD_PCT #165
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!165
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-165"
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?
@eirik200 on GitHub · 2026-12-02 05:42 UTC · original
pr/um-wc-cold-yield→main· +245 −17 · 3 files · 2 commits · closed without mergingSummary
Three small, opt-in / safety improvements to unified-memory page residency on 16 GiB cards:
VICTORY_PAGES=wcmode (um.rs,um/residency.rs): Moves pages only in write-combined pools (1w,5w), leaving plain CPU-read/written pools (7,15) in system RAM. In open-world runs on RX 9060 XT, letting all pools move caused 92% CPU-touch thrashing (114,609 of 124,585 promoted pages immediately pulled back on CPU touch), whereasVICTORY_PAGES=0exiled5w(including the 64 MiB HW RT BVH) to system RAM.VICTORY_PAGES=wckeeps5win VRAM with zero CPU-touch ping-pong on pools7/15. Default behavior (VICTORY_PAGESunset or1) is unchanged.um/residency.rs): Write-combined pools like1w(~2.2 GiB) start in VRAM, and the page governor previously only evicted cold pages when< 384 MiBVRAM was free — while the texture governor (host::vram_keep) starts evicting textures at 80% of budget (~2.9 GiB free). When adapter VRAM reaches 78%,residencynow gently demotes cold-only pages (idle>= 30 s/ never read by the card for>= 30 s, never touching warm pages) down toward 75%. In a 10-minute run on RX 9060 XT this shed 1.56 GiB of unread1wpages (2,096 MB -> 532 MB, 30,571 cold pages down) while keeping 100% of active5w(254/255 MB) in VRAM.VICTORY_UM_CARD_MBoverride (um.rs): Optional env var to cap unified-memory VRAM room (clamped to256 MiB..reached, default unchanged).Testing
JOBS=6 ./build.sh checkpasses cleanly.only_write_combined_pools_move_when_askedandcold_pages_yield_before_the_texture_eviction_lineadded.1wshrank from 2,096 MB to 532 MB,5wstayed 254/255 MB in VRAM.@audunleganger on GitHub · 2026-12-02 08:39 UTC · original · edited 2026-12-02 12:42 UTC
Tested on an RX 9070 XT 16 GB (RDNA4), i7-13700KF, 32 GB, Arch (kernel 7.3.6), this repo's patched Mesa and vkd3d-proton. Series X profile, 1920x1080 output, 1280x720 render, ray tracing on (
VICTORY_BVH_BUILDER=1),VICTORY_CARD_PULL=0. Build:d044248+ #163 + #164, with and without #165. Nothing else differs between the runs.The scene is a scripted 5-minute camera orbit around Jason on the balcony of the first safehouse. Numbers are the mean of 5-s windows over the orbit.
VICTORY_PAGES=wcFor reference,
dad990bwithout these PRs gave 23.9-26.5 fps in 6 runs of the same scene.With ray tracing this card stays at about 88% of VRAM for the whole run, so the cold-page yield (on by default above 78%) runs all the time. It takes ~2.3 GB of title memory off the card and leaves ~2.2 GB of VRAM free. The pages it treats as cold are still read by the GPU every frame, so those reads go over the bus.
Suggestion: keep the early yield opt-in (like
VICTORY_PAGES=wc), or count a page as cold only when the card hasn't read it either (the residency line already tracks "seen by the card").Happy to share the logs (the residency line every few seconds) if useful.
AI assistance: Claude Code (Claude Opus 5.5) ran the builds and the measurements, read the logs and wrote this report, on the hardware above.
@GreemSC on GitHub · 2026-12-02 11:21 UTC · original · edited 2026-12-02 11:52 UTC
Tested on an RX 7900 XT 20 GB (RDNA 3), i7-12700K, 24 GB RAM, CachyOS kernel 7.3.6, Proton-CachyOS Wine, this repo's patched Mesa 26.3.1 and vkd3d-proton
71cae09. Series X, 2560x1440 output, render scale 0.75, ray tracing on. Build:d044248+ #163 + #164 + #166 + #165 (+ #149, #155), run withVICTORY_PAGES=wc. One run, scripted drive from the same save as the run without #165 (results of that one in #163).Result: device lost after ~124 s in the world, and the kernel says why. This complements @audunleganger's fps result above: here the cold-page yield ends in a crash, not only a slowdown.
host GPU device removed ... 0x887A0005.amdgpu 0000:03:00.0: [drm] *ERROR* Not enough memory for command submission!(three times).11264 down cold,4513 MB of the card free.So the yield moves pages from VRAM (4.5 GB free) into GTT, which is already full, and the next submission cannot be allocated. On machines where GTT is the scarce side (24 GB of RAM or less; #119 and #147 show the same kernel message), the 78 % rule pushes in the wrong direction.
Suggestions, in line with the one above:
mem_info_gtt_used/mem_info_gtt_totalin sysfs, or the system-side heap of VK_EXT_memory_budget);VICTORY_UM_CARD_MBis useful on its own: on this 20 GB card the title gets 8,176 MB (CARD_KEPT_FOR_HOST= 12 GiB) while ~2.5 GB of VRAM stays free at peak and GTT is full. A split-out PR with only that switch would be easy to test.Edit, measured since: with the same effect as
VICTORY_UM_CARD_MB(title card room 8,176 → 10,224 MB, a local switch onCARD_KEPT_FOR_HOST), withoutVICTORY_PAGES=wc(soVICTORY_PAGES=0, "each pool stays where it starts"): no change — GTT peak 11,880 MB vs 11,884, VRAM peak 17,917 vs 17,918 MB, median frame 33.6 vs 33.9 ms (one run each). With pages not moving, the card room is not what fills GTT here; the pools that start in system memory are. So it only matters together with a mode that moves pages.Logs (residency lines, kernel lines, summary) are available if useful.
AI assistance: Claude Code (Claude Opus 5.5) ran the build and the measurement, read the logs and wrote this report on the hardware above.
um: add VICTORY_PAGES=wc, VICTORY_UM_CARD_MB, and yield cold pages above 78% VRAMto um: add VICTORY_PAGES=wc, VICTORY_UM_CARD_MB, and opt-in VICTORY_PAGE_YIELD_PCT@eirik200 on GitHub · 2026-12-02 15:16 UTC · original
Thanks @audunleganger and @GreemSC for the detailed tests and logs — both reports pinpointed real bugs in the default-on 78% yield:
age == u8::MAXincludes pages the GPU reads every frame thatresidency::heatskips (RT/BVH, descriptors, ranges >= 64 MiB), so firing early yield by default above 78% stripped active title pages over PCIe even with ~2.2 GB VRAM free.Updated in the latest commit:
VICTORY_PAGE_YIELD_PCT=<50..95>(unset or0= off, identical tomainby default).lazy::seen_by_card(WANT/SEEN) and will not evictage == u8::MAXpages that the card has been pointed at by address.DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL(shared_budget - reserve - (shared_used + freed)), and skips if GTT budget is unavailable, so it cannot push a tight GTT into command-submission OOM.Verified with
build.sh checkandum::residency::tests(4/4 passed).Pull request closed