RDNA 2: preludes from a shared pool, opt-in allocator caps, -Rdna2 preset, unattended bench (#329, #376) #620

Open
github-bot wants to merge 2 commits from github-bot/gh-620 into a-publier AGit
Owner

@⁠icdmkg2 on GitHub · 2026-11-27 14:20 UTC · original
icdmkg2:rdna2-allocator-limits → a-publier · +176 −15 · 5 files · 2 commits · open

RDNA 2 (RX 6000) cards lose the device with the relay on (#329, #376). This keeps the relay on and the device alive on an RX 6750 XT, by keeping live command allocators under AMD's limit, and adds a measured launcher preset and an unattended benchmark. On an RX 6750 XT with 32 GB, busy scenes go from 4 to 5 fps (the VICTORY_RELAY=0 workaround) to about 18 fps.

What was wrong on this card

Under the D3D12 debug layer, at the loss: Kernel memory failure. There might be a memory leak. (id 834), and the live-object report listed 2,041 ID3D12CommandAllocators with 1,236 host lists alive. Every host list kept a second allocator (its prelude) for its whole life once it had needed one, and the pools let idle lists pile up. VICTORY_RELAY=0 avoided the loss but left busy scenes at 4 to 5 fps on this card.

Changes

  • Preludes come from a shared pool (host.rs): a list borrows one when it first needs a prelude and gives it back at reset(), after all of its submissions have run. Idle lists now hold one allocator, not two. VICTORY_PRELUDE_POOL bounds the spare ones (default 64). This is the one change that affects every card.
  • Opt-in caps (no change unless set):
    • VICTORY_IDLE_LISTS (list.rs): idle host lists kept, at most the existing 512.
    • VICTORY_LIST_CEILING (list.rs): above this many live host lists, lists that have run are let go instead of kept. 900 was below what is alive in play here (about 1,210) and made the layer remake about 200 lists a frame (3 fps); 1,300 held.
    • VICTORY_CARD_STEPS_POOL (host/card_steps.rs): landed card-step lists kept.
  • scripts\play.ps1: -Console series-s|series-x, and -Rdna2, the settings below.
  • scripts\bench.ps1: an unattended run (diagnostics build). It presses Enter through the menus with VICTORY_KEYS, waits for scenes of more than 1,000 draws, records them for 150 s, stops the title and prints the median, lowest and highest frame rate and the frame line's preparing / GPU / copying-back times. Runs differ by about 1 fps from one to the next.

Measured (RX 6750 XT 12 GB, i9-13900K, 32 GB RAM, Windows 11, Series S profile)

Median fps of bench.ps1 runs, scenes of more than 1,000 draws (the opening cutscene into the first street):

median fps device lost
VICTORY_RELAY=0 (the workaround in #376) 4 to 5 no
relay on, before this change crashes in 1 to 3 min yes, 0x887A0007
-Rdna2 with 64 idle lists (first version of this PR) 9.0 to 11.9 over 8 runs none in about 30 runs
-Rdna2 with 256 idle lists (now) 17.4 to 18.0 over 5 runs (64 in the same session: 9.2) none

Within -Rdna2, one switch at a time (two runs where noted; about ±1 fps between runs):

median fps
card-buffer tier 16 MiB / 512 MiB (the 12 GB default) 8.9
1 MiB / 1024 MiB (#444's 12 GB tier) 10.6, 11.9
2048 MiB of card buffers 10.1
Series X profile at 1920x1080 7.7 (Series S: 10.3)
output 1280x720 12.4
VICTORY_PORT_CBV=1 and VICTORY_PORT_JOURNAL=1 5.8 (alone at first: black frames, 1 to 3 fps)
VICTORY_LATE_WAIT_LISTS 128 / 192 6.0 / 9.8 (96: 10.6)
VICTORY_THIN_THREADS 12 / 16 11.3, 11.1 / 10.4
VICTORY_LAND_THREADS=6 9.7
VICTORY_SUBMIT_DEPTH=64 8.8

VICTORY_UPSCALER=6 with VICTORY_AMBIENT=1 removed a grid pattern, a dark ghost and dark blocks from the opening cutscene on this card (frames captured with VICTORY_CAPTURE and compared), at no cost in frame rate. Both are in -Rdna2.

These runs had #428, #424 and #443 applied as well. -Rdna2 has only been run with them.

Why 256 idle lists: a timeline of the critical chain

VICTORY_TIMELINE on three busy frames with 64 idle lists (109 ms a frame), causes on the chain each present came out of, per frame:

ms
outside our spans on victory-submit 38.8
the card running submissions 20.6
submit: the lists' steps 16.8
landed lists reset and given back 12.8
the card's copy queue 4.5

Under VICTORY_PROFILE, the time outside spans on the submitting thread is drop_glue<HostList> from list::recycle from landing (about 30 % of that thread). Every list beyond the idle cap was released (its allocator and lists, through the graphics kernel) and another one made later. 64 was chosen before preludes were pooled, when a list held two allocators. With pooled preludes, 128, 256 and 512 all gave 17.6 to 18.0 fps, with 0 lists made a frame (from 12 to 77) and about 1,260 alive. -Rdna2 now sets 256 and a ceiling of 1,600.

Found on the way, not in this change

  • Signalling the title before the landing (an experiment: fences and bottom-of-pipe writes set as soon as the card has run the flights) changed nothing: 8.8 and 9.5 fps against 9.2. Under the profile the render thread still waited 84 % of the time at its frame fence. The landing is not what the frame waits for here; the submitting thread is.
  • Where the frame goes. With VICTORY_PROFILE, the title's render thread spends about 70 % of a frame waiting at +0x2474740. That is a two-slot ring of frame fences: after pushing frame N it waits for N-1. So the frame time here is prepare (~35 ms) + card (~20 ms) + landing (~25 ms) in a row. A load-time patch to a four-slot ring (three frames in flight) applied cleanly, but crashed: first in HostHeap::copy_to from heap_buffer_pass (a view of a host copy already let go), then, with a longer VICTORY_BURY_LAG, in the title's own code. The title's per-frame data looks double-buffered by frame parity.
  • Letting finished host lists go on a thread of their own. This was 29 % of the submitting thread here, but it lost the device in 2 of 2 runs: the backlog took the live allocators past the limit again.
  • #480 on this machine. The preparing time went from about 40 to about 140 ms a frame in busy scenes. Part of it is the snapshot budget under memory pressure: 256 MB, or 64 MB, against about 250 MB of snapshots a frame.

Checks

cargo clippy --workspace --all-targets --locked -- -D warnings and the same with --all-features pass. cargo test --workspace --locked passes (0 failed; the victory-gpu suite 396 passed, 34 ignored, on the RX 6750 XT).

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

**@⁠icdmkg2** on GitHub · 2026-11-27 14:20 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/620) `icdmkg2:rdna2-allocator-limits` → `a-publier` · +176 −15 · 5 files · 2 commits · open RDNA 2 (RX 6000) cards lose the device with the relay on (#329, #376). This keeps the relay on and the device alive on an RX 6750 XT, by keeping live command allocators under AMD's limit, and adds a measured launcher preset and an unattended benchmark. **On an RX 6750 XT with 32 GB, busy scenes go from 4 to 5 fps (the `VICTORY_RELAY=0` workaround) to about 18 fps.** ## What was wrong on this card Under the D3D12 debug layer, at the loss: `Kernel memory failure. There might be a memory leak.` (id 834), and the live-object report listed **2,041 `ID3D12CommandAllocator`s** with 1,236 host lists alive. Every host list kept a second allocator (its prelude) for its whole life once it had needed one, and the pools let idle lists pile up. `VICTORY_RELAY=0` avoided the loss but left busy scenes at 4 to 5 fps on this card. ## Changes - **Preludes come from a shared pool** (`host.rs`): a list borrows one when it first needs a prelude and gives it back at `reset()`, after all of its submissions have run. Idle lists now hold one allocator, not two. `VICTORY_PRELUDE_POOL` bounds the spare ones (default 64). This is the one change that affects every card. - **Opt-in caps** (no change unless set): - `VICTORY_IDLE_LISTS` (`list.rs`): idle host lists kept, at most the existing 512. - `VICTORY_LIST_CEILING` (`list.rs`): above this many live host lists, lists that have run are let go instead of kept. 900 was below what is alive in play here (about 1,210) and made the layer remake about 200 lists a frame (3 fps); 1,300 held. - `VICTORY_CARD_STEPS_POOL` (`host/card_steps.rs`): landed card-step lists kept. - **`scripts\play.ps1`**: `-Console series-s|series-x`, and `-Rdna2`, the settings below. - **`scripts\bench.ps1`**: an unattended run (diagnostics build). It presses Enter through the menus with `VICTORY_KEYS`, waits for scenes of more than 1,000 draws, records them for 150 s, stops the title and prints the median, lowest and highest frame rate and the frame line's preparing / GPU / copying-back times. Runs differ by about 1 fps from one to the next. ## Measured (RX 6750 XT 12 GB, i9-13900K, 32 GB RAM, Windows 11, Series S profile) Median fps of `bench.ps1` runs, scenes of more than 1,000 draws (the opening cutscene into the first street): | | median fps | device lost | |---|---|---| | `VICTORY_RELAY=0` (the workaround in #376) | 4 to 5 | no | | relay on, before this change | crashes in 1 to 3 min | yes, 0x887A0007 | | `-Rdna2` with 64 idle lists (first version of this PR) | 9.0 to 11.9 over 8 runs | none in about 30 runs | | **`-Rdna2` with 256 idle lists (now)** | **17.4 to 18.0** over 5 runs (64 in the same session: 9.2) | **none** | Within `-Rdna2`, one switch at a time (two runs where noted; about ±1 fps between runs): | | median fps | |---|---| | card-buffer tier 16 MiB / 512 MiB (the 12 GB default) | 8.9 | | 1 MiB / 1024 MiB (#444's 12 GB tier) | 10.6, 11.9 | | 2048 MiB of card buffers | 10.1 | | Series X profile at 1920x1080 | 7.7 (Series S: 10.3) | | output 1280x720 | 12.4 | | `VICTORY_PORT_CBV=1` and `VICTORY_PORT_JOURNAL=1` | 5.8 (alone at first: black frames, 1 to 3 fps) | | `VICTORY_LATE_WAIT_LISTS` 128 / 192 | 6.0 / 9.8 (96: 10.6) | | `VICTORY_THIN_THREADS` 12 / 16 | 11.3, 11.1 / 10.4 | | `VICTORY_LAND_THREADS=6` | 9.7 | | `VICTORY_SUBMIT_DEPTH=64` | 8.8 | `VICTORY_UPSCALER=6` with `VICTORY_AMBIENT=1` removed a grid pattern, a dark ghost and dark blocks from the opening cutscene on this card (frames captured with `VICTORY_CAPTURE` and compared), at no cost in frame rate. Both are in `-Rdna2`. These runs had #428, #424 and #443 applied as well. `-Rdna2` has only been run with them. ## Why 256 idle lists: a timeline of the critical chain `VICTORY_TIMELINE` on three busy frames with 64 idle lists (109 ms a frame), causes on the chain each present came out of, per frame: | | ms | |---|---| | outside our spans on `victory-submit` | 38.8 | | the card running submissions | 20.6 | | submit: the lists' steps | 16.8 | | landed lists reset and given back | 12.8 | | the card's copy queue | 4.5 | Under `VICTORY_PROFILE`, the time outside spans on the submitting thread is `drop_glue<HostList>` from `list::recycle` from landing (about 30 % of that thread). Every list beyond the idle cap was released (its allocator and lists, through the graphics kernel) and another one made later. 64 was chosen before preludes were pooled, when a list held two allocators. With pooled preludes, 128, 256 and 512 all gave 17.6 to 18.0 fps, with **0 lists made a frame** (from 12 to 77) and about 1,260 alive. `-Rdna2` now sets 256 and a ceiling of 1,600. ## Found on the way, not in this change - **Signalling the title before the landing** (an experiment: fences and bottom-of-pipe writes set as soon as the card has run the flights) changed nothing: 8.8 and 9.5 fps against 9.2. Under the profile the render thread still waited 84 % of the time at its frame fence. The landing is not what the frame waits for here; the submitting thread is. - **Where the frame goes.** With `VICTORY_PROFILE`, the title's render thread spends about 70 % of a frame waiting at +0x2474740. That is a two-slot ring of frame fences: after pushing frame N it waits for N-1. So the frame time here is prepare (~35 ms) + card (~20 ms) + landing (~25 ms) in a row. A load-time patch to a four-slot ring (three frames in flight) applied cleanly, but crashed: first in `HostHeap::copy_to` from `heap_buffer_pass` (a view of a host copy already let go), then, with a longer `VICTORY_BURY_LAG`, in the title's own code. The title's per-frame data looks double-buffered by frame parity. - **Letting finished host lists go on a thread of their own.** This was 29 % of the submitting thread here, but it lost the device in 2 of 2 runs: the backlog took the live allocators past the limit again. - **#480 on this machine.** The preparing time went from about 40 to about 140 ms a frame in busy scenes. Part of it is the snapshot budget under memory pressure: 256 MB, or 64 MB, against about 250 MB of snapshots a frame. ## Checks `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same with `--all-features` pass. `cargo test --workspace --locked` passes (0 failed; the victory-gpu suite 396 passed, 34 ignored, on the RX 6750 XT). AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On RDNA 2 cards the device was lost with the relay on: at the loss the
debug layer reported a kernel memory failure (id 834) and 2,041 live
command allocators, 1,236 host lists alive. Each host list kept its
prelude's allocator for life.

- Preludes are borrowed from a shared pool and given back at reset
  (VICTORY_PRELUDE_POOL, default 64 spare): idle lists hold one
  allocator, not two.
- Opt-in caps, no change unless set: VICTORY_IDLE_LISTS (idle host
  lists kept), VICTORY_LIST_CEILING (live host lists before lists that
  have run are let go), VICTORY_CARD_STEPS_POOL (landed card-step lists).
- scripts\play.ps1: -Console series-s|series-x, and -Rdna2, the settings
  measured on an RX 6750 XT.
- scripts\bench.ps1: an unattended frame-rate run (VICTORY_KEYS through
  the menus, scenes of more than 1,000 draws, one summary line).

RX 6750 XT, 32 GB, Series S: busy scenes 9 to 12 fps median with the
relay on and no device loss in about 30 runs, against 4 to 5 fps with
VICTORY_RELAY=0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:24:44 +00:00
A VICTORY_TIMELINE of three busy frames on an RX 6750 XT put about half
of each frame's critical chain in host lists being let go and made anew
(38.8 ms outside spans on the submitting thread, drop_glue<HostList> from
list::recycle under the profile, and 12.8 ms resetting): every list past
the idle cap of 64 was released through the graphics kernel. 64 was set
before preludes were pooled, when a list held two allocators.

With 128, 256 or 512 kept: 17.4 to 18.0 fps median in five runs, 0 lists
made a frame, about 1,260 alive, no device loss; 64 in the same session:
9.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This pull request can be merged automatically.
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/620/head:github-bot/gh-620'
git switch 'github-bot/gh-620'

Merge

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