PORT_CONSTANTS on Windows 11 23H2: ID3D12Device3 fallback, −18 ms CPU per frame #3938

Open
opened 2026-11-30 12:29:13 +00:00 by github-bot · 3 comments
Owner

@⁠ntrglcrn on GitHub · 2026-11-30 12:26 UTC · original

Setup: RTX 3080 10 GB, i5-13400F (6P+4E), 32 GB, Windows 11 Pro 23H2 (build 22631), driver 621.24. Series X profile, DLSS Performance, no frame generation.

Problem: with PORT_CONSTANTS=1 the port never opens on 23H2. The heap is opened through ID3D12Device13, and that interface only exists on Windows 11 24H2 and later, so on older builds the game silently falls back to copying.

What I changed locally: if ID3D12Device13 is not available, the game now falls back to ID3D12Device3::OpenExistingHeapFromAddress. That older call needs the address to be the start of an allocation. The port opens the memory through its own mapping, and that mapping always starts at the beginning of the allocated block, so the requirement is met. Nothing else changed, and no shader code was touched.

Test: I added a test on WARP that takes exactly the path without Device13. In it, the GPU reads the game's bytes, the game sees the GPU's writes, and the game can unmap its views. The test passes.

Results on my PC (4 sessions on v2026.11.29.01 + this change):

  • The port opened all of the game's graphics memory (185 MB). No errors, no crashes, no artifacts.
  • Copies per frame: 38 → 25 ms.
  • CPU frame preparation: 71 → 53 ms (−25%).
  • Median fps: 11 → 11.7 (Series X). Series S: 13.2 at 540p, 13.8 at 360p.

The same change also works on v2026.11.29.05 (I rebuilt it from source, 5/5 port tests pass). There the port opened again (185 MB) and the game starts with no crashes.

Note on .05: PORT_CONSTANTS is on by default there but turned off on RTX 30 cards. On my RTX 3080 I turned it on explicitly and it has run without problems so far. If there is a known problem with it on RTX 30, what should I look for?

Related: #1474, #2415. I can open a PR with the change and the test if that helps.

Checked with AI assistance (Claude Code). The numbers come from my PC's play logs.

**@⁠ntrglcrn** on GitHub · 2026-11-30 12:26 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3938) **Setup:** RTX 3080 10 GB, i5-13400F (6P+4E), 32 GB, Windows 11 Pro 23H2 (build 22631), driver 621.24. Series X profile, DLSS Performance, no frame generation. **Problem:** with `PORT_CONSTANTS=1` the port never opens on 23H2. The heap is opened through `ID3D12Device13`, and that interface only exists on Windows 11 24H2 and later, so on older builds the game silently falls back to copying. **What I changed locally:** if `ID3D12Device13` is not available, the game now falls back to `ID3D12Device3::OpenExistingHeapFromAddress`. That older call needs the address to be the start of an allocation. The port opens the memory through its own mapping, and that mapping always starts at the beginning of the allocated block, so the requirement is met. Nothing else changed, and no shader code was touched. **Test:** I added a test on WARP that takes exactly the path without `Device13`. In it, the GPU reads the game's bytes, the game sees the GPU's writes, and the game can unmap its views. The test passes. **Results on my PC** (4 sessions on v2026.11.29.01 + this change): - The port opened all of the game's graphics memory (185 MB). No errors, no crashes, no artifacts. - Copies per frame: 38 → 25 ms. - CPU frame preparation: 71 → 53 ms (−25%). - Median fps: 11 → 11.7 (Series X). Series S: 13.2 at 540p, 13.8 at 360p. The same change also works on v2026.11.29.05 (I rebuilt it from source, 5/5 port tests pass). There the port opened again (185 MB) and the game starts with no crashes. **Note on .05:** `PORT_CONSTANTS` is on by default there but turned off on RTX 30 cards. On my RTX 3080 I turned it on explicitly and it has run without problems so far. If there is a known problem with it on RTX 30, what should I look for? Related: #1474, #2415. I can open a PR with the change and the test if that helps. Checked with AI assistance (Claude Code). The numbers come from my PC's play logs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 12:29:13 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-30 12:27 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 12:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3938#issuecomment-7278455456) 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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-30 12:30 UTC · original

@⁠ntrglcrn, the Ampere default was changed in e4860eb after the paired RTX 3090 measurements in #1223. Enabling the port lowered CPU preparation from 28.4 to 19.3 ms, while waiting for the card rose from 2.4 to 27.7 ms and median frame time rose from 40.8 to 54.1 ms. The reported pictures matched in that comparison.

I reran the mode-selection unit test at 41adb551. The default is off on recognized Ampere adapters, and an explicit VICTORY_PORT_CONSTANTS=1 wins.

