[D3D12 / AMD RDNA] Device removal (0x887A0007 / id=834) caused by ID3D12CommandAllocator exhaustion (~2,048 ceiling) #1057

Closed
opened 2026-11-28 14:32:21 +00:00 by github-bot · 2 comments
Owner

@⁠wxnelord-boop on GitHub · 2026-11-28 12:21 UTC · original

On AMD RDNA GPUs (tested on RX 6700 XT 12 GB, RX 6800 XT 16 GB, also affects other RDNA 2 / RDNA 4 cards), running with list pooling and streaming enabled (VICTORY_LIST_POOL=1, VICTORY_THIN=1, VICTORY_CARD_STEPS=2) consistently triggers a D3D12 device removal (0x887A0007) after ~80–180 seconds of gameplay/streaming.

Root Cause
D3D12 debug layer captures show D3D12: Kernel memory failure. There might be a memory leak. (id=834) right as the live ID3D12CommandAllocator count reaches ~2,045:

  • AMD's WDDM kernel driver enforces a hard per-device ceiling of ~2,048 live ID3D12CommandAllocator objects (each reserving kernel-mode command-buffer backing pages).
  • Each HostList owns 1 ID3D12CommandAllocator, and initializing prelude: OnceLock<Option<Prelude>> pins a 2nd permanent allocator for the entire lifetime of that HostList.
  • Concurrent retention across IDLE list pools, BACKS, bury_lag, VICTORY_SUBMIT_DEPTH=64, and card_steps pushes total live allocators past the ~2,048 limit.
  • Because CreateComputePipelineState takes seconds on RDNA 2, it is usually in flight on a worker thread when the limit trips — making pipeline compilation or E_INVALIDARG (0x80070057) appear as the culprit while DRED breadcrumbs remain empty ([]).

Workaround
Setting VICTORY_LIST_POOL=0 (and/or VICTORY_SUBMIT_DEPTH=32) prevents allocator hoarding and avoids the crash, though at a significant streaming performance cost.

VICTORY_LIST_POOL=0 did not prevent the crash on my setup; the only env variable that noticeably affects it here is VICTORY_RELAY (disabling/changing VICTORY_RELAY alters the behavior). With VICTORY_RELAY=0: runs without the crash.

Proposed Fix

  1. host.rs: Replace per-HostList prelude: OnceLock<Option<Prelude>> with Mutex<Option<Prelude>> backed by a bounded shared PRELUDE_POOL (cap 128), borrowed in HostList::prelude() and returned in HostList::reset(). Cap line.landed retention in land() to bury_lag().min(4).
  2. list.rs: Lower IDLE_MOST from (512, 256 << 20) to (256, 128 << 20). Defer HostList allocation until reset() (list.host = None in detach() / detach_parts(), add boxed_back(kind)).
  3. list/thin.rs: Cap BACKS_MOST = 64, use boxed_back(), and clear back.host = None / drop overflow backing allocators early in Recording::drop.
  4. queue/behind.rs: Lower default VICTORY_SUBMIT_DEPTH (runs_most()) from 64 to 32.
  5. host/card_steps.rs: Cap POOL_MOST = 8 and limit cool_down retention lag to bury_lag().min(16).

Environment

  • GPU: AMD Radeon RX 6700 XT (12 GB, RDNA 2) / AMD Radeon RX 6800 XT (16 GB, RDNA 2)
  • CPU / RAM: Ryzen 7 5700X; Intel I5-14600KF, 32 GB DDR5 RAM
  • OS: Windows 11
