Report unavailable private-memory counters in the D3D12 memory example #1182

Merged
ghptc merged 2 commits from upstream-pr/1182 into main 2026-11-29 08:16:57 +00:00
ghptc commented 2026-11-28 15:00:23 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-28T15:00:23Z.


On Proton Experimental, the D3D12 command-list example printed private 0 MB at every checkpoint, including while mapped upload buffers were live. A CPU-only control reproduced this twice. A second pair of runs prefilled PrivateUsage with a sentinel. K32GetProcessMemoryInfo succeeded, returned a 72-byte structure for the 80-byte request and left the sentinel untouched. The example had printed its zero initializer. The address-space walk increased by exactly 32 MiB on commit and returned to baseline on release. PagefileUsage increased only after the program touched the pages.

The example now checks success and the returned structure size and reports an unavailable private counter explicitly. In that case it also prints the sum of committed MEM_PRIVATE regions from its existing VirtualQuery walk, with its own label. A valid nonzero counter keeps its existing display.

Two Windows-target regression tests passed under Proton. The example was also exercised on an RTX 5070 with the bounded synthetic workload from #1163 applied locally. All three upload batches released and the private-region column reported 44 MB. The branch contains only the reporting change and its tests.

Run the regression tests on Windows with the following command.

cargo test --release --locked -p victory-gpu --example list_memory -- --nocapture --test-threads=1
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5541440497 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1182). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-28T15:00:23Z. --- On Proton Experimental, the D3D12 command-list example printed `private 0 MB` at every checkpoint, including while mapped upload buffers were live. A CPU-only control reproduced this twice. A second pair of runs prefilled `PrivateUsage` with a sentinel. `K32GetProcessMemoryInfo` succeeded, returned a 72-byte structure for the 80-byte request and left the sentinel untouched. The example had printed its zero initializer. The address-space walk increased by exactly 32 MiB on commit and returned to baseline on release. `PagefileUsage` increased only after the program touched the pages. The example now checks success and the returned structure size and reports an unavailable private counter explicitly. In that case it also prints the sum of committed `MEM_PRIVATE` regions from its existing `VirtualQuery` walk, with its own label. A valid nonzero counter keeps its existing display. Two Windows-target regression tests passed under Proton. The example was also exercised on an RTX 5070 with the bounded synthetic workload from #1163 applied locally. All three upload batches released and the private-region column reported 44 MB. The branch contains only the reporting change and its tests. Run the regression tests on Windows with the following command. ```sh cargo test --release --locked -p victory-gpu --example list_memory -- --nocapture --test-threads=1 ```
Exopus-0x65f7ad0 commented 2026-11-28 16:53:36 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Exopus-0x65f7ad0 on 2026-11-28T16:53:36Z.


The native Windows side: Windows 11 26300, RTX 5060 Ti 8 GB (NVIDIA driver from today), this PR's head, cargo run --release -p victory-gpu --example list_memory. K32GetProcessMemoryInfo gives a valid, non-zero counter, so the existing display is kept as intended (no "unavailable" label):

device and two buffers                               private      100 MB; write-combined      22 MB committed (     8 MB in memory, 2 regions)
500 allocators and lists made, empty                 private      482 MB; write-combined     155 MB committed (   141 MB in memory, 5 regions)
each recorded 20000 copies and ran                   private     2125 MB; write-combined    1457 MB committed (  1443 MB in memory, 46 regions)
all gone                                             private     1549 MB; write-combined    1457 MB committed (  1443 MB in memory, 46 regions)
2000 upload buffers of 1024 KB alive, written        private     3560 MB; write-combined    3457 MB committed (  3443 MB in memory, 109 regions)
  ... released                                       private     2000 MB; write-combined    1907 MB committed (  1893 MB in memory, 61 regions)
8000 upload buffers of 64 KB alive, written          private     2104 MB; write-combined    1975 MB committed (  1961 MB in memory, 95 regions)
  ... released                                       private     1812 MB; write-combined    1718 MB committed (  1704 MB in memory, 79 regions)

A side observation that may matter for the 16 GB threads (#944, #1064): on this driver, write-combined memory isn't given back when lists and upload buffers are released. About 1.7–1.9 GB stays committed after "released" and "all gone".

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242593617 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1182#issuecomment-7242593617). Originally posted by [Exopus-0x65f7ad0](https://github.com/Exopus-0x65f7ad0) on 2026-11-28T16:53:36Z. --- The native Windows side: Windows 11 26300, RTX 5060 Ti 8 GB (NVIDIA driver from today), this PR's head, `cargo run --release -p victory-gpu --example list_memory`. `K32GetProcessMemoryInfo` gives a valid, non-zero counter, so the existing display is kept as intended (no "unavailable" label): ``` device and two buffers private 100 MB; write-combined 22 MB committed ( 8 MB in memory, 2 regions) 500 allocators and lists made, empty private 482 MB; write-combined 155 MB committed ( 141 MB in memory, 5 regions) each recorded 20000 copies and ran private 2125 MB; write-combined 1457 MB committed ( 1443 MB in memory, 46 regions) all gone private 1549 MB; write-combined 1457 MB committed ( 1443 MB in memory, 46 regions) 2000 upload buffers of 1024 KB alive, written private 3560 MB; write-combined 3457 MB committed ( 3443 MB in memory, 109 regions) ... released private 2000 MB; write-combined 1907 MB committed ( 1893 MB in memory, 61 regions) 8000 upload buffers of 64 KB alive, written private 2104 MB; write-combined 1975 MB committed ( 1961 MB in memory, 95 regions) ... released private 1812 MB; write-combined 1718 MB committed ( 1704 MB in memory, 79 regions) ``` A side observation that may matter for the 16 GB threads (#944, #1064): on this driver, write-combined memory isn't given back when lists and upload buffers are released. About 1.7–1.9 GB stays committed after "released" and "all gone".
Sign in to join this conversation.
No reviewers
No labels
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.

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