D3D12 in-place title memory on NVIDIA: what OpenExistingHeap* accepts (measurements for zero-copy attempts) #1387

Open
opened 2026-11-27 01:02:54 +00:00 by github-bot · 0 comments
Owner

@⁠MKmajster on GitHub · 2026-11-26 22:17 UTC · original

Several forks are trying to let the card read title memory in place instead of copying it every frame. These are measurements from one machine (RTX 3070 8 GB, driver 617.42, Windows 11, Resizable BAR off for 1–3, on for 4) that may save others the same experiments. The tests are synthetic (our own sections and views, no title data).

  1. OpenExistingHeapFromAddress1 takes one view, not several. One 64 KiB view of a pagefile-backed section opens, and the card reads and writes it. Two adjacent views — even of the section's next pages, in order — are refused with E_INVALIDARG; so are 8 views in reverse order, 8 views of two sections, and 256 scattered views. A range the title maps page by page cannot be one heap this way.
  2. Under such a heap the view's protection cannot change: VirtualProtect fails with error 87. Write tracking that makes views read-only cannot cover memory that is in place.
  3. OpenExistingHeapFromFileMapping on a SEC_COMMIT section works, but the driver pins the whole section. Opening a 3,977 MB section took 4.2 s and raised "shared with the card" usage by about 4.3 GB at once; on a 16 GB PC the run then failed with 0x8007000E. Cutting the pool into 64 MiB sections and opening at most 1 GB of them was stable, but buffers placed there are read across PCIe, and the frame got slower (176 → 189 ms here).
  4. What did work: the title's 32-bit graphics heap, which is mapped as one ordered stretch, opened through one view of our own (renderer port 1 of avatarmanz/VIctory-7900XTX): 185 MB in place, no errors — but on this NVIDIA card the constants it serves are then read across PCIe, which cost more than the copies it saved (see #1083).

Vulkan's VK_EXT_external_memory_host imports a virtual range, which is how some PS5-side projects avoid point 1; we found no D3D12 equivalent.

AI-assisted (Claude Code). No game data attached.

**@⁠MKmajster** on GitHub · 2026-11-26 22:17 UTC · [original](https://github.com/fxceless/victory-fork/issues/1387) Several forks are trying to let the card read title memory in place instead of copying it every frame. These are measurements from one machine (RTX 3070 8 GB, driver 617.42, Windows 11, Resizable BAR off for 1–3, on for 4) that may save others the same experiments. The tests are synthetic (our own sections and views, no title data). 1. **`OpenExistingHeapFromAddress1` takes one view, not several.** One 64 KiB view of a pagefile-backed section opens, and the card reads and writes it. Two adjacent views — even of the section's next pages, in order — are refused with `E_INVALIDARG`; so are 8 views in reverse order, 8 views of two sections, and 256 scattered views. A range the title maps page by page cannot be one heap this way. 2. **Under such a heap the view's protection cannot change:** `VirtualProtect` fails with error 87. Write tracking that makes views read-only cannot cover memory that is in place. 3. **`OpenExistingHeapFromFileMapping` on a `SEC_COMMIT` section works, but the driver pins the whole section.** Opening a 3,977 MB section took 4.2 s and raised "shared with the card" usage by about 4.3 GB at once; on a 16 GB PC the run then failed with `0x8007000E`. Cutting the pool into 64 MiB sections and opening at most 1 GB of them was stable, but buffers placed there are read across PCIe, and the frame got slower (176 → 189 ms here). 4. **What did work:** the title's 32-bit graphics heap, which is mapped as one ordered stretch, opened through one view of our own (renderer port 1 of avatarmanz/VIctory-7900XTX): 185 MB in place, no errors — but on this NVIDIA card the constants it serves are then read across PCIe, which cost more than the copies it saved (see #1083). Vulkan's `VK_EXT_external_memory_host` imports a virtual range, which is how some PS5-side projects avoid point 1; we found no D3D12 equivalent. AI-assisted (Claude Code). No game data attached.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:02:54 +00:00
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/fxceless--victory-fork#1387
No description provided.