port: keep VICTORY_PORT_CONSTANTS off by default across GPU generations #2923

Open
github-bot wants to merge 1 commit from github-bot/gh-2923 into main AGit
Owner

@⁠Maverick0351a on GitHub · 2026-11-29 18:51 UTC · original
Maverick0351a:fix/port-constants-default-off → main · +15 −25 · 1 files · 1 commits · open

Fixes #1223

What it changes

  • Restores ictory_gpu::port::on() (
    esolve_port_mode) to default to alse when VICTORY_PORT_CONSTANTS is unset, matching both its module documentation (VICTORY_PORT_CONSTANTS, off by default) and ictory_hle::modules::xmem::port_on().
  • PR #1286 disabled the unset default only on Ampere (!adapter_name.is_some_and(is_ampere_adapter_name)), which left ictory_gpu::port::on() enabled by default on Ada (RTX 40) and Blackwell (RTX 50) GPUs even while xmem::port_on() remained alse.
  • Because OpenExistingHeapFromAddress1 opens the title's 185 MB 32-bit graphics heap (containing the 174 MB main ring buffer) in PC system memory (D3D12_MEMORY_POOL_L0) over PCIe, and the 174 MB working set exceeds even Blackwell's 64 MB L2 cache while shaders read ~40 GB/frame across 230+ command lists (shadow.rs:252-257), leaving VICTORY_PORT_CONSTANTS on by default severely starved the GPU on PCIe latency.
  • Explicit overrides (VICTORY_PORT_CONSTANTS=1 / rue / on and
**@⁠Maverick0351a** on GitHub · 2026-11-29 18:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2923) `Maverick0351a:fix/port-constants-default-off` → `main` · +15 −25 · 1 files · 1 commits · open Fixes #1223 ## What it changes - Restores ictory_gpu::port::on() ( esolve_port_mode) to default to alse when VICTORY_PORT_CONSTANTS is unset, matching both its module documentation (VICTORY_PORT_CONSTANTS, off by default) and ictory_hle::modules::xmem::port_on(). - PR #1286 disabled the unset default only on Ampere (!adapter_name.is_some_and(is_ampere_adapter_name)), which left ictory_gpu::port::on() enabled by default on Ada (RTX 40) and Blackwell (RTX 50) GPUs even while xmem::port_on() remained alse. - Because OpenExistingHeapFromAddress1 opens the title's 185 MB 32-bit graphics heap (containing the 174 MB main ring buffer) in PC system memory (D3D12_MEMORY_POOL_L0) over PCIe, and the 174 MB working set exceeds even Blackwell's 64 MB L2 cache while shaders read ~40 GB/frame across 230+ command lists (shadow.rs:252-257), leaving VICTORY_PORT_CONSTANTS on by default severely starved the GPU on PCIe latency. - Explicit overrides (VICTORY_PORT_CONSTANTS=1 / rue / on and
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:51:30 +00:00
Author
Owner

@⁠JSa25 on GitHub · 2026-11-29 21:10 UTC · original

RTX 5090 A/B, VICTORY_PORT_CONSTANTS (supports defaulting it off)

RTX 5090 32 GB (linked at PCIe 5.0 x8), Ryzen 9 9950X3D, 64 GB RAM. Series X profile, native 1440p, DLSS Quality, frame generation off, VICTORY_WC_BAR=1, VICTORY_WINDOWS_BAR_MB=4096, release build at f72cec77. Same area of the open world, two runs a few minutes apart.

Unset: the GPU half was on by default (non-Ampere) but xmem's arrange was off, so the 32-bit heap was refused as Scattered and copied as before. That mismatch is what this PR fixes.

Per frame (5-s lines, >3k draws) unset (refused) =1 (185 MB in place)
fps 24.1 14.2
preparing (CPU) 26.3 ms 19.4 ms
copies 13.6 ms / 59.9 MB 8.2 ms / 40.4 MB
sent up to card copies 15.6 MB in 4,006 ranges 2.5 MB in 78 ranges
card meter (GPU work) 18.7 ms 33.7 ms
"on the GPU" wait 11.0 ms 34.9 ms

With the port on, the CPU saves ~7 ms, but GPU work nearly doubles from reading the heap in system memory. Even on Blackwell it's a net loss of ~40% fps here, so off by default looks right. One caveat: this card is at x8. At x16, the GPU-side cost should be lower.

