D3D12.X: report.json keeps the memory by owner at its peak and at the end #2776
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2776
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2776"
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?
@joeypercia on GitHub · 2026-11-26 11:51 UTC · original
joeypercia:d3d12x-memory-table→main· +619 −11 · 13 files · 3 commits · openStacked on #2750 (itself on #2697); only the top commit belongs here.
report.jsongets the memory table workstream 1 of #2688 asked for: the snapshot by owner where video memory in use was highest, and the last one of the run, in MB. Runs can be compared from their reports instead of their logs. Part of #2688 (workstream 1, part 2 of the plan there).What is in it (one commit)
crates/xcl/src/hle/d3d12x/memory_report.rs:Recordis a snapshot as the report keeps it, with owned strings so the report can be read back: the second of the run, commit, video and non-local usage with their budgets, XCL's parts as (owner, memory, MB), and the rest of each total.Tableholdslastandpeak_video.notekeeps them, andtable()hands them to the report.crates/xcl/src/host.rs: theXCL_ACTIVITYthread takes one snapshot every 2 s. It logs that snapshot's line, as before, and now alsonotes it.crates/xcl/src/report.rs:memory_by_owner(with#[serde(default)]: older reports still read). The report copies what was kept and makes no DXGI call, because a crash report can be written from any thread. WithoutXCL_ACTIVITYthe table is empty.the_table_keeps_the_last_snapshot_and_the_peak_of_video_memory: a record's totals, budgets, parts and rests in MB; a JSON round trip; and that the table keeps the last snapshot and the one with the most video memory.The newer retail title on an RTX 4070 Ti 12 GB (
nvidia-devaf2cecc4with this stack, 1 GiB shader heap). The run ended in a device removal at 282 s, and the table was in the report all the same.peak_video:(
UMA windowappears twice: once in commit, as CPU memory, and once in non-local, where DXGI counts the imported window.)Tested
XCL_ADAPTER=Radeon. Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11. Debug builds for the tests, release for the runs.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4ond485694b:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way onmainon this iGPU (#2115).Regression run
RTX 4070 Ti (driver 621.40), release builds, 60 s each,
scripts/smoke.ps1 -Game <folder> -Title retail-titleon the newer retail title, with the same settings. Both ran with the NVIDIA shader-heap profile (#2590, 1 GiB) installed on this machine.mainb49be183(the base of the stack) and this PR's head (no uncommitted changes):main:
PR:
Not tested
table()usestry_lockand gives an empty table then, rather than waiting.XCL_ACTIVITY: no table, by design (a snapshot costs a DXGI query).AI use
@MatyEjsr on GitHub · 2026-11-26 12:03 UTC · original
Independent verification of PR #2776 at
d485694b216101c2d684d3395cfb93679cd39e56(stacked on #2750 / #2697, cleanly mergeable withmainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7) on an RTX 3090 24 GB.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)(x86_64-pc-windows-msvc), debug (test suite) and release (60 s smoke run), DXC1.9.2602.17(21d28f72).cargo build --workspace -j 8andcargo build --release --workspace -j 8: ok (exit 0).cargo test -p xcl --lib hle::d3d12x::memory_report::tests -- --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored (0.34 s), includingthe_table_keeps_the_last_snapshot_and_the_peak_of_video_memory.cargo test -p xcl --lib hle::d3d12x::resource_census::tests -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0.31 s).cargo test -p xcl --lib report::tests -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0.11 s).cargo test --workspace -j 8 --no-fail-fast -- --test-threads=8): 1439 passed, 0 failed, 47 ignored across 37 targets.SKIPPEDchecks on this host (28 total, not counted as GPU coverage):no wave64(21):gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole, 4 ingpu::recomp::lower::tests, 14 wave64 cases ingpu::recomp::lower_dxil::tests, and 2 ingpu::recomp::tests(gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).per-lane form: refused(3 sub-cases ingpu::recomp::lower_dxil::tests):f16_programs_on_the_gpu(f16 arithmetic, wave32;f16 packed, wave32) andf32_programs_on_the_gpu(f32 conversions, wave32).no heap windows(1):heap_window_out_of_memory_falls_back_to_the_switch_form(default env).no D3D12 debug layer/no d3d12SDKLayers.dll(3):test_title_draws_with_a_root_signature_under_the_debug_layer,test_title_runs_under_the_debug_layer_with_dred,uploads_start_from_each_subresources_state.report.jsonverification from the 60 sscripts/smoke.ps1run on RTX 3090 (XCL_ACTIVITY=1):memory_by_owner.last(seconds: 58.0293664) matches the final[58.029]memory by owner (MB):log line (commit_mb: 13983,video_mb: 6125,video_budget_mb: 23554,non_local_mb: 4688,non_local_budget_mb: 15298, all 14 owner entries, andother_mb: { "commit": 2330, "non-local": 463, "video": 842 }).memory_by_owner.peak_video(seconds: 34.0184304) retained the earliest snapshot that reached the6125 MBlocal video-memory plateau:Regression run
main (
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7):PR (
d485694b216101c2d684d3395cfb93679cd39e56):Not tested
commit_mb: nullwhenPrivateUsagereads 0), and crash-handlerreport.jsonemission on a live title fault.AI use
report.jsonagainstxcl.log, and drafted this report.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.