Repository navigation
D3D12.X: report UMA DXGI backing and D3D12 heap commit without allocating UMA - #3229
Conversation
…ting UMA Follow-up to xcl-dev#2697 and part of xcl-dev#3211 (Workstream C): - Add uma::existing() so memory_report::snapshot() never initializes the coherent UMA window before the title does. - Track coherent UMA bytes backed by DXGI per device (handling driver CUSTOM L0, mixed GPU_UPLOAD+L0, legacy OpenExistingHeapFromAddress, and shadowed windows without double counting). - Report D3D12 heaps on Commit (local + non-local minus shared coherent UMA) and the coherent UMA window on its DXGI segment.
|
merge-check |
|
merge-check claim |
|
merge-check |
Follow-up to #2697; part of #3211 (Workstream C) and #1773.
On current
main,memory_report::snapshot()callsuma::get(), which can allocate and commit the coherent UMA window on a fresh process before the title asks for it (noted by@thehollowedoneon #2697). It also leaves both WDDM's commit charge for D3D12 heaps and the DXGI-backed coherent UMA window unattributed insideother.This PR adds a read-only
uma::existing()accessor, tracks per-device coherent UMA bytes counted by DXGI across allopen_umamodes (driver CUSTOM L0,mixed:GPU_UPLOAD + L0, legacyOpenExistingHeapFromAddress, and shadowed windows without double counting), and reportsD3D12 heapsonCommitplusUMA windowon its DXGI segment.What is in it
crates/xcl/src/gpu/uma.rs: adduma::existing()returning the initializedUmawithout allocating one.crates/xcl/src/hle/d3d12x/real.rs: record per-device coherent UMA(non_local, local)bytes backed by DXGI inopen_uma(0 for shadowed windows whose CPU and GPU allocations are separate) and exposeuma_dxgi_bytes_for(device).crates/xcl/src/hle/d3d12x/memory_report.rs: switchsnapshot()touma::existing(), addD3D12 heaps((local + non_local).saturating_sub(uma_dxgi_shared)) onCommitandUMA windowon its DXGI segment (UMA window (local)whenmixed:placesGPU_UPLOADsegments in local VRAM), plus unit tests and a child-process regression provingsnapshot()does not initialize UMA.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), debug + release.cargo test -p xcl --lib memory_report -- --nocapture --test-threads=1: 5 passed, 0 failed, 0 ignored (0 skipped).cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 2,596 passed, 0 failed, 49 ignored across 41 test targets.SKIPPEDGPU tests (30 total): 21no wave64(NVIDIA wave32 adapter), 4no D3D12 debug layer / Developer Mode(0x887A002D/ missingd3d12SDKLayers.dll), 3per-lane f16/f32 refused (#1426), 2no heap windows.dc7b94e1, 60 sXCL_ACTIVITY=1 XCL_PREPARE=0, NVIDIA driver CUSTOM L0 UMA): at t=60 s,commit otherdropped from9235 MB(main7db2f391) to2799 MB(D3D12 heaps 6812), andnon-local otherdropped from4765 MBto754 MB(UMA window 4095).Regression run
mainbaseline (XCL_PREPARE=0):PR head (
XCL_PREPARE=0):Not tested
non_local.budget == 0),XCL_UMA_DRIVER=mixed:...,XCL_UMA_SHADOW=1, and Wine on live hardware (covered by unit tests only).AI use
#2697/ currentmainUMA paths, wrote the code, unit tests, and PR description, and ran the workspace tests and smoke runs locally; the human contributor (lnqigr) directed the scope and reviewed the diff and results before opening the PR.