Frame drops when entering new areas track texture upload volume (RX 9070 XT / 5700X3D) #159
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#159
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?
@joaowtrdev on GitHub · 2026-12-02 04:19 UTC · original
Possibly related to item 2 of #37 (same GPU, slow texture streaming). This report focuses on the CPU-side
cost per frame, with measurements.
Setup
setup.sh)USE_SYSTEM_WINE=1)6dbc3e7run.conf(relevant lines):What happens
Most of the time the title runs at 33–38 fps (real frames, from
present timing). When I walk or driveinto an area I have not been to during the session, it drops to 14–22 fps for several seconds. The 1% low
across a ~5 min session stays around 9 fps.
Real frames only (
present timingintervals, loading screens excluded):What I ruled out
host pipelines all made made=0 loaded=...in every process).
VICTORY_LOD_SCALE=0.35 VICTORY_SMALL_CULL=2.5 VICTORY_VEHICLE_LOD_BIAS=0.5cut the mediandraws per frame by 24% (8375 → 6341) and the frame rate did not move (27.9 → 27.4 fps, 1% low 9.7 → 9.3).
What changes in the slow blocks
5-second
stats: frameblocks from the lsfg-vk run, grouped by fps (menus and loading excluded):The worst blocks reach 15–25 MB of textures per frame, with
preparing_ms16–18 andcopy_ms8–10, whilegpu_wait_msstays flat. So the time seems to go into preparing and uploading new textures on the frame'spath rather than into GPU work. Draws also rise in the slow blocks, but the LOD test above suggests they are
not what costs the time.
texture_late written_to_shownaverages 27 ms over the session, with p99 mostlyunder 166 ms and a few blocks reaching "<4000 ms".
Questions
numbers above look wrong?
several frames, showing a smaller mip first)? I am happy to run with any of the
VICTORY_TEXTURE_*diagnostic variables and post the output.
cost again?
Two smaller things
VICTORY_FIDELITYFX_FRAMEGEN=1,real frames fall from ~28 to ~14 fps (the screen shows ~28). It is the same under XWayland and with Wine's
Wayland driver. From reading the code,
Present(1, ...)inhost.rsblocks the sender thread for 10–40 ms,and the frame generation config uses
allow_async: false. lsfg-vk 2x on the same scene costs nothingmeasurable (table above), so the card has room for it.
LSFGVK_PROFILE=is treated as off byrun.shand as on byrun.rs.run.shtests-nand sets
DISABLE_LSFGVK=1, whilerun.rschecksvar_os(...).is_some()and setsVICTORY_LSFG=1.A run started with
./run.sh play LSFGVK_PROFILE=therefore has no layer but still logs "native pipelinekey: none saved ... by a run without lsfg-vk" and does not save
native-id.bin. Checking for a non-emptyvalue in
run.rswould make the two agree.@coil111 on GitHub · 2026-12-02 08:08 UTC · original
About framegen:
I tried to reproduce this and couldn't, FidelityFX frame generation costs no real frames by three runs back to back
Setup
mesa.patch(RADV)d044248, plus a local switch for the sync interval of generated presents (below)run.conf:VICTORY_FSR_4K=performance(1920x1080 -> 3840x2160),VICTORY_FULLSCREEN=1,VICTORY_UI_PLANE=3840x2160,VICTORY_FIDELITYFX_FRAMEGEN=1,VICTORY_BVH_BUILDER=1,VICTORY_DEPTH_TEST_ONLY=1,VICTORY_ZERO_READ_KEEP=0,VICTORY_PARTIAL_WRITTEN=1,VICTORY_SKIP_BINK=1,VICTORY_TEXTURE_ROOM_CAP_PERCENT=95,VICTORY_TEXTURE_ROOM_PERCENT=90VICTORY_PRESENT_TIMING=1Runs
Present(1, 0)on the proxyPresent(0, 0)on the proxy (VICTORY_FIDELITYFX_FRAMEGEN_SYNC=0, local switch)VICTORY_FIDELITYFX_FRAMEGEN=0Medians over the 5 s
framestats lines in gameplay (loading and menu windows left out), and over thesenderandpresent timinglines:gpu_wait_msPresentblocked, median / p90busy_mstitle_present_ms, median / p90What I take from it:
Presentsometimes blocks for ~30 ms, on the sender thread, which every submission goes through. But here it doesn't lower the real frame rate. The frame is bound by the title's CPU side at ~50 ms, so the sender has the room, and the time it spends inPresentreplaces time it would otherwise sit idle.title_present_msp90 28.5 -> 19.5 ms). That felt a bit smoother, but the median frame rate didn't change.allow_async: falseonly decides which queue the interpolation compute runs on; that's a few ms of GPU time, and the GPU is mostly idle here anyway.That said, my base rate is ~20 fps and yours is ~30–35 on the same card (I run
VICTORY_BVH_BUILDER=1and the default paging, you runVICTORY_BVH_BUILDER=0,VICTORY_CARD_PULL=0,VICTORY_PAGES_SEEN=1). At ~30 ms per frame the sender has far less slack to absorb a ~30 ms block, so it may well cost you frames where it costs me none. I will run tests on your settings later to see if it changes my findingsTwo things would help tell:
frame,senderandpresent timinglines from a run with FG and one without. Ifbusy_msreaches your frame time with FG on, the sender is the limit, and moving the present off the sender thread would be the fix.@TheRifai on GitHub · 2026-12-02 10:57 UTC · original
A controlled data point from the vkback codebase (different implementation, same GPU class): disabling partial fills does not recover frame time here, so texture-fill work does not look like the dominant cost in a streaming walk.
Setup: main
d59b4f8, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X, 3840x2160, house savert3, scripted camera walk (W/I/K/J/L at 20/45/70/95/120 s), warm store, 135 s per run, A/B/B/A withVKB_FILL_PARTIAL=1(default) vs=0,VKB_LAT=1for per-frame labels.tex: fill prepareper slow frameslot_reads at Executeper slow frameSo turning partial fills off removes ~1.2 ms of fill-prepare work per slow frame but the run gets slightly slower and has more slow frames; index slot reads are ~6–7 ms and remapper waits ~3–6 ms per slow frame. That agrees with our earlier cost model (posted on vktory6/VKtory#138): in steady frames the fill path is smaller than slot resolution and remap waits. This does not disprove your upload-volume correlation — our scene, backend and output size differ — but it suggests that if you A/B a fill optimisation, keep slot reads and remap waits in the same profile so a small fill win is not outweighed. Evidence:
/home/shlong/Documents/VKtory-capture/partial-ab-{A1,B1,B2,A2}/.@audunleganger on GitHub · 2026-12-02 11:32 UTC · original
A data point the other way on the same card: on my RX 9070 XT, FidelityFX frame generation halves the real frame rate.
Setup: RX 9070 XT 16 GB, i7-13700KF, Arch (kernel 7.3.6), KDE Plasma Wayland, this repo's patched Mesa and vkd3d-proton. Build
d044248+ #163 + #164. Series X profile,VICTORY_OUTPUT=1920x1080,VICTORY_FSR_4K=performance, ray tracing on,VICTORY_CARD_PULL=0. Fullscreen on a 1920x1080 144 Hz screen with VRR on (KDE "Automatic"), plus a second 60 Hz screen.Scene: a scripted 5-minute camera orbit on the first safehouse's balcony. Numbers are the mean of 5-s windows of real frames over the orbit.
VICTORY_FIDELITYFX_FRAMEGEN=1VICTORY_UI_PLANE=0With ray tracing off it's the same pattern (38.7 → 20.7 real fps). The log says "generated frames ... rendered=3 generated=3 presents=4". Taking the 4K interface plane out of the interpolation doesn't change it, and the frame time comes out close to double. That looks like pacing (each generated present holding the title back) rather than the cost of generating.
The one setup difference I can see from your run is VRR (yours off, mine on). I haven't tried with it off yet.
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.
@joaowtrdev on GitHub · 2026-12-02 11:43 UTC · original
Thanks for testing it on the same card. Here is what you asked for.
Display: 2560x1440 at 210 Hz, VRR off (KDE Plasma 6.8 Wayland, the game under XWayland unless noted).
Runs: all three use a 4K output with FSR 4 Performance (1920x1080 render), RT off,
VICTORY_CARD_PULL=0 VICTORY_PAGES_SEEN=1, onf7f0360. Same route each time: on foot around a house, then driving. They are not back-to-back: they were played one after another in the same evening, 4–7 min each.Medians / p90 over the 5 s blocks in the world (menus and loading excluded):
stats: frame)gpu_wait_msblocked_us(present timing, frames > 20 ms)busy_mstitle_present_msSo here the real frame rate halves with FG on, with either presentation path. That matches @audunleganger's numbers above. My display has VRR off and theirs has it on, and both halve, so VRR does not seem to be the difference.
gpu_wait_msdrops to zero at the same time, so the frame is not waiting on the GPU. Present blocks for tens of ms at p90, and the title spends more time waiting on present. Your point about the base rate fits: at ~29 fps without FG there is less slack per frame than at ~20.I could not try
VICTORY_FIDELITYFX_FRAMEGEN_SYNC=0, because it is not inmain. If you push it, I will run the same three cases with it. I can also redo the runs at 2560x1440 output to match yours.Attached, with paths removed: every
stats: frameandstats: senderline of each run, then thepresent timinglines for 60 s in the world.Correction to the issue: the LOD comparison used a run with FG on as its baseline. The baseline without FG is 8074 median draws per frame (not 8375), so the LOD settings cut draws by 21%, not 24%. The conclusion does not change: the frame rate did not move.
For context: lsfg-vk 2x on the same scene costs no real frames (29.1 fps, median 33.6), so I am using that for now.
fg-on-winewayland.txt
fg-off.txt
fg-on-xwayland.txt
@coil111 on GitHub · 2026-12-02 17:53 UTC · original
Thanks to all of you, that settles a few things. I reran with your settings and can reproduce part of it.
same setup as before, with 4K output with FSR 4 Performance (1920x1080 render),
VICTORY_UI_PLANE=3840x2160, and your settings:VICTORY_BVH_BUILDER=0 VICTORY_CARD_PULL=0 VICTORY_PAGES_SEEN=1,VICTORY_PRESENT_TIMING=1Medians over the 5 s
stats: frameblocks in the world, and over thesender/present timinglines:Present(1, 0), as on main)Present(0, 0)gpu_wait_msbusy_mstitle_present_ms, median / p90Presentblocked, median / p90Earlier, with ray tracing on (base ~20 fps), FG cost me nothing: the title's own ~50 ms frame hid it. At a ~29 fps base it costs ~12–14% here, not half, but it's the same pattern you see: the GPU stops waiting and sender
busy_msrises to about the whole frame.What's ruled out:
Present(0, 0)(a local switch I tried, so not in main) doesn't help: same blocking, same frame rate. Not worth pushing, so I've dropped it.allow_asynconly moves a few ms of GPU work between queues, and the GPU is idle in all FG runs.What I think it is: the proxy's
Presentholds the next present until the previous generated + real pair is out. We make that call on the sender thread, which also sends every submission, so the next frame's lists wait behind it. How much that costs depends on how much slack the sender has. Here it goes from 27 to ~40 ms busy, for you from 22 to 63, which fits slower single-thread CPUs losing more. That last part is a guess.The fix I'm trying is to make the blocking
Presentcall on a thread of its own. The sender still submits the present's copy, so GPU order stays the same, but it doesn't wait for the proxy. I'll post a branch when it builds and holds up; your runs would be the better test, since you lose much more than I do.@joaowtrdev on GitHub · 2026-12-02 20:02 UTC · original
Thanks for rerunning it with my settings and for the breakdown. It is good to know VRR and the sync interval are out. When the branch with
Presenton its own thread is up, I'll run the same three cases (no FG, FG, and lsfg-vk for reference) and post the numbers here.@coil111 on GitHub · 2026-12-02 21:51 UTC · original
update:
on RADV the proxy swap chain's present queue shares the single graphics queue with ours, and vkd3d-proton staggers our submissions to let it in, which leaves the GPU idle a lot. I put up an opt-in path that skips the proxy and presents both frames ourselves in this pr: #253 .
Here it takes frame generation from −25% to −8% of the real frame rate (1440p, your settings). You lose more than I do, so I'd really like your numbers.