Repository navigation
Conversation
|
Tested Exact I ran
The process readbacks distinguished Not tested Device or GPU behavior, heap allocation or fallback, tile mapping, VRAM accounting, production logging, performance, retail smoke, and the full suite. AI use T3 Code through the Codex harness ( |
|
RX 7800 XT comparison I compared release builds of the latest Hardware: RX 7800 XT, AMD driver Common settings:
The PR log confirms the cap setting and reports local sparse pools staying at 1,024 MB. The drop in local video memory and rise in non-local use are consistent with overflow to system memory. These counters do not directly count L0 heaps. Both runs ended at the same earlier BVH builder exception, so this test shows the memory cap taking effect on RDNA3, not improved world-load progress. With one run per revision, I cannot attribute the frame-count difference to the PR.
Driver compile starts without a logged finish at exit: amd-dev baseline, one MS PSO (339,108 B DXIL); PR, two MS PSOs (376,292 B and 265,320 B DXIL). Those start lines contain no hashes and do not establish a driver hang. AI use: OpenAI Codex (GPT-6) verified the commits, prepared the builds and runs, analyzed the logs, and drafted this report. I ran the test on my PC. |
5ca7677 to
b007712
Compare
|
Related, not the same: #2987 (against main) puts sparse tiles outside the title's GPU heaps into L0 system-memory pools ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
Review (head b007712, diff read, not a merge-check; draft, base
Fine: off when unset (parsing checked by JJAutoCompare), retired heaps are reused only for the same kind, and a failed L0 heap creation falls back to video memory. #3335 / #3039 put texture levels in system memory, a different path; #2987 (main) overlaps in what it does. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
…o L0 system memory With XCL_SPARSE_VRAM_CAP_MB=<N> set (unset: no change), sparse pool heaps past N MiB of local video memory are allocated in custom L0 write-back system memory. Video-memory pool counts exclude L0 pools, and memory_report exposes them on the non-local side as "sparse pools in system memory". Retired pool reuse matches the heap kind, and a failed L0 heap allocation falls back to video memory. Assisted-by: Antigravity (Gemini 4 Neon High)
b007712 to
a0f65e2
Compare
|
Rebased onto
Note: first-come placement past the cap remains intentional for this opt-in MiB cap (workload-aware placement is tracked separately by #2987 and #3587). |
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range allocates a local VRAM tile, copies the 64 KiB tile bytes from L0 to local on Pages::queue (via lazily-created 0-VRAM reserved scratch textures), promotes the page in-place, cools the old L0 tile, remaps any live mapped aliases in Pages::targets, and marks any pending HeldUnmap referencing that page stale so cancelling it in remap_if_unmapped re-maps onto the promoted local tiles. Non-OOM adapter refusals of custom L0 heaps are cached per heap class. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
Adds opt-in
XCL_SPARSE_VRAM_CAP_MB=<N>(unset: no change). OnceNMiB of sparse pool heaps live in local video memory, further 4 MiB sparse pools are allocated asD3D12_HEAP_TYPE_CUSTOM(write-back,MEMORY_POOL_L0) system memory, keeping an 8 GB card under its DXGI local budget when sparse pools grow large. IfCreateHeapfor an L0 pool fails, aDEFAULTpool is made as before.TL;DR — Before vs After
41aa60ce, cap unset)maind8bd9a38)a0f65e2f)XCL_SPARSE_VRAM_CAP_MB=1024, moombathepilot)b0077129)memory_report& GPU overflow testmemory_report; no overflow test"sparse pools in system memory"onNonLocal+ GPU testRebased onto
amd-dev41aa60ce(replacingb0077129): resolves theretiredtuple conflict, exposes L0 sparse pools inmemory_report.rs, and adds unit + GPU tests covering parsing, L0 overflow allocation, retired-pool kind matching, and split memory reporting.What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:parse_sparse_vram_cap_pools/sparse_vram_cap_pools,State::pool_is_sys(parallel topools),retiredentries carryis_sysso retired pools are only reused for the same kind,take_tile_with_capoverflows past the cap toCUSTOM/L0withDEFAULTfallback,pool_bytes()counts only local VRAM pools/tiles,State::memory_bytes/memory_bytes_forsplits local VRAM pools from L0 system-memory pools, plus unit (sparse_vram_cap_parses_pool_counts) and GPU (sparse_vram_cap_overflows_to_l0_and_reports_separately) tests.crates/xcl/src/hle/d3d12x/memory_report.rs: reports"sparse pools in system memory"onKind::NonLocaland updatesdevice_snapshot_has_budget_and_all_owners.XCL_SPARSE_SYSMEM, targetsmain); D3D12.X: XCL_VRAM_BUDGET keeps XCL's pools under the adapter's budget #3587 (XCL_VRAM_BUDGET) targets texture page pools by DXGI budget headroom; this PR is an explicit MiB cap for sparse buffer pools onamd-dev.Tested
32.0.21045.29003), AMD Ryzen 7 5700X, Windows 11,rustc 1.100.0 (0ef1bc386 2026-11-09), debug test build onorigin/amd-dev41aa60ce+ this commit.cargo test -p xcl --lib -- hle::d3d12x::sparse:: hle::d3d12x::memory_report --test-threads=4: 156 passed, 1 failed (sparse::tests::private_physical_pages_reach_the_gpu_on_mapping, pre-existing onorigin/amd-dev41aa60ce), 1 ignored, 0 SKIPPED. Both new tests (sparse_vram_cap_parses_pool_countsand GPU overflow/retirement/accounting testsparse_vram_cap_overflows_to_l0_and_reports_separately) pass, as doesmemory_report::tests::device_snapshot_has_budget_and_all_owners.7c795f5e(RX 6650 XT, 3 × 600 s, cap 1024 MB) and RDNA3 (moombathepilot, RX 7800 XT, cap 1024 MB: local sparse pools capped at 1,024 vs 2,236 MB, peak local VRAM 5,784 vs 6,896 MB) exercised the L0 overflow path in-game. On41aa60ce, the 60 s smoke below covers the unset (no-change) path and the GPU test above covers the L0 overflow + retirement +memory_reportsplit path.Regression run
Both 60 s runs with
scripts/smoke.ps1 -Seconds 60(XCL_PREPARE=0,XCL_NETWORK=0,XCL_ACTIVITY=1,XCL_SPARSE_VRAM_CAP_MBunset) on the same retail title and RX 6650 XT. Firstmaind8bd9a38, then this PR's clean heada0f65e2f:Not tested
cargo test --workspaceon this commit (targetedsparse+memory_reportsuite run instead), NVIDIA GPUs, RDNA4, Wine/Proton, and retail world soak withXCL_SPARSE_VRAM_CAP_MBset on41aa60ce.AI use
7c795f5e) was written and tested by Antigravity with Gemini 4 Neon (High). The port tof33df5a7was done by Claude Code (Claude Sonnet 5.5). This rebase toamd-dev41aa60ce,memory_reportL0 reporting, unit + GPU overflow tests, smoke run, and description update were done by Antigravity with Gemini 4 Neon (High).