Where the card's time goes on an RTX 5080: a flat profile of small serial passes, not translator overhead (per-shader GPU time + census of all 26,180 programs) #4917
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#4917
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?
@mstrmoos on GitHub · 2026-12-01 13:53 UTC · original
Summary: on an RTX 5080 the card is the limit, but it is barely used: shader cores execute about 7 % of their peak instructions. I measured where the card's time goes, counted what the translator emits for every shader in the game, and compared the two. The time is spread thinly over hundreds of shaders, the translated code shows no dominant overhead, and the low use comes from the title's many small passes running one after another. I'm writing it up so others don't spend days on the same dead ends, and so the ideas that are left are ranked by what they can be worth.
Setup
main0c8c2092merged up to5fabb46e), diagnostics build.VICTORY_IMAGE_HOLD); 8,700 at the title's own values.1. Card time per command (
VICTORY_GPU_TIME=1,VICTORY_GPU_TIME_TOP=40)7b2c3c1db2298f44, one dispatch) is 0.82 ms a frame. The top 40 together are 48 % of the card's time. There is no hot shader to fix.2. How busy the card really is (Nsight GPU Trace of a replayed frame)
3. What the translator emits (
VICTORY_SHADER_CENSUS, all 26,180 programs)victory translate <game folder>withVICTORY_SHADER_CENSUS=<file>writes one line per program. Overall:ResourceDescriptorHeap[i]).groupsharedarray.Joined with the 40 most expensive commands, nothing stands out:
7b2c3c1d(compute)915ed81e(compute)764ca63d(compute)3a79195f(compute)be6ce5d8(compute)17af15c4(compute)4. Ceilings already measured
Barriers: removing every barrier in a captured frame (replay) is worth about 2.5 ms at most.
VICTORY_NARROW_BARRIERS=1is slower on NVIDIA.An async compute queue: the title's compute-queue lists are 1.8-1.9 ms of card time a frame (9 submissions, 13 waits), so that is the most it could take.
Merging draws: an indirect record plus a table change costs about 6 ns a draw, so there is nothing to win.
Resolution: see below.
Resolution: card time barely follows the pixel count. Same scene and switches, 90-120 s each, frame generation off:
Three times the pixels costs 22 % more time. Performance mode (1280x720) was no faster than Balanced in an earlier run (31.7 ms, with the card's own time unchanged at 24.6 ms). Most of the frame is fixed cost per pass, not per pixel. A side effect for players on big cards: DLAA or Quality costs little more than Balanced.
Conclusion
The card isn't held back by bad translated code. It's held back by the shape of the title's frame: many small dispatches and draws, each too small to fill 84 SMs, run one after another with memory latency in each. On console hardware that shape fits. On a much wider PC card it leaves most of the card idle.
What's left, ranked by what it might be worth
Each of these is small: about 0.1-0.5 ms, perhaps 1-2 ms together. All are translator changes, so they're part of the shader cache key and need a fresh translation to measure.
read_memis cleared at every block (crates/victory-shader/src/emit/bitcode/opt.rs:1824). I've written this as optimiser bit 512 (LOADS_DOM, off by default,VICTORY_SHADER_OPT=959).1cd9bc63149 to 127,b3756505266 to 244,c5d4ff74403 to 379).crates/victory-shader/src/emit/lower.rs:8641,bitcode/opt.rs:2469), so their fetches start together. Check SASS first: the driver may already hoist them.lower.rs:4692), and the DPP ballot in blocks every lane runs (lower.rs:6019).s_buffer_loadthrough the raw twin (lower.rs:7890-7960,9144-9187): removes a dependent stride-table load and two branches. Only withVICTORY_PORT_CBV=1, which needs renderer port 1 (VICTORY_PORT_CONSTANTS=1), which is off in most setups because the card then reads title memory over the bus.lower.rs:2574-2587): the smallest. They're zero in most top shaders, and under 3 % of the instructions where they appear.Larger, structural, and not investigated: running the title's independent passes side by side, beyond what removing barriers already allows.
I'll post measurements here as I go.
@github-actions[bot] on GitHub · 2026-12-01 13:53 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU you have and which Windows version (10 or 11).
If this issue needs logs and none are posted here within 12 hours, it will be closed. Add them by editing your post or in a comment.
@mstrmoos on GitHub · 2026-12-01 14:02 UTC · original
First item measured: resource reads reused across the dominator tree in programs that write no resource memory. It's optimiser bit 512 (
LOADS_DOM) and off by default;VICTORY_SHADER_OPT=959turns it on.Same pier scene, the same switches in both runs, 90 s each, after a warm-up run to translate the shaders:
VICTORY_SHADER_OPT=959)That's about 1.5 % on the median, inside what I see between runs of the same build. The census predicted this: the change removes 1.3 % of buffer reads in total, and the card's memory waits aren't mostly repeated reads. I'm keeping it on my branch as an opt-in switch. I'm not opening a PR for it unless someone sees more on another card.
@HQasper on GitHub · 2026-12-01 14:13 UTC · original
7b2c3c1db2298f44's cost comes from #3780's gray stand-ins, not from the program's own work. On our RTX 5090 it is about 1.1 ms a frame since v2026.11.30.01 and 0.01 ms before it, andVICTORY_NEUTRAL_ALL_KINDS=0gives that time back.Setup: RTX 5090 (32 GB), driver 621.24, Windows 11, 2560x1440 output, DLSS Quality, the opening from one save, ray tracing off unless said. The fps and card-meter runs are release builds of our branch (upstream
84bd61e2, v2026.11.30.02, plus local changes of ours); the bisect builds are upstream's own commits.VICTORY_GPU_TIMING=1):7b2c3c1db2298f44(one 14x10x1 dispatch) is 0.00-0.01 ms a frame through a whole run on a build on41adb551, and 1.11-1.12 ms a frame through the steady part of every run on builds onc71899d9(v2026.11.30.01) and84bd61e2, with ray tracing on and off. The cost is the same in every frame.VICTORY_SCRATCH_WB=0so that #2174's table placement is out of the way; measured by the card meter's list kind[compute 00e6aef268b1ef81] / [compute 03e3e26783a5799b], which holds this dispatch, in the still scene at the end of a 150 s run):41adb5511.22 ms,c71899d92.34 ms; then6b0618831.65,8808916f1.24,baaace8b1.24,0b8719d32.35. That leaves the 14 commits 05e2e1b4..0b8719d3, with #3780 (3496e742) among them. Each build logs once when it makes a gray stand-in of a kind:baaace8bmade none, while0b8719d3,c71899d9and every 84bd61e2-based run made them for Line and Cube views (and Volume in a capture run).84bd61e2, release, 3 runs each, interleaved): withVICTORY_NEUTRAL_ALL_KINDS=0that list kind is 1.25-1.27 ms in the still scene against 2.35-2.37 ms, the title's lists take 13.5-13.6 ms of the card a frame against 14.6-14.7 ms, and the steady frame rate is 50.8, 50.9, 50.9 fps against 50.2, 50.3.VICTORY_NEUTRAL_ALL_KINDS=0, frames at the same count after the world's first frame: in the scene we compared (the cell, 3,000 frames in), the two differ only where things move (4.7-9.3 per channel against 1.2-2.1 within one run). No black patch in that scene. One scene only, which does not show where #3780's stand-ins help.How we read it: where a volume or cube texture is not there yet, the program reads a gray texel instead of zeros, and its loops run to their cap (its translation has 13 loops capped at 4,096 iterations). That would fit both the 0.82 ms on your RTX 5080 and a cost that is the same in every frame.
Not done: other cards and other scenes; which kind of stand-in it is; whether a narrower fix (keeping the gray stand-in for materials but not for this program's slot) is possible. We use
VICTORY_NEUTRAL_ALL_KINDS=0in our own launcher for now.Written with Claude Code (Claude Opus 5.5); measured on my PC; reviewed by me.
@mstrmoos on GitHub · 2026-12-01 17:43 UTC · original
Two more measurements for the ranked list, and one structural lever checked off. All on the same pier scene and RTX 5080.
A second (compute) queue would overlap almost nothing as the layer orders things today.
VICTORY_ASYNC_QUEUE=plan(90 s, about 5,300 draws a frame) reported, per frame:card_steps) 5.0, compares of copies in the card's memory 2.1, a texture's state moved on the direct queue first 6.3 (a submission can wait for more than one).The title's compute-queue lists are about 1.8-1.9 ms of card time a frame, so that's the ceiling. It's not reachable without first changing how the layer's own card steps and compares are ordered between queues. That's a bigger design question than building the queue itself.
Two upstream PRs measured on this scene:
Translator items 3 and 4 from the list are measured null:
b8f3f797is 0.392 against 0.390 ms andb22a16a10.143 against 0.140.So on NVIDIA, this title's card time is the shape of its frame, not overhead the translator can trim.