8 GB card / 16 GB RAM: prelude OOM retry, texture sweep off the frame, lighter memory line, replay cross-adapter fix #4305

Closed
leo-pansonato wants to merge 26 commits from upstream-pr/4305 into main
leo-pansonato commented 2026-11-30 18:39:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by leo-pansonato on 2026-11-30T18:39:21Z.


What it changes

Fixes and memory relief for an 8 GB card with 16 GB of RAM (RTX 5060 Ti, i5-14600KF). On that PC the process ran out of commit, stalled on its own bookkeeping, and sometimes crashed. Every change below is on by default and needs no switch.

  • State prelude: no more crash on E_OUTOFMEMORY.
    • Before: a prelude recording that hit 0x8007000E gave up the run ("host state prelude did not record").
    • Now: the spares no list holds are freed and the prelude is recorded again on a new allocator.
    • The last commit points that retry at the plan's uploads and detiles, because they moved into the prelude plan upstream.
  • Preludes: fewer are kept on small PCs (32 instead of 256), and they are let go under memory pressure.
  • Host lists:
    • their tables are trimmed on reset;
    • the pipeline names kept per list are capped, unless pipelines are metered.
  • Texture sweep: runs on a thread of its own instead of inside the frame. It used to hold a frame for up to 1.5 s.
  • Process heaps: under memory pressure, they give back the memory they keep free.
  • Memory line (procmem):
    • named no longer counts mapped sections;
    • lists and preludes are counted;
    • the line shows Windows' own figure for the card's memory;
    • the heap census and the address-space walk run at most once a minute (VICTORY_PROCESS_MEMORY_S, default 60 s). Walking every 5 s stalled the game for 1.5–2 s each time.
    • There is also a counter of hitches.
  • Replay: resources of heaps opened from title memory are made without D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER.
    • Those heaps lose their sharing flags in a capture, so creation failed with E_INVALIDARG, and the replay then hung the device (0x887A0006).
  • Commits: 12, rebased on e1251c31.

How it was tested

  • Profile: RTX 5060 Ti 8 GB, 16 GB RAM, Series S profile, 1080p to 1440p, DLSS performance, no frame generation.
  • Runs: 300 s each with the same scripted inputs, on the same scene (the boat scene).
  • Builds compared:
    • Before: upstream 84bd61e2 with its defaults.
    • After: these commits on top of 84bd61e2, with the same defaults.
  • Before: median fps 21.5 / 22.5 / 22.8 over three runs. Two more runs stopped early: 25 s and 129 s of play, with long stretches under 1 fps. Least free RAM was 16–340 MB.
  • After: median fps 22.5 / 23.3 over two runs, both completed. Per stretch, the opening ran at 33–36 fps and the boat at 18–25 fps.
    • fps is about equal to upstream; the gain is in stability and memory.
  • Not tested: the 30-series or AMD cards, and frame generation.
  • cargo test --workspace --locked: everything this PR touches passes. Two tests fail, and they fail the same way on a clean upstream/main (e1251c31):
    • list::thin::tests::bindings_record_no_work: 47 != 49;
    • shader_cache::tests::every_switch_of_the_translator_is_in_the_key.
  • cargo clippy --workspace --all-targets --all-features --locked: none of the warnings come from these commits. The five there are in upstream lines: copystat.rs:1470, host.rs:5252, shadow.rs:7211, xmem.rs:1933, lower.rs:114.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related, partly overlapping:

    This PR does not depend on any of them; whichever lands first, I can rebase the other side.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5571454087 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4305). Originally posted by [leo-pansonato](https://github.com/leo-pansonato) on 2026-11-30T18:39:21Z. --- ## What it changes Fixes and memory relief for an 8 GB card with 16 GB of RAM (RTX 5060 Ti, i5-14600KF). On that PC the process ran out of commit, stalled on its own bookkeeping, and sometimes crashed. Every change below is on by default and needs no switch. - **State prelude: no more crash on E_OUTOFMEMORY.** - Before: a prelude recording that hit `0x8007000E` gave up the run ("host state prelude did not record"). - Now: the spares no list holds are freed and the prelude is recorded again on a new allocator. - The last commit points that retry at the plan's uploads and detiles, because they moved into the prelude plan upstream. - **Preludes:** fewer are kept on small PCs (32 instead of 256), and they are let go under memory pressure. - **Host lists:** - their tables are trimmed on reset; - the pipeline names kept per list are capped, unless pipelines are metered. - **Texture sweep:** runs on a thread of its own instead of inside the frame. It used to hold a frame for up to 1.5 s. - **Process heaps:** under memory pressure, they give back the memory they keep free. - **Memory line (`procmem`):** - `named` no longer counts mapped sections; - lists and preludes are counted; - the line shows Windows' own figure for the card's memory; - the heap census and the address-space walk run at most once a minute (`VICTORY_PROCESS_MEMORY_S`, default 60 s). Walking every 5 s stalled the game for 1.5–2 s each time. - There is also a counter of hitches. - **Replay:** resources of heaps opened from title memory are made without `D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER`. - Those heaps lose their sharing flags in a capture, so creation failed with `E_INVALIDARG`, and the replay then hung the device (`0x887A0006`). - **Commits:** 12, rebased on `e1251c31`. ## How it was tested - **Profile:** RTX 5060 Ti 8 GB, 16 GB RAM, Series S profile, 1080p to 1440p, DLSS performance, no frame generation. - **Runs:** 300 s each with the same scripted inputs, on the same scene (the boat scene). - **Builds compared:** - Before: upstream `84bd61e2` with its defaults. - After: these commits on top of `84bd61e2`, with the same defaults. - **Before:** median fps 21.5 / 22.5 / 22.8 over three runs. Two more runs stopped early: 25 s and 129 s of play, with long stretches under 1 fps. Least free RAM was 16–340 MB. - **After:** median fps 22.5 / 23.3 over two runs, both completed. Per stretch, the opening ran at 33–36 fps and the boat at 18–25 fps. - fps is about equal to upstream; the gain is in stability and memory. - **Not tested:** the 30-series or AMD cards, and frame generation. - **`cargo test --workspace --locked`:** everything this PR touches passes. Two tests fail, and they fail the same way on a clean `upstream/main` (`e1251c31`): - `list::thin::tests::bindings_record_no_work`: `47 != 49`; - `shader_cache::tests::every_switch_of_the_translator_is_in_the_key`. - **`cargo clippy --workspace --all-targets --all-features --locked`:** none of the warnings come from these commits. The five there are in upstream lines: `copystat.rs:1470`, `host.rs:5252`, `shadow.rs:7211`, `xmem.rs:1933`, `lower.rs:114`. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related, partly overlapping: - #4204: procmem `named` count; - #2783 and #2877: the 5 s address-space walk; - #3858, #3578, #4138: texture sweep pacing or threading; - #4042 and #1397: prelude recording. This PR does not depend on any of them; whichever lands first, I can rebase the other side. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
trustno1-coder commented 2026-12-01 18:44:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:44:24Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321449933 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4305#issuecomment-7321449933). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:44:24Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

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
trustno1-coder/VIctory-NVIDIA!4305
No description provided.