Memory: the machine's memory in the log and the texture cap, a warning while commit is nearly spent #241

Open
github-bot wants to merge 2 commits from github-bot/gh-241 into main AGit
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 08:56 UTC · original
MamaLeVrai:memory-pressure → main · +173 −6 · 3 files · 2 commits · open

Note (later the same day): with the paging file raised to 64 GiB, the same build lost the device in the same way (0x887A0007, DRED breadcrumbs (done/count, list) []) with commit at 42.7 of 98.2 GiB. That run is not clean, though: a victory-shader test run of mine, which dispatches on the same card, was going on during the whole session. So it neither confirms nor refutes the commit link. I will report a clean run (nothing else on the card) here.

What

The memory log and the streamed texture cap now take the whole machine's memory into account, not only the card's:

  1. The memory log names the machine's memory. Each line ends with machine: memory X of Y MiB in use, commit X of Y MiB in use (GlobalMemoryStatusEx: physical memory, and the commit limit, which is physical memory plus the paging files).
  2. The streamed texture cap follows the fuller of the two. It still steps 1024, 512, 256 at 70 % and 85 %, but the percent is now the larger of video memory in use and the machine's (physical memory or commit, whichever is fuller). Each change of the cap is logged once (streamed texture size cap changed).
  3. A warning while commit is nearly spent. With less than 4 GiB of commit left, the memory log warns, at most once a minute. The warning says allocations may fail and the device may be lost, and points to a larger paging file.
  4. The adapter's preemption granularity is logged once, after the device is made.

Files: memstat.rs (system_memory, system_memory_percent, commit_is_low, warn_if_commit_low), resource.rs (texture_cap, video_pressure_of, over_cap), host.rs (log_preemption).

Why

