Keep large buffers in VRAM and enable GPU-side in-place buffer operations #339

Open
github-bot wants to merge 5 commits from github-bot/gh-339 into main AGit
Owner

@⁠XaviFortes on GitHub · 2026-11-26 17:30 UTC · original
XaviFortes:upstream/in-place-buffer-gpu-path → main · +54 −23 · 5 files · 5 commits · open

Summary

  • Add opt-in placement for eligible contiguous-section buffers above the 4 GiB title address boundary, with relay write-hazard tracking. Keep large buffers above that boundary in local VRAM.
  • Let card_steps copy or fill eligible in-place buffers on the GPU. Allow placed copies to use in-place buffers and skip redundant CPU publication for in-place destinations.

The first commit (b2917b4 in the fork) adds the placement and lifetime tracking required by the three follow-up fixes (4487275, 5e6fec2, 4c210de).

Measurements

Tested and benchmarked in VIctory-RDNA on an RX 7900 XT with Series X at 4K output, using VICTORY_PORT_BUFFERS=1 and VICTORY_INPLACE=2. After the card_steps fix, 11 of the final 12 samples logged 0.0 ms of settle wait, compared with 0 of 11 before it. Both captures exited cleanly. These fork captures predate the place_copy follow-up. A controlled comparison is needed to measure the patch's frame-rate impact.

Happy to adjust the style or split the changes if useful.

**@⁠XaviFortes** on GitHub · 2026-11-26 17:30 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/339) `XaviFortes:upstream/in-place-buffer-gpu-path` → `main` · +54 −23 · 5 files · 5 commits · open ## Summary - Add opt-in placement for eligible contiguous-section buffers above the 4 GiB title address boundary, with relay write-hazard tracking. Keep large buffers above that boundary in local VRAM. - Let `card_steps` copy or fill eligible in-place buffers on the GPU. Allow placed copies to use in-place buffers and skip redundant CPU publication for in-place destinations. The first commit (`b2917b4` in the fork) adds the placement and lifetime tracking required by the three follow-up fixes (`4487275`, `5e6fec2`, `4c210de`). ## Measurements Tested and benchmarked in [VIctory-RDNA](https://github.com/XaviFortes/VIctory-RDNA/blob/main/README.md#gta-vi-measurements) on an RX 7900 XT with Series X at 4K output, using `VICTORY_PORT_BUFFERS=1` and `VICTORY_INPLACE=2`. After the `card_steps` fix, 11 of the final 12 samples logged 0.0 ms of settle wait, compared with 0 of 11 before it. Both captures exited cleanly. These fork captures predate the `place_copy` follow-up. A controlled comparison is needed to measure the patch's frame-rate impact. Happy to adjust the style or split the changes if useful.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:39:12 +00:00
Author
Owner

@⁠HAL9000RELOADED on GitHub · 2026-11-27 14:23 UTC · original

A data point for this PR and #337 together on an RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 Pro 22H2 (19045), Rust 1.98.1 MSVC.

Setup: 014d52d + #165 (Agility, needed on Windows 10), then the same + #337 (fb82170) + #339 (dfb83a8). Series X, 4K output, VICTORY_RENDER_SCALE=0.5, ports 1/2/5/6/7, VICTORY_PORT_BUFFERS=1 VICTORY_INPLACE=2, warm --used first, warm caches, a 600 s run with the same scripted boat drive in the first boat mission. Numbers are means over the host frame lines with 3000-4999 draws.

tree frame preparing card busy
014d52d + #165 67.4 ms 23.7 ms 97%
+ #337 + #339 64.9 ms 20.5 ms 97%
+ #337 + #339, VICTORY_PORT_CONSTANTS_ORDER=0 37.1 ms 21.9 ms 92%
  • The two PRs take about 3 ms (13%) off the preparing thread.
  • The frame barely moves with the defaults: the card is busy 97% of the time, and most of that comes from VICTORY_PORT_CONSTANTS_ORDER (about 4,200 clamped in-place executions a frame here). With it off the same tree runs at 37 ms, but trees and palms then pop again; #438 is about that cost.
  • No device removal and no ERROR line in any run. One run each and the drive varies the scene, so treat the frame columns as ±a few ms.

AI-assisted (Claude Code)

**@⁠HAL9000RELOADED** on GitHub · 2026-11-27 14:23 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/339#issuecomment-7220731198) A data point for this PR and #337 together on an RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 Pro 22H2 (19045), Rust 1.98.1 MSVC. Setup: `014d52d` + #165 (Agility, needed on Windows 10), then the same + #337 (`fb82170`) + #339 (`dfb83a8`). Series X, 4K output, `VICTORY_RENDER_SCALE=0.5`, ports 1/2/5/6/7, `VICTORY_PORT_BUFFERS=1 VICTORY_INPLACE=2`, `warm --used` first, warm caches, a 600 s run with the same scripted boat drive in the first boat mission. Numbers are means over the host frame lines with 3000-4999 draws. | tree | frame | preparing | card busy | |---|---|---|---| | `014d52d` + #165 | 67.4 ms | 23.7 ms | 97% | | + #337 + #339 | 64.9 ms | 20.5 ms | 97% | | + #337 + #339, `VICTORY_PORT_CONSTANTS_ORDER=0` | 37.1 ms | 21.9 ms | 92% | - The two PRs take about 3 ms (13%) off the preparing thread. - The frame barely moves with the defaults: the card is busy 97% of the time, and most of that comes from `VICTORY_PORT_CONSTANTS_ORDER` (about 4,200 clamped in-place executions a frame here). With it off the same tree runs at 37 ms, but trees and palms then pop again; #438 is about that cost. - No device removal and no ERROR line in any run. One run each and the drive varies the scene, so treat the frame columns as ±a few ms. AI-assisted (Claude Code)
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/339/head:github-bot/gh-339'
git switch 'github-bot/gh-339'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-339'
git switch 'github-bot/gh-339'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-339'
git switch 'github-bot/gh-339'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-339'
git switch 'main'
git merge --squash 'github-bot/gh-339'
git switch 'main'
git merge --ff-only 'github-bot/gh-339'
git switch 'main'
git merge 'github-bot/gh-339'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.