RX 6750 XT: 12 GB VRAM/RAM stability and texture reserve #267

Open
github-bot wants to merge 4 commits from github-bot/gh-267 into main AGit
Owner

@⁠ultimatebash on GitHub · 2026-12-02 22:58 UTC · original
ultimatebash:rx6750xt-memory → main · +1088 −81 · 16 files · 4 commits · open

RX 6750 XT: 12 GB VRAM/RAM stability, texture reserve, and automated benchmarks

Base: lobomfz/VIctory-xmem main @ d3dbb1a
Head: pr/rx6750xt-memory @ 6462338 (merged latest main, conflicts resolved)

Summary

This branch targets a 12 GB RX 6750 XT and fixes the two failure modes seen on
it: the title was RAM-capped far below its working set (4.1 GiB, 3.5 GB swap)
and VRAM reached about 11.6 GB of 12.9 GB, so the kernel could no longer pin a
display framebuffer (amdgpu ... pin failed, -ENOMEM). The picture stopped
while the radio kept playing.

The branch keeps the title's paged room around 3 GiB, stops host textures
before the card is full, and never lets a play session's RAM cap fall below its
12 GiB working set while that much is available. It also makes the benchmark
path repeatable and integrates two small upstream performance PRs.

Main changes

  • run.sh: play sessions get at least min(WANT_RAM, available - 2 GiB)
    instead of the old KEEP_FREE-only value. The 12 GiB host default and GTT
    warning from upstream #226 are kept.
  • Unified-memory title room: unset now keeps 12 GiB for the host or 30 % of
    the card for the title, whichever leaves more
    (3.7 GiB on 12 GB, 4.8 GiB
    on 16 GB, 12 GiB on 24 GB). Explicit VICTORY_CARD_KEPT_MB /
    VICTORY_UM_CARD_MB still win.
  • Texture room and title room are documented and were A/B tested on the
    12 GB card. The working configuration uses VICTORY_CARD_KEPT_MB=9216
    and VICTORY_TEXTURE_ROOM_CAP_PERCENT=86 / ..._PERCENT=82; the latter is
    a local run.conf value, not a changed code default.
  • PR #248: skip staging when earlier GPU copies already cover every part of a
    texture upload (no discarded reads, hashes or detiling).
  • PR #233: skip RADV's foreign-BO list walk when every buffer belongs to the
    same winsys (patches/mesa.patch; the pipeline cache key changes once).
  • VICTORY_LIST_RESETS_MOST (PR #3) bounds command-allocator growth.
  • Frame-time statistics in the 5 s line: 1 %/0.1 % lows, p99, worst, VRAM.
  • VICTORY_KEYS parser extracted and tested, including the
    from-to/step:Key repeat form.
  • VICTORY_TITLE_ARGS passes title arguments (-skipToIIS) through run.sh.
  • tools/bench-keys.sh: unattended diagnostic benchmark runner.
  • Asset-policy allowlist entry for the already-tracked run.conf.default.

Measurements

Old configuration (44-minute session, 4.1 GiB RAM cap, 92/86 texture room):

metric old
median gameplay 1 %-low 6.0 FPS
median gameplay 0.1 %-low 3.0 FPS
p99 frame time 167 ms
average FPS 19.3
VRAM 10.86 GB
result frozen after 44 min, pin failed, 3.745 s worst frame

Stable configuration (release and diagnostic runs, same safehouse):

metric release short run diagnostic steady
1 %-low 9.1 FPS 10.7–11.2 FPS
0.1 %-low 2.6 FPS* 4.2–5.2 FPS
p99 frame time 110 ms 89–93 ms
average FPS 22.3 ~22
VRAM 8.92 GB 9.05–9.36 GB
result no pin failure no pin failure

*The short release run is dominated by the one-time world-load frame; the
4-minute steady windows are in the next column.

Six 4-minute automated runs (base twice, pool move, page tuning, late fence,
all three) showed run-to-run drift larger than every variant. The repeated
baseline moved by −8 % (1 %), −32 % (0.1 %), +9 % (p99) and +27 % (worst), so
no speculative switch was adopted. Moving benchmarks kept 86/82 over 82/78
(fewer neutral-texture frames: 0.78 vs 1.26) and 3.0 GiB title room over
3.5 GiB.

Known remaining artifact: a character face can be black for a few seconds.
Logs show 731–932 texture uploads whose source read all zeros, plus 0.78–1.26
neutral frames per slot; there is no pin failure. This is a first-upload /
zero-memory streaming issue, not VRAM exhaustion. More title room did not fix
it; a careful all-zero-upload deferral is the next code step.

Tests

  • Release and diagnostic (PROFILE=diag) builds pass.
  • the_title_room_follows_the_card_and_the_switches passes.
  • key_script_parses_presses_and_repeats passes.
  • victory-hle under Wine: 153 passed, 1 ignored; the 5 failures are host
    effects (native Wine pointer path, missing WSAConnectByList, non-NTFS temp
    folder), not the changed Bink/key paths.
  • ./run.sh shaders: 25.694 shaders cached, 195 known non-translatable GFX10
    containers, exit 0.
  • Automated start with VICTORY_SKIP_INTRO=1, VICTORY_KEYS=20:Enter and
    -skipToIIS works; the safehouse TV plays instead of showing a green
    rectangle after VICTORY_SKIP_BINK is left unset.
**@⁠ultimatebash** on GitHub · 2026-12-02 22:58 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/267) `ultimatebash:rx6750xt-memory` → `main` · +1088 −81 · 16 files · 4 commits · open # RX 6750 XT: 12 GB VRAM/RAM stability, texture reserve, and automated benchmarks Base: `lobomfz/VIctory-xmem` `main` @ `d3dbb1a` Head: `pr/rx6750xt-memory` @ `6462338` (merged latest main, conflicts resolved) ## Summary This branch targets a 12 GB RX 6750 XT and fixes the two failure modes seen on it: the title was RAM-capped far below its working set (4.1 GiB, 3.5 GB swap) and VRAM reached about 11.6 GB of 12.9 GB, so the kernel could no longer pin a display framebuffer (`amdgpu ... pin failed`, `-ENOMEM`). The picture stopped while the radio kept playing. The branch keeps the title's paged room around 3 GiB, stops host textures before the card is full, and never lets a play session's RAM cap fall below its 12 GiB working set while that much is available. It also makes the benchmark path repeatable and integrates two small upstream performance PRs. ## Main changes - `run.sh`: play sessions get at least `min(WANT_RAM, available - 2 GiB)` instead of the old `KEEP_FREE`-only value. The 12 GiB host default and GTT warning from upstream #226 are kept. - Unified-memory title room: unset now keeps 12 GiB for the host **or 30 % of the card for the title, whichever leaves more** (3.7 GiB on 12 GB, 4.8 GiB on 16 GB, 12 GiB on 24 GB). Explicit `VICTORY_CARD_KEPT_MB` / `VICTORY_UM_CARD_MB` still win. - Texture room and title room are documented and were A/B tested on the 12 GB card. The working configuration uses `VICTORY_CARD_KEPT_MB=9216` and `VICTORY_TEXTURE_ROOM_CAP_PERCENT=86` / `..._PERCENT=82`; the latter is a local `run.conf` value, not a changed code default. - PR #248: skip staging when earlier GPU copies already cover every part of a texture upload (no discarded reads, hashes or detiling). - PR #233: skip RADV's foreign-BO list walk when every buffer belongs to the same winsys (`patches/mesa.patch`; the pipeline cache key changes once). - `VICTORY_LIST_RESETS_MOST` (PR #3) bounds command-allocator growth. - Frame-time statistics in the 5 s line: 1 %/0.1 % lows, p99, worst, VRAM. - `VICTORY_KEYS` parser extracted and tested, including the `from-to/step:Key` repeat form. - `VICTORY_TITLE_ARGS` passes title arguments (`-skipToIIS`) through `run.sh`. - `tools/bench-keys.sh`: unattended diagnostic benchmark runner. - Asset-policy allowlist entry for the already-tracked `run.conf.default`. ## Measurements Old configuration (44-minute session, 4.1 GiB RAM cap, 92/86 texture room): | metric | old | |---|---:| | median gameplay 1 %-low | 6.0 FPS | | median gameplay 0.1 %-low | 3.0 FPS | | p99 frame time | 167 ms | | average FPS | 19.3 | | VRAM | 10.86 GB | | result | frozen after 44 min, `pin failed`, 3.745 s worst frame | Stable configuration (release and diagnostic runs, same safehouse): | metric | release short run | diagnostic steady | |---|---:|---:| | 1 %-low | 9.1 FPS | 10.7–11.2 FPS | | 0.1 %-low | 2.6 FPS* | 4.2–5.2 FPS | | p99 frame time | 110 ms | 89–93 ms | | average FPS | 22.3 | ~22 | | VRAM | 8.92 GB | 9.05–9.36 GB | | result | no pin failure | no pin failure | \*The short release run is dominated by the one-time world-load frame; the 4-minute steady windows are in the next column. Six 4-minute automated runs (base twice, pool move, page tuning, late fence, all three) showed run-to-run drift larger than every variant. The repeated baseline moved by −8 % (1 %), −32 % (0.1 %), +9 % (p99) and +27 % (worst), so no speculative switch was adopted. Moving benchmarks kept 86/82 over 82/78 (fewer neutral-texture frames: 0.78 vs 1.26) and 3.0 GiB title room over 3.5 GiB. Known remaining artifact: a character face can be black for a few seconds. Logs show 731–932 texture uploads whose source read all zeros, plus 0.78–1.26 neutral frames per slot; there is no pin failure. This is a first-upload / zero-memory streaming issue, not VRAM exhaustion. More title room did not fix it; a careful all-zero-upload deferral is the next code step. ## Tests - Release and diagnostic (`PROFILE=diag`) builds pass. - `the_title_room_follows_the_card_and_the_switches` passes. - `key_script_parses_presses_and_repeats` passes. - `victory-hle` under Wine: 153 passed, 1 ignored; the 5 failures are host effects (native Wine pointer path, missing `WSAConnectByList`, non-NTFS temp folder), not the changed Bink/key paths. - `./run.sh shaders`: 25.694 shaders cached, 195 known non-translatable GFX10 containers, exit 0. - Automated start with `VICTORY_SKIP_INTRO=1`, `VICTORY_KEYS=20:Enter` and `-skipToIIS` works; the safehouse TV plays instead of showing a green rectangle after `VICTORY_SKIP_BINK` is left unset.
Squashed PR branch: play-session RAM floor, 30% title default, 86/82 tested texture room, PR #248 discarded-upload skip, PR #233 Mesa BO scan skip, frame-time lows, list-reset bound, key-script tests, title arguments, and the unattended benchmark runner. See /tmp/opencode/PR.md for the full description and measurements.
Resolved host.rs: upstream long-frame logger plus the local frame-time lows test. Resolved gameinput.rs: upstream Space/Shift and VICTORY_KEYS_FILE plus the local parse_script repeat syntax.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 23:01:16 +00:00
Author
Owner

