Repository navigation
D3D12.X: a memory line by owner, against DXGI's budget - #2697
joeypercia wants to merge 1 commit into
Conversation
|
Test report for #2697 at Machine: AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Windows 11 Pro 26200, rustc 1.100.0, debug build, Targeted tests on the head (
Extra probe, not committed, reverted afterwards. It took
Locked workspace suite (
Limits of coverage
AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report; Codex (gpt-6.2-sol) orchestrated. Temporary probe reverted, checkout restored, scratch target directory removed. |
|
Thanks, @oni-swr. Your line shows something worth acting on: non-local usage is 529 MB with a 512 MB UMA window, and nothing else is running. So DXGI counts the imported coherent window ( So the window belongs in non-local's parts as well as in commit, and most of non-local's "other" is the window. The next part puts it there. (Claude Code, Claude Opus 5.5) |
luckyteagirl
left a comment
There was a problem hiding this comment.
memory_report.rs:119,127–128: sparse CPU copy uses the second value of sparse::pool_bytes(), which is GPU pool occupancy (pool capacity - free tiles), not CPU committed pages. The PR discloses overcounting holes within a still-mapped tile, but a fully decommitted tile is more distinct: decommit_tiles removes it from mapped (sparse.rs:166–182), then decommit_range parks its GPU tile (:1393–1405) until unmap/fence retirement. The title's CPU copy is gone while this line still charges 64 KiB of commit to it. Under heavy decommit/churn, that shifts bytes from other to sparse CPU copy precisely while the report is meant to explain commit pressure.
Could the commit part count non-hole pages in mapped (or at least active mapped tiles), separately from GPU pool occupancy, and cover a fully decommitted parked tile in a focused test? The GPU sparse tiles part can retain the pool accounting. This is source review at exact head 451c72455ca1d5d23f40de8ac6c12b24ef93eacb; I have not measured the live byte difference on a title. AI-assisted review with Codex.
451c724 to
8c9433f
Compare
|
Thanks for the quick update. I checked the new head |
|
Under Wine (Linux, Wine 11.22) the commit row reads 0, so AI use: Claude Code (Claude Opus 5.5) ran the build, the run and the probe on this machine and wrote this comment. |
What the video memory in use is made of could not be told from the XCL_ACTIVITY memory line: it gives no budget, and three of XCL's owners (xcl-dev#2688, workstream 1). memory_report::snapshot() takes the process's commit, and DXGI's local and non-local usage with their budgets, and XCL's parts of each: - commit: the UMA coherent window, and the CPU copy of mapped sparse tiles (a title page in a sparse window is committed on the CPU too); - video memory: target pages and the free part of their pools, arenas, mapped sparse tiles, free sparse pools, retired sparse pools (counted now: sparse::retired_bytes), and title textures that are committed resources of their own (title_textures::committed_bytes, console size). What each total holds besides them is its own part, "other". XCL_ACTIVITY logs it as a line of its own after the memory line, which stays as it was (scripts/smoke.ps1 and the integration branches' tools read it). Part of xcl-dev#2688. Assisted-by: Claude Code (Claude Opus 5.5)
8c9433f to
f7e4869
Compare
|
Thanks, @pr1sm-dev. Right: |
|
Focused Windows AMD check of current head Environment: Windows 11 Home build 26200 x64, AMD Radeon RX 6800M (driver 30.0.13002.13003), Ryzen 9 5980HX, Rust 1.99 MSVC.
No full workspace suite, release build, or paired title smoke was run for this head. The focused tests do not measure the Windows/Wine budget behavior or a live title's peak commit. AI use: OpenAI Codex (GPT-6.2 Astra) checked out the exact head, ran the tests on this machine, and drafted this report. |
|
Independent RTX 4060 (8 GB) verification of PR #2697 at
Setup
Targeted RTX 4060 release unit tests (
|
| Segment / Owner | First (2.0 s) |
Peak | End (58.1 s) |
End share of segment |
|---|---|---|---|---|
| Commit total | 5,245 | 14,015 | 14,015 | 100.0% |
— UMA window |
4,095 | 4,095 | 4,095 | 29.2% |
— sparse CPU copy |
20 | 838 | 838 | 6.0% |
— other |
1,129 | 9,081 | 9,081 | 64.8% |
| Video memory (local) total | 91 | 6,175 | 6,114 | 100.0% (88.3% of end budget) |
| — DXGI local budget | 7,188 | 7,188 (min 6,910) | 6,922 | — |
— target pages |
0 | 3,576 | 3,542 | 57.9% |
— target pools free |
0 | 71 | 41 | 0.7% |
— arenas |
0 | 465 | 401 | 6.6% |
— sparse tiles |
20 | 838 | 838 | 13.7% |
— sparse pools free |
44 | 58 | 57 | 0.9% |
— sparse pools retired |
0 | 0 | 0 | 0.0% |
— committed textures |
0 | 400 | 400 | 6.5% |
— other |
27 | 832 | 832 | 13.6% |
| Non-local total | 4,243 | 4,684 | 4,684 | 100.0% (30.1% of budget) |
| — DXGI non-local budget | 15,556 | 15,556 | 15,556 | — |
— UMA window |
4,095 | 4,095 | 4,095 | 87.4% |
— other |
148 | 588 | 588 | 12.6% |
Key findings on 8c9433fe (RTX 4060 8 GB)
- Non-local
UMA windowattribution verified live on 8 GB NVIDIA:uma_segment(non_local)placesUMA window 4095innon-localon this discrete RTX 4060, accounting for 87.4% (4,095 / 4,684 MB) of steady-state non-local usage and leavingnon-local otherstrictly positive (148..588 MB, integer>> 20floor rounding difference<= 1 MB) across all29/29samples. - Active
sparse::committed_bytes()accounting verified live:sparse CPU copytracked20 -> 838 MBcleanly across all29/29samples, matchingsparse tiles(0 MBhole delta in this 60 s menu/intro window; sub-tile decommit / hole paths are covered byhle::d3d12x::sparse::tests,17/0/1). - 86.3% of local VRAM attributed under load on 8 GB: Tracked owners sum to
5,279 MBof6,114 MBsteady-state local VRAM (other = 832 MB, strictly positive27..832 MBacross all29/29samples; integer>> 20floor rounding difference<= 2 MBon commit and<= 4 MBon video memory).target pages(3,542 MB, 57.9%) andsparse tiles(838 MB, 13.7%) dominate local VRAM. - 8 GB local budget headroom: DXGI local budget started at
7,188 MB, tightened to6,910 MB(-278 MB) during load, and ended at6,922 MB. Peak local usage reached6,175 MB(88.9%of the concurrent6,945 MBbudget att = 18.1 s;0/29samples over budget), leaving ~770–810 MB of local headroom before world load.
Paired 60 s RTX 4060 smoke (b49be183 vs 8c9433fe)
Parent origin/main (b49be183):
xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB
PR #2697 head (8c9433fe):
xcl-smoke v1
commit: 8c9433fe2e7b4795e262c783b55554d724c6e136
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1597 (PresentX 1597)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14015 MB
Limits of coverage
- Default
main60 s no-input menu/intro run:sparse pools retiredstayed0 MBandsparse tiles - sparse CPU copystayed0 MBthroughout this window; VRAM stayed under the 8 GB DXGI budget (0/29over-budget samples), so negativevideo memory otherunder VRAM oversubscription/demotion was not exercised here. - Full workspace suite was not re-run on
8c9433fe(only targetedmemory_report,sparse, andtitle_texturestests plus paired 60 s smoke). - Single discrete NVIDIA 8 GB GPU (
RTX 4060); no AMD, Intel, or iGPU tested on this host.
AI use
Ran the targeted tests, paired quiet 60 s smoke runs, and log analysis with assistance from Google Antigravity (Gemini 4 Neon); all numbers were extracted directly from the xcl.log, report.json, and scripts/smoke.ps1 outputs.
|
Updated independent Windows/NVIDIA check for #2697 head Tested: Windows 11 build 26300, RTX 3080 Ti (12 GB, NVIDIA 621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11; debug build.
Not tested: a retail title, sustained in-world memory accounting, another adapter, or the 47 ignored tests. Synthetic inputs only; no game files or diagnostics were used or posted. AI use: Codex (GPT-6.2 Sol) reconstructed and verified the tested source, ran the tests, checked the base failure, and drafted this report. |
A memory line by owner under
XCL_ACTIVITY. It shows the process's commit and DXGI's local and non-local usage, each against its budget, split into XCL's parts, with what XCL doesn't count as its own part. Without the budget and that remainder, nothing in #2688 can be judged. Part of #2688 (workstream 1, part 1 of the plan there).The existing
memory:line stays as it is:scripts/smoke.ps1and the integration branches' tools read it. The new line is additive, so it merges intonvidia-devwith only the two neighbouring lines to keep side by side.From the newer retail title on an RTX 4070 Ti 12 GB (
nvidia-devc044dc6dwith this commit), 4 s before the device was removed:The run's last 12 s show what the line is for. Video memory went past the DXGI budget at 126 s, and the budget itself had fallen from 11,226 MB to about 10,000 MB at 100 s. Of the 2.0 GB added between 124 s and 137 s, 1.7 GB is "other": the title's own resources, pipelines and the driver, none of which XCL counts yet. Target pages and sparse tiles grew by 0.4 GB. The device was removed at 137 s (DRED: a fault at VA 0x0, as in #2403). The full series will be on #2688.
What is in it (one commit)
crates/xcl/src/hle/d3d12x/memory_report.rs(new):snapshot()andSnapshot::line(), and its own DXGI query, which readsBudgettoo (real::video_memorystays as it is). The parts, by where they sit:crates/xcl/src/hle/d3d12x/sparse.rs:retired_bytes, the pool heaps given back but not released yet. They weren't counted anywhere before.crates/xcl/src/hle/d3d12x/title_textures.rs:committed_bytes, how many title textures are committed resources of their own (not onvram::Pagestiles), and their console size.crates/xcl/src/host.rs: the line, every 2 s withXCL_ACTIVITY, after the memory line.the_rest_is_the_total_less_the_parts: the rest is each total less its parts, a negative rest stays negative, a missing DXGI answer shows as "unknown", and the exact line.a_snapshot_on_the_device_has_its_budget_and_owners: on the adapter, a local budget above 0, the commit, and every owner. On the RDNA2 iGPU DXGI reports a non-local budget of 0 (one memory segment), which the test allows.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=4on451c7245:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way onmainon this iGPU (DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115).... ok), not skipped.scripts/smoke.ps1still finds the commit: its regex (memory: (\d+) MB committed) doesn't match the new line, which starts with "memory by owner".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 before the NVIDIA shader-heap profile (#2590) was installed on this machine.mainb49be183(this PR's base) and this PR's head (no uncommitted changes):main:
PR:
Not tested
nvidia-devaf2cecc4.main'sUploader; the integration branches replaced it);These are next, in this order, as small follow-ups, along with the end-of-run table in
report.json(part 2).real::device_raw.AI use