Run on a 16 GB PC: windows on the card, relief on out-of-memory, idle lists by memory #92

Closed
TheHoracio wants to merge 2 commits from upstream-pr/92 into main
TheHoracio commented 2026-11-26 03:09:58 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by TheHoracio on 2026-11-26T03:09:58Z.


Thanks for this fork. On a 16 GB machine it ran out of memory in the world. These changes make it run stable there. They are measured on one PC only.

PC:

  • RX 7800 XT 16 GB, Ryzen 7 9800X3D, 16 GB RAM with a 64 GB page file;
  • Windows 11, 1080p (VICTORY_DISPLAY_MODE=1920x1080), Series X profile;
  • play.ps1 -Safe settings.

The problem

The PC's memory shared with the card is half the RAM, so 7.1 GB here. It filled at world entry, mostly with 4 MiB windows of title memory (2.7–3.8 GB) and with idle host lists' command allocators. List creation or Close then failed with E_OUTOFMEMORY:

  • "no host list for a state prelude";
  • "a host command list did not close".

The card itself still had several GB free.

What changed

  • Windows on the card. Windows of title memory go to a GPU upload heap (Resizable BAR) first, while the card is under 85 % of its budget. Then they go to shared memory, then to the card up to 92 %. VICTORY_WINDOWS_VRAM=0 keeps them in shared memory only; =late uses the card only after shared memory refuses. Windows are only written by the CPU here: the log showed 0 MB a frame compared on the CPU.

  • Upload buffers. When PC memory refuses an upload buffer, it falls back to a GPU upload heap, up to 95 % of the card's budget.

  • Relief and retry. On a refusal, relieve / again_on_oom / again_while_none free what is held in reserve:

    • spare scratch chunks;
    • texture staging no list holds;
    • idle host lists;
    • the pipeline library's mapping.

    Idle copies then age out quickly for 3 s, and the creation is retried. This covers make_list, make_prelude, and upload/shared/uav buffers.

  • Refused Close. A host list whose Close is refused for lack of memory is left out of its submission instead of ending the run.

  • Idle host lists scale with shared memory. The pool keeps 256 lists under 70 % of the shared budget, 96 under 86 %, 32 under 92 %, and none above. The pool is trimmed when the level drops. VICTORY_LIST_POOL_MOST=<n> fixes the count.

  • Texture room. The default goes from 90 % to 85 %, leaving card room for the above.

Measured

Run Result
Before crash at world entry
Windows on the card only, pool of 512 13–14 fps, crash after about 1 min (shared memory full)
VICTORY_LIST_POOL=0 stable, 4.5 fps
Pool of 96 stable for 8 min, 10–11 fps, shared memory 5.8 GB
This PR (adaptive pool) stable, 9.5–11.4 fps in the prologue, shared memory 5.6–6.1 GB
Non-Safe settings (THIN …) on this PC still out of memory, and slower (5–8 fps)

