Skip to content

D3D12.X: the log shows what memory is left when video memory is refused - #2317

Open
427001 wants to merge 1 commit into
xcl-dev:mainfrom
427001:memory-line-system-commit
Open

427001 wants to merge 1 commit into
xcl-dev:mainfrom
427001:memory-line-system-commit

Conversation

@427001

@427001 427001 commented Nov 25, 2026 •

Copy link
Copy Markdown

When a pool heap for title textures is refused, the log says "no video memory for more pages of title textures", and the XCL_ACTIVITY memory line gives the process's commit and the video memory in use. Neither says what ran out: the card, the memory the system shares with it, or the system's commit, which a PC charges video memory to as well. The warning and the memory line now also give the system's free commit with its limit, and the video memory budgets. Logging only. Part of #333.

Correction (same day): this description and the first commit message said the heap was refused "only when its commit was used up". Runs with a larger page file show that was wrong for this machine. The commit is amended (c2f4abc → 70a26dd: corrected message, and the non-local figures added) and the text below is from the new runs.

What the figures show on a 10 GB card with 16 GB of RAM, in three runs to the title's stop at +0x193e00f (#333): the first refusal comes with 779 MB of commit free in one run and with 31 764 MB and 32 252 MB free in the two others, each time at 12 541 – 12 552 MB of local video memory in use against a budget of about 9.3 GB. So there the commit is not what stops it; before, the log could not tell the two cases apart.

What is in it

  • crates/xcl/src/gpu/uma.rs: system_commit(), the system's free commit and its limit.
  • crates/xcl/src/hle/d3d12x/real.rs: video_memory() returns the budget next to the bytes in use, for local and non-local memory; memory_left() puts the figures into one string for a log line.
  • crates/xcl/src/hle/d3d12x/vram.rs: the warning of a refused pool heap ends with memory_left().
  • crates/xcl/src/host.rs: the memory line ends with ; system commit N MB free of M MB; video memory budgets L MB local, K MB non-local. The start of the line, which scripts/smoke.ps1 reads, is unchanged.

Tested

  • NVIDIA GeForce RTX 3080 10 GB (32-lane waves), driver 616.92; Intel Core i9-10900K; 16 GB RAM; Windows 11 Pro 26200.9974; rustc 1.100.0 stable-x86_64-pc-windows-msvc; tests in debug, runs in release.

  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4 on 70a26dd: 1254 passed, 0 failed, 46 ignored. 27 SKIPPED lines of 17 tests: 20 "no wave64", 3 per-lane f16 forms refused, 1 "no heap windows", 2 without the D3D12 debug layer, 1 that cannot turn the driver cache off (no Developer Mode).

  • The new lines at the stop, retail title 1.0.2.1, Series S profile, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PRESS_A_AT=40,55. These runs are not of this head: main does not get that far on this profile, so they are of this change applied to a local merge of main 379725a + kernelx: XMemMapPhysicalPagesScatter with no page array unmaps #495 + D3D12.X: composite multi-plane PresentX overlays #615 (runs 1 and 2 with the first version of the change, which had no non-local figures).

    Run 1, system-managed page file, other programs holding about 15 GB of commit:

[  145.248] D3D12.X: no video memory for more pages of title textures (… (0x8007000E)); system commit 779 MB free of 41243 MB, local video memory 12549 MB in use of a 9260 MB budget

Run 2, after a reboot with a fixed 48 GB page file:

[  127.328] D3D12.X: no video memory for more pages of title textures (… (0x8007000E)); system commit 31764 MB free of 65407 MB, local video memory 12541 MB in use of a 9285 MB budget

Run 3, the same machine state, this head's lines:

[  152.262] memory: 26260 MB committed by the process; video memory 12551 MB local, 4708 MB non-local; … ; system commit 31435 MB free of 65407 MB; video memory budgets 9282 MB local, 7465 MB non-local
[  153.475] D3D12.X: no video memory for more pages of title textures (… (0x8007000E)); system commit 32252 MB free of 65407 MB, video memory in use: 12552 MB local of a 9285 MB budget, 4708 MB non-local of a 7465 MB budget

The title stops at +0x193e00f at 145.5 s, 127.4 s and 153.6 s. A run without this change stopped the same way with 12 557 MB of local video memory in use at its last memory line.

Regression run

main (379725a):

xcl-smoke v1
commit: 379725aefffe3023696f2f8c784315f7a6fbc318
gpu: NVIDIA GeForce RTX 3080
title: 7da7e06c
seconds: 60
exit: 0x0
frames shown: 1219 (PresentX 1219)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19462 MB

this PR's head (70a26dd):

xcl-smoke v1
commit: 70a26dd652a6e2e7d8cd3b5519b42b3240bf2ad6
gpu: NVIDIA GeForce RTX 3080
title: 7da7e06c
seconds: 60
exit: 0x0
frames shown: 1233 (PresentX 1234)
presents per 2 s (last 3): 59 61 60
device removals: 0
crashes: 0
peak commit: 19434 MB

Both with the Series S profile, after the reboot. 60 s stay in the title's first screens: the memory line is reached (30 times), the warning is not.

