pull: the card's copies only where the processor reads its memory slowly #173
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!173
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-173"
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?
@EdouardSence on GitHub · 2026-12-02 09:06 UTC · original
EdouardSence:pull-auto-fast-bar→main· +38 −6 · 4 files · 1 commits · closed without mergingFollow-up to #93: the card-side reads are turned on only where the CPU reads the card's memory slowly.
Why
#93's GPU copies fix the slow-readback case: CPU reads through the BAR at ~100 MB/s (RX 7900 XTX + i7-13700K; the 9060 XT + 14600KF report in #93 shows the same gain). On systems where the CPU reads the card's memory at bus-like speed, they cost more than they save. Reports in #93 from an RX 7800 XT + 5800X3D and an RX 9070 XT + 7950X3D say the same.
On my RX 9070 XT + Ryzen 7 7800X3D with resizable BAR,
um::calibrate_readsalready measures this at startup:That is about 25x the 7900 XTX figure in
pull.rs.Change
calibrate_readsstores the faster of its two speeds inpull::CARD_READ_MB_S.pull::on():VICTORY_CARD_PULL=0: never use the copies, as before.=1: always use them.title memory on the card is read by ....run.conf.defaultdescribe the three states.Measured
RX 9070 XT 16 GB, Ryzen 7 7800X3D, 32 GB, CachyOS 7.3.5, Proton-CachyOS,
setup.sh's Mesa 26.3.1. Diag builds, Series X, 1706x960 -> 2560x1440, RT on. Each run restored the same frozen save first and was 6 minutes long with scripted input. Screenshots confirm the same place in all three.Per-frame numbers. Every frame time was logged by a one-line local probe in the panel's frame-time push, which is not part of this PR. About 7,500 frames in the world per run. The lows are computed the way the panel computes its "1% low" (99th-percentile frame time):
37bb30fd044248(main, with #93)copy_msAgainst current main, the copy time goes back to the CPU's ~2 ms and the frames over 50 ms drop by about two thirds (394 to 138). The 1% low stays the same, and the 0.1% low is a little better. The averages are within run-to-run noise. A first round of 5-second samples gave the same
copy_mspattern (2.5 / 14.2 / 2.0).Note on the per-frame table: the title spawns the player at a slightly different spot of the same checkpoint on each load (the deck, the house seen from outside, by the railing). These three runs did not all start at the same spot, so take the fps and lows columns with that in mind. The
copy_msgap (about 11 vs 2 ms) is the same in every run I made, including the 5-second-sample round, whose screenshots show the same spot in all three.The 1000 MB/s threshold sits between the two measured groups: ~100 MB/s where the copies help and ~2,300 MB/s where they hurt. Anyone with a card in between can force either way with
VICTORY_CARD_PULL=0/1.Builds clean with
PROFILE=diag ./build.sh. Not run: the#[ignore]card tests.@DecayingEagle on GitHub · 2026-12-02 11:15 UTC · original
Additional RX 7900 XT / Ryzen 9 9900X / 32 GB Linux result on
d044248(Wine 11.22, private Mesa 26.3.1 RADV, diag build): the automatic choice correctly selects CPU reads after calibrating streaming reads at 3,437 MB/s (read_mb_s=3436).Matched frozen-save balcony scene, Series X, 2560×1440 render and output, FSR 4 Native AA, RT/FG off, pages off. Each run used its own copy of the same frozen save. Screenshots confirm the same view during the 90-second measurement after 60 seconds of settling. Medians of 18 five-second
stats: frameintervals (not per-frame percentile measurements):This confirms a large CPU preparation saving, with no FPS gain in this GPU-limited native-1440p scene. The candidate also included #163 and #164, so this is a combined-build check rather than a claim that the entire difference belongs to this PR alone. Both runs included the same Native AA patch, now #178.
The candidate then completed a 20-minute monitored session containing balcony/ground traversal, menus and virtual-controller reconnection. No runtime exception, device loss, kernel GPU reset/timeout, or 60-second frame-stat stall was recorded; physical VRAM peaked at 18,396 MiB. It did not reach vehicle driving, so this is not a driving-stress result. Settings-label overlap remains, and the missing-terrain/void issue was not reproduced on this limited route.
AI assistance: Codex ran the tests, inspected screenshots/logs and wrote this report on the hardware above.
@GreemSC on GitHub · 2026-12-02 11:21 UTC · original
A data point for the threshold, from the slow side: RX 7900 XT 20 GB (RDNA 3) + i7-12700K, resizable BAR on, 24 GB RAM, CachyOS kernel 7.3.6,
d044248.um::calibrate_readsunder Wine:rep_movsb_mb_s=51 streaming_mb_s=2(same in every run).DEVICE_LOCAL|HOST_VISIBLE, map, read 8 MB withrep movsband withmovntdqalines, 1 and 4 threads): 65 MB/s rep movsb, 35 MB/s streaming; the same code reads GTT write-combined memory at 7–18 GB/s. The VRAM mapping is already write-combining in the PAT, so this is the platform, not the mapping.So the same card reads its BAR at ~3.4 GB/s on a Ryzen 9 9900X (@DecayingEagle above) and at ~0.05 GB/s on this Intel 12th-gen desktop: the auto choice really has to be measured per machine, as this PR does, and it should keep the card's copies here. With #163 + #164 + #166 on top of
d044248,copy_msalready falls from 15.0 to 0.8 ms with the pull still on (details in #163).AI assistance: Claude Code (Claude Opus 5.5) wrote and ran the test and this report on the hardware above.
@TreXito on GitHub · 2026-12-02 13:04 UTC · original
A data point from the slow side, on the same GPU class as the 7800 XT report in #93: RX 7800 XT 16 GB (RDNA 3) + i5-13600KF, 32 GB, Nobara kernel 7.3.4, Mesa 26.3.1 RADV from
setup.sh,run.sh's defaultRADV_PERFTEST=nosam, diag build of current main. The GPU link runs at PCIe 4.0 x8 here.um::calibrate_reads:rep_movsb_mb_s=102-106 streaming_mb_s=35-85(two play sessions), so the automatic choice in this PR keeps the card's copies on. That matches what I measured:Headless gamescope 2560x1440, scripted new-game intro, 300 s, ~7,000 frames in the world per run,
VICTORY_PAGES=0, alternating runs:VICTORY_CARD_PULL=0, run 1VICTORY_CARD_PULL=0, run 2Only 2 runs a side, so treat the average as flat; the lows were lower in both CPU-read runs.
A local counter around
copy_mapped(not part of anything I'd PR) showed why the average does not move: with the copies on, the card-sourced reads (about 1-4 a frame, 4-64 KiB, ~0.1 MB a frame) cost 10-16 ms a frame of waiting on the copy queue's fence, and in heavy frames (~4,100 draws)preparing_mswas ~21 ms withgpu_wait_ms~3.6. WithVICTORY_CARD_PULL=0those reads dropped to ~1.5 ms a frame andpreparing_msto ~7 ms, butgpu_wait_msrose to ~11.5 and the frame stayed at ~39 ms: those frames are GPU-bound here, so the wait is hidden, while the BAR reads seem to cost the GPU side something.So a measured threshold looks right to me rather than a per-GPU rule: the same GPU family lands on both sides depending on the platform.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WNCfbX5dPKJzSkgbf16GX4
@Flamware on GitHub · 2026-12-02 16:41 UTC · original
An RDNA 2 data point for the threshold, from the fast side: RX 6950 XT 16 GB (RDNA 2) + Ryzen 5 7600X, 32 GB, PCIe 4.0 x16 (16 GT/s, checked in sysfs), resizable BAR on (16 GB BAR 0). Bazzite, kernel 7.3.5, system Wine 11.22 with the patched wineserver, Mesa 26.3.1 +
mesa.patch.um::calibrate_readsover 76 game starts (Dec 1–2, several builds):rep_movsb_mb_sstreaming_mb_sSo the faster of the two is always well above 1 GB/s here, and this PR picks CPU reads. That matches what I have been running by hand since #93:
VICTORY_CARD_PULL=0for every session on this machine, including ~30 min ond044248+ this PR + #165 today with no hitch I could tie to readback. I have no matched A/B fps run yet, so this is only a calibration data point, not a measured gain.Data gathered with Claude Code from my own run logs; the runs are real.
@goldfishdev on GitHub · 2026-12-02 19:15 UTC · original
superseded by #215
Pull request closed