D3D12.X: memory by owner counts the D3D12 heaps' charge to commit #3344
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3344"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by cj-tomlin on 2026-11-29T09:39:03Z.
Stacked on #3343; only the top commit (
0f0cc342) belongs here.Windows charges a process's D3D12 heaps, local and non-local, to its commit, so
memory by ownerleft them in commitotherand counted them a second time under video memory. A newD3D12 heapscommit part is both DXGI segments' usage less the committed windows the GPU reads in place (imported, or remade as a driver heap on NVIDIA), which theUMA windowpart already has. A shadowed window is a separate copy in video memory and is not subtracted. Part of #3211 (C).The part and
uma_imported_bytes()come from #2697 (@joeypercia), adapted tomain's per-window heap list. #2999 carries them too but conflicts withmain; I asked there before opening this, and will close this if #2999 is rebased first.What is in it
hle/d3d12x/real.rs:uma_imported_bytes(), the bytes of the committed windows inUMA_HEAPS, 0 when shadowed or before they are openedhle/d3d12x/memory_report.rs:heap_charge()and theD3D12 heapspart; a unit test ofheap_charge, and the device test expects the new partTested
cargo test --workspace --no-fail-fast -- --test-threads=4at0f0cc342: 2,620 passed, 0 failed, 49 ignored (41 targets)D3D12 heapspart against VMMap's write-combined private regions, and commitotheragainst VMMap's private memory less the UMA window, sparse CPU copy and write-combined regions (MB):D3D12 heapsotherBefore this,
otherat 64 s would have been 16,511 MB. Snapshots taken while the system was paging came back partial and are left out. AVirtualAlloctrace of an earlier run (#3211) put 19,470 MB of commit ondxgmms2.sysagainst 19,468 MB of local + non-local.Regression run
A retail title, 120 s,
XCL_PREPARE=0,XCL_PRESS_AT=25:A(loads a save into the world), the same DXIL cache copy and data root for both.Not tested
XCL_UMA_SHADOW=1),XCL_UMA_DRIVER=mixed, other NVIDIA driversAI use
main, wrote the tests, ran the tests, title runs and smoke runs, wrote this description. I checked the diff and the results.🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by minimalhipster990 on 2026-11-29T17:16:11Z.
RTX 4090 24 GB, 32 GB RAM, retail world to device removal: with this PR
otherends at 15.8–18.2 GB, against 33–36 GB in six earlier runs of the same setup without it, andD3D12 heapsends at 18.8–19.2 GB. These runs go well past 110 s (to 268 and 437 s), on a card where video memory alone is 17.5 GB.Setup
--locked.main7a649b0e+ #3318 headf5496479(without it this title does not reach the world onmainwithXCL_GFX_PSO_WAIT_MSset) + this PR's head0f0cc342. Clean merges, local commit966f035b.cargo test --release --locked -p xcl --lib memory_report -- --test-threads=1: 5 passed, 0 failed (includingsnapshot_does_not_initialize_uma,heap_charge_is_both_segments_less_the_windows_read_in_placeanddevice_snapshot_has_budget_and_all_ownerson the 4090).XCL_ACTIVITY=1 XCL_GFX_PSO_WAIT_MS=50 XCL_CS_PSO_WAIT_MS=200 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=3990 XCL_TWO_PASS_MB=3072,XCL_PREPARE=0.memory by owner, commit parts (MB), from the 2 s lines nearest each time. The in-place windows come to 3,989–3,990 MB here (local + non-local −D3D12 heaps), so theUMA windowpart is not counted twice.D3D12 heapsotherD3D12 heapsotherUMA window(3,990) andsparse CPU copy(5,573) are flat in both runs.otherat 60 s is 6.4–7.0 GB, close to the 6.9 GB at 64 s in the description on an RTX 3080. After 110 s it keeps rising, to 15.8–18.2 GB: +2.8–5.3 GB from 110 s to the end, beside +3.8–4.3 GB ofD3D12 heaps.System commit. The rest of the system holds a steady 12.4–12.9 GB of commit. So on this 32 GB PC, system commit is at its limit once the process holds ~43–44 GB.
0x887A0005) with 3.6–4.2 GB left, with no DRED breadcrumbs. Run A reached the world at 310.3 s; run B did not (last present 267.8 s).mainruns without #3318 were removed at 133–144 s with 1.2–1.7 GB left, before the page file had grown at all.Not tested: VMMap or a
VirtualAlloctrace (no admin shell on this PC), AMD, this PR onmainalone, withoutXCL_UMA_WINDOWS=16/XCL_HEAP_WINDOWS=1, and a fixed-size page file.AI use: Claude Code (Claude Opus 5.5) built the tree, ran the tests and the replays, and wrote this report. The person running these tests asked for it.
Imported from ivall/xcl. Originally posted by cj-tomlin on 2026-11-30T16:39:39Z.
Closing as a duplicate: #3229 (merged) adds the same D3D12 heaps commit part and also covers the mixed and legacy UMA modes.
Pull request closed