Add a fenced D3D12 resource retention probe #1426

Manually merged
github merged 1 commit from github-bot/gh-1426 into main 2026-11-29 08:22:13 +00:00 AGit
Owner

@⁠ghptc on GitHub · 2026-11-28 19:43 UTC · original
ghptc:tools/d3d12-resource-retention → main · +485 −0 · 3 files · 1 commits · merged 2026-11-29 08:16 UTC

What this measures

Add a bounded D3D12 copy and readback example for comparing explicit buffer ownership, driver-reported usage and Linux cgroup reclaim at the same checkpoints. One process verifies every word in four 32 MiB waves, with eight fenced submissions. The example exercises release, reuse and hold policies with 4 MiB or 64 KiB default buffers.

The optional Linux observer joins NVIDIA client memory by cgroup membership and samples local and nonlocal DXGI usage, memory charge, direct reclaim and PSI around the checked waves. It uses a caller-provided bounded cgroup and can read a fixed-size clean file for a matched soft-limit test.

The fixed-interval host sampler in #1162, list and upload smoke profile in #1163, and private-memory counter fix in #1182 cover separate measurements.

Measured on Proton Experimental and an RTX 5070

NVIDIA 620.73.04 with Proton Experimental 11.0-20261123b. After a guarded warm-up, four fresh services ran the same release workload with 64 KiB buffers and the same 224 MiB file-read schedule. The hard limit was 2 GiB and swap was zero in every service.

MemoryHigh in run order High events in wave brackets Directly reclaimed pages Full PSI in wave brackets Verified bytes and fences
1,024 MiB 0 0 0 µs 128 MiB and 8
352 MiB 7 701 51 µs 128 MiB and 8
352 MiB 42 5,236 188 µs 128 MiB and 8
1,024 MiB 0 0 0 µs 128 MiB and 8

All four measured processes showed 51 MiB of NVIDIA client memory at device creation, 115 MiB during the final verified wave, 83 MiB after dropping the final default buffers and 51 MiB after dropping the transfer buffers. DXGI local usage returned to its 16.5 MiB baseline. Whole-service hard-limit and OOM counters stayed at zero. The longest observed fence wait was 0.765 ms. The cgroup measurements are scoped to the whole service. Attribution to an individual API or thread requires finer tracing.

The physical run used this Rust source built as a standalone MSVC-target fixture with the same windows and anyhow dependency versions. Readback counts, phase clock brackets, per-client usage and guard results were rechecked from the raw data. Build and reproduction commands are in the added documentation. Linux cgroup memory counters · DXGI usage query

Verification

  • Exact upstream workspace example built with cargo xwin build --offline --locked --release --target x86_64-pc-windows-msvc -p victory-gpu --example resource_retention -j 2.
  • Rust formatting, Python source compilation and staged asset policy checks passed.
**@⁠ghptc** on GitHub · 2026-11-28 19:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1426) `ghptc:tools/d3d12-resource-retention` → `main` · +485 −0 · 3 files · 1 commits · merged 2026-11-29 08:16 UTC ## What this measures Add a bounded D3D12 copy and readback example for comparing explicit buffer ownership, driver-reported usage and Linux cgroup reclaim at the same checkpoints. One process verifies every word in four 32 MiB waves, with eight fenced submissions. The example exercises release, reuse and hold policies with 4 MiB or 64 KiB default buffers. The optional Linux observer joins NVIDIA client memory by cgroup membership and samples local and nonlocal DXGI usage, memory charge, direct reclaim and PSI around the checked waves. It uses a caller-provided bounded cgroup and can read a fixed-size clean file for a matched soft-limit test. The fixed-interval host sampler in #1162, list and upload smoke profile in #1163, and private-memory counter fix in #1182 cover separate measurements. ## Measured on Proton Experimental and an RTX 5070 NVIDIA 620.73.04 with Proton Experimental 11.0-20261123b. After a guarded warm-up, four fresh services ran the same release workload with 64 KiB buffers and the same 224 MiB file-read schedule. The hard limit was 2 GiB and swap was zero in every service. | MemoryHigh in run order | High events in wave brackets | Directly reclaimed pages | Full PSI in wave brackets | Verified bytes and fences | | ---: | ---: | ---: | ---: | --- | | 1,024 MiB | 0 | 0 | 0 µs | 128 MiB and 8 | | 352 MiB | 7 | 701 | 51 µs | 128 MiB and 8 | | 352 MiB | 42 | 5,236 | 188 µs | 128 MiB and 8 | | 1,024 MiB | 0 | 0 | 0 µs | 128 MiB and 8 | All four measured processes showed 51 MiB of NVIDIA client memory at device creation, 115 MiB during the final verified wave, 83 MiB after dropping the final default buffers and 51 MiB after dropping the transfer buffers. DXGI local usage returned to its 16.5 MiB baseline. Whole-service hard-limit and OOM counters stayed at zero. The longest observed fence wait was 0.765 ms. The cgroup measurements are scoped to the whole service. Attribution to an individual API or thread requires finer tracing. The physical run used this Rust source built as a standalone MSVC-target fixture with the same windows and anyhow dependency versions. Readback counts, phase clock brackets, per-client usage and guard results were rechecked from the raw data. Build and reproduction commands are in the added documentation. [Linux cgroup memory counters](https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files) · [DXGI usage query](https://learn.microsoft.com/windows/win32/api/dxgi1_4/nf-dxgi1_4-idxgiadapter3-queryvideomemoryinfo) ## Verification - Exact upstream workspace example built with `cargo xwin build --offline --locked --release --target x86_64-pc-windows-msvc -p victory-gpu --example resource_retention -j 2`. - Rust formatting, Python source compilation and staged asset policy checks passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 19:49:20 +00:00
github manually merged commit d522cb21f5 into main 2026-11-29 08:22:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1426
No description provided.