CPU usage optimization #274

Closed
opened 2026-11-27 20:37:27 +00:00 by github-bot · 5 comments
Owner

@⁠flokybbad-cmd on GitHub · 2026-11-27 20:34 UTC · original

System Specs

  • CPU: AMD Ryzen 5 3600 (6 cores / 12 threads, ~3.92 GHz all-core load)
  • GPU: NVIDIA GeForce RTX 3070 8 GB (Driver 582.99)
  • RAM: 32 GB DDR4
  • OS: Windows 11 Pro 24H2 (26100.1742)
  • Build: v2026.11.27.3 (Series S profile, DLSS Balanced, FSR 3 2X, shaders preloaded)

Problem Description

In outdoor / dense scenes, the game hits a massive CPU translation and synchronization bottleneck, dropping to ~3–4 base FPS (~6–7 FPS with FG) while the RTX 3070 sits nearly idle.

Profiling Data from Logs & F3 Overlay

From victory-nvidia-play logs in outdoor scenes:

  • GPU idle time: the card's clock per frame: nothing of ours queued 242.9 ms (the card about 14% busy by this count)
  • Command list translation (VICTORY_THIN): 40521 calls in 747.4 ms (all threads), 202.2 lists, 328.0 pieces
  • Submitting & Present waits (VICTORY_ASYNC_SUBMIT): that thread worked 60.6 ms... threads of the title waited 240.5 ms at presents
  • Memory sync / Relay (VICTORY_LAND): was 29.1 ms landing in all
  • Indirect draws: indirect executions per frame: 4219 (unmerged)

Ready Community PRs Targeting These Exact Bottlenecks

There are already several open PRs in this repo that directly address these CPU/memory bottlenecks on mid-range multi-core CPUs:

  1. #151 (shadow: use the existing AVX2 compare for the refresh and copy-back runs) — speeds up memory comparison in landing using AVX2.
  2. #142 (perf(gpu): shard RETIRED resource queue 16-way and add VICTORY_WIDE_THREADS) — reduces lock contention across CPU worker threads.
  3. #209 (perf(gpu): reservation-aware write-watch batching, lock-free view/non-watched bitsets) — reduces write-watch overhead during submission prep.
  4. #132 (Release profile: the program optimised as one unit (fat LTO, one codegen unit)) — enables fat LTO for better single-thread and cross-crate CPU throughput.
  5. #203 (A lighter profile for 8 GB cards and 16 GB of RAM) — helps keep VRAM/RAM pressure low on 8 GB GPUs.

Merging these CPU/memory optimizations into the next official release would make a huge difference for 6-core/8-core CPUs where the GPU is currently starved for work. Thanks for the awesome progress on this project!

**@⁠flokybbad-cmd** on GitHub · 2026-11-27 20:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/274) ### System Specs - **CPU:** AMD Ryzen 5 3600 (6 cores / 12 threads, ~3.92 GHz all-core load) - **GPU:** NVIDIA GeForce RTX 3070 8 GB (Driver 582.99) - **RAM:** 32 GB DDR4 - **OS:** Windows 11 Pro 24H2 (26100.1742) - **Build:** `v2026.11.27.3` (`Series S` profile, `DLSS Balanced`, `FSR 3 2X`, shaders preloaded) ### Problem Description In outdoor / dense scenes, the game hits a massive **CPU translation and synchronization bottleneck**, dropping to **~3–4 base FPS (~6–7 FPS with FG)** while the RTX 3070 sits nearly idle. ### Profiling Data from Logs & F3 Overlay From `victory-nvidia-play` logs in outdoor scenes: - **GPU idle time:** `the card's clock per frame: nothing of ours queued 242.9 ms (the card about 14% busy by this count)` - **Command list translation (`VICTORY_THIN`):** `40521 calls in 747.4 ms (all threads), 202.2 lists, 328.0 pieces` - **Submitting & Present waits (`VICTORY_ASYNC_SUBMIT`):** `that thread worked 60.6 ms... threads of the title waited 240.5 ms at presents` - **Memory sync / Relay (`VICTORY_LAND`):** `was 29.1 ms landing in all` - **Indirect draws:** `indirect executions per frame: 4219` (unmerged) ### Ready Community PRs Targeting These Exact Bottlenecks There are already several open PRs in this repo that directly address these CPU/memory bottlenecks on mid-range multi-core CPUs: 1. **#151** (`shadow: use the existing AVX2 compare for the refresh and copy-back runs`) — speeds up memory comparison in `landing` using AVX2. 2. **#142** (`perf(gpu): shard RETIRED resource queue 16-way and add VICTORY_WIDE_THREADS`) — reduces lock contention across CPU worker threads. 3. **#209** (`perf(gpu): reservation-aware write-watch batching, lock-free view/non-watched bitsets`) — reduces write-watch overhead during submission prep. 4. **#132** (`Release profile: the program optimised as one unit (fat LTO, one codegen unit)`) — enables fat LTO for better single-thread and cross-crate CPU throughput. 5. **#203** (`A lighter profile for 8 GB cards and 16 GB of RAM`) — helps keep VRAM/RAM pressure low on 8 GB GPUs. Merging these CPU/memory optimizations into the next official release would make a huge difference for 6-core/8-core CPUs where the GPU is currently starved for work. Thanks for the awesome progress on this project!
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 20:37:27 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-27 20:59 UTC · original

