RTX 3060: test suite and on-card measurements pass; where does the NVIDIA slowdown come from? #457
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/Belobug--VIctory-Belobug-AMD#457
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?
@DhaNho-Z on GitHub · 2026-11-27 03:13 UTC · original
Summary
I can't run the title myself, so I ran the full test suite and every ignored on-card measurement in
victory-gpuon an RTX 3060. Every test passes, and none of the card-side costs thatdocs/findings.mdnames as frame walls looks pathological on NVIDIA. The ~10× gap between NVIDIA and AMD in the reports (e.g. #333: RTX 3090, ~530 ms/frame vs ~45 ms on the RX 7900 XTX) therefore probably comes from something these synthetic tests don't exercise. Below are the numbers, three hypotheses, and two measurements that would settle them.Setup
nvidia-smi: BAR1 total 16384 MiB)a-publier@4eb6cfd, toolchain 1.98.1 (as pinned)Test suite
cargo test --workspace --locked: all pass.cargo test --workspace --all-features --locked --no-fail-fast -- --test-threads=1: 1,123 passed, 0 failed, 46 ignored.victory-shader's 303 tests took ~350 s;victory-gpu's 445 took 39 s.Side note for other contributors: on Windows PowerShell 5.1,
cargo test ... | Tee-Object log.txtinside the repo writes a UTF-16 file, andxtask'srepository_passes_policythen fails on it ("binary content (NUL bytes)"). Keep the logs outside the tree. That's the policy working, not a bug.On-card measurements (release,
--ignored --nocapture --test-threads=1)bench_indirect_draw_barriers: 3,200 one-record draws, windows of 32 (this tree)VICTORY_INDIRECT_WINDOW=1batch_costs: 2,355 indirect dispatchescard_compare_costs: 80 rounds × 5 passes × 500 piecesallocation_costs: committed BC7 texture, 1 threadpool.rsquotes ~310 µs on the 7900 XTX, so NVIDIA is not slower herecopy_costs: 64 KiB into a card-read bufferhash_costs: 96 MBwhat_landing_costslevels_on_demand_on_the_cardUpdateTileMappingsin 602 µsVICTORY_TILES_TEST_CARD=1for the card)bare_command_cost, (a) nothing changesbare_command_cost, (b) new pipeline every drawbare_command_cost, (c) barrier pair every drawbare_command_cost, (h) one-group compute pass before every drawbare_command_cost, (i) same, between two UAV waitsHypotheses
WaveLaneCountMin = Max = 32, so programs whose cross-lane code crosses the 32-lane halves take theexchangepath: extra LDS traffic and barriers, on NVIDIA only (crates/victory-shader/src/emit/lower.rs, around L336 and L1845–1907;emit/mod.rsL488). On RDNA hosts this path never runs, so the AMD-focused tuning would never have seen its cost. This is my main suspect.victory warm --usedbefore measuring.Requests
translatehonoursVICTORY_HOST_WAVE): translate offline as a 32-lane host and count the programs that need the console's whole 64-lane wave: If that count is large and includes hot passes, hypothesis 1 is the place to work.I'm happy to rerun anything on the 3060 that doesn't need title files. The test runs are mine; the analysis and this write-up were done with help from Claude.
@Lancito01 on GitHub · 2026-11-27 03:19 UTC · original
In-game data from an RTX 3080 10 GB (driver 621.14, Resizable BAR off, BAR1 256 MiB), i9-11900K, 32 GB, Windows 11. Prison cutscene, Series S profile, frames judged only once nothing is being made ("0 being made"). It may help narrow your three hypotheses.
The big NVIDIA gap is in the tree, not the card. Same switches on every run (
INDIRECT_WINDOW=1 LEVELS_ON_DEMAND=1 TEXTURE_NO_WAIT=1 CARD_REHASH_RUNS=1 TEXTURE_BACK=1 LATE_WAIT=3 AMBIENT=0.6 CARD_BUFFERS_MIN_KB=64 CARD_BUFFERS_MB=1536):0a43566f4b48ad)a9400a6Bisecting cool_fox, almost all of the gain is in its big merge commit (
e05d463: fallback heaps, TablePlan, residency guard, two-plane compose, 256 MiB DirectStorage staging, WaitOnAddress fence wakes). Its Wave32 policy made no difference by itself. cool_fox is GPL-3 and its commits are also in DexNom/VIctory PR #130. avatarmanz #213 (RTX 4070) and #225 (RTX 3060 12 GB) saw the same pattern: the card-buffer pairCARD_BUFFERS_MIN_KB=64+CARD_BUFFERS_MB=1536does a lot on the cool_fox tree and little on main.With the GPU fixed, what's left is the CPU and the bus. Per frame at ~4.5k draws: about 62 ms preparing, including about 25 ms of upload copies, and about 40 ms copying back what the card wrote to system memory (about 45 MB a frame). GPU is about 10 ms. Resolution makes no difference (1080p vs 1440p), which fits.
So on NVIDIA I'd look at (1) which allocation/heap path the title's surfaces take (committed vs placed in fallback heaps; your
allocation_costs151-269 µs vs 3-8 µs fits), and (2) copy-back volume. DexNom #126-#128 work on (2). We haven't tested ReBAR on yet; it's next on our list, and it should matter more for copy-back than anything synthetic shows.Measurements by the reporter's team; write-up AI-assisted (Claude).
@DhaNho-Z on GitHub · 2026-11-27 03:27 UTC · original
Thanks, this is exactly the data I couldn't get. It rules out my hypothesis 1 for now: if cool_fox's Wave32 policy alone changed nothing, the LDS exchange path isn't where the time goes. And it puts the gap in the tree, not the card:
f4b48adtakes GPU time from 170–209 ms to 7–12 ms on the same 3080.On copy-back, one data point from the run above:
what_landing_costslands ~96 MB in 8–9 ms with ≥4 threads (>10 GB/s) on the 3060, while you see ~45 MB in ~40 ms in game (~1.1 GB/s). The synthetic test starts with the bytes already in system memory, so that ~10× gap would sit in getting them there: the transfer from the card, or the waits before the landing. That fits your point that ReBAR should matter more there than anything synthetic shows.This 3060 has ReBAR on (BAR1 16 GB), so if your ReBAR test needs a second NVIDIA data point for anything that runs without title files, I'm happy to run it.
@Lancito01 on GitHub · 2026-11-27 03:31 UTC · original
Good catch on the ~1.1 GB/s vs >10 GB/s. That points the copy-back cost at the readback itself, or the fence waits in front of it, not the landing. Since your 3060 has ReBAR on, one synthetic number would help a lot if it's easy to add: the time for a card-written buffer of about 45 MB to reach system memory, readback heap vs a CPU-visible default heap (ReBAR), with the fence wait timed separately. Then our ReBAR-off vs ReBAR-on runs in game would have something to compare against. We'll post the in-game ReBAR result here when Andy has flipped it in the BIOS.
AI-assisted (Claude).
@DhaNho-Z on GitHub · 2026-11-27 03:41 UTC · original · edited 2026-11-27 03:43 UTC
Synthetic copy-back on the 3060 (ReBAR on, PCIe 4.0), 45 MiB per iteration, medians of 20, fence wait timed on its own:
The fence wait is ~2.1 ms, i.e. the card's write + copy (~2.0 ms) plus very little.
Two readings:
mapped_card_bufferwarns. When you flip ReBAR on, it's worth checking nothing on the copy-back side starts reading through the BAR (e.g.VICTORY_WINDOWS_BAR_MBwith a shader-written window). That would make it far worse, not better.The tool is ~450 lines of Rust with
windows0.62 and no title files. Happy to open it as a PR (an ignored on-card test invictory-gpu, or a standalone bench) so you can run it on the 3080.@Lancito01 on GitHub · 2026-11-27 03:45 UTC · original
Thanks, that's a clear floor: ~5 ms for 45 MB, so our ~40 ms is organisation (waits, many small copies, serialisation), not the bus. Noted on the BAR read trap. When we flip ReBAR on we'll check that nothing on the copy-back side reads through the BAR,
VICTORY_WINDOWS_BAR_MBincluded. Yes please on the bench: a standalone one is easiest for us. We'll run it on the 3080 with ReBAR off first (PCIe 4.0 too), then on, and post both here.AI-assisted (Claude).
@DhaNho-Z on GitHub · 2026-11-27 03:50 UTC · original
Here it is, standalone: https://github.com/DhaNho-Z/readback-bench (MIT,
windows0.62.2 pinned,Cargo.lockincluded, no title files).With ReBAR off, the GPU upload heap isn't offered, so the tool says so and runs only the
readbackmode. That's the number to compare between your off and on runs. With ReBAR on, it also runs the threerebar-*modes. Every iteration checks that the bytes that arrived are the ones the card just wrote. The README has the 3060 numbers as a reference. Looking forward to the 3080 results.