**@⁠wxnelord-boop** on GitHub · 2026-11-28 12:21 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1057) On AMD RDNA GPUs (tested on RX 6700 XT 12 GB, RX 6800 XT 16 GB, also affects other RDNA 2 / RDNA 4 cards), running with list pooling and streaming enabled (`VICTORY_LIST_POOL=1`, `VICTORY_THIN=1`, `VICTORY_CARD_STEPS=2`) consistently triggers a D3D12 device removal (`0x887A0007`) after ~80–180 seconds of gameplay/streaming. Root Cause D3D12 debug layer captures show `D3D12: Kernel memory failure. There might be a memory leak. (id=834)` right as the live `ID3D12CommandAllocator` count reaches ~2,045: - AMD's WDDM kernel driver enforces a hard per-device ceiling of ~2,048 live `ID3D12CommandAllocator` objects (each reserving kernel-mode command-buffer backing pages). - Each `HostList` owns 1 `ID3D12CommandAllocator`, and initializing `prelude: OnceLock<Option<Prelude>>` pins a 2nd permanent allocator for the entire lifetime of that `HostList`. - Concurrent retention across `IDLE` list pools, `BACKS`, `bury_lag`, `VICTORY_SUBMIT_DEPTH=64`, and `card_steps` pushes total live allocators past the ~2,048 limit. - Because `CreateComputePipelineState` takes seconds on RDNA 2, it is usually in flight on a worker thread when the limit trips — making pipeline compilation or `E_INVALIDARG` (`0x80070057`) appear as the culprit while DRED breadcrumbs remain empty (`[]`). Workaround Setting `VICTORY_LIST_POOL=0` (and/or `VICTORY_SUBMIT_DEPTH=32`) prevents allocator hoarding and avoids the crash, though at a significant streaming performance cost. `VICTORY_LIST_POOL=0` did not prevent the crash on my setup; the only env variable that noticeably affects it here is `VICTORY_RELAY` (disabling/changing `VICTORY_RELAY` alters the behavior). With `VICTORY_RELAY=0`: runs without the crash. Proposed Fix 1. `host.rs`: Replace per-`HostList` `prelude: OnceLock<Option<Prelude>>` with `Mutex<Option<Prelude>>` backed by a bounded shared `PRELUDE_POOL` (cap `128`), borrowed in `HostList::prelude()` and returned in `HostList::reset()`. Cap `line.landed` retention in `land()` to `bury_lag().min(4)`. 2. `list.rs`: Lower `IDLE_MOST` from `(512, 256 << 20)` to `(256, 128 << 20)`. Defer `HostList` allocation until `reset()` (`list.host = None` in `detach()` / `detach_parts()`, add `boxed_back(kind)`). 3. `list/thin.rs`: Cap `BACKS_MOST = 64`, use `boxed_back()`, and clear `back.host = None` / drop overflow backing allocators early in `Recording::drop`. 4. `queue/behind.rs`: Lower default `VICTORY_SUBMIT_DEPTH` (`runs_most()`) from `64` to `32`. 5. `host/card_steps.rs`: Cap `POOL_MOST = 8` and limit `cool_down` retention lag to `bury_lag().min(16)`. Environment - GPU: AMD Radeon RX 6700 XT (12 GB, RDNA 2) / AMD Radeon RX 6800 XT (16 GB, RDNA 2) - CPU / RAM: Ryzen 7 5700X; Intel I5-14600KF, 32 GB DDR5 RAM - OS: Windows 11
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:32:21 +00:00
Author
Owner

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

@⁠trustno1-coder on GitHub · 2026-11-30 15:48 UTC · original

Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is v2026.11.30.01.

If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run:

  1. The play log: the newest victory-nvidia-play-<date>-<time>-<number>.log in %LOCALAPPDATA%\victory\logs\.
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, plus the newest .crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\ if there is one from that run.
**@⁠trustno1-coder** on GitHub · 2026-11-30 15:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1057#issuecomment-7283608819) Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is [v2026.11.30.01](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.30.01). If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run: 1. The play log: the newest `victory-nvidia-play-<date>-<time>-<number>.log` in `%LOCALAPPDATA%\victory\logs\`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, plus the newest `.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\` if there is one from that run.
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#1057
No description provided.