gpu: page mover off the title's path, honest VRAM budget, tighter texture pool #44
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!44
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-44"
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?
@k-qno1 on GitHub · 2026-11-30 20:51 UTC · original
k-qno1:memory-pressure→main· +214 −30 · 5 files · 3 commits · closed without mergingWhat
Memory-pressure work for unified memory on AMD, now that RADV's page pools (
90338ca) run with a current driver. Three commits:radv: page-pool pages count in the driver's own memory tally (
patches/mesa.patch)Pool pages are made with raw GEM calls that RADV's allocation tracker never saw, so
VK_EXT_memory_budgettreated the title's own pages as another process's memory: the budget shrank by every MB the page mover put on the card, and the reported use was low by the same amount. Pages now count as CPU-visible VRAM on the card and GTT off it, updated on create, place and free.RX 9070 XT, ~2.9 GB of title pages on the card: the budget read 9,698 MB before; ~13.8 GB after (part of that from closing other GPU apps).
um: the page mover no longer holds the title back while pages move (
um/residency.rs)lazy::moving()guard is released before the kick that makes the kernel migrate a pass's pages. Under it, every title thread first-touching any lazy page (lazy::materialize) waited out the whole migration, up to the kick's one-second wait, once per pass.VICTORY_PAGE_PASS_MS/VICTORY_PAGE_MOVE_MB;1000/8is the old pace.pool: tightest free range, resting pieces not room; room lines as switches
texture_room().VICTORY_TEXTURE_ROOM_CAP_PERCENT(92) andVICTORY_TEXTURE_ROOM_PERCENT(86) forresource::room's two lines; defaults unchanged.VICTORY_VRAM_BUDGET_MBreplaces the system's budget, above or below it. Above it only with the title's cgroup protected (dmem.low, e.g. dmemcg-booster with KDE's foreground booster), or the kernel may move the game's own buffers out.Testing
victory-gpupool and resource tests pass under Wine (19, two new: tightest hole, resting bytes).Needs
./setup.sh mesafor the RADV part.🤖 Generated with Claude Code
@BlueCatsz on GitHub · 2026-12-01 15:22 UTC · original
Tested #44 (
992cc11merged cleanly ontoorigin/main37bb30f) on CachyOS + RX 9070 XT 16 GB.Environment
26.3.1+ #44'spatches/mesa.patch)7.3.6),proton-cachyos-slr+ RB-treewineserver,vkd3d-proton 71cae0911706x960 -> 2560x1440, HW RT on, FG off)Unit Tests (under Wine)
pool::: 6/6 passed (including both new tests:a_small_piece_takes_the_tightest_holeandresting_pieces_are_counted_until_they_have_rested)resource::: 13/13 passed with--test-threads=1(buffer_data_reaches_the_host_textureraced when run in parallel against tests sharinghost()upload lists)Live Observations (
main37bb30fvs.37bb30f + #44)(Caveat: the
mainrun was a cold first run with1,499first-use pipeline misses, whereas both#44runs were warm with0misses, so this is not a strict cold-vs-cold A/B.)main(37bb30f, cold)37bb30f + #44(run 1)37bb30f + #44(run 2,VICTORY_AMBIENT_RT=0)F3)9.97–10.56 GB13.38–13.43 GB13.31–13.37 GB15.0 fps(Submit 37.6 ms,Copy prep 18.7 ms)28.5 fps(Submit 17.0 ms,Copy prep 4.2 ms)texture_late (after_memory)mean19.35 s(n=182,469)7.95 s(n=131,412)12.18 s(n=252,449)texture_late (part_to_whole)mean4.60 s(n=75,261)3.40 s(n=35,433)60,078(0failed)0/0/00/0/00/0/0Remaining Notes
VK_EXT_memory_budgetjumped by ~3.4 GB once RADV tracked pool pages, and0pages waited for room (15,869–21,347pages moved up seen by the card,0refused).87–93%(11.7–12.4 / 13.4 GB),textures picked by index: the card has no room for morestill fired (444times in run 1), and at the end of run 2texture blocks: 80 alive, 8 being emptied, 0 given back to the card, 2 taken into use again for want of room elsewhere— looks complementary to #31 (VICTORY_POOL_MOVE=1).@Luxuride on GitHub · 2026-12-04 12:00 UTC · original · edited 2026-12-05 11:24 UTC
As I read it, this is already in
main: all three commits are inmain.ce61ce3("pool: tightest free range, resting pieces not room; room lines as switches") —crates/victory-gpu/src/pool.rs:141-172(take),:236resting_bytes,:506in_holes, withVICTORY_TEXTURE_ROOM_PERCENT/..._CAP_PERCENTatcrates/victory-gpu/src/resource.rs:1870-1873.VICTORY_VRAM_BUDGET_MBis atcrates/victory-gpu/src/host.rs:9334-9345.crates/victory-gpu/src/um/residency.rs:759let moving = lazy::moving();…:798drop(moving);before the kick, and the flat wave has since been replaced byDOWN_MOST = 512-bounded work, so the constants here are older than what runs.One thing from this work is still true on
mainand worth a separate docs PR:VICTORY_VRAM_BUDGET_MB,VICTORY_PAGE_PASS_MS,VICTORY_PAGE_MOVE_MB,VICTORY_TEXTURE_ROOM_PERCENTandVICTORY_TEXTURE_ROOM_CAP_PERCENTare in neitherdocs/SETTINGS.mdnorrun.conf.default, so five shipped switches are invisible in the F1 menu. One line each inrun.conf.defaultwould fix that.Whether it still has work of its own is the maintainer's call, not mine.
Pull request closed