Optimize GPU residency and host scaling for NVIDIA workloads #4637

Closed
github-bot wants to merge 34 commits from github-bot/gh-4636 into main AGit
Owner

@⁠Davetheshrew-git on GitHub · 2026-12-01 00:24 UTC · original
Davetheshrew-git:main → main · +2874 −903 · 44 files · 34 commits · closed without merging

This PR improves GPU utilization and host-side scaling across different RAM and CPU configurations:

Keeps GPU render targets and shader buffers resident to reduce WDDM paging stalls
Adds automatic scaling for RAM tiers and logical CPU counts
Optimizes staging memory allocation and queue synchronization
Refines GPU copy, barrier, and ReBAR behavior
Removes legacy residency flags that were not sufficiently tested
Synchronizes Rust and PowerShell launcher defaults
Adds a React-based tuning console for launch and switch configuration
Updates documentation and launcher naming for VIctory-NVIDIA
Key changes
Added fast staging-memory zeroing with VICTORY_STAGING_FAST_ZERO
Synchronized GPU submission queues before command execution
Improved 16 GB/32 GB+ RAM worker scaling
Added automatic 16/24+ CPU worker pool tuning
Preserved safety guardrails for known face, hair, foliage, and memory issues
Improved shader-cache and pipeline preloading behavior
Updated CI and Clippy fixes for Rust 1.98.1
Added automatic and explicit ReBAR handling
Removed deprecated Steam launcher and old play-foxhound references
Validation
cargo xtask policy
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked
cargo build --release --locked -p victory

**@⁠Davetheshrew-git** on GitHub · 2026-12-01 00:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4636) `Davetheshrew-git:main` → `main` · +2874 −903 · 44 files · 34 commits · closed without merging This PR improves GPU utilization and host-side scaling across different RAM and CPU configurations: Keeps GPU render targets and shader buffers resident to reduce WDDM paging stalls Adds automatic scaling for RAM tiers and logical CPU counts Optimizes staging memory allocation and queue synchronization Refines GPU copy, barrier, and ReBAR behavior Removes legacy residency flags that were not sufficiently tested Synchronizes Rust and PowerShell launcher defaults Adds a React-based tuning console for launch and switch configuration Updates documentation and launcher naming for VIctory-NVIDIA Key changes Added fast staging-memory zeroing with VICTORY_STAGING_FAST_ZERO Synchronized GPU submission queues before command execution Improved 16 GB/32 GB+ RAM worker scaling Added automatic 16/24+ CPU worker pool tuning Preserved safety guardrails for known face, hair, foliage, and memory issues Improved shader-cache and pipeline preloading behavior Updated CI and Clippy fixes for Rust 1.98.1 Added automatic and explicit ReBAR handling Removed deprecated Steam launcher and old play-foxhound references Validation cargo xtask policy cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo test --workspace --locked cargo build --release --locked -p victory
`slots_showing` took the slot's `Made` key with `?`, but `Made` has keys
for the title's `count` slots only while `kept` also has the dynamic
ones: a host texture shown by a dynamic slot was no longer reported, so
it was no longer blocked and could be chosen (freeing nothing, as the
dynamic slot holds a reference, while the title made a second copy).
Those slots are reported again with key 0, as before the key was carried;
they are never put back to waiting, only counted as blocking. Test:
`a_dynamic_slot_showing_a_texture_still_blocks_its_eviction`.

