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

Closed
github-bot wants to merge 2 commits from github-bot/gh-92 into main AGit
Owner

@⁠TheHoracio on GitHub · 2026-11-26 03:09 UTC · original
TheHoracio:memory-16gb → main · +406 −12 · 4 files · 2 commits · closed without merging

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

**@⁠TheHoracio** on GitHub · 2026-11-26 03:09 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/92) `TheHoracio:memory-16gb` → `main` · +406 −12 · 4 files · 2 commits · closed without merging 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)
On a 16 GB PC (RX 7800 XT 16 GB, Ryzen 7 9800X3D, 64 GB page file, 1080p,
Series X profile) the world crashed within seconds to a minute: the PC's
memory shared with the card (half the PC's, 7.1 GB) filled and a list could
not be made or closed ("no host list for a state prelude", "did not close",
E_OUTOFMEMORY). The card itself still had GBs free.

- Windows of title memory go to a GPU upload heap (Resizable BAR) first
  while the card is under 85 % of its budget, then to the shared memory,
  then the card up to 92 % (`VICTORY_WINDOWS_VRAM=0`: shared only, `late`:
  card only after a refusal). The CPU only writes windows here (0 MB a frame
  compared on the CPU).
- Upload buffers fall back to a GPU upload heap up to 95 % when the PC's
  memory refuses one.
- `relieve` / `again_on_oom` / `again_while_none`: on a refusal the spare
  scratch chunks, unheld texture staging, idle host lists and the pipeline
  library's mapping go, idle copies age out fast for 3 s, and the creation is
  tried again (make_list, make_prelude, upload/shared/uav buffers).
- 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 kept by how full the shared memory is: 256 under 70 %,
  96 under 86 %, 32 under 92 %, none above (`VICTORY_LIST_POOL_MOST=<n>`
  fixes it). Their command allocators live in that memory: 512 of them
  (the old fixed count) ran it out a minute into the world.
- Texture room default 90 -> 85 %, leaving card room for the above.

Measured on that PC with play.ps1 -Safe settings:
- before: crash at world entry (or after ~1 min at 13-14 fps with the
  windows change alone);
- after: 8-minute runs without a crash, 9.5-11.4 fps in the prologue,
  shared memory steady at 5.6-6.1 GB.
- `VICTORY_LIST_POOL=0` (no pool) was stable too, but at 4.5 fps.
- The non-Safe settings (THIN etc.) still ran out of memory and were
  slower there (5-8 fps).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Texture room default back to 90 %: at 85 % the textures waited for card
  room (2,040 passes made none, about 10,000 slots waiting, surfaces late)
  while the windows used the card. At 90 %: no pass without room, 600-2,500
  waiting while moving, still no out-of-memory in a 7-minute run (16 GB PC,
  9.6-11.5 fps in the prologue, shared memory 5.9-6.0 GB).
- A host list's Reset goes through `again_on_oom` as well: a run with
  `VICTORY_LEVELS_ON_DEMAND=1` (which filled the card to 97 % here) ended in
  "a host command list did not reset".
- When idle host lists are let go, the shared memory before and after is
  logged (first 40 times): about 2-3 MB a list on this PC (RX 7800 XT).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:32:02 +00:00
Author
Owner

@⁠TheHoracio on GitHub · 2026-11-26 03:25 UTC · original

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.

**@⁠TheHoracio** on GitHub · 2026-11-26 03:25 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/92#issuecomment-7181699741) 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.
Author
Owner

@⁠HrHd on GitHub · 2026-11-26 06:13 UTC · original

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.

**@⁠HrHd** on GitHub · 2026-11-26 06:13 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/92#issuecomment-7184221699) 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.
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:35 UTC · original

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.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:35 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/92#issuecomment-7185629109) 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.
github-bot closed this pull request 2026-11-27 07:58:18 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.