On a 32 GB machine with an RX 6950 XT (system-managed paging file), each host device loss so far (0x887A0007, then the title's int3 with E_OUTOFMEMORY from list.rs) came with the commit limit nearly reached:

  • two device losses on Nov 25, on an earlier main: the title reported 1.4 to 2.8 GiB of commit free at its crash;
  • one run today, on main 4f62c2a + #144 + #110 + #214 + this branch: the last memory line before the loss read commit 58743 of 59369 MiB in use, and the title reported 373 MB free. The loss came about 6 s after the world came on screen. The DRED data (#214) showed no page fault and no list in flight (breadcrumbs (done/count, list) []), and the System event log had no display driver reset.

That the loss is caused by the commit running out is not proven. But nothing in the log said memory was the tight resource: video memory was at 6.7 of 15.6 GiB. The new figures and the warning make that visible. Over the run, the commit limit grew from 52 to 59 GiB: Windows grew the paging file and could not keep up.

Tests

  • memstat::tests::commit_is_low_below_four_gib_left (new): the 4 GiB edge, and in use above the limit.
  • resource::tests::texture_cap_falls_as_memory_fills (new): the steps, and that the fuller of video and machine memory picks the cap.
  • resource::tests::the_machine_reports_its_memory (new): the figures are sane on the host (in use within total, commit limit at least physical memory).

cargo test --release -p victory-gpu --lib, twice: 115 passed, 1 failed, 4 ignored. The failure is list::tests::lists_are_cut_at_waits_that_follow_work, which fails the same way on main in release runs (fixed in #210). cargo clippy --release -p victory-gpu --all-targets --no-deps: nothing in memstat.rs.

The log lines (1, 2 and 4) were seen in a game run on the machine above. The cap went to 256 four seconds after start, because commit was already at 87 %. The warning (3) has not run in the game yet.

Not measured

  • Whether the lower cap at 87 % commit changes frame time or what the picture looks like.
  • The 4 GiB edge is a choice. The losses above came with 0.4 to 2.8 GiB of commit left.
  • In today's run the cap was already 256, and the device was still lost. The cap alone does not prevent the loss when the machine is this short of commit.

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

🤖 Generated with Claude Code

**@⁠MamaLeVrai** on GitHub · 2026-11-26 08:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/241) `MamaLeVrai:memory-pressure` → `main` · +173 −6 · 3 files · 2 commits · open > **Note (later the same day):** with the paging file raised to 64 GiB, the same build lost the device in the same way (`0x887A0007`, DRED `breadcrumbs (done/count, list) []`) with commit at 42.7 of 98.2 GiB. That run is **not clean**, though: a `victory-shader` test run of mine, which dispatches on the same card, was going on during the whole session. So it neither confirms nor refutes the commit link. I will report a clean run (nothing else on the card) here. ## What The memory log and the streamed texture cap now take the whole machine's memory into account, not only the card's: 1. **The memory log names the machine's memory.** Each line ends with `machine: memory X of Y MiB in use, commit X of Y MiB in use` (`GlobalMemoryStatusEx`: physical memory, and the commit limit, which is physical memory plus the paging files). 2. **The streamed texture cap follows the fuller of the two.** It still steps 1024, 512, 256 at 70 % and 85 %, but the percent is now the larger of video memory in use and the machine's (physical memory or commit, whichever is fuller). Each change of the cap is logged once (`streamed texture size cap changed`). 3. **A warning while commit is nearly spent.** With less than 4 GiB of commit left, the memory log warns, at most once a minute. The warning says allocations may fail and the device may be lost, and points to a larger paging file. 4. **The adapter's preemption granularity** is logged once, after the device is made. Files: `memstat.rs` (`system_memory`, `system_memory_percent`, `commit_is_low`, `warn_if_commit_low`), `resource.rs` (`texture_cap`, `video_pressure_of`, `over_cap`), `host.rs` (`log_preemption`). ## Why On a 32 GB machine with an RX 6950 XT (system-managed paging file), each host device loss so far (`0x887A0007`, then the title's int3 with `E_OUTOFMEMORY` from `list.rs`) came with the commit limit nearly reached: - two device losses on Nov 25, on an earlier main: the title reported 1.4 to 2.8 GiB of commit free at its crash; - one run today, on main 4f62c2a + #144 + #110 + #214 + this branch: the last memory line before the loss read `commit 58743 of 59369 MiB in use`, and the title reported 373 MB free. The loss came about 6 s after the world came on screen. The DRED data (#214) showed no page fault and no list in flight (`breadcrumbs (done/count, list) []`), and the System event log had no display driver reset. That the loss is caused by the commit running out is **not proven**. But nothing in the log said memory was the tight resource: video memory was at 6.7 of 15.6 GiB. The new figures and the warning make that visible. Over the run, the commit limit grew from 52 to 59 GiB: Windows grew the paging file and could not keep up. ## Tests - `memstat::tests::commit_is_low_below_four_gib_left` (new): the 4 GiB edge, and in use above the limit. - `resource::tests::texture_cap_falls_as_memory_fills` (new): the steps, and that the fuller of video and machine memory picks the cap. - `resource::tests::the_machine_reports_its_memory` (new): the figures are sane on the host (in use within total, commit limit at least physical memory). `cargo test --release -p victory-gpu --lib`, twice: 115 passed, 1 failed, 4 ignored. The failure is `list::tests::lists_are_cut_at_waits_that_follow_work`, which fails the same way on main in release runs (fixed in #210). `cargo clippy --release -p victory-gpu --all-targets --no-deps`: nothing in `memstat.rs`. The log lines (1, 2 and 4) were seen in a game run on the machine above. The cap went to 256 four seconds after start, because commit was already at 87 %. The warning (3) has not run in the game yet. ## Not measured - Whether the lower cap at 87 % commit changes frame time or what the picture looks like. - The 4 GiB edge is a choice. The losses above came with 0.4 to 2.8 GiB of commit left. - In today's run the cap was already 256, and the device was still lost. The cap alone does not prevent the loss when the machine is this short of commit. AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:00:21 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-26 08:56 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-26 08:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/241#pullrequestreview-6071060614) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 08:58 UTC · original

Note: this PR is against main. The default branch is now rx9070xt, which already has part of this in its own form: xmem::commit_refused writes the commit in use and the limit to crashes.log when a commit is refused at the limit, and copystat reads the machine's free memory. What is not there is the texture cap following the machine's commit, and a warning before the limit is reached. If that is wanted on rx9070xt, I can port it there.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-26 08:58 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/241#issuecomment-7187248796) Note: this PR is against `main`. The default branch is now `rx9070xt`, which already has part of this in its own form: `xmem::commit_refused` writes the commit in use and the limit to `crashes.log` when a commit is refused at the limit, and `copystat` reads the machine's free memory. What is not there is the texture cap following the machine's commit, and a warning before the limit is reached. If that is wanted on `rx9070xt`, I can port it there. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 19:27 UTC · original

Update: the run with the 64 GiB paging file (device lost with commit at 42.7 of 98.2 GiB) is not clean. A victory-shader test run of mine, which dispatches on the same card, was going on for the whole game session, so that loss may have been caused from outside the game. It neither confirms nor refutes the commit link. I have corrected the note at the top of the description, and I will post a clean run.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-26 19:27 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/241#issuecomment-7201610253) Update: the run with the 64 GiB paging file (device lost with commit at 42.7 of 98.2 GiB) is not clean. A `victory-shader` test run of mine, which dispatches on the same card, was going on for the whole game session, so that loss may have been caused from outside the game. It neither confirms nor refutes the commit link. I have corrected the note at the top of the description, and I will post a clean run. AI-assisted (Claude Code); no game data.
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/241/head:github-bot/gh-241'
git switch 'github-bot/gh-241'

Merge

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