GPU-bound at low occupancy — RGP suggests shader waves wait on title memory read from system RAM (9.6 GB in RAM vs 2.3 GB in VRAM) #14
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#14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@grykom on GitHub · 2026-11-29 21:14 UTC · original
RX 9070 (RDNA 4): GPU-bound at low occupancy — RGP suggests shader waves wait on title memory read from system RAM (9.6 GB in RAM vs 2.3 GB in VRAM)
Thanks for xmem — it is clearly faster here than the Windows forks we used before. We spent an evening measuring where the remaining frame time goes and wanted to share the data, since it may point at something structural.
Setup
patches/wine.patch), your Mesa 26.3.1 +patches/mesa.patch, vkd3d-proton as pinnedca97da2, diag build, Series X profile,run.sh playdefaultsVICTORY_KEYS(Enter, then turn the camera toward a scripted NPC scene), MangoHud log + VIctory per-frame log lines +amdgpu_topGRBM sampling. Run-to-run spread ±0.2 fps.What we measured (cell scene, after the camera turn)
amdgpu_topGRBM at every resolution: Graphics pipe / CP gfx / CP fetch 98–99%, SPI 91–95%, TA 70–78%; memory controller activity only 4–10%; board power drops with resolution (167 W → 131 W) at the same ~3.05 GHz.Switch tests (all within noise unless noted):
VICTORY_BARRIER_TEST=indirect: no change → clamp waits are free.VICTORY_BARRIER_TEST=groups: +11% (cell) / +28% (standing) but heavy visual corruption → upper bound for the title's barriers ~4–8 ms.VICTORY_JOIN_BARRIERS=1,VICTORY_PORT_CONSTANTS_ORDER=0: no change (clamp pass count stays 168 withINDIRECT_BATCH=3).MESA_VK_TRACE=ctxroll: 1,256 context rolls per frame, only 7 redundant → ~1–2 ms at most, not the cause.RGP capture (one frame, cell scene, 1080p output)
Overview:
vkCmdDispatch4,147,vkCmdDrawMeshTasksIndirectEXT2,963,vkCmdPipelineBarrier1,819,vkCmdDispatchIndirect1,269,vkCmdDrawMeshTasksEXT1,060,vkCmdCopyImage547,vkCmdDraw488. Almost every draw has instance count 1.Most expensive events: a block of ~170 small
vkCmdDispatch(1..98,1,1)(CS, 120 VGPRs, occupancy 12/16, ~5 waves each) that each take 0.9–2.1 ms, running concurrently (~2.1 ms for the block, ~5% of the frame).The interesting part — zooming into a low-occupancy stretch, many events are in flight while occupancy is near zero. The events are tiny but every wave lives for tens of microseconds:
vkCmdDispatchIndirect(59,1,1)vkCmdDrawMeshTasksIndirectEXTvkCmdDrawMeshTasksEXTvkCmdDrawMeshTasksIndirectEXTA 4-wave mesh draw taking 42 µs looks latency-bound, not work-bound.
Likely cause: title memory the GPU reads lives in system RAM
The diag log says:
In
victory-hle/src/modules/xmem.rs,XMemAllocatePhysicalPagesalways callsum::pool(size, false), so the title's big physical pool (6,236 MB, flags0x380, mapped by the title as protection0x2004) goes to theHOST_VISIBLE | HOST_COHERENT | HOST_CACHEDtype. Only write-combined memory (0x2404, ~2.2 + 1.6 GB) gets VRAM. If buffers the shaders chase (meshlets, records, constants) sit in snooped system memory, every dependent read goes over PCIe with a coherence check — which would match all of the above: resolution-independent cost, low VRAM controller activity, low power, long-lived tiny waves, cheap barriers.We tried the naive version (local switch:
um::pool(size, true)forXMemAllocatePhysicalPages). The pool did land in VRAM (2420 MB in RAM, 9410 MB in VRAM), but the title sat on a black screen with ~4 cores busy, GPU ~5% and zero layer work — the title's own CPU code reads that memory, and CPU reads over the BAR are far too slow. So the whole pool can't move.Questions / ideas
Side note: RGP on this setup (in case others try)
MESA_VK_TRACE=rgp, RADV sets a profiling pstate per device. The first RADV device in the process (presumably xmem's own one fromum.rs) takes it, vkd3d-proton's device then getsradv/amdgpu: failed to set new pstate. (-16), device creation fails, and the layer silently falls back to the iGPU (here a Ryzen 610M), which then ate all system RAM and froze the machine. Check forhost D3D12 adapter adapter="AMD Radeon(TM) Graphics"in the log.RADV_PROFILE_PSTATE=noneavoids the failure, but then RADV cancels the capture ("hang condition", not in a profiling pstate). Forcingprofile_peakthrough sysfs instead made device creation fail with -16 again (same fallback to the iGPU).VK_DRIVER_FILES=...), withradv_sqtt_initnot failing whenradv_device_acquire_performance_countersreturns busy (the first device has already set the profiling pstate), plusVICTORY_PREPARE_PIPELINES=0(SQTT changes the driver hash, so all ~94k prepared pipelines would recompile), 64 MiB SQTT buffer, instruction timing and cache counters off.Happy to share the
.rgpcapture or run anything you'd like measured.@SemmerSky on GitHub · 2026-11-30 16:58 UTC · original
RX 7900 XTX (RDNA 3, 24 GB): page residency (
VICTORY_PAGES) measured, A/B in a repeatable sceneA data point from different hardware for the residency work in
90338ca.Setup
mesa.patch, vkd3d-proton + both patchesbaf0468(plus #27 locally), diag build (forVICTORY_KEYS), Series X, 2560x1440, sound mutedcard room for the title 12272 MBMethod (repeatable, no hands)
VICTORY_KEYS=20:Enter,30:Enter,40:Enterreaches it ~60 s after start.stats: framelines. Menus are excluded. Each run is the same scene with the same camera.PAGES=1/PAGES=0. Two repeats of the same setting differed by ~1.5 % in mean fps.Results (fps mean / worst 10 %)
VICTORY_PAGES=1VICTORY_PAGES=0on=true), run 1 / 2gpu_wait_msis the same with and without paging (RT off ~6.5 ms, RT on ~8.5 ms).Residency at the end of a run with RT on:
3676 MB of 9330 MB of paged title memory on the card,2831 MB of the card free, 16055 pages moved up, 3771 down when the processor touched them, 0 down cold, 0 down for room. With RT off it's 3.25 GB up and ~2,100 down.Reading
Earlier data (
cd811c1, windowed, RT off): resolution scaling in the same sceneThat's ~18 ms fixed per frame and ~1.3 ms per megapixel, the same shape as the RX 9070 numbers above. On RDNA 3 too, most of the frame doesn't depend on resolution.
Caveats
PAGESA/B is controlled.Two small fixes I ran into on the way: #34 (
MUTE=1as an argument didn't mute) and #35 (./setup.sh vkd3ddidn't copy the DLLs into an existing prefix, which after90338casilently leaves the card's node test off).Happy to run other settings or scenes, or add a
VICTORY_*diag line, if that helps narrow it down.@Ritualcolt on GitHub · 2026-11-30 22:05 UTC · original
Open-world heavy-streaming A/B on RX 7900 XTX (24 GB, RDNA 3) —
baf0468, 2560x1440 (0.75 render scale), RT off (~8,500–10,100 draws/f):• VICTORY_PAGES=1 (default): 14.5–15.1 FPS (66.3–69.0 ms), 1% low: 5.2 FPS, Worst: 72.4–157.1 ms (14–25 hitches), GPU / Wait: 54.5–61.8 / 4.4–11.1 ms, xmem pool: V3.2G R8.5G
• VICTORY_PAGES=0: 15.8 FPS (63.5 ms), 1% low: 6.5 FPS, Worst: 63.5 ms (12 hitches), GPU / Wait: 53.4 / 10.5 ms, xmem pool: V3.0G R8.7G
Confirms the cutscene A/B behavior holds up in heavy open-world streaming too: disabling background page migration (VICTORY_PAGES=0) improves 1% low (+25%) and cuts worst-frame hitches in half while keeping identical ~53 ms GPU wave time at ~8,558 draws/f.
@Aruku448 on GitHub · 2026-12-01 14:17 UTC · original
Supporting numbers from a slower card: RDNA3 (RX 7800 XT, NAVI32, 16 GB,
37bb30f, wine-staging 11.22, Series X profile, 1080p, RT off, all 94,215 pipelines warm).Same shape as yours (9.4 GB RAM vs 2.6 GB VRAM) with the same occupancy ceiling, on a card that is roughly half the speed:
preparing_ms7.6 andcopy_ms4.4 together do not explain a 35 ms frame,gpu_wait_ms8.9 plus the GPU idle time do, and the GPU sits at 89 % while the CPU side is not saturated. That reads like the waves waiting on title memory read out of system RAM rather than on the layer's own bookkeeping, which is your conclusion.I have not run the
VICTORY_UM_VRAM_MBexperiment, so I cannot add anything to the split question — if you want a second data point on it, I can put a save through it and report back.@grykom on GitHub · 2026-12-01 19:45 UTC · original
A data point for the PAGES=1 / PAGES=0 question from @SemmerSky and @Ritualcolt, on RX 9070 16 GB (
37bb30f,1440p, diag build, RT off, physical monitor, 7 min runs, A B B A; run-to-run spread 0.4 fps).
Prison cell:
Open world (Mandy save, walking then driving, one run each, played by hand on a similar route):
So on this card it is both: in a steady scene residency is a clear win (+10 %, lows equal or better); the lows get
worse while it is moving, i.e. at the start of a scene and in the open world, where 55 % of the moved pages came back
during the run (return times in vktory6/VKtory#17). The player didn't feel a big difference in the open world;
the numbers are one run per arm, so take the open-world part as a hint.
The worst open-world frames (0.5-0.7 s) only happened with PAGES=1. We haven't checked whether they line up with
waves or with returns. A pace test (same pages per second in 200 ms steps instead of 1 s waves, and 3x faster) is
ready on our side and is the next thing we run.