@⁠El-Biiscuit on GitHub · 2026-12-03 15:48 UTC · original

A/B data from another 12 GB gfx1031 card, in case it helps the review.

Setup: RX 6700 XT 12 GB (gfx1031, resizable BAR 16 GiB), Ryzen 7 5800X, 62 GiB RAM, Fedora 45, kernel 7.3.6, GE-Proton11-16. Built-in benchmark mode (VICTORY_BENCH=nort: Series X, FSR 4 Quality 1440p → 3840x2160), 4 min per run with the last 3 min measured (MangoHud frame times). The same save was restored before every run, nobody touched the PC, and no remote desktop session was open.

  • A = 842767a (main).
  • B = 842767a with this PR merged locally (only README.md conflicted; Mesa rebuilt with the PR's mesa.patch), default settings, no VICTORY_CARD_KEPT_MB.
  • Order A B B A A B B A, prebuilt exe and Mesa per arm, so nothing was rebuilt between runs.
A (main) B (#267)
card_mb_for_title 1024 3681
median frame time, median of 4 runs [range] 67.3 ms [67.1–67.6] 66.4 ms [65.9–66.8]
p95, median of 4 runs 90.1 ms 89.4 ms
p99, median of 4 runs [range] 137.0 ms [131.6–140.1] 130.2 ms [128.8–135.5]
1% low (benchmark's own), median 7.15 fps 7.4 fps
VRAM used (benchmark's own) 9.4–9.6 GB 10.6–10.7 GB
kernel faults / pin failed 0 / 0 0 / 0

8/8 runs completed. B was faster in every pair, but by little: median −1.3 %, and the four B medians are all below the four A medians. p99 is −4.9 %, with the ranges slightly overlapping. B's first run logged 465 × texture already on the card is brought up to date although the card has no room, so the extra title room does put some pressure on textures.

Moving scene. Same harness and order, but with a city save on foot and the camera turning continuously for the whole measured window. Both arms used the diagnostics build (PROFILE=diag), so these numbers are not comparable with the table above. VICTORY_KEYS=40-600:L was used with a copy of the default native-keys table in which L is bound to the Numpad6 actions (INPUT_LOOK_RIGHT_ONLY, …). This was needed because, with a real pad connected, the scripted L reached the game as its native key and opened the phone.

moving camera, diag build A (main) B (#267)
median frame time, median of 4 runs [range] 89.3 ms [87.9–89.8] 85.3 ms [84.6–91.3]
p99, median of 4 runs [range] 263.6 ms [259.4–292.5] 226.1 ms [214.9–296.1]
average fps (benchmark's own), range 9.5–9.7 9.5–10.5
card has no room lines per run 1053–1394 2018–2159
kernel faults / pin failed 0 / 0 0 / 0

Three of the four B runs are clearly better than every A run (median 84.6–86.0 ms against 87.9–89.8 ms; p99 215–227 ms against 259–293 ms). The fourth (run 6) matched A, with the same card_mb_for_title=3681 and a similar no room count, and I don't know why. So the trend favours the PR, mostly in the tail (p99 −14 %), but the ranges overlap.

The character stands on foot and jumps only at the start, because of the benchmark's Enter / pad A presses (5–65 s). That overlaps at most the first ~5 s of the measured window, in both arms.

Limits: 3 min measured per run, camera rotation only (no walking or driving). I did not test a long session (the 44-minute freeze you describe) or VICTORY_CARD_KEPT_MB=9216. I can run any of those with the same harness if that would help.

**@⁠El-Biiscuit** on GitHub · 2026-12-03 15:48 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/267#issuecomment-7383773935) A/B data from another 12 GB gfx1031 card, in case it helps the review. **Setup:** RX 6700 XT 12 GB (gfx1031, resizable BAR 16 GiB), Ryzen 7 5800X, 62 GiB RAM, Fedora 45, kernel 7.3.6, GE-Proton11-16. Built-in benchmark mode (`VICTORY_BENCH=nort`: Series X, FSR 4 Quality 1440p → 3840x2160), 4 min per run with the last 3 min measured (MangoHud frame times). The same save was restored before every run, nobody touched the PC, and no remote desktop session was open. - **A** = `842767a` (main). - **B** = `842767a` with this PR merged locally (only `README.md` conflicted; Mesa rebuilt with the PR's `mesa.patch`), default settings, no `VICTORY_CARD_KEPT_MB`. - Order A B B A A B B A, prebuilt exe and Mesa per arm, so nothing was rebuilt between runs. | | A (main) | B (#267) | |---|---|---| | `card_mb_for_title` | 1024 | 3681 | | median frame time, median of 4 runs [range] | 67.3 ms [67.1–67.6] | 66.4 ms [65.9–66.8] | | p95, median of 4 runs | 90.1 ms | 89.4 ms | | p99, median of 4 runs [range] | 137.0 ms [131.6–140.1] | 130.2 ms [128.8–135.5] | | 1% low (benchmark's own), median | 7.15 fps | 7.4 fps | | VRAM used (benchmark's own) | 9.4–9.6 GB | 10.6–10.7 GB | | kernel faults / `pin failed` | 0 / 0 | 0 / 0 | 8/8 runs completed. B was faster in every pair, but by little: median −1.3 %, and the four B medians are all below the four A medians. p99 is −4.9 %, with the ranges slightly overlapping. B's first run logged 465 × `texture already on the card is brought up to date although the card has no room`, so the extra title room does put some pressure on textures. **Moving scene.** Same harness and order, but with a city save on foot and the camera turning continuously for the whole measured window. Both arms used the diagnostics build (`PROFILE=diag`), so these numbers are not comparable with the table above. `VICTORY_KEYS=40-600:L` was used with a copy of the default native-keys table in which `L` is bound to the `Numpad6` actions (`INPUT_LOOK_RIGHT_ONLY`, …). This was needed because, with a real pad connected, the scripted `L` reached the game as its native key and opened the phone. | moving camera, diag build | A (main) | B (#267) | |---|---|---| | median frame time, median of 4 runs [range] | 89.3 ms [87.9–89.8] | 85.3 ms [84.6–91.3] | | p99, median of 4 runs [range] | 263.6 ms [259.4–292.5] | 226.1 ms [214.9–296.1] | | average fps (benchmark's own), range | 9.5–9.7 | 9.5–10.5 | | `card has no room` lines per run | 1053–1394 | 2018–2159 | | kernel faults / `pin failed` | 0 / 0 | 0 / 0 | Three of the four B runs are clearly better than every A run (median 84.6–86.0 ms against 87.9–89.8 ms; p99 215–227 ms against 259–293 ms). The fourth (run 6) matched A, with the same `card_mb_for_title=3681` and a similar `no room` count, and I don't know why. So the trend favours the PR, mostly in the tail (p99 −14 %), but the ranges overlap. The character stands on foot and jumps only at the start, because of the benchmark's Enter / pad `A` presses (5–65 s). That overlaps at most the first ~5 s of the measured window, in both arms. **Limits:** 3 min measured per run, camera rotation only (no walking or driving). I did not test a long session (the 44-minute freeze you describe) or `VICTORY_CARD_KEPT_MB=9216`. I can run any of those with the same harness if that would help.
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:02 UTC · original

There is real field data in here — the allocator "Kernel memory failure" story and a reset-count cap is worth having in the tree — but as sent this is your fork state, not a change: version bump (Cargo.toml:8 0.1.0 → 0.2.0), a new 230-line CHANGELOG.md, a 62-line README rewrite, ten switches, a RAM-policy reversal and a paging heuristic in one 1,088-line diff, 200 commits stale, conflicting in four files.

Three findings worth acting on:

  • run.sh:124-130 silently raises KEEP_FREE to WANT_RAM minus 2 GiB for play, while run.conf.default:95-101 still documents KEEP_FREE as "MiB of RAM left to the rest of the system" and run.sh:179 only warns when the cap is below WANT_RAM. A policy reversal on a documented knob, hidden in a VRAM PR, and on a 16 GiB machine it can push you into the swap-death the comment is trying to avoid on the other side.
  • Ten switches, documented only in run.conf.default (none in docs/SETTINGS.md), which is the table the project treats as the contract.
  • crates/victory-gpu/src/um/residency.rs:570-576 asks "are we pressed?" twice per tick with different inputs (:735 again, with freed and warm moves accounted); the two can disagree within one tick and nothing says which wins.

Send HostList::worn() / VICTORY_LIST_RESETS_MOST alone first — small, mechanism, lands. Then one PR per remaining idea, and the RAM cap needs the maintainer's decision before it needs review.

**@⁠Luxuride** on GitHub · 2026-12-04 12:02 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/267#issuecomment-7410887092) There is real field data in here — the allocator "Kernel memory failure" story and a reset-count cap is worth having in the tree — but as sent this is your fork state, not a change: version bump (`Cargo.toml:8` 0.1.0 → 0.2.0), a new 230-line `CHANGELOG.md`, a 62-line README rewrite, ten switches, a RAM-policy reversal and a paging heuristic in one 1,088-line diff, 200 commits stale, conflicting in four files. Three findings worth acting on: - `run.sh:124-130` silently raises `KEEP_FREE` to `WANT_RAM` minus 2 GiB for play, while `run.conf.default:95-101` still documents `KEEP_FREE` as "MiB of RAM left to the rest of the system" and `run.sh:179` only *warns* when the cap is below `WANT_RAM`. A policy reversal on a documented knob, hidden in a VRAM PR, and on a 16 GiB machine it can push you into the swap-death the comment is trying to avoid on the other side. - Ten switches, documented only in `run.conf.default` (none in `docs/SETTINGS.md`), which is the table the project treats as the contract. - `crates/victory-gpu/src/um/residency.rs:570-576` asks "are we pressed?" twice per tick with different inputs (`:735` again, with `freed` and warm moves accounted); the two can disagree within one tick and nothing says which wins. Send `HostList::worn()` / `VICTORY_LIST_RESETS_MOST` alone first — small, mechanism, lands. Then one PR per remaining idea, and the RAM cap needs the maintainer's decision before it needs review.
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/victory-gpu/src/um/residency.rs
  • patches/mesa.patch
  • run.conf.default
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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