performance: 8 GB RTX 5060 is submit-thread bound; profiles of where the frame goes (measurements only) #4505

Open
opened 2026-11-30 21:35:05 +00:00 by github-bot · 2 comments
Owner

@⁠eipastel on GitHub · 2026-11-30 21:31 UTC · original

Summary

On an 8 GB RTX 5060 with a 6-core CPU, the frame rate is held by the submitting thread, not by the card. Below are profiles (WPR/xperf with victory.pdb symbols) and A/B runs from 30/11, in case they help whoever works on the submit path. No fix is proposed; this is measurements only.

Setup

  • RTX 5060 8 GB, Ryzen 5 7600X (6 cores / 12 threads), 32 GB RAM, Windows 11 26200.
  • main at c71899d9 (30/11), release build, play-foxhound.ps1 -SeriesS -Dlss performance -NoMenu, no frame generation, no fps cap.
  • VICTORY_TEXTURE_BUDGET_MB=2000 on every run. Without it, card use sits 1.6–2.4 GB over the DXGI budget and everything gets slow and uneven (more in #4463).
  • Same save every run (prison scene right after the menu, it plays by itself), VICTORY_BENCH_CSV for frame times.

1. The card is not the limit

test fps (same session)
base 20.4
skip the 5 most expensive shaders 19.9
texture budget 256 MB 20.2
DLSS Ultra Performance 20.0
no wait on the card at present 20.4
no copy-back of shader writes 20.9

Card meter (VICTORY_CARD_METER_PIPELINES=1): the title's lists take about 30 ms of card time per 58 ms frame; the card sits idle 4–22 ms per frame, almost all of it while the submit thread is still working.

2. Where the submitting thread spends the frame

WPR, 46 whole frames, taken 120 s after entering the world (after the driver compile below has stopped), frame = present to present, 64.2 ms with WPR on. Sum of slices matches the frame time in every frame.

slice ms/frame
on CPU (land::Pool::each 2.7, kernel_written 2.0, Host::submit 1.9 + 2.0 kernel, wide_each_scoped 1.6, card_record in nvwgf2umx 1.9, victory_safe_copy_at 1.2, ...) 30.8
waiting for new work from the title (Lane::serve) 11.6
waiting for the landing (send_late 4.6, settle 1.9, woken by victory-relay) 6.6
ready, no free core 4.0
waiting for shadow::workers (copy refresh helpers) 3.9
kernel graphics calls in try_upload_buffer_own / resident / sweep 5.1
other 2.2

The play-log line agrees: of ~64 ms, ~45 ms "preparing", 20–27 ms of it "copies" (~75 MB per frame).

3. The NVIDIA driver recompiles for ~90 s on every start

The four D3D Background Thread threads use 50–218 ms of CPU per world frame for the first ~90 s after entering the world, then drop to 0. It happens on every run, including back to back runs: %LOCALAPPDATA%\NVIDIA\DXCache (22 GB here) gains no files and no bytes. While it runs, the submit thread loses ~11 ms/frame waiting for a core and ~6 ms/frame inside the driver in card_record; both drop to ~4 and ~0.1 ms once it stops. Running non-elevated (runas /trustlevel:0x20000) did not change it. Unverified guesses: the driver cache is full, or pipelines loaded from the pipeline book are recompiled in the background each time.

Practical note for anyone benchmarking: a window that starts before ~100 s in the world measures the driver compile, not the runtime.

4. The title's heaviest thread is a spin on the main queue fence

The title thread with the most CPU (~30 ms/frame) spends ~27 ms of it in SleepEx(0) inside the title's frames-in-flight limiter: +0x4fb0c27 (in the function at +0x4fb0ad0, called from the end of frame at +0x2474740). It reads the main queue fence value through ID3D12Fence slot 0x60 and waits for frame N-1 to land. On console that loop is monitorx/mwaitx; on PC console_insn.rs turns them into a no-op and pause, so the wait becomes a busy spin with Sleep(0).

Measured with a hook on that loop: 479 ms of waiting per second of play (21.8 ms per frame). From the title asking for the signal to fence::set in the landing: median 22.5 ms, p95 39.7 ms.

Making the fence land at once (unsafe experiment) gave +1.5 % fps, inside noise, so the wait itself is not the limit: the title just reaches the next point where it waits on the runtime. The spin does use a core, though, on a CPU that is short of cores (item 2).

5. Things that did not move the frame rate (each tried in alternating A/B, gain under noise)

  • Answering the copy refresh's journal lookups from a per-round snapshot, and a lock-free shortcut in watch::guard (the shortcut is never taken: every lookup that reaches GUARDS has a written block).
  • Skipping MakeResident and sweep: +5 %. Not waiting for the landing: +5 %. Submit thread at time-critical priority: +8.5 %. Noise between base segments of the same run: 15.6 %.
  • Copying everything without asking GetWriteWatch: about 9x slower. Asking is much cheaper than copying what did not change.

Logs, the WPR-derived tables and the analysis scripts are available if useful.

**@⁠eipastel** on GitHub · 2026-11-30 21:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4504) ### Summary On an 8 GB RTX 5060 with a 6-core CPU, the frame rate is held by the submitting thread, not by the card. Below are profiles (WPR/xperf with `victory.pdb` symbols) and A/B runs from 30/11, in case they help whoever works on the submit path. No fix is proposed; this is measurements only. ### Setup - RTX 5060 8 GB, Ryzen 5 7600X (6 cores / 12 threads), 32 GB RAM, Windows 11 26200. - `main` at `c71899d9` (30/11), release build, `play-foxhound.ps1 -SeriesS -Dlss performance -NoMenu`, no frame generation, no fps cap. - `VICTORY_TEXTURE_BUDGET_MB=2000` on every run. Without it, card use sits 1.6–2.4 GB over the DXGI budget and everything gets slow and uneven (more in #4463). - Same save every run (prison scene right after the menu, it plays by itself), `VICTORY_BENCH_CSV` for frame times. ### 1. The card is not the limit | test | fps (same session) | |---|---| | base | 20.4 | | skip the 5 most expensive shaders | 19.9 | | texture budget 256 MB | 20.2 | | DLSS Ultra Performance | 20.0 | | no wait on the card at present | 20.4 | | no copy-back of shader writes | 20.9 | Card meter (`VICTORY_CARD_METER_PIPELINES=1`): the title's lists take about 30 ms of card time per 58 ms frame; the card sits idle 4–22 ms per frame, almost all of it while the submit thread is still working. ### 2. Where the submitting thread spends the frame WPR, 46 whole frames, taken 120 s after entering the world (after the driver compile below has stopped), frame = present to present, 64.2 ms with WPR on. Sum of slices matches the frame time in every frame. | slice | ms/frame | |---|---| | on CPU (`land::Pool::each` 2.7, `kernel_written` 2.0, `Host::submit` 1.9 + 2.0 kernel, `wide_each_scoped` 1.6, `card_record` in `nvwgf2umx` 1.9, `victory_safe_copy_at` 1.2, ...) | 30.8 | | waiting for new work from the title (`Lane::serve`) | 11.6 | | waiting for the landing (`send_late` 4.6, `settle` 1.9, woken by `victory-relay`) | 6.6 | | ready, no free core | 4.0 | | waiting for `shadow::workers` (copy refresh helpers) | 3.9 | | kernel graphics calls in `try_upload_buffer_own` / `resident` / `sweep` | 5.1 | | other | 2.2 | The play-log line agrees: of ~64 ms, ~45 ms "preparing", 20–27 ms of it "copies" (~75 MB per frame). ### 3. The NVIDIA driver recompiles for ~90 s on every start The four `D3D Background Thread` threads use 50–218 ms of CPU per world frame for the first ~90 s after entering the world, then drop to 0. It happens on every run, including back to back runs: `%LOCALAPPDATA%\NVIDIA\DXCache` (22 GB here) gains no files and no bytes. While it runs, the submit thread loses ~11 ms/frame waiting for a core and ~6 ms/frame inside the driver in `card_record`; both drop to ~4 and ~0.1 ms once it stops. Running non-elevated (`runas /trustlevel:0x20000`) did not change it. Unverified guesses: the driver cache is full, or pipelines loaded from the pipeline book are recompiled in the background each time. Practical note for anyone benchmarking: a window that starts before ~100 s in the world measures the driver compile, not the runtime. ### 4. The title's heaviest thread is a spin on the main queue fence The title thread with the most CPU (~30 ms/frame) spends ~27 ms of it in `SleepEx(0)` inside the title's frames-in-flight limiter: `+0x4fb0c27` (in the function at `+0x4fb0ad0`, called from the end of frame at `+0x2474740`). It reads the main queue fence value through `ID3D12Fence` slot `0x60` and waits for frame N-1 to land. On console that loop is `monitorx`/`mwaitx`; on PC `console_insn.rs` turns them into a no-op and `pause`, so the wait becomes a busy spin with `Sleep(0)`. Measured with a hook on that loop: 479 ms of waiting per second of play (21.8 ms per frame). From the title asking for the signal to `fence::set` in the landing: median 22.5 ms, p95 39.7 ms. Making the fence land at once (unsafe experiment) gave +1.5 % fps, inside noise, so the wait itself is not the limit: the title just reaches the next point where it waits on the runtime. The spin does use a core, though, on a CPU that is short of cores (item 2). ### 5. Things that did not move the frame rate (each tried in alternating A/B, gain under noise) - Answering the copy refresh's journal lookups from a per-round snapshot, and a lock-free shortcut in `watch::guard` (the shortcut is never taken: every lookup that reaches `GUARDS` has a written block). - Skipping `MakeResident` and `sweep`: +5 %. Not waiting for the landing: +5 %. Submit thread at time-critical priority: +8.5 %. Noise between base segments of the same run: 15.6 %. - Copying everything without asking `GetWriteWatch`: about 9x slower. Asking is much cheaper than copying what did not change. Logs, the WPR-derived tables and the analysis scripts are available if useful.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 21:35:05 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-30 21:31 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.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-30 21:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4504#issuecomment-7292537923) 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. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Author
Owner

@⁠eipastel on GitHub · 2026-11-30 23:11 UTC · original

Play log of the profiled run behind sections 2 and 3 (the driver compile stops about 92 s after the world; WPR ran from 120 to 135 s): https://gist.github.com/eipastel/b7ad36336e15f06607e95ba336820074 (raw: https://gist.githubusercontent.com/eipastel/b7ad36336e15f06607e95ba336820074/raw/275d38c87d8a0ac2b9be7bb9526d1d3538924d65/victory-nvidia-20261130-145543.log). Posted as a gist because the file is 7.9 MB. This one is not a crash, so there is no crash log.

**@⁠eipastel** on GitHub · 2026-11-30 23:11 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4504#issuecomment-7294829733) Play log of the profiled run behind sections 2 and 3 (the driver compile stops about 92 s after the world; WPR ran from 120 to 135 s): https://gist.github.com/eipastel/b7ad36336e15f06607e95ba336820074 (raw: https://gist.githubusercontent.com/eipastel/b7ad36336e15f06607e95ba336820074/raw/275d38c87d8a0ac2b9be7bb9526d1d3538924d65/victory-nvidia-20261130-145543.log). Posted as a gist because the file is 7.9 MB. This one is not a crash, so there is no crash log.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA#4505
No description provided.