Please open the fallback PR with your WARP test. The older API covers the whole allocation, so the test of the port's owned mapping is useful evidence for that path. A paired capture on your RTX 3080 with the same route and settings could also show whether the CPU saving there comes with more GPU wait. Keep the compatibility change and the Ampere default decision independently reviewable. Microsoft API documentation

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-30 12:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3938#issuecomment-7278544315) @⁠ntrglcrn, the Ampere default was changed in [`e4860eb`](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/e4860ebc724946569c0cdd8511213cdeac8fe13f) after the paired RTX 3090 measurements in [#1223](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/issues/1223). Enabling the port lowered CPU preparation from 28.4 to 19.3 ms, while waiting for the card rose from 2.4 to 27.7 ms and median frame time rose from 40.8 to 54.1 ms. The reported pictures matched in that comparison. I reran the mode-selection unit test at `41adb551`. The default is off on recognized Ampere adapters, and an explicit `VICTORY_PORT_CONSTANTS=1` wins. Please open the fallback PR with your WARP test. The older API covers the whole allocation, so the test of the port's owned mapping is useful evidence for that path. A paired capture on your RTX 3080 with the same route and settings could also show whether the CPU saving there comes with more GPU wait. Keep the compatibility change and the Ampere default decision independently reviewable. [Microsoft API documentation](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device3-openexistingheapfromaddress) AI-assisted with OpenAI Codex.
Author
Owner

@⁠ntrglcrn on GitHub · 2026-11-30 12:36 UTC · original

No crash here, so there is no crash log. The game runs normally, and the issue is about the port not opening. GPU: RTX 3080 10 GB, driver 621.24. Windows 11 Pro 23H2 (build 22631).

The full play logs are a few MB each and contain local paths, so here are the relevant lines (Series X, VICTORY_PORT_CONSTANTS=1).

Before, stock v2026.11.29.01 (victory-nvidia-play-20261129-210256-2228.log):

WARN victory_gpu::port: renderer port 1: title memory not in place, a copy as before start=0x237f0000 len=182452224 window=false why="refused by the host: Интерфейс не поддерживается (0x80004002)"
INFO victory_gpu::port: renderer port 1 (VICTORY_PORT_CONSTANTS=1): 0 regions of the title's graphics memory in place (0 MB), 0 title buffers and windows placed in them ...

(0x80004002 is E_NOINTERFACE: no ID3D12Device13 on 23H2.)

After, v2026.11.29.05 with the fallback (victory-nvidia-play-20261130-062115-9540.log):

INFO victory_gpu::port: renderer port 1: no ID3D12Device13 (OpenExistingHeapFromAddress1); the view opened with ID3D12Device3's OpenExistingHeapFromAddress instead
INFO victory_gpu::port: renderer port 1: a stretch of the title's graphics memory opened as a host heap through a view of ours start=0xa970000 bytes=193986560 section=0x1c78 offset=0x0 view=0x1e0a59b0000
INFO victory_gpu::port: renderer port 1: title memory in place, read and written by the card where the title has it start=0xb470000 len=182452224 window=false
INFO victory_gpu::port: renderer port 1 (VICTORY_PORT_CONSTANTS=1): 1 regions of the title's graphics memory in place (185 MB), 1 title buffers and windows placed in them ...; since the start refused: 0 not one stretch of a section, 0 not committed, 0 by the host, 0 no buffer
**@⁠ntrglcrn** on GitHub · 2026-11-30 12:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3938#issuecomment-7278675282) No crash here, so there is no crash log. The game runs normally, and the issue is about the port not opening. GPU: RTX 3080 10 GB, driver 621.24. Windows 11 Pro 23H2 (build 22631). The full play logs are a few MB each and contain local paths, so here are the relevant lines (Series X, `VICTORY_PORT_CONSTANTS=1`). **Before**, stock v2026.11.29.01 (`victory-nvidia-play-20261129-210256-2228.log`): ``` WARN victory_gpu::port: renderer port 1: title memory not in place, a copy as before start=0x237f0000 len=182452224 window=false why="refused by the host: Интерфейс не поддерживается (0x80004002)" INFO victory_gpu::port: renderer port 1 (VICTORY_PORT_CONSTANTS=1): 0 regions of the title's graphics memory in place (0 MB), 0 title buffers and windows placed in them ... ``` (0x80004002 is E_NOINTERFACE: no `ID3D12Device13` on 23H2.) **After**, v2026.11.29.05 with the fallback (`victory-nvidia-play-20261130-062115-9540.log`): ``` INFO victory_gpu::port: renderer port 1: no ID3D12Device13 (OpenExistingHeapFromAddress1); the view opened with ID3D12Device3's OpenExistingHeapFromAddress instead INFO victory_gpu::port: renderer port 1: a stretch of the title's graphics memory opened as a host heap through a view of ours start=0xa970000 bytes=193986560 section=0x1c78 offset=0x0 view=0x1e0a59b0000 INFO victory_gpu::port: renderer port 1: title memory in place, read and written by the card where the title has it start=0xb470000 len=182452224 window=false INFO victory_gpu::port: renderer port 1 (VICTORY_PORT_CONSTANTS=1): 1 regions of the title's graphics memory in place (185 MB), 1 title buffers and windows placed in them ...; since the start refused: 0 not one stretch of a section, 0 not committed, 0 by the host, 0 no buffer ```
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#3938
No description provided.