`SLOT_LOOKING` is now cleared by a drop guard, so a look that panics does
not stop every later look.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b23c0c4038)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bump versions for anyhow, arrayvec, blake3, cc, and clap in Cargo.lock.
Enable high-residency GPU settings, improve submission logic via asynchronous overlap and splitting, and synchronize tuning parameters between Rust and PowerShell. Includes minor test fixes for memory range locking and shader metadata compilation.
- Replace manual modulo checks with `is_multiple_of` helper
- Add `#[allow(dead_code)]` to unused shader and shadow fields
- Initialize React web frontend for the NVIDIA Tuning Console
Updated directory name for cloning the repository.
Simplify the initialization of the ON static variable in xmem.rs and clean up the README to clarify project scope and documentation.
Rename project and clarify fork origin in documentation. Simplify
log message calculations in copystat.rs for better readability.
Remove VICTORY_ORACLE environment variables from the shader cache validation list as they are no longer utilized.
Implement a mutex lock in sync_heaps to prevent race conditions during page mirroring and ensure proper memory tracking for allocated buffers.
Add node_modules and dist to gitignore, and include web-related extensions in policy checks.
Zero every staging piece upon checkout to prevent leakage of stale memory, as D3D12 upload heaps do not guarantee zero-initialized memory when recycling blocks.
Add a mutex lock to the heap_state_counts_each_heap test to prevent race conditions with other tests sharing the same heap.
Enable improved buffer barrier management, add software adapter detection to refine memory zeroing logic, and update default configuration flags for enhanced GPU throughput.
Introduce fine-grained pipeline wait budgets and scheduling policies to prevent frame hitching during driver compilation. Update the pipeline registry to support tracking masked pixel shaders and ensure they are precompiled into the shader cache.
Simplify GPU residency configuration by removing legacy flags and focusing on high-priority residency. Add `VICTORY_STAGING_FAST_ZERO` to optimize memory staging, refine automatic ReBAR detection, and ensure command queue synchronization before submission.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:29:13 +00:00
Author
Owner

@⁠captn-hook on GitHub · 2026-12-01 07:41 UTC · original

Test data for the VICTORY_TEXTURE_SOFT_MB change here, on a 16 GB card (RTX 3080 Laptop 16 GB, Series S 960x540, DLSS Performance). Diagnostics build of main at 7d93ee07, scripts/bench.ps1, same save, 120 s windows. Flicker = frames with VICTORY_POP_WATCH blips.

soft cap 3000 (current default) unset (dynamic cap)
soft sweeps 129 0
texture copies made again 6,842 2,357
frames with flicker 5.8% 1.1%
fps 20.9 21.7

With 3000 the copies sat at about 3.1 GB, so the sweep ran all the time with about 1.4 GB of the card free. The visible effect was grey/neutral textures flashing in and out.

Two notes on the change:

  • "auto" isn't parsed by soft_budget(). It works only because the failed parse reads as unset and the dynamic cap takes over. An empty value or removing the line would say that directly.
  • It also drops the cap on 8 GB cards, which this data doesn't cover. A narrower option: keep 3000 but never trim below the dynamic room, i.e. max(soft, dynamic_texture_cap). That leaves small cards as they are and lifts the cap on large ones.

(Drafted with Claude Code from my own runs.)

**@⁠captn-hook** on GitHub · 2026-12-01 07:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4636#issuecomment-7304355081) Test data for the `VICTORY_TEXTURE_SOFT_MB` change here, on a 16 GB card (RTX 3080 Laptop 16 GB, Series S 960x540, DLSS Performance). Diagnostics build of `main` at `7d93ee07`, `scripts/bench.ps1`, same save, 120 s windows. Flicker = frames with `VICTORY_POP_WATCH` blips. | | soft cap 3000 (current default) | unset (dynamic cap) | |---|---|---| | soft sweeps | 129 | 0 | | texture copies made again | 6,842 | 2,357 | | frames with flicker | 5.8% | 1.1% | | fps | 20.9 | 21.7 | With 3000 the copies sat at about 3.1 GB, so the sweep ran all the time with about 1.4 GB of the card free. The visible effect was grey/neutral textures flashing in and out. Two notes on the change: - `"auto"` isn't parsed by `soft_budget()`. It works only because the failed parse reads as unset and the dynamic cap takes over. An empty value or removing the line would say that directly. - It also drops the cap on 8 GB cards, which this data doesn't cover. A narrower option: keep 3000 but never trim below the dynamic room, i.e. `max(soft, dynamic_texture_cap)`. That leaves small cards as they are and lifts the cap on large ones. *(Drafted with Claude Code from my own runs.)*
- Simplify UI shell and remove external font dependencies.
- Refactor panel logic to use let-else bindings.
- Use `is_multiple_of` in menu key handling.
- Update data structures and types for tuning configuration.
- Clean up test metadata helper in shader module.
- Implement VRAM-based scratch and stride buffers for higher bandwidth
- Add option to disable Reflex sleep for unthrottled frame generation
- Increase view processing thread count for improved throughput
- Reduce frequency of memory-space scans to avoid thread contention
Clarify the impact of PCIe L0 stalls, presenter sleep, and ReBAR memory optimizations on GPU utilization.
github-bot closed this pull request 2026-12-01 18:37:04 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:36 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4636#issuecomment-7321199908) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!4637
No description provided.