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

Open
Maverick0351a wants to merge 1 commit from upstream-pr/2923 into main
Maverick0351a commented 2026-11-29 18:51:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Maverick0351a on 2026-11-29T18:51:02Z.


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
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5553948275 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2923). Originally posted by [Maverick0351a](https://github.com/Maverick0351a) on 2026-11-29T18:51:02Z. --- 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
JSa25 commented 2026-11-29 21:10:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by JSa25 on 2026-11-29T21:10:35Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262665106 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2923#issuecomment-7262665106). Originally posted by [JSa25](https://github.com/JSa25) on 2026-11-29T21:10:35Z. --- **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.
iwanttobelievethem commented 2026-11-30 07:28:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by iwanttobelievethem on 2026-11-30T07:28:33Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7271774564 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2923#issuecomment-7271774564). Originally posted by [iwanttobelievethem](https://github.com/iwanttobelievethem) on 2026-11-30T07:28:33Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2923:upstream-pr/2923'
git switch 'upstream-pr/2923'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2923'
git switch 'upstream-pr/2923'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2923'
git switch 'upstream-pr/2923'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2923'
git switch 'main'
git merge --squash 'upstream-pr/2923'
git switch 'main'
git merge --ff-only 'upstream-pr/2923'
git switch 'main'
git merge 'upstream-pr/2923'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!2923
No description provided.