Thanks for the report. v2026.11.27.6 is out (https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.27.6). Since this was posted, releases from v2026.11.27.4 on include:

  • a fix for memory that kept growing through a session (PR #58), behind late-session slowdowns, full RAM/VRAM and coloured blocks;
  • a fix for very long frames when the low memory range filled up (PR #88).

If you have time, please try .6 and post new numbers or a new log here. It helps to see what changed on your PC.

**@⁠trustno1-coder** on GitHub · 2026-11-27 20:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/274#issuecomment-7228034886) Thanks for the report. **v2026.11.27.6** is out (https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.27.6). Since this was posted, releases from v2026.11.27.4 on include: - a fix for memory that kept growing through a session (PR #58), behind late-session slowdowns, full RAM/VRAM and coloured blocks; - a fix for very long frames when the low memory range filled up (PR #88). If you have time, please try .6 and post new numbers or a new log here. It helps to see what changed on your PC.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-27 21:09 UTC · original

Thanks for the detailed report. It's noted, and it stays here for others to find. Closing it, since it's a measurement rather than a single bug to fix. Since it was posted, v2026.11.27.4 and later (https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.27.6) fixed memory that kept growing and very long frames when memory filled up. If you find a specific bug or crash, please open an issue for it with the log.

**@⁠trustno1-coder** on GitHub · 2026-11-27 21:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/274#issuecomment-7228182677) Thanks for the detailed report. It's noted, and it stays here for others to find. Closing it, since it's a measurement rather than a single bug to fix. Since it was posted, v2026.11.27.4 and later (https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.27.6) fixed memory that kept growing and very long frames when memory filled up. If you find a specific bug or crash, please open an issue for it with the log.
Author
Owner

@⁠flokybbad-cmd on GitHub · 2026-11-27 21:23 UTC · original

Thanks for the quick fixes in .6! Here is a detailed breakdown of the v2026.11.27.6 profiling data and logs from the exact same scene on my setup (AMD Ryzen 5 3600 + RTX 3070 8 GB, Windows 11 24H2, Series S profile, DLSS Balanced, FSR 3 2X, MFG Unlocker: OFF):

1. Performance & Frame Pacing Breakdown (.3 vs .6)

  • Base FPS & Frame Time: Improved from ~3.3 FPS (300.8 ms/frame, 6.6 FPS with FG) up to 9.1 FPS (110.1 ms/frame, LONGEST 145 ms, 18.2 FPS with FG).
  • Copy-back / Relay (VICTORY_RELAY / VICTORY_LAND): Dropped dramatically from 32.7 ms down to 8.1 ms, eliminating the massive late-session slowdowns.
  • Memory Footprint: Stabilized at 5.6 / 6.8 GB VRAM and 19.7 GB RAM (no longer ballooning over time).

2. Remaining CPU & Submission Bottlenecks (F3 & Log Data)

Despite the big improvement, the game is still heavily CPU-bound on a 6-core Ryzen 5 3600 while the RTX 3070 sits nearly half idle:

  • F3 Timings: SUBMIT BUSY: 78.0 ms vs GPU BUSY: 38.2 ms (IDLE BEHIND US: 45.8 ms, WAITS FOR GPU: 22.8 ms).
  • Dropped Draws: DRAWS 4273 / DROPPED 3529 per frame.
  • Log Breakdown (VICTORY_THIN / VICTORY_ASYNC_SUBMIT / VICTORY_HEAP_SYNC):
    • Command list translation (VICTORY_THIN) and descriptor mirroring (VICTORY_HEAP_SYNC) across 6 cores still bottleneck the submitting thread (~56–78 ms per frame), starving the GPU between submits.
    • Unmerged indirect executions (VICTORY_INDIRECT_MERGE=0 by default) generate thousands of separate indirect dispatches per frame on the CPU.

3. Remaining Visual Bugs: Black Faces/Clothing & Missing Body Parts

While the bright "confetti" blocks from .3 are gone, black texture patches on character faces/clothing and disappearing eyes/teeth/body parts are still very frequent in both cutscenes and gameplay:

  • Increasing VICTORY_TEXTURE_ROOM_PERCENT from 70 to 82 (~6 GB texture budget) did not fix these black character textures, even though total VRAM usage stays around 5.6 / 6.8 GB.
  • In the log, texture queue entries still report waiting for room or falling back to black/missing surfaces—likely due to either texture pool eviction under Series S / 8 GB limits or untranslated console texture formats / character SSS shaders (e.g. Marvisak/VIctory / fork PR #228 map console texture formats 189-191).

4. Fresh Upstream & Fork PRs Targeting This Exact CPU Bottleneck (SUBMIT BUSY / Lock Contention)

If you're looking for high-impact CPU optimizations for the next builds (.7+), these fresh PRs directly target the 78 ms submission and memory-sync overhead seen in my logs:

  • Marvisak/VIctory#3487 (Batch submission heap/memory steps and fast-scan bindless and page-table bitmaps): Cuts SUBMIT BUSY time by batching heap/memory steps and accelerating bitmap scans on the CPU.
  • Marvisak/VIctory#3516 (Make pages read-only outside the guard lock — VICTORY_GUARD_OUTSIDE): Moves page protection updates out o

f the global guard lock, reducing worker thread stalls on 6-core CPUs.

  • Marvisak/VIctory#3484 (Fast-skip clean/idle bindless textures and lazy-reset upload list): Avoids redundant per-frame CPU checks on unchanged bindless textures.
  • #142 (Shard RETIRED resource queue 16-way and add VICTORY_WIDE_THREADS): Removes lock contention during retired resource cleanup across worker threads.
  • #209 (Reservation-aware write-watch batching, lock-free view/non-watched bitsets): Eliminates write-watch locking overhead during submission prep.
  • #151 (Use existing AVX2 compare for refresh and copy-back runs): Accelerates landing / copy-back memory comparisons using AVX2 instructions.
  • #132 (Release profile: fat LTO, one codegen unit): Enables full cross-crate link-time optimization for free single-thread CPU throughput gains.

Attaching the full victory-nvidia-play log from .6 and the F3 screenshot showing the black face/clothing textures below:

victory-settings.txt

victory-nvidia-play-20261127-211211-20336.log

изображение_2026-11-28_002217225
**@⁠flokybbad-cmd** on GitHub · 2026-11-27 21:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/274#issuecomment-7228394324) Thanks for the quick fixes in `.6`! Here is a detailed breakdown of the **v2026.11.27.6** profiling data and logs from the exact same scene on my setup (AMD Ryzen 5 3600 + RTX 3070 8 GB, Windows 11 24H2, `Series S` profile, `DLSS Balanced`, `FSR 3 2X`, `MFG Unlocker: OFF`): ### 1. Performance & Frame Pacing Breakdown (`.3` vs `.6`) - **Base FPS & Frame Time:** Improved from `~3.3 FPS` (`300.8 ms/frame`, `6.6 FPS` with FG) up to **`9.1 FPS` (`110.1 ms/frame`, `LONGEST 145 ms`, `18.2 FPS` with FG)**. - **Copy-back / Relay (`VICTORY_RELAY` / `VICTORY_LAND`):** Dropped dramatically from `32.7 ms` down to **`8.1 ms`**, eliminating the massive late-session slowdowns. - **Memory Footprint:** Stabilized at **`5.6 / 6.8 GB` VRAM** and **`19.7 GB` RAM** (no longer ballooning over time). ### 2. Remaining CPU & Submission Bottlenecks (F3 & Log Data) Despite the big improvement, the game is still heavily CPU-bound on a 6-core Ryzen 5 3600 while the RTX 3070 sits nearly half idle: - **F3 Timings:** `SUBMIT BUSY: 78.0 ms` vs `GPU BUSY: 38.2 ms` (`IDLE BEHIND US: 45.8 ms`, `WAITS FOR GPU: 22.8 ms`). - **Dropped Draws:** `DRAWS 4273` / `DROPPED 3529` per frame. - **Log Breakdown (`VICTORY_THIN` / `VICTORY_ASYNC_SUBMIT` / `VICTORY_HEAP_SYNC`):** - Command list translation (`VICTORY_THIN`) and descriptor mirroring (`VICTORY_HEAP_SYNC`) across 6 cores still bottleneck the submitting thread (`~56–78 ms` per frame), starving the GPU between submits. - Unmerged indirect executions (`VICTORY_INDIRECT_MERGE=0` by default) generate thousands of separate indirect dispatches per frame on the CPU. ### 3. Remaining Visual Bugs: Black Faces/Clothing & Missing Body Parts While the bright "confetti" blocks from `.3` are gone, **black texture patches on character faces/clothing and disappearing eyes/teeth/body parts are still very frequent** in both cutscenes and gameplay: - Increasing `VICTORY_TEXTURE_ROOM_PERCENT` from `70` to `82` (~6 GB texture budget) did not fix these black character textures, even though total VRAM usage stays around `5.6 / 6.8 GB`. - In the log, texture queue entries still report waiting for room or falling back to black/missing surfaces—likely due to either texture pool eviction under `Series S` / 8 GB limits or untranslated console texture formats / character SSS shaders (e.g. `Marvisak/VIctory` / fork PR **#228** `map console texture formats 189-191`). ### 4. Fresh Upstream & Fork PRs Targeting This Exact CPU Bottleneck (`SUBMIT BUSY` / Lock Contention) If you're looking for high-impact CPU optimizations for the next builds (`.7`+), these fresh PRs directly target the `78 ms` submission and memory-sync overhead seen in my logs: - **`Marvisak/VIctory#3487`** (*Batch submission heap/memory steps and fast-scan bindless and page-table bitmaps*): Cuts `SUBMIT BUSY` time by batching heap/memory steps and accelerating bitmap scans on the CPU. - **`Marvisak/VIctory#3516`** (*Make pages read-only outside the guard lock — `VICTORY_GUARD_OUTSIDE`*): Moves page protection updates out o f the global guard lock, reducing worker thread stalls on 6-core CPUs. - **`Marvisak/VIctory#3484`** (*Fast-skip clean/idle bindless textures and lazy-reset upload list*): Avoids redundant per-frame CPU checks on unchanged bindless textures. - **`#142`** (*Shard RETIRED resource queue 16-way and add `VICTORY_WIDE_THREADS`*): Removes lock contention during retired resource cleanup across worker threads. - **`#209`** (*Reservation-aware write-watch batching, lock-free view/non-watched bitsets*): Eliminates write-watch locking overhead during submission prep. - **`#151`** (*Use existing AVX2 compare for refresh and copy-back runs*): Accelerates `landing` / `copy-back` memory comparisons using AVX2 instructions. - **`#132`** (*Release profile: fat LTO, one codegen unit*): Enables full cross-crate link-time optimization for free single-thread CPU throughput gains. Attaching the full `victory-nvidia-play` log from `.6` and the F3 screenshot showing the black face/clothing textures below: [victory-settings.txt](https://github.com/user-attachments/files/35531373/victory-settings.txt) [victory-nvidia-play-20261127-211211-20336.log](https://github.com/user-attachments/files/35531386/victory-nvidia-play-20261127-211211-20336.log) <img width="2559" height="1439" alt="изображение_2026-11-28_002217225" src="https://github.com/user-attachments/assets/ed8c32f5-3205-4c3d-ae8a-f29eeaa40fe7" />
Author
Owner

@⁠flokybbad-cmd on GitHub · 2026-11-27 21:25 UTC · original

изображение_2026-11-28_002412234 изображение_2026-11-28_002440137 изображение_2026-11-28_002524744
**@⁠flokybbad-cmd** on GitHub · 2026-11-27 21:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/274#issuecomment-7228431467) <img width="2558" height="1438" alt="изображение_2026-11-28_002412234" src="https://github.com/user-attachments/assets/e1377b54-319b-445e-a06e-a05007463847" /> <img width="2558" height="1439" alt="изображение_2026-11-28_002440137" src="https://github.com/user-attachments/assets/9925b0b8-1f1c-4af0-b205-ff25c6c1d8ce" /> <img width="2559" height="1439" alt="изображение_2026-11-28_002524744" src="https://github.com/user-attachments/assets/a213f0a6-6ced-46f0-ab38-c0c84bbaf88f" />
Author
Owner

@⁠justrealyme on GitHub · 2026-11-27 22:09 UTC · original

Measurements from a different kind of CPU: Core Ultra 7 265K (Intel hybrid, 8 P + 12 E cores), RTX 5070 Ti (driver 621.40), 31 GB RAM. Release build, play-nvidia.ps1 defaults (Series X, 1440p, DLSS Quality). In the prison cell with caches warm it runs at about 23-29 fps, with the card 70-79% busy. Earlier reports of ~14 fps there were from runs that were still building pipelines.

1. On Intel hybrid CPUs the title pins its workers partly onto E-cores. The title calls SetThreadGroupAffinity itself, with console-style masks. Its ~9 busiest threads ask for 0-7, but on a 265K that's 4 P-cores and 4 E-cores (the P-cores are 0, 1, 6-9, 18, 19). A "time critical" thread asks for 13 alone, which is an E-core. #419 maps the title's processor numbers onto the fastest cores first. Card time spent waiting on the title went from 3.7 to 0.1 ms per frame, and the lowest second went from 6 to 23 fps. The mean was unchanged on this CPU, because the next limit is the submitting thread. Nothing changes on CPUs without E-cores.

2. Things tried on the submitting thread that did not raise fps (to save others the time):

  • The "copy nothing" checks in a flush cost about 1.3 µs each, roughly 11,000 per frame. Most of that is the journal's read lock and its map of ~70,000 pages. Doing the checks on the submitting thread before waking helpers (instead of on the helpers) was worse: 20.4 fps instead of 23.1.
  • A lock-free mirror of the journal's pages cut refresh time from 12.0 to 9.7 ms per frame. In a same-scene VICTORY_AB run, though, frame times were the same either way, so it isn't proposed.
  • VICTORY_FAST_CORES=3: no difference.

3. On noise: the same route into the cell varies by about ±3 fps between runs, so compare small changes with VICTORY_AB in the diagnostics build, not run against run.

Done with AI assistance (Claude Code).

**@⁠justrealyme** on GitHub · 2026-11-27 22:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/274#issuecomment-7229083188) Measurements from a different kind of CPU: **Core Ultra 7 265K** (Intel hybrid, 8 P + 12 E cores), RTX 5070 Ti (driver 621.40), 31 GB RAM. Release build, `play-nvidia.ps1` defaults (Series X, 1440p, DLSS Quality). In the prison cell with caches warm it runs at about **23-29 fps**, with the card 70-79% busy. Earlier reports of ~14 fps there were from runs that were still building pipelines. **1. On Intel hybrid CPUs the title pins its workers partly onto E-cores.** The title calls `SetThreadGroupAffinity` itself, with console-style masks. Its ~9 busiest threads ask for 0-7, but on a 265K that's 4 P-cores and 4 E-cores (the P-cores are 0, 1, 6-9, 18, 19). A "time critical" thread asks for 13 alone, which is an E-core. #419 maps the title's processor numbers onto the fastest cores first. Card time spent waiting on the title went from 3.7 to 0.1 ms per frame, and the lowest second went from 6 to 23 fps. The mean was unchanged on this CPU, because the next limit is the submitting thread. Nothing changes on CPUs without E-cores. **2. Things tried on the submitting thread that did not raise fps (to save others the time):** - The "copy nothing" checks in a flush cost about 1.3 µs each, roughly 11,000 per frame. Most of that is the journal's read lock and its map of ~70,000 pages. Doing the checks on the submitting thread before waking helpers (instead of on the helpers) was worse: 20.4 fps instead of 23.1. - A lock-free mirror of the journal's pages cut refresh time from 12.0 to 9.7 ms per frame. In a same-scene `VICTORY_AB` run, though, frame times were the same either way, so it isn't proposed. - `VICTORY_FAST_CORES=3`: no difference. **3. On noise:** the same route into the cell varies by about ±3 fps between runs, so compare small changes with `VICTORY_AB` in the diagnostics build, not run against run. Done with AI assistance (Claude Code).
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#274
No description provided.