gpu: copy the title's streamed geometry once to the card (VICTORY_GEOMETRY_ON_CARD) #611
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!611
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-611"
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?
@SoRadGaming on GitHub · 2026-12-05 17:45 UTC · original
SoRadGaming:geometry-on-card→main· +975 −0 · 8 files · 1 commits · openProblem
With unified memory, the pool the title gets from
XMemAllocatePhysicalPagesfor its streaming heap (about 6.2 GB on Series X) stays in system RAM. It has to: the title's own threads read that pool constantly. An earlier crude experiment that started the whole pool on the card ran at 1-2 fps for that reason.The cost is that the card reads the streamed geometry placed in that pool (vertex, index, meshlet and instance buffers) in place over PCIe, at every draw. It shows up as per-draw card time in the shadow and G-buffer passes, time that does not shrink when the resolution goes down.
What it does
The buffers the title places from that pool are final once placed: the loader writes them and the title's CPU code does not write them again. So the split is made per buffer, not per pool. Each placed buffer gets one copy in card memory. The card reads the copy; the title's CPU keeps its own bytes.
Verified against Series X 1.0.2.1 (
game_scarlett_master.exe, BLAKE3b99f876b74d4a77f…).gbuf_create_resource(+0x6dc20) is detoured. It is the only writer of a buffer object's CPU memory (+0x18) and GPU address (+0x38) for created and placed buffers.count × stridebytes are copied into card memory and +0x38 is pointed at the copy.gctx_set_root_srv/cctx_set_root_srv). They are rewritten to load +0x38.VICTORY_GEOMETRY_ON_CARD=viewsleaves these loads untouched, so only views made from +0x38 read copies. It exists to rule this rewrite out if something looks wrong.gbuf_uav_alias_slot_create_q: an alias made over a copied buffer is made over the copy, so what programs write through it is what the draws read.gbuf_release(+0x4fafdb0);xmem_stream_free_single_chunk_q(+0x4f8eb60) for a physical chunk,xmem_resource_map_release_q(+0x4f8ea40) for a map's physical chunks;tex_lock(+0x5121690) only counts locks of copied buffers. A CPU write through one would not reach the copy.um::own_card, a thin wrapper over the existingum::own;shadow::loosewindows like any other;VICTORY_GEOMETRY_ON_CARD_MB(default 1024);stats: geometry on card, once a second: copies made, alive and ended, MB alive, region MB and free MB, refusals for room and size, aliases and locks.Measurements
This branch (current main + this commit), software ray-tracing walk
Same machine and scene as below,
VICTORY_BVH_BUILDER=1 VICTORY_BVH_IN_PLACE=1, two runs each, alternating, about 60 s measured per run, frame times from the present log:VICTORY_GEOMETRY_ON_CARD=1Counters at the end of a run: 54,385 copies alive (744 MB in 896 MB of regions), 78,634 ended, 0 refused for room, 0 locks of copied buffers. No crash or device loss in four runs. The copies fit in main's fixed room for title memory on a 16 GB card.
With per-pass timings (local stack)
The per-pass numbers were measured on a local stack, not on this branch alone:
Setup:
VICTORY_HW_RT=1 VICTORY_HW_RT_LEAN_BUILDER=1.VICTORY_GEOMETRY_ON_CARD=1Camera-pan route (single runs): 44.15 → 38.85 ms.
Counters at the end of a standing run: about 54,600 copies alive (748 MB), about 100,900 ended, 0 refused for room, 0 locks of copied buffers.
Limits of these numbers:
Switch
VICTORY_GEOMETRY_ON_CARDviews: root-view loads left alone). Off by defaultVICTORY_GEOMETRY_ON_CARD_MB1024Both are added to
docs/SETTINGS.md, and the first torun.conf.default.Risks
lockedstayed 0.=viewsturns it off.Not done
Credit
um::own,shadow::loose) by the lobomfz/VIctory-xmem maintainers.🤖 Generated with Claude Code
@fsrajner on GitHub · 2026-12-05 19:17 UTC · original
A/B data point on RDNA 4, tested together with #596 in one build (both opt-in, so the arms differ only by env).
Setup: RX 9070 XT 16 GB, Ryzen 7 7800X3D, CachyOS, repo-patched Mesa 26.3.1 RADV + vkd3d-proton, proton-cachyos-slr. Series X profile, 4K output with FSR 4.1.2 Quality, hardware RT (
HW_RT+LEAN_BUILDER+REUSE), frame generation off, headless gamescope. Base:main@8bf4878+rt-7-reuse+ #542, then this PR (d1f1944) and #596 (e2dc089) merged in. The only conflict was thepage residencyformat string.Method: the same intro snapshot every run (standing, light streaming), 120 s after the first A press. One warm-up run, then two rounds of base /
GEOMETRY_ON_CARD=1/ #596 / both, interleaved. "Long frames" are thelong framelog lines (≥ 50 ms).GEOMETRY_ON_CARD=1RESIDENCY_STICKY=1,KICK_SPLIT=64)stats: geometry on cardshows ~39k buffers / ~550 MB alive in 768–896 MB of regions, with 0 refused for room or size, 0 locks, and no device loss or visual problems.@DrArroway on GitHub · 2026-12-05 20:44 UTC · original
37-minute real-play soak data point on RDNA 2 / PCIe 4.0 (
main+#611alone, software RT).Setup & build
AMD Radeon RX 6900 XT (1002:73bf)(RDNA 2, 16 GB VRAM, PCIe 4.0), Ryzen 9 7900X (12C/24T), 64 GB DDR5-6000 EXPO, CachyOS kernel7.3.7-1-cachyos,GE-Proton11-15-x86_64, repo-patched Mesa (deps/mesa-inst) + vkd3d-proton.main(a5c6484) +#611merged cleanly with 0 conflicts (52.3 srelease build; shaders +94,449pipelines warmed cleanly).VICTORY_OUTPUT=2560x1440,VICTORY_FSR_4K=quality,VICTORY_FIDELITYFX_FRAMEGEN=1,VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1,VICTORY_UI_PLANE=3840x2160,VICTORY_GEOMETRY_ON_CARD=1(defaultcap_mb=1024),VICTORY_PLACED_COPIED=1,VICTORY_PARTS_ONE_CALL=1,VICTORY_KEEP_HOST_BUFFERS=1,VICTORY_SKIP_INTRO=1, software RT (VICTORY_BVH_BUILDER=1).Soak results (
37m 08s, free play + driving + story progression, clean voluntary exit)0errors,0crashes,0visual glitches or mesh corruption across 2.34 million copied buffers (53.7 GBcopied).locked=0andmade_again=0throughout the entire 37-minute session (refused_size=0,aliased=97).card_mb_for_titleceiling (896 MBvscap_mb=1024):main's fixedcard_mb_for_title=4080room ceiling:alive_mbreached878 / 896 MB(free_mb=9,largest_free_kb=1932), causing56,874buffers (2,026 MB) over the full soak to fall back gracefully to in-place PCIe reads — with zero issues — even though total card VRAM still had >2 GB of headroom (12,999 / 15,264 MB, peak13,231 MB, shared11,752 MB/ peak13,179 MB).stats: geometry on cardline (at37m 08s):tools/session-fps.sh(371samples):23.9median /24.5avg real FPS,min_fps=14.6(no single-digit drops),avg_preparing_ms=4.5 ms,avg_copy_ms=1.2 ms; Direct Framegen finished at29.0real /29.0gen (~58presented FPS,0resets,0.66 msinterp).@Milkhaus-tech on GitHub · 2026-12-06 04:01 UTC · original
RDNA 4 A/B for
VICTORY_GEOMETRY_ON_CARD=1. It was the clearest gain of everything we tested, and we now run it by default.Setup: RX 9060 XT 16 GB (RDNA 4, Navi 44), Ryzen 7 5800X, 32 GB RAM, Ubuntu 26.04 (kernel 7.0.0-44), repo Mesa 26.3.1 RADV, GE-Proton11-11, resizable BAR on. Series X profile, potato preset, 1920x1080 output,
VICTORY_FSR_4K=balanced, ML frame generation, ray tracing off. Build:main@8c4e663+ #596 + #637 + #639 + #599 + #626 + this PR, with all other switches off. No pipeline was missed at first use in any run.Method:
VICTORY_BENCH_ROUTE=downtownwith the same save restored before every run. Measured from route start +30 s to +330 s using thestats: frame5 s windows (about 59 per run). Rendered fps only; generated frames are not counted. Arms were interleaved and run on the same build.RECORD_PLACES=1+RECORD_RANGES=1geometry on card: a region of 128 MB for copies. A screenshot at +150 s matches the default: full city, correct vehicle and foliage. No errors or crashes over 6 runs, plus a normal play session started on it.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.