**@⁠JSa25** on GitHub · 2026-11-29 21:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2923#issuecomment-7262665106) **RTX 5090 A/B, `VICTORY_PORT_CONSTANTS` (supports defaulting it off)** RTX 5090 32 GB (linked at PCIe 5.0 x8), Ryzen 9 9950X3D, 64 GB RAM. Series X profile, native 1440p, DLSS Quality, frame generation off, `VICTORY_WC_BAR=1`, `VICTORY_WINDOWS_BAR_MB=4096`, release build at f72cec77. Same area of the open world, two runs a few minutes apart. Unset: the GPU half was on by default (non-Ampere) but xmem's `arrange` was off, so the 32-bit heap was refused as `Scattered` and copied as before. That mismatch is what this PR fixes. | Per frame (5-s lines, >3k draws) | unset (refused) | `=1` (185 MB in place) | |---|---|---| | fps | 24.1 | 14.2 | | preparing (CPU) | 26.3 ms | 19.4 ms | | copies | 13.6 ms / 59.9 MB | 8.2 ms / 40.4 MB | | sent up to card copies | 15.6 MB in 4,006 ranges | 2.5 MB in 78 ranges | | card meter (GPU work) | 18.7 ms | 33.7 ms | | "on the GPU" wait | 11.0 ms | 34.9 ms | With the port on, the CPU saves ~7 ms, but GPU work nearly doubles from reading the heap in system memory. Even on Blackwell it's a net loss of ~40% fps here, so off by default looks right. One caveat: this card is at x8. At x16, the GPU-side cost should be lower.
Author
Owner

@⁠iwanttobelievethem on GitHub · 2026-11-30 07:28 UTC · original

Test report in support of this, from a second 5090, this one on a x16 link (PCIe 5.0 capable board).

Ryzen 9 9950X3D, RTX 5090, driver 621.24, Windows 11 (26300). Main at 41adb551, Series S, DLSS performance, frame generation off, 640x360 window. Fixed scene: prologue interior from a save, walking in a circle by a key script; averages of the 5-second fps lines once steady (about 4,600 draws/frame). One run each.

VICTORY_PORT_CONSTANTS unset =1
fps 38.3 9.0
ms/frame 26.1 110.5
submitting thread, preparing 20.0 ms 15.0 ms
"on the GPU" wait 0.1 ms 80.8 ms
card meter, the title's lists 14.7 ms 106.7 ms

With =1 the port engaged (1 regions ... in place (185 MB), 8,940 fills a frame read out of it) and did what it promises on the CPU: refreshes 9.1 -> 4.5 ms, copies and fills 3.2 -> 1.4 ms. But the card's time for the same lists went up about seven times, even at 360p, so the frame is four times longer. So x16 does not rescue it here.

Unset, the GPU half tries the heap, xmem has not arranged the pages, and every run logs not one native-import-eligible stretch of a section: Scattered, as described above; this PR makes the two halves agree.

(Both runs also had a few local opt-in switches on, the same in both. No crash in either; an automatic check of captures flagged nothing.)

AI-assisted (Claude Code); measured on my machine; no game data in this comment.

**@⁠iwanttobelievethem** on GitHub · 2026-11-30 07:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2923#issuecomment-7271774564) Test report in support of this, from a second 5090, this one on a x16 link (PCIe 5.0 capable board). Ryzen 9 9950X3D, RTX 5090, driver 621.24, Windows 11 (26300). Main at 41adb551, Series S, DLSS performance, frame generation off, 640x360 window. Fixed scene: prologue interior from a save, walking in a circle by a key script; averages of the 5-second fps lines once steady (about 4,600 draws/frame). One run each. | | `VICTORY_PORT_CONSTANTS` unset | `=1` | |---|---|---| | fps | 38.3 | 9.0 | | ms/frame | 26.1 | 110.5 | | submitting thread, preparing | 20.0 ms | 15.0 ms | | "on the GPU" wait | 0.1 ms | 80.8 ms | | card meter, the title's lists | 14.7 ms | 106.7 ms | With `=1` the port engaged (`1 regions ... in place (185 MB)`, 8,940 fills a frame read out of it) and did what it promises on the CPU: refreshes 9.1 -> 4.5 ms, copies and fills 3.2 -> 1.4 ms. But the card's time for the same lists went up about seven times, even at 360p, so the frame is four times longer. So x16 does not rescue it here. Unset, the GPU half tries the heap, xmem has not arranged the pages, and every run logs `not one native-import-eligible stretch of a section: Scattered`, as described above; this PR makes the two halves agree. (Both runs also had a few local opt-in switches on, the same in both. No crash in either; an automatic check of captures flagged nothing.) AI-assisted (Claude Code); measured on my machine; no game data in this comment.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2923/head:github-bot/gh-2923'
git switch 'github-bot/gh-2923'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2923'
git switch 'github-bot/gh-2923'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2923'
git switch 'github-bot/gh-2923'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2923'
git switch 'main'
git merge --squash 'github-bot/gh-2923'
git switch 'main'
git merge --ff-only 'github-bot/gh-2923'
git switch 'main'
git merge 'github-bot/gh-2923'
git push origin 'main'
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!2923
No description provided.