On machines with 32 GB of RAM or more, nothing should change: the pool stays at 256 lists, and windows only use card space while it is free. That is untested here.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5503281550 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/92). Originally posted by [TheHoracio](https://github.com/TheHoracio) on 2026-11-26T03:09:58Z. --- Thanks for this fork. On a 16 GB machine it ran out of memory in the world. These changes make it run stable there. They are measured on one PC only. **PC:** - RX 7800 XT 16 GB, Ryzen 7 9800X3D, 16 GB RAM with a 64 GB page file; - Windows 11, 1080p (`VICTORY_DISPLAY_MODE=1920x1080`), Series X profile; - `play.ps1 -Safe` settings. ### The problem The PC's memory shared with the card is half the RAM, so 7.1 GB here. It filled at world entry, mostly with 4 MiB windows of title memory (2.7–3.8 GB) and with idle host lists' command allocators. List creation or `Close` then failed with E_OUTOFMEMORY: - "no host list for a state prelude"; - "a host command list did not close". The card itself still had several GB free. ### What changed - **Windows on the card.** Windows of title memory go to a GPU upload heap (Resizable BAR) first, while the card is under 85 % of its budget. Then they go to shared memory, then to the card up to 92 %. `VICTORY_WINDOWS_VRAM=0` keeps them in shared memory only; `=late` uses the card only after shared memory refuses. Windows are only written by the CPU here: the log showed 0 MB a frame compared on the CPU. - **Upload buffers.** When PC memory refuses an upload buffer, it falls back to a GPU upload heap, up to 95 % of the card's budget. - **Relief and retry.** On a refusal, `relieve` / `again_on_oom` / `again_while_none` free what is held in reserve: - spare scratch chunks; - texture staging no list holds; - idle host lists; - the pipeline library's mapping. Idle copies then age out quickly for 3 s, and the creation is retried. This covers make_list, make_prelude, and upload/shared/uav buffers. - **Refused `Close`.** A host list whose `Close` is refused for lack of memory is left out of its submission instead of ending the run. - **Idle host lists scale with shared memory.** The pool keeps 256 lists under 70 % of the shared budget, 96 under 86 %, 32 under 92 %, and none above. The pool is trimmed when the level drops. `VICTORY_LIST_POOL_MOST=<n>` fixes the count. - **Texture room.** The default goes from 90 % to 85 %, leaving card room for the above. ### Measured | Run | Result | |---|---| | Before | crash at world entry | | Windows on the card only, pool of 512 | 13–14 fps, crash after about 1 min (shared memory full) | | `VICTORY_LIST_POOL=0` | stable, 4.5 fps | | Pool of 96 | stable for 8 min, 10–11 fps, shared memory 5.8 GB | | **This PR (adaptive pool)** | **stable, 9.5–11.4 fps in the prologue, shared memory 5.6–6.1 GB** | | Non-Safe settings (THIN …) on this PC | still out of memory, and slower (5–8 fps) | On machines with 32 GB of RAM or more, nothing should change: the pool stays at 256 lists, and windows only use card space while it is free. That is untested here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TheHoracio commented 2026-11-26 03:25:02 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by TheHoracio on 2026-11-26T03:25:02Z.


Follow-up commit: the texture room default is back to 90 %. At 85 %, textures waited for room on the card. With 90 %, no pass went without room, and a 7-minute run on the same 16 GB PC stayed stable at 9.6–11.5 fps. List Reset is now also retried on out-of-memory. One more finding: an idle host list holds about 2–3 MB of shared memory here.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7181699741 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/92#issuecomment-7181699741). Originally posted by [TheHoracio](https://github.com/TheHoracio) on 2026-11-26T03:25:02Z. --- Follow-up commit: the texture room default is back to 90 %. At 85 %, textures waited for room on the card. With 90 %, no pass went without room, and a 7-minute run on the same 16 GB PC stayed stable at 9.6–11.5 fps. List Reset is now also retried on out-of-memory. One more finding: an idle host list holds about 2–3 MB of shared memory here.
HrHd commented 2026-11-26 06:13:53 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by HrHd on 2026-11-26T06:13:53Z.


Confirmed from a small PC, in case it helps the 16 GB thread: with both halves of this applied the tree no longer stops at 0x8007000E in the load the old way, but on an RTX 4060 Ti 8 GB / 15.7 GB RAM it then removes the device (0x887A0006) as soon as the world is entered — frame 4092, VRAM 3.1 GB of 8 GB, working set 7.4 GB, so it is not raw capacity.

Switches used alongside it: play.ps1 -Safe plus VICTORY_KEYS_LIVE (to press pad A into the world without a person) and our clamp VICTORY_RENDER_SCALE=2; the page file is 48 GB allocated, with a 13.5 GB peak seen, so that is not the limit either.

Without this change the same configuration dies earlier, at make_prelude (0x8007000E), so it does move the wall — just not past world entry on 8 GB.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7184221699 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/92#issuecomment-7184221699). Originally posted by [HrHd](https://github.com/HrHd) on 2026-11-26T06:13:53Z. --- Confirmed from a small PC, in case it helps the 16 GB thread: with both halves of this applied the tree no longer stops at `0x8007000E` in the load the old way, but on an **RTX 4060 Ti 8 GB / 15.7 GB RAM** it then removes the device (`0x887A0006`) as soon as the world is entered — frame 4092, VRAM 3.1 GB of 8 GB, working set 7.4 GB, so it is not raw capacity. Switches used alongside it: `play.ps1 -Safe` plus `VICTORY_KEYS_LIVE` (to press pad A into the world without a person) and our clamp `VICTORY_RENDER_SCALE=2`; the page file is 48 GB allocated, with a 13.5 GB peak seen, so that is not the limit either. Without this change the same configuration dies earlier, at `make_prelude` (`0x8007000E`), so it does move the wall — just not past world entry on 8 GB.
avatarmanz commented 2026-11-26 07:35:56 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:35:56Z.


Left open: VICTORY_WINDOWS_VRAM defaults to 2 (windows in GPU upload heaps) and the out-of-memory retries sleep on the render path; needs an in-game check on the 7900 XTX and a 16 GB PC first.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7185629109 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/92#issuecomment-7185629109). Originally posted by [avatarmanz](https://github.com/avatarmanz) on 2026-11-26T07:35:56Z. --- Left open: VICTORY_WINDOWS_VRAM defaults to 2 (windows in GPU upload heaps) and the out-of-memory retries sleep on the render path; needs an in-game check on the 7900 XTX and a 16 GB PC first.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
avatarmanz/VIctory-7900XTX!92
No description provided.