Not tested

  • The warning on this head itself (see Tested); AMD and Intel GPUs; a machine where the commit is what runs out at the refusal (run 1 came close: 779 MB free, and the same stop).
  • Why the refusal comes at 12.5 GB of local video memory on this 10 GB card. A guess from the figures, not checked: what is over the card's own 10 053 MB (about 2.5 GB) plus the 4.7 GB of non-local memory comes to 7.2 GB, close to the 7.5 GB non-local budget.
  • Other places that report E_OUTOFMEMORY (CreatePlacedResourceX … a resource of its own (0x8007000e), the sparse pools) are unchanged.

AI use

  • Claude Code with Claude Fable 5.2: wrote the change and this description, made the test and title runs reported here, and drew the first, wrong conclusion that the correction above takes back.

🤖 Generated with Claude Code

@oni-swr

oni-swr commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

CPU-only review and test report for c2f4abc82c37b70f2c6e873d722e5bfe4bab8a6a (this PR's head), for #1607. GPU tests and scripts/smoke.ps1 were not run.

Tested

  • Windows 11 build 26200, AMD Ryzen 7 5700X3D, rustc/cargo 1.100.0 MSVC, debug, own target dir.
  • Read the full diff (4 files, +35/-7). It merges with main 06c9f55 without conflicts (the PR's base is 379725a; only host.rs auto-merged).
  • On that merge: cargo test -p xcl --lib --no-run builds, and cargo check --workspace --all-targets finishes with no new warning in the changed files. video_memory() has no other caller than host.rs and memory_left().
  • cargo test -p xcl --lib -- gpu::uma::tests hle::d3d12x::real::big_compile_tests --skip gpu_: 23 passed, 0 failed, 0 ignored, no SKIPPED line. I picked these two modules because they hold the changed uma.rs/real.rs code's neighbours and I checked that none of them creates a D3D12 device. The PR adds no test (logging only), so these show it breaks nothing there, not that the new strings are right.
  • scripts/smoke.ps1 still matches the changed line: it reads memory: N MB committed, and the start of the line is unchanged.

Review notes (not blockers)

  • host.rs prints system commit 0 MB free of 0 MB when system_commit() is None, while memory_left() says system commit not known.
  • memory_left() makes a DXGI factory on each refused heap. The description reports 170 refusals in one run; that is cheap next to the failed CreateHeap, but it is a call per refusal.

Not tested

  • Any GPU test, any D3D12 path, a smoke run, the refusal path itself, AMD/Intel behaviour of QueryVideoMemoryInfo. The xcl-smoke blocks in the description were not checked by me.

AI use

  • Claude Code (Claude Sonnet 5.5) read the diff, ran the commands and wrote this report.

When a pool heap for title textures is refused, the log said "no video
memory for more pages of title textures", and the activity line gave the
process's commit and the video memory in use. Neither says what ran out:
the card, the memory the system shares with it, or the system's commit,
which a PC charges video memory to as well.

The warning now ends with the system's free commit and its limit, and the
local and the non-local video memory in use with their budgets. The
activity line (XCL_ACTIVITY) gets the commit and the two budgets at its
end; what scripts/smoke.ps1 reads from it is unchanged.

What they showed in runs of a retail title on a 10 GB card with 16 GB of
RAM (a local tree with xcl-dev#495 and xcl-dev#615, Series S profile), up to the title's
own check at +0x193e00f (xcl-dev#333): the first refusal came with 779 MB of
commit free in one run and with 31764 MB and 32252 MB free in two runs with
a larger page file, each time at 12541 - 12552 MB of local video memory in
use against a budget of 9260 - 9285 MB. In the last run non-local video
memory stood at 4708 MB of a 7465 MB budget. So the commit is not what
stops that machine, which the first run alone suggested.

Logging only: no test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@427001
427001 force-pushed the memory-line-system-commit branch from c2f4abc to 70a26dd Compare November 25, 2026 14:17
@427001 427001 changed the title D3D12.X: the log shows the system's commit when video memory is refused D3D12.X: the log shows what memory is left when video memory is refused Nov 25, 2026
@nnonno91

Copy link
Copy Markdown

Independent Windows activity-log verification of 70a26dd652a6e2e7d8cd3b5519b42b3240bf2ad6 on Radeon integrated graphics and RTX 5090.

Tested

  • Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, SDK DXC/DXIL 1.8.2502.11, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and RTX 5090 driver 32.0.16.1742.
  • cargo build --locked --workspace passed. I temporarily held the bundled test title for 2.6 s at its normal exit and added an assertion on the activity log to the existing e2e fixture. XCL runtime source was unchanged. Ran cargo test --locked -p xcl --test e2e test_title_draws_with_a_root_signature_under_the_debug_layer -- --exact --nocapture --test-threads=1 with XCL_ACTIVITY=1, XCL_NETWORK=0 and each adapter selected by XCL_ADAPTER. Each run gave 1 passed, 0 failed, 0 ignored and no skips. Both temporary test edits were restored.
  • Each run emitted two memory lines with the existing usage figures followed by free/total system commit and both video memory budgets. At the first sample the Radeon reported 3587 MB free of 68630 MB and budgets of 15665 MB local, 0 MB non-local. The RTX 5090 reported 3016 MB free of 68630 MB and budgets of 24086 MB local, 15179 MB non-local.

Not tested

A refused heap allocation, a retail title and the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) adapted the test fixture, ran the checks and wrote this report.

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants