Repository navigation
perf(agc): keep device buffers placed in host memory for reuse while the device heap is full - #8748
Conversation
|
This pull request is labeled |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the allocation-selection and pool-key changes plus the host-placement regression cases. The device-local pool is still preferred; a retained host-placed slot is reused only after a fresh budget check says a new device-local allocation would not fit, and the tests assert both reuse under pressure and device-local selection once the budget allows it. The PR includes paired same-machine SuperTuxKart captures and reports the buffer-allocation drop from 8,192 placements to 5. Eligibility, conventions, intake, labels, and report checks pass; hosted platform/runtime jobs are skipped, and the author notes the Khronos validation layer was unavailable.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
8a45597 to
d1ce2c5
Compare
|
SuperTuxKart race data with the rest of the STK fixes underneath. This PR removes the device-buffer churn that is left once the storage round trip and the label waits are gone. Setup.
The frame rate gain is small, 5 to 10 %. What the PR removes shows on the draw committer: one run per side with
On the base, the committer is the busiest thread. Sampling it puts about 19 % of its time inside the driver under Traces and summary lines: pr8748-race-traces. |
|
Linux (RADV) run on the same chip as the description: head Setup
|
|
Data point for the Linux APU case: Radeon 780M, RADV, Mesa 26.0.8, upstream main 853baf3 with this PR (d1ce2c5) on top. Diablo II: Resurrected and Hot Wheels Unleashed (garage), two alternating pairs each against main. The host-placement path never fired: 0 host placements in every run. The device heap peaked at ~1290 of 1324 MiB on D2R and never overflowed; on Hot Wheels the device tier sat at ~752-758 of 768 MiB and was reclaimed instead. Frame rates were the same as main (Hot Wheels 3/3 presents per 10 s in all four runs; D2R within its run-to-run noise). No new errors. So no regression on this setup, but also no coverage of the code path itself. A title that actually overflows the device heap on an APU would be needed for that. This comment was written with help from Claude (AI). |
|
@LeandroLP23 This now merges cleanly with the idle-device reclaim code from #8672, but ReclaimIdleDevice in the resulting BufferPool.cpp does not skip allocation.hostPlaced. Those retained slots live in deviceTier while their memory belongs to the host heap. An old host-placed slot can therefore satisfy the requested reclaim byte count, leave idle device-local slots untouched, and report device memory released when none was freed. Please exclude hostPlaced allocations from this scan and add a composition regression with an older host-placed slot and a younger idle device-local slot, checking that reclaim preserves the former and frees/counts the latter. The current IdleDeviceReclaim test's host allocation uses Buffer rather than a host-placed DeviceBuffer, so it does not cover this case. |
d1ce2c5 to
70a183e
Compare
|
@oneandonlydean thanks, confirmed and fixed in The new AI-assisted: yes (Claude Code) |
|
Note 🤖 Claude Opus 5.5 responding on behalf of JulesB40 On Windows + NVIDIA (Ada), head Setup: Windows 11 Home 10.0.26200, Intel Core i9-13900HX, NVIDIA GeForce RTX 4070 Laptop GPU ( Command, the same on both sides:
No title was run. |
✅ NVIDIA GPU test: passedPR head
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (5, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (4 IDs in 407 tests)Skipped (39)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-check — changes requested\n\nThe additional ReclaimIdleDevice change and IdleReclaimSkipsHostPlaced test address the accounting issue: reclaim now skips host-placed slots instead of freeing host memory while reporting it as released device memory. The new NVIDIA report on head 70a183e is useful broad coverage, but it is not a comparison against current main and does not repeat the title performance measurement.\n\nThe branch is based on acbfd7c, and current main is aaccd0b. Main has changed all five PR paths since that base: BufferPool.hpp/cpp, Context.hpp, Resources.cpp and BufferPool.cpp tests. Please rebase onto current main, preserve the device-local-first/host-fallback budget behavior and the reclaim regression, then rerun agc_buffer_pool and the focused memory-budget tests on the exact updated head. Because this is labeled perf, refresh the same-machine SuperTuxKart main/change captures, summary lines, traces and digests after the integration as well. I did not run local tests or GPU captures.
70a183e to
28f80c2
Compare
|
@MarcZX10 thanks for the re-check. I rebased this onto I ran the focused tests on that exact head:
I don't have the SuperTuxKart main/change captures on current AI-assisted: yes (Claude Code) |
Re-checked — new head, changes still requestedThe focused tests now cover the updated head, but the required matched performance report for the current main/change pair is still outstanding. What I ran
Results
Unedited local command output
FindingsBlocking
Non-blocking
Sources
Not verifiedI did not independently run the focused tests, the Radeon 860M capture pair, traces, or digests. Hosted Linux and specialized product checks were skipped. To get this to a good statePlease add the current-main/change performance artifacts described above. I’ll rerun the same merge and diff checks and re-review the report when they are posted. |
XairRrR
left a comment
There was a problem hiding this comment.
Reviewed — approved
Head 28f80c25a9 merges cleanly onto current main, builds, and passes the focused buffer-pool and device-memory tests with the Khronos validation layer active and no VUID- lines on either side; the new agc_buffer_pool checks fail when the production files are reverted to main.
What I ran
- Head:
28f80c25a9b466b067a3c3b9bbbd504d548e0376 main:5454cd2e455994d992aca39335ce60507eeda1eb(merge base of the branch:aaccd0ba39)- Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree.
git fetch origin main pull/8748/head:refs/review/8748
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/8748
git diff --check origin/main...refs/review/8748
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target agc_buffer_pool_tests agc_device_memory_fallback_tests \
guest_agc_driver_resources_tests agc_driver_many_buffers_tests agc_driver_pooled_buffer_range_tests \
agc_driver_graphics_tests agc_static_buffer_tests agc_driver_buffer_load_store_tests \
agc_driver_depth_plane_buffer_memory_tests agc_driver_recorder_tests agc_driver_sparse_buffer_holes_tests libs
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -j4 -V --output-on-failure -R \
'^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_device_memory_fallback|guest_agc_driver_resources|agc_driver_many_buffers|agc_driver_pooled_buffer_range|agc_pipeline_store_lazy_buffer_pool|agc_static_buffer|agc_driver_buffer_load_store|agc_driver_depth_plane_buffer_memory|agc_storage_written_buffer_order|agc_driver_sparse_buffer_holes)$'
# same build targets and ctest command on origin/main, then back to the merged treeResults
| Check | Result |
|---|---|
Merge onto main |
Clean |
git diff --check |
Clean |
tools/check_conventions.py --base origin/main |
All conventions checks passed. |
Build of the targets above and libs (merged tree) |
OK, no warnings |
| Focused tests, merged tree, with validation | 13/13 passed |
Focused tests, main, with validation |
13/13 passed |
VUID- lines |
0 on main, 0 on the merged tree |
was not found but was requested by env var VK_INSTANCE_LAYERS |
Absent from both logs; the loader inserted VK_LAYER_KHRONOS_validation 6 times in each run (the GPU tests in the set) |
| GPU used by the GPU tests | NVIDIA GeForce RTX 4070 Ti SUPER, 10de:2705, driver 615.78.08 |
| Test duration | agc_buffer_pool 0.38 s; whole set 1.32 s |
Merged tree, ctest summary
1/13 Test #763: agc_buffer_pool_small_device_no_staging ... Passed 0.00 sec
2/13 Test #762: agc_buffer_pool_small_device_shared ....... Passed 0.00 sec
3/13 Test #674: agc_static_buffer ......................... Passed 0.00 sec
4/13 Test #765: agc_device_memory_fallback ................ Passed 0.00 sec
5/13 Test #761: agc_buffer_pool ........................... Passed 0.38 sec
6/13 Test #804: agc_storage_written_buffer_order .......... Passed 0.54 sec
7/13 Test #1343: agc_driver_pooled_buffer_range ............ Passed 0.25 sec
8/13 Test #1014: agc_driver_depth_plane_buffer_memory ...... Passed 0.94 sec
9/13 Test #1581: agc_pipeline_store_lazy_buffer_pool ....... Passed 0.00 sec
10/13 Test #1765: guest_agc_driver_resources ................ Passed 0.00 sec
11/13 Test #1416: agc_driver_sparse_buffer_holes ............ Passed 0.23 sec
12/13 Test #981: agc_driver_buffer_load_store .............. Passed 1.09 sec
13/13 Test #1268: agc_driver_many_buffers ................... Passed 0.90 sec
100% tests passed out of 13
Negative control
-
Restored
BufferPool.hpp,Context.hpp,BufferPool.cppandResources.cppfrommainand kept the PR'stests/BufferPool.cpp.agc_buffer_poolfails; the two small-device modes still pass:FAIL: a device buffer placed in host memory was not kept in the pool after its release FAIL: a device buffer over the device-local budget did not reuse the retained host-placed buffer FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local one -
On the merged tree, removed only the
slot.allocation.hostPlaced ||condition fromReclaimIdleDevice.agc_buffer_poolfails:FAIL: idle device reclaim counted a host-placed buffer as device memory FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local oneThis confirms the author's report on the #8672 composition, which oneandonlydean raised.
Both changes were restored afterwards.
Findings
Blocking
None.
Non-blocking
-
A host-placed slot that is probed and refused is re-inserted as the newest slot.
Resources.cppL166-L172 puts the slot back withcache->Put(*pooled)whenDeviceLocalFitssays device memory is available.Putgives it a freshlastUse(++clock,BufferPool.cppL578), andTakehas already counted the probe in++tier.hits(BufferPool.cppL409-L426). Once the heap is back under budget, a host-placed slot holds host memory that the pool will not hand out while device memory fits. Each refused probe also makes that slot the youngest in the device tier.evictOldestthen drops reusable device-local slots of other keys before it, andReclaimIdleDeviceskips it by design. TheAPS5_PROFILE_DRAWdevice-tier hit count also includes these refused probes. Suggested fix: when the probe is refused, destroy the slot rather than putting it back, because device memory fits and the host copy is the wrong placement. Alternatively, re-insert it with its originallastUseand leavehitsuncounted. -
DeviceLocalFitsdoes not check exactly what the fresh path checks. The probe callsDeviceLocalFits(~0u, capacity). The fresh allocation it competes with usesDeviceMemoryType(requirements.memoryTypeBits, ClassAllocationBytes(requirements, capacity), ...)(Resources.cppL200-L210). With~0u,MemoryTypecan pick a device-local type the buffer cannot use. The size also lacks the alignment rounding. On the usual single device-local heap these agree. In the edge case, a request just at the budget boundary passes over the host slot, then gets host memory anyway from a new allocation. The description says both decisions use "the same rule", and that holds only approximately. Passing the slot's alignment-roundedallocationByteswould make the two match exactly. -
The
GPUs testedline does not match the validation evidence. The checklist names only the Radeon 860M, where the description says the Khronos validation layer is not installed. The author's later run with validation on head28f80c25a9used an RTX 5060 Ti and covered only the change, notmain. CONTRIBUTING asks for the same focused tests onmainand the change with the layer, with each GPU named on that line. The comparison above on the RTX 4070 Ti SUPER, and the earlier ones by JulesB40 and the NVIDIA CI comment, show no newVUID-lines, so I do not treat this as blocking. Adding the 5060 Ti, and amainrun on it, to the description would close it. -
Overlap with #4472, as the description already says: #4472 stops pooling device buffers while the device-local heap is over budget. Whichever lands second has to exempt
hostPlacedslots, or the churn this PR removes comes back on 512 MiB carve-outs. Agreeing the order with that author, and noting it underDepends onif needed, would help.
Not verified
- The performance claim. I have no APU with a small device-local carve-out. On this machine the device-local heap never goes over budget, so the host-placement path only runs in the mock tests. The description's summary lines and traces are for head
d1ce2c51278fagainstmainec7eacc62, not the current head. MarcZX10 asked for a refresh on currentmain, and the author says that is pending. The code behind the measured path is the same apart from the reclaim skip, but I have not reproduced the numbers. - Windows and AMD drivers, and any title. I ran no title.
- The full test suite; only the 13 focused tests above.
✅ NVIDIA GPU test: passedPR head
Failing on main too (3, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (4 IDs in 406 tests)Skipped (39)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Static review plus an independent Linux/AMD run on both trees per the repo AGENTS AGC protocol (CachyOS, kernel 7.2.10, GCC 16.2.1, Ninja 1.13.2, Release, What I checked (static)
Focused paired run (VVL env)
Both logs: 0 Overlap note
Not covered The mock-device suite ( |
|
@MarcZX10 here are the matched captures on the 860M for current Setup
I dropped a sixth run, What this shows
I'll update the description so it claims the removed allocation churn rather than an FPS gain. If you'd rather this not carry the Summary lines{"commit":"aaccd0ba39b7","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":568,"ms":20038.473},"presents":154,"frame_ms":{"p50":130.851,"p90":149.309,"p99":195.904,"max":198.737},"gpu_busy_ms_per_present":44.676,"worker_busy_pct":{"queue worker 0x0":17.835},"top_phases_ms_per_frame":{"Graphics.Draw":25.517,"Graphics.Draw.draw_and_resource_release":24.604,"Driver.Packet":21.681,"Driver.Packet.draw":19.131,"Driver.Draw":19.048,"Driver.Draw.draw_enqueued":14.698,"Vulkan.DrawFromRecipe":4.115,"Graphics.DrawWithRecipe":4.094},"trace_dropped":false,"trace":"aps5-trace-aaccd0ba39b7-2880.json.gz"}
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":964,"ms":20030.191},"presents":236,"frame_ms":{"p50":84.143,"p90":87.982,"p99":108.403,"max":110.949},"gpu_busy_ms_per_present":26.388,"worker_busy_pct":{"queue worker 0x0":13.317},"top_phases_ms_per_frame":{"Graphics.Draw":17.642,"Graphics.Draw.draw_and_resource_release":16.970,"Driver.Packet":9.435,"Driver.Packet.draw":7.396,"Driver.Draw":7.327,"Driver.Draw.draw_enqueued":4.360,"Vulkan.DrawFromRecipe":2.866,"Graphics.DrawWithRecipe":2.851},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-7800.json.gz"}
{"commit":"aaccd0ba39b7","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":865,"ms":20010.054},"presents":209,"frame_ms":{"p50":91.668,"p90":117.107,"p99":124.081,"max":144.382},"gpu_busy_ms_per_present":27.932,"worker_busy_pct":{"queue worker 0x0":17.825},"top_phases_ms_per_frame":{"Graphics.Draw":19.501,"Graphics.Draw.draw_and_resource_release":18.808,"Driver.Packet":16.312,"Driver.Packet.draw":14.269,"Driver.Draw":14.204,"Driver.Draw.draw_enqueued":10.438,"Driver.Draw.shader_compile_and_link":3.041,"Vulkan.DrawFromRecipe":2.901},"trace_dropped":false,"trace":"aps5-trace-aaccd0ba39b7-9236.json.gz"}
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":918,"ms":20014.382},"presents":166,"frame_ms":{"p50":121.488,"p90":143.807,"p99":168.221,"max":172.264},"gpu_busy_ms_per_present":43.101,"worker_busy_pct":{"queue worker 0x0":14.932},"top_phases_ms_per_frame":{"Graphics.Draw":21.394,"Graphics.Draw.draw_and_resource_release":20.433,"Driver.Packet":17.025,"Driver.Packet.draw":14.584,"Driver.Draw":14.503,"Driver.Draw.draw_enqueued":10.019,"Vulkan.DrawFromRecipe":4.026,"Graphics.DrawWithRecipe":4.004},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-6440.json.gz"}
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":925,"ms":20061.966},"presents":233,"frame_ms":{"p50":84.459,"p90":95.874,"p99":98.879,"max":102.374},"gpu_busy_ms_per_present":26.438,"worker_busy_pct":{"queue worker 0x0":13.498},"top_phases_ms_per_frame":{"Graphics.Draw":18.401,"Graphics.Draw.draw_and_resource_release":17.704,"Driver.Packet":9.745,"Driver.Packet.draw":7.623,"Driver.Draw":7.553,"Driver.Draw.draw_enqueued":4.503,"Vulkan.DrawFromRecipe":2.900,"Graphics.DrawWithRecipe":2.884},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-13900.json.gz"}Run 1 (`main`):
|
| thread | busy | wait | untraced | in slices < 20 us | largest |
|---|---|---|---|---|---|
| title | 0.0 (0 %) | 0.0 (0 %) | 130.1 | 0.2 | Recorder.Sync 0.0 |
| queue worker 0x0 | 21.9 (17 %) | 106.4 (82 %) | 1.8 | 6.6 | Driver.Packet 20.4, Driver.EndSubmission 1.5 |
| draw committer | 30.5 (23 %) | 2.1 (2 %) | 97.6 | 0.4 | Graphics.Draw 25.5, Vulkan.DrawFromRecipe 4.1 |
| presenter | 0.7 (1 %) | 1.0 (1 %) | 128.4 | 0.0 | VideoOut.Flip 1.7, Driver.Present 0.0 |
| gpu | 44.6 (34 %) | 0.0 (0 %) | 85.5 | 0.0 | batch 44.6 |
Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 106.4, Driver.WorkerWait.idle_and_completion_poll 106.3, batch 44.6, Graphics.Draw 25.5, Graphics.Draw.draw_and_resource_release 24.6, Driver.Packet 20.4, Driver.Packet.draw 19.1, Driver.Draw 19.0, Driver.Draw.draw_enqueued 14.2, Vulkan.DrawFromRecipe 4.1
Longest waits
- Driver.WorkerWait (queue worker 0x0) 28.3 ms at 4991 ms, present 605
- Driver.WorkerWait (queue worker 0x0) 24.1 ms at 16149 ms, present 692
- Driver.WorkerWait (queue worker 0x0) 23.9 ms at 5019 ms, present 605
- Driver.WorkerWait (queue worker 0x0) 23.3 ms at 19352 ms, present 717
- Driver.WorkerWait (queue worker 0x0) 22.8 ms at 6888 ms, present 619
- Driver.WorkerWait (queue worker 0x0) 22.5 ms at 17736 ms, present 706
- Driver.WorkerWait (queue worker 0x0) 21.2 ms at 5293 ms, present 607
- Driver.WorkerWait (queue worker 0x0) 21.1 ms at 7172 ms, present 621
- Driver.WorkerWait (queue worker 0x0) 20.8 ms at 17922 ms, present 707
- Driver.WorkerWait (queue worker 0x0) 19.5 ms at 614 ms, present 572
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
- batch 1265: 22.1 ms at 4968 ms, present 605: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.0, Graphics.Draw.draw_and_resource_release (draw committer) 1.0, Recorder.Submit (draw committer) 0.1, Recorder.Reap (draw committer) 0.0
- batch 1741: 18.1 ms at 6864 ms, present 619: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
- batch 1266: 17.9 ms at 4995 ms, present 605: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.4, Recorder.Submit (draw committer) 0.1, Recorder.Reap (draw committer) 0.0
- batch 5073: 17.1 ms at 19330 ms, present 717: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1
- batch 1333: 16.4 ms at 5269 ms, present 607: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.9, Graphics.Draw.draw_and_resource_release (draw committer) 0.9, Recorder.Submit (draw committer) 0.1
Run 2 (this PR): tools/trace_digest.py
seconds 95:20 from present 964: 236 presents, frame p50 84.1 / p90 88.0 / p99 108.4 / max 110.9 ms, GPU busy 26.4 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit 28f80c2, dropped: no
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":964,"ms":20030.191},"presents":236,"frame_ms":{"p50":84.143,"p90":87.982,"p99":108.403,"max":110.949},"gpu_busy_ms_per_present":26.388,"worker_busy_pct":{"queue worker 0x0":13.317},"top_phases_ms_per_frame":{"Graphics.Draw":17.642,"Graphics.Draw.draw_and_resource_release":16.97,"Driver.Packet":9.435,"Driver.Packet.draw":7.396,"Driver.Draw":7.327,"Driver.Draw.draw_enqueued":4.36,"Vulkan.DrawFromRecipe":2.866,"Graphics.DrawWithRecipe":2.851},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-7800.json.gz"}Slowest frames (largest slices inside each, inclusive)
- present 965: 110.9 ms at 108 ms: Driver.WorkerWait (queue worker 0x0) 97.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 97.4, batch (gpu) 43.1, Graphics.Draw (draw committer) 21.3
- present 966: 108.9 ms at 219 ms: Driver.WorkerWait (queue worker 0x0) 95.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 95.0, batch (gpu) 45.0, Graphics.Draw (draw committer) 19.3
- present 964: 108.4 ms at 0 ms: Driver.WorkerWait (queue worker 0x0) 88.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 88.5, batch (gpu) 40.4, Graphics.Draw (draw committer) 21.4
- present 967: 105.6 ms at 328 ms: Driver.WorkerWait (queue worker 0x0) 92.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 92.9, batch (gpu) 38.5, Graphics.Draw (draw committer) 20.0
- present 968: 103.9 ms at 434 ms: Driver.WorkerWait (queue worker 0x0) 91.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 91.1, batch (gpu) 34.5, Graphics.Draw (draw committer) 20.8
Threads (ms per frame)
| thread | busy | wait | untraced | in slices < 20 us | largest |
|---|---|---|---|---|---|
| title | 0.0 (0 %) | 0.0 (0 %) | 84.9 | 0.1 | Recorder.Sync 0.0 |
| queue worker 0x0 | 10.0 (12 %) | 73.1 (86 %) | 1.8 | 5.8 | Driver.Packet 8.1, Driver.EndSubmission 1.8 |
| draw committer | 21.4 (25 %) | 1.3 (2 %) | 62.2 | 0.3 | Graphics.Draw 17.6, Vulkan.DrawFromRecipe 2.9 |
| presenter | 0.8 (1 %) | 0.6 (1 %) | 83.5 | 0.0 | VideoOut.Flip 1.4, Driver.Present 0.0 |
| gpu | 26.4 (31 %) | 0.0 (0 %) | 58.5 | 0.0 | batch 26.4 |
Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 73.1, Driver.WorkerWait.idle_and_completion_poll 73.1, batch 26.4, Graphics.Draw 17.6, Graphics.Draw.draw_and_resource_release 17.0, Driver.Packet 8.1, Driver.Packet.draw 7.2, Driver.Draw 7.1, Driver.Draw.draw_enqueued 4.0, Vulkan.DrawFromRecipe 2.9
Longest waits
- Driver.WorkerWait (queue worker 0x0) 22.3 ms at 249 ms, present 966
- Driver.WorkerWait (queue worker 0x0) 21.5 ms at 138 ms, present 965
- Driver.WorkerWait (queue worker 0x0) 20.1 ms at 355 ms, present 967
- Driver.WorkerWait (queue worker 0x0) 19.4 ms at 30 ms, present 964
- Driver.WorkerWait (queue worker 0x0) 14.7 ms at 464 ms, present 968
- Driver.WorkerWait (queue worker 0x0) 14.0 ms at 49 ms, present 964
- Driver.WorkerWait (queue worker 0x0) 13.7 ms at 160 ms, present 965
- Driver.WorkerWait (queue worker 0x0) 12.9 ms at 7667 ms, present 1052
- Driver.WorkerWait (queue worker 0x0) 12.7 ms at 7753 ms, present 1053
- Driver.WorkerWait (queue worker 0x0) 12.6 ms at 375 ms, present 967
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
- batch 74: 12.8 ms at 221 ms, present 966: GPU no ranges; recorded by Graphics.Draw (draw committer) 7.3, Graphics.Draw.draw_and_resource_release (draw committer) 6.9, Graphics.Draw.validate (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
- batch 108: 11.6 ms at 327 ms, present 966: GPU no ranges; recorded by Graphics.Draw (draw committer) 6.9, Graphics.Draw.draw_and_resource_release (draw committer) 6.5, Graphics.Draw.validate (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
- batch 40: 11.4 ms at 111 ms, present 965: GPU no ranges; recorded by Graphics.Draw (draw committer) 7.5, Graphics.Draw.draw_and_resource_release (draw committer) 7.0, Graphics.Draw.validate (draw committer) 0.3, Recorder.Submit (draw committer) 0.1
- batch 6: 10.1 ms at 3 ms, present 964: GPU no ranges; recorded by Graphics.Draw (draw committer) 7.6, Graphics.Draw.draw_and_resource_release (draw committer) 7.1, Graphics.Draw.validate (draw committer) 0.3, Recorder.Submit (draw committer) 0.1
- batch 75: 9.1 ms at 234 ms, present 966: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
Run 3 (`main`): tools/trace_digest.py
seconds 95:20 from present 865: 209 presents, frame p50 91.7 / p90 117.1 / p99 124.1 / max 144.4 ms, GPU busy 27.9 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit aaccd0b, dropped: no
{"commit":"aaccd0ba39b7","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":865,"ms":20010.054},"presents":209,"frame_ms":{"p50":91.668,"p90":117.107,"p99":124.081,"max":144.382},"gpu_busy_ms_per_present":27.932,"worker_busy_pct":{"queue worker 0x0":17.825},"top_phases_ms_per_frame":{"Graphics.Draw":19.501,"Graphics.Draw.draw_and_resource_release":18.808,"Driver.Packet":16.312,"Driver.Packet.draw":14.269,"Driver.Draw":14.204,"Driver.Draw.draw_enqueued":10.438,"Driver.Draw.shader_compile_and_link":3.041,"Vulkan.DrawFromRecipe":2.901},"trace_dropped":false,"trace":"aps5-trace-aaccd0ba39b7-9236.json.gz"}Slowest frames (largest slices inside each, inclusive)
- present 901: 144.4 ms at 3618 ms: Driver.WorkerWait (queue worker 0x0) 104.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 104.1, batch (gpu) 53.3, Driver.Packet (queue worker 0x0) 37.6
- present 909: 131.5 ms at 4598 ms: Driver.WorkerWait (queue worker 0x0) 98.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 98.1, batch (gpu) 45.3, Driver.Packet (queue worker 0x0) 30.8
- present 919: 124.1 ms at 5794 ms: Driver.WorkerWait (queue worker 0x0) 99.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 99.0, batch (gpu) 45.8, Driver.Packet (queue worker 0x0) 22.5
- present 898: 123.3 ms at 3258 ms: Driver.WorkerWait (queue worker 0x0) 104.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 104.7, batch (gpu) 44.8, Graphics.Draw (draw committer) 21.9
- present 904: 122.2 ms at 4004 ms: Driver.WorkerWait (queue worker 0x0) 106.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 106.0, batch (gpu) 43.9, Graphics.Draw (draw committer) 20.4
Threads (ms per frame)
| thread | busy | wait | untraced | in slices < 20 us | largest |
|---|---|---|---|---|---|
| title | 0.0 (0 %) | 0.0 (0 %) | 95.7 | 0.2 | Recorder.Sync 0.0 |
| queue worker 0x0 | 15.8 (16 %) | 78.2 (82 %) | 1.7 | 6.5 | Driver.Packet 15.1, Driver.EndSubmission 0.7 |
| draw committer | 22.8 (24 %) | 2.1 (2 %) | 70.8 | 0.3 | Graphics.Draw 19.5, Vulkan.DrawFromRecipe 2.9 |
| presenter | 1.1 (1 %) | 0.5 (1 %) | 94.1 | 0.0 | VideoOut.Flip 1.6, Driver.Present 0.0 |
| gpu | 28.0 (29 %) | 0.0 (0 %) | 67.8 | 0.0 | batch 28.0 |
Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 78.2, Driver.WorkerWait.idle_and_completion_poll 78.2, batch 28.0, Graphics.Draw 19.5, Graphics.Draw.draw_and_resource_release 18.8, Driver.Packet 15.1, Driver.Packet.draw 14.1, Driver.Draw 14.0, Driver.Draw.draw_enqueued 10.0, Vulkan.DrawFromRecipe 2.9
Longest waits
- GpuMutex.wait.draw (draw committer) 16.2 ms at 3625 ms, present 901
- GpuMutex.wait.draw (draw committer) 16.0 ms at 4604 ms, present 909
- Driver.WorkerWait (queue worker 0x0) 16.0 ms at 3698 ms, present 901
- Driver.WorkerWait (queue worker 0x0) 15.3 ms at 5496 ms, present 916
- Driver.WorkerWait (queue worker 0x0) 15.0 ms at 5856 ms, present 919
- Driver.WorkerWait (queue worker 0x0) 14.8 ms at 3684 ms, present 901
- Driver.WorkerWait (queue worker 0x0) 14.8 ms at 3662 ms, present 901
- Driver.WorkerWait (queue worker 0x0) 14.7 ms at 5733 ms, present 918
- Driver.WorkerWait (queue worker 0x0) 14.6 ms at 4062 ms, present 904
- Driver.WorkerWait (queue worker 0x0) 14.5 ms at 4537 ms, present 908
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
- batch 1227: 13.3 ms at 3635 ms, present 901: GPU no ranges; recorded by Graphics.Draw (draw committer) 16.7, Graphics.Draw.draw_and_resource_release (draw committer) 16.5, Resources.Complete (draw committer) 0.2, Resources.Prepare (draw committer) 0.2
- batch 1499: 12.3 ms at 4607 ms, present 909: GPU no ranges; recorded by Graphics.Draw (draw committer) 10.6, Graphics.Draw.draw_and_resource_release (draw committer) 10.5, Recorder.Submit (draw committer) 0.1
- batch 1091: 11.8 ms at 3135 ms, present 896: GPU no ranges; recorded by Graphics.Draw (draw committer) 10.9, Graphics.Draw.draw_and_resource_release (draw committer) 10.5, Recorder.Submit (draw committer) 0.1
- batch 993: 11.4 ms at 2799 ms, present 894: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
- batch 1601: 11.3 ms at 4963 ms, present 911: GPU no ranges; recorded by Graphics.Draw (draw committer) 13.9, Graphics.Draw.draw_and_resource_release (draw committer) 13.5, Recorder.Submit (draw committer) 0.1
Run 4 (this PR): tools/trace_digest.py
seconds 95:20 from present 918: 166 presents, frame p50 121.5 / p90 143.8 / p99 168.2 / max 172.3 ms, GPU busy 43.1 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit 28f80c2, dropped: no
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":918,"ms":20014.382},"presents":166,"frame_ms":{"p50":121.488,"p90":143.807,"p99":168.221,"max":172.264},"gpu_busy_ms_per_present":43.101,"worker_busy_pct":{"queue worker 0x0":14.932},"top_phases_ms_per_frame":{"Graphics.Draw":21.394,"Graphics.Draw.draw_and_resource_release":20.433,"Driver.Packet":17.025,"Driver.Packet.draw":14.584,"Driver.Draw":14.503,"Driver.Draw.draw_enqueued":10.019,"Vulkan.DrawFromRecipe":4.026,"Graphics.DrawWithRecipe":4.004},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-6440.json.gz"}Slowest frames (largest slices inside each, inclusive)
- present 937: 172.3 ms at 2401 ms: Driver.WorkerWait (queue worker 0x0) 147.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 147.7, batch (gpu) 80.0, Graphics.Draw (draw committer) 28.5
- present 1030: 168.2 ms at 13913 ms: Driver.WorkerWait (queue worker 0x0) 147.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 147.0, batch (gpu) 58.0, Graphics.Draw (draw committer) 24.9
- present 936: 167.3 ms at 2234 ms: Driver.WorkerWait (queue worker 0x0) 147.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 147.3, batch (gpu) 68.0, Graphics.Draw (draw committer) 22.3
- present 1056: 161.2 ms at 16902 ms: Driver.WorkerWait (queue worker 0x0) 139.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 139.1, batch (gpu) 69.7, Graphics.Draw (draw committer) 24.3
- present 923: 152.9 ms at 688 ms: Driver.WorkerWait (queue worker 0x0) 132.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 132.1, batch (gpu) 67.1, Graphics.Draw (draw committer) 24.8
Threads (ms per frame)
| thread | busy | wait | untraced | in slices < 20 us | largest |
|---|---|---|---|---|---|
| title | 0.1 (0 %) | 0.0 (0 %) | 120.5 | 0.2 | Recorder.Sync 0.1 |
| queue worker 0x0 | 16.7 (14 %) | 102.0 (85 %) | 1.9 | 6.7 | Driver.Packet 15.7, Driver.EndSubmission 0.9 |
| draw committer | 26.4 (22 %) | 2.1 (2 %) | 92.1 | 0.4 | Graphics.Draw 21.4, Vulkan.DrawFromRecipe 4.0 |
| presenter | 0.8 (1 %) | 1.0 (1 %) | 118.7 | 0.0 | VideoOut.Flip 1.8, Driver.Present 0.0 |
| gpu | 43.1 (36 %) | 0.0 (0 %) | 77.5 | 0.0 | batch 43.1 |
Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 102.0, Driver.WorkerWait.idle_and_completion_poll 101.9, batch 43.1, Graphics.Draw 21.4, Graphics.Draw.draw_and_resource_release 20.4, Driver.Packet 15.7, Driver.Packet.draw 14.5, Driver.Draw 14.4, Driver.Draw.draw_enqueued 9.5, Vulkan.DrawFromRecipe 4.0
Longest waits
- Driver.WorkerWait (queue worker 0x0) 24.3 ms at 585 ms, present 922
- Driver.WorkerWait (queue worker 0x0) 24.1 ms at 2296 ms, present 936
- Driver.WorkerWait (queue worker 0x0) 23.8 ms at 2478 ms, present 937
- Driver.WorkerWait (queue worker 0x0) 22.8 ms at 2456 ms, present 937
- Driver.WorkerWait (queue worker 0x0) 22.6 ms at 3595 ms, present 945
- Driver.WorkerWait (queue worker 0x0) 21.9 ms at 4480 ms, present 952
- Driver.WorkerWait (queue worker 0x0) 21.7 ms at 4844 ms, present 955
- Driver.WorkerWait (queue worker 0x0) 21.6 ms at 6615 ms, present 969
- Driver.WorkerWait (queue worker 0x0) 21.4 ms at 5268 ms, present 958
- Driver.WorkerWait (queue worker 0x0) 20.5 ms at 3575 ms, present 945
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
- batch 143: 22.3 ms at 559 ms, present 922: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.1, Graphics.Draw.draw_and_resource_release (draw committer) 1.0, Recorder.Submit (draw committer) 0.1
- batch 654: 21.0 ms at 2451 ms, present 937: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.3, Recorder.Submit (draw committer) 0.1
- batch 653: 21.0 ms at 2429 ms, present 937: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.9, Graphics.Draw.draw_and_resource_release (draw committer) 0.9, Recorder.Submit (draw committer) 0.1
- batch 1163: 20.4 ms at 4453 ms, present 952: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
- batch 620: 20.3 ms at 2269 ms, present 936: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.4, Graphics.DrawWithRecipe (draw committer) 0.4, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.4, Recorder.Submit (draw committer) 0.2
Run 5 (this PR): tools/trace_digest.py
seconds 95:20 from present 925: 233 presents, frame p50 84.5 / p90 95.9 / p99 98.9 / max 102.4 ms, GPU busy 26.4 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit 28f80c2, dropped: no
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":925,"ms":20061.966},"presents":233,"frame_ms":{"p50":84.459,"p90":95.874,"p99":98.879,"max":102.374},"gpu_busy_ms_per_present":26.438,"worker_busy_pct":{"queue worker 0x0":13.498},"top_phases_ms_per_frame":{"Graphics.Draw":18.401,"Graphics.Draw.draw_and_resource_release":17.704,"Driver.Packet":9.745,"Driver.Packet.draw":7.623,"Driver.Draw":7.553,"Driver.Draw.draw_enqueued":4.503,"Vulkan.DrawFromRecipe":2.9,"Graphics.DrawWithRecipe":2.884},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-13900.json.gz"}Slowest frames (largest slices inside each, inclusive)
- present 968: 102.4 ms at 3689 ms: Driver.WorkerWait (queue worker 0x0) 87.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 87.6, batch (gpu) 28.0, Graphics.Draw (draw committer) 22.7
- present 974: 100.1 ms at 4262 ms: Driver.WorkerWait (queue worker 0x0) 86.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 86.5, batch (gpu) 27.0, Graphics.Draw (draw committer) 21.8
- present 998: 98.9 ms at 6574 ms: Driver.WorkerWait (queue worker 0x0) 86.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 86.3, batch (gpu) 27.5, Graphics.Draw (draw committer) 21.3
- present 984: 98.9 ms at 5216 ms: Driver.WorkerWait (queue worker 0x0) 82.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 82.5, batch (gpu) 28.2, Graphics.Draw (draw committer) 21.8
- present 980: 98.8 ms at 4842 ms: Driver.WorkerWait (queue worker 0x0) 84.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 84.1, batch (gpu) 28.2, Graphics.Draw (draw committer) 22.9
Threads (ms per frame)
| thread | busy | wait | untraced | in slices < 20 us | largest |
|---|---|---|---|---|---|
| title | 0.0 (0 %) | 0.0 (0 %) | 86.1 | 0.2 | Recorder.Sync 0.0 |
| queue worker 0x0 | 10.3 (12 %) | 74.0 (86 %) | 1.8 | 5.9 | Driver.Packet 8.4, Driver.EndSubmission 1.8 |
| draw committer | 22.1 (26 %) | 1.4 (2 %) | 62.6 | 0.3 | Graphics.Draw 18.4, Vulkan.DrawFromRecipe 2.9 |
| presenter | 0.8 (1 %) | 0.6 (1 %) | 84.7 | 0.0 | VideoOut.Flip 1.4, Driver.Present 0.0 |
| gpu | 26.5 (31 %) | 0.0 (0 %) | 59.6 | 0.0 | batch 26.5 |
Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 74.0, Driver.WorkerWait.idle_and_completion_poll 74.0, batch 26.5, Graphics.Draw 18.4, Graphics.Draw.draw_and_resource_release 17.7, Driver.Packet 8.4, Driver.Packet.draw 7.4, Driver.Draw 7.3, Driver.Draw.draw_enqueued 4.1, Vulkan.DrawFromRecipe 2.9
Longest waits
- Driver.WorkerWait (queue worker 0x0) 13.7 ms at 11299 ms, present 1053
- Driver.WorkerWait (queue worker 0x0) 12.7 ms at 10863 ms, present 1048
- Driver.WorkerWait (queue worker 0x0) 12.6 ms at 11383 ms, present 1054
- Driver.WorkerWait (queue worker 0x0) 12.3 ms at 3730 ms, present 968
- Driver.WorkerWait (queue worker 0x0) 12.1 ms at 3828 ms, present 969
- Driver.WorkerWait (queue worker 0x0) 12.0 ms at 804 ms, present 934
- Driver.WorkerWait (queue worker 0x0) 11.9 ms at 6613 ms, present 998
- Driver.WorkerWait (queue worker 0x0) 11.8 ms at 6515 ms, present 997
- Driver.WorkerWait (queue worker 0x0) 11.8 ms at 2761 ms, present 957
- Driver.WorkerWait (queue worker 0x0) 11.7 ms at 5549 ms, present 987
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
- batch 4360: 7.5 ms at 11276 ms, present 1053: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.4, Graphics.DrawWithRecipe (draw committer) 0.4, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.4, Recorder.Submit (draw committer) 0.1
- batch 4189: 7.0 ms at 10841 ms, present 1048: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1
- batch 4393: 6.9 ms at 11360 ms, present 1054: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1
- batch 1708: 6.7 ms at 4376 ms, present 975: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
- batch 4359: 6.7 ms at 11264 ms, present 1053: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1
AI-assisted: yes (Claude Code)
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
I reviewed head 28f80c25a9b466b067a3c3b9bbbd504d548e0376; the updated evidence supports reduced host-memory allocation churn, while correctly making no repeatable FPS-gain claim.
What I ran
- Compared PR head
28f80c25a9b466b067a3c3b9bbbd504d548e0376with currentmain1a217758a55c09e817366fa4411daac854eeb3f9; their merge base isaaccd0ba39b7d40fdbf19664575a7e567d8542f7and the merge preview is clean (8c6773cdd121de6ed2d9fa52bfb5f7ee5275c1dd). None of the five PR files changed onmainafter that baseline. - Ran
git diff --check upstream/main...refs/review/upstream-8748andpython tools/check_conventions.py --base upstream/main --head refs/review/upstream-8748on Linux with Python 3.11.2. No local build or tests were run. - Read the updated SuperTuxKart report on the same Radeon 860M, including the reported paired summaries, trace digests, and trace links.
git merge-base upstream/main refs/review/upstream-8748
git merge-tree --write-tree upstream/main refs/review/upstream-8748
git diff --check upstream/main...refs/review/upstream-8748
python tools/check_conventions.py --base upstream/main --head refs/review/upstream-8748Results
| Check | Result |
|---|---|
| Current-main merge preview | Clean; tree 8c6773cdd121de6ed2d9fa52bfb5f7ee5275c1dd |
git diff --check |
Pass; no output |
| Conventions | Pass; All conventions checks passed. |
| Exact-head focused tests | Author reports 76/76 focused buffer-pool/resource tests passed on 28f80c25a9, with Vulkan validation enabled |
| Matched title captures | Author reports same-machine main aaccd0ba39b7 and PR-head 28f80c25a9b4 captures, summaries, digests, and traces. Buffer placements fell from 8,192+ to 3; the measured FPS modes overlap, so the report does not claim a repeatable FPS gain. |
| Hosted checks | Windows, conventions, labels, eligibility, and report pass; Linux and specialized jobs are skipped |
Findings
Blocking
None.
Non-blocking
The evidence supports the reduced allocation churn. It does not establish a general frame-rate improvement, and the updated description states that limitation clearly.
Sources
- PR-head buffer-pool implementation
- PR-head pool and host-placement tests
- Updated matched-capture report
Not verified
I did not build or run tests locally, download or independently digest the attached traces, or test Linux behavior. Hosted Linux and specialized jobs were skipped.
…the device heap is full A device buffer placed in host memory because the device-local heap was over its VK_EXT_memory_budget was freed on release, so every later request allocated host memory again. On an APU with a 512 MiB carve-out the device-local heap stays over budget, and SuperTuxKart's race made and freed 4096-8192 such 8 MiB buffers per run. They now enter the device tier under their own key and are handed out only when a new allocation would be placed in host memory too, so a device buffer still gets device-local memory whenever it fits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReclaimIdleDevice (boykopovar#8672) scans deviceTier for the oldest idle slots, and the host-placed device buffers this change retains live there too. An older host-placed slot could satisfy the requested byte count, so the reclaim freed host memory, reported it as released device memory and left the idle device-local slots in place. The scan now skips hostPlaced allocations. IdleReclaimSkipsHostPlaced retains an older host-placed and a younger device-local slot and checks that the reclaim frees and counts only the device-local one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Heap The texture-cache release before a host placement (from main) re-queried the budget through locals that DeviceMemoryType no longer has since the heap report moved into ReportedHeap. Use the report and re-read it after a release, with the same fit test as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28f80c2 to
7cd426f
Compare
|
Rebased onto current
Tested on the RTX 5060 Ti desktop (Windows, driver 621.01, WinLibs GCC 15.2.0, Release).
Neither log has AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (5 IDs in 480 tests)Skipped (44)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
@TechLevelZero thanks for the run. About the slow-test lines, which show up on most PRs and on main too: the same tests are much faster on my Windows machine, with the same environment (
My validation layer is the one from Vulkan SDK 1.4.363.0, with default settings.
AI-assisted: yes (Claude Code) |
# Conflicts: # core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp
✅ AMD GPU test: passedPR head
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (7, not counted against this PR)Validation IDs already present on main (4 IDs in 517 tests)Skipped (58)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
XairRrR
left a comment
There was a problem hiding this comment.
Re-checked — approved
Since my last review the branch was rebased onto newer main and gained commit 7cd426f00f, which re-reads the heap report through ReportedHeap after main's texture-cache release. main 4f41f4c was also merged into it, and the description now has matched 860M captures. The merged tree builds, the focused tests pass with the Khronos layer active, and the new checks still fail without the production change. One new non-blocking point: how this change interacts with main's texture-cache release.
What changed since my last review
- Rebase.
48b6bc5d12now passes thecategoryargument thatmainadded toBufferPool::Take. Otherwise its logic is unchanged.0ac7f6d55e(the reclaim skip) is identical to the commit I reviewed before. - New commit
7cd426f00f.main'se2c1c305ffadded a texture-cache release toDeviceMemoryTypebefore it falls back to host memory. That code re-read the budget through locals this PR removed. It now callsReportedHeap(heap)again after a release and applies the same fit test. 53570aa5ffmergesmain4f41f4c. The only conflict was intests/BufferPool.cpp. The resolution keepsIdleReclaimSkipsHostPlacedand its call inmain().- Description. It now has the matched SuperTuxKart pairs on
mainaaccd0ba39and head28f80c25a9, and it claims only the removed allocation churn, not a frame-rate gain. TheGPUs testedline now names the RTX 5060 Ti too.
What I ran
Head 53570aa5ffeabb0b4b49dd951649de8a5afa0e71, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 25ccd1a440c2976735630c9f7f144eb5981ffc72. Machine: Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...53570aa5ffeabb0b4b49dd951649de8a5afa0e71
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
# negative control: BufferPool.hpp, Context.hpp, BufferPool.cpp, Resources.cpp from main; PR tests kept
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:<path> > <path>
ninja -C build agc_buffer_pool_tests agc_driver_native_multisample_depth_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
ctest --test-dir build -j8 -V --output-on-failure \
-R '^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_driver_native_depth_uniform_planes)$'
# restore the merged files, rebuild, rerun
git show 25ccd1a440c2976735630c9f7f144eb5981ffc72:<path> > <path>
ninja -C build agc_buffer_pool_tests agc_driver_native_multisample_depth_tests agc_device_memory_fallback_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
ctest --test-dir build -j8 -V --output-on-failure \
-R '^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_device_memory_fallback|agc_driver_native_depth_uniform_planes)$'
git status --porcelain| Check | Result |
|---|---|
git diff --check |
Clean, exit 0 |
check_conventions.py |
All conventions checks passed. |
Build and libs, merged tree (script) |
OK |
| Selected tests, merged tree (script) | 2173 run, 2052 passed, 114 expected skips, 0 new failures. All 7 failures also fail on main: the denormal/division agc_driver_* tests, vector_constant_factor_tininess and one unwrap_self test. |
| Validation comparison (script) | Layer loaded in 769/770 tests. One "new" ID, VUID-vkCmdDispatch-groupCountX-00386 in agc_driver_native_depth_uniform_planes, a test that is newer than the baseline. It comes from main; see below. |
| Focused tests, merged tree, with validation | 5/5 passed (agc_buffer_pool 0.49 s) |
| Negative control | agc_buffer_pool fails with 3 messages; see below |
| Worktree after restore | git status --porcelain empty |
VUID check with main's production files
With the four production files restored from main, agc_driver_native_depth_uniform_planes reports the same 4× VUID-vkCmdDispatch-groupCountX-00386 as on the merged tree. The test was added on main by c9987271e3, after the validation baseline d1ae628bc2. The message comes from main, not from this PR.
Negative control
I restored BufferPool.hpp, Context.hpp, BufferPool.cpp and Resources.cpp from main and kept the PR's tests/BufferPool.cpp. agc_buffer_pool fails; the two small-device modes still pass:
FAIL: a device buffer placed in host memory was not kept in the pool after its release
FAIL: a device buffer over the device-local budget did not reuse the retained host-placed buffer
FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local one
After restoring the merged files and rebuilding, all 5 tests pass.
Previous findings
- A refused host-placed slot is put back as the newest slot and counted as a hit. Still open, non-blocking.
Resources.cppL179-L186 still callscache->Put(*pooled), andPutgives the slot a fresh++clock(BufferPool.cppL589). DeviceLocalFits(~0u, capacity)does not test what the fresh path tests. Still open, non-blocking. The fresh path uses the buffer'smemoryTypeBitsand the alignment-roundedClassAllocationBytes.GPUs testedline vs the validation evidence. Resolved for the checklist: the line now names the RTX 5060 Ti next to the 860M. The author has not posted amain-side layer run on the 5060 Ti. The lavapipe comparison here, the AMD RX 6300 CI comment on this exact head, and the earlier NVIDIA runs show no new IDs, which covers that gap.- Overlap with #4472. Still open, non-blocking. The description still records it and leaves the order to be agreed.
The perf evidence MarcZX10 asked for is now posted (three PR runs and two main runs, with summary lines, traces and digests). It supports the narrowed claim that 8192+ host placements per run drop to 3. I accept those numbers as author-reported; I could not reproduce them.
New findings
Blocking
None.
Non-blocking
- The host-slot probe skips
main's texture-cache release, so a retained host slot now wins over a device-local placement that the cache release could make possible. Sincee2c1c305ff, a fresh over-budget request first asks the texture caches for the request plus the heap's overage. If they release enough, or the budget read again has room, the request stays device-local (Context.hppL357-L372). The probe inResources.cppL182 only reads the budget throughDeviceLocalFits. While a matching host-placed slot exists, the cache release never runs for that size, and the buffer stays in host memory. This contradicts two claims in the description: "a buffer still gets device-local memory whenever there is room for it" and "both decide with the same rule". It may be the better trade-off: releasing textures on every 8 MiB request on a permanently full 512 MiB heap could just move the churn into the texture cache. But it was not measured: the captures are onaaccd0ba39, which predatese2c1c305ff(git merge-base --is-ancestorconfirms this). Suggested fix: either state that a retained host slot is preferred over a texture-cache release, and add a mock case withcacheReclaimset that pins this, or try the release before taking the host slot. - Minor: the re-check after a release (
Context.hppL368-L371) writes out the fit test by hand instead of callingafter.Fits(bytes). The two differ only when the budget is 0, which the firstFitsalready handled, so behaviour is the same. CallingFitswould keep a single rule.
Not verified
- The performance numbers. I have no APU with a small carve-out. The host-placement path runs here only in the mock tests.
- The interaction with the texture-cache release (new finding 1) in a title.
- Windows and AMD/NVIDIA hardware drivers. I ran on lavapipe only, and launched no title. I did not run the full suite: only the script's selected tests plus the 5 focused tests above.
…exture-cache release Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eapReport::Fits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @XairRrR. Both new points are addressed at
AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 517 tests)Skipped (48)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
XairRrR
left a comment
There was a problem hiding this comment.
Re-checked — approved
Since my last review, bd4354ef0c adds HostSlotBeforeCacheRelease, which pins the order between a retained host-placed slot and main's texture-cache release. d845d4bfc5 replaces the hand-written re-check after a release with after.Fits(bytes). The description now states the order and that the captures predate e2c1c305ff. Both points I raised last time are addressed. The new test fails in both negative controls, and nothing blocking remains.
What changed since my last review
-
bd4354ef0c(test only).HostSlotBeforeCacheReleaseretains a 176 MiB host-placed buffer, then installs acacheReclaimthat releases any amount and counts its calls. It checks two things. First, a new request of the same size reuses the retained buffer and makes zero release calls. Second, a 64 MiB request, which has no host slot, makes exactly one release call and gets device-local memory. -
d845d4bfc5. InDeviceMemoryType, the re-check after a partial release is nowafter.Fits(bytes)(Context.hppL364-L371). Production code changed nowhere else (git diff 53570aa5ff d845d4bfc5 --stat: 1 line inContext.hpp, 31 lines intests/BufferPool.cpp). -
Description. It now says a matching host-placed slot is taken without a cache release, and it gives the reason. "Whenever there is room" became "whenever the reported budget has room". It notes that the order was not measured in a title.
-
Author reply (11:46 UTC). The author kept the order on purpose and gave two reasons:
- Releasing caches on every request against a heap that stays over budget would move the churn into the texture caches.
- A release that succeeds before the reported budget catches up would put the slot back and still place the new buffer in host memory.
I agree with both: the first is the trade-off I raised, and the second is a real cost of the alternative order. With the order now documented and pinned by a test, I withdraw the request.
What I ran
Head d845d4bfc50963a172bbefb624641ed48e704fb5, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 4abace0fa91fceb7f140487b1aed12fbd3ce130f. Machine: Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...d845d4bfc50963a172bbefb624641ed48e704fb5
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
git diff 53570aa5ffeabb0b4b49dd951649de8a5afa0e71 d845d4bfc50963a172bbefb624641ed48e704fb5 --stat
# negative control A: the probe tries the texture-cache release before keeping a host slot (Resources.cpp line 182)
# if (pooled && ((context.cacheReclaim != nullptr && context.cacheReclaim(capacity, true) >= capacity) || context.DeviceLocalFits(~0u, capacity)))
ninja -C build agc_buffer_pool_tests
ctest --test-dir build --output-on-failure -R '^agc_buffer_pool'
# negative control B: BufferPool.hpp, Context.hpp, BufferPool.cpp, Resources.cpp from main; PR tests kept
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:<path> > <path>
ninja -C build agc_buffer_pool_tests
ctest --test-dir build --output-on-failure -R '^agc_buffer_pool'
# restore merged files, rebuild, focused run with the layer requested
git show 4abace0fa91fceb7f140487b1aed12fbd3ce130f:<path> > <path>
git status --porcelain
ninja -C build agc_buffer_pool_tests agc_device_memory_fallback_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
ctest --test-dir build -j8 --test-load 32 -V --output-on-failure \
-R '^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_device_memory_fallback|agc_memory_accounting.*)$'| Check | Result |
|---|---|
git diff --check |
Clean, exit 0 |
check_conventions.py |
All conventions checks passed. |
Build and libs, merged tree (script) |
OK |
| Selected tests, merged tree (script) | 2173 run, 2052 passed, 114 expected skips, 0 new failures. The 7 failures (the denormal/division agc_driver_* tests, vector_constant_factor_tininess and one unwrap_self test) also fail on main. |
| Validation comparison (script) | The layer loaded in 769/770 tests. One ID is listed as new: VUID-vkCmdDispatch-groupCountX-00386 in agc_driver_native_depth_uniform_planes. That test is newer than the baseline d1ae628bc2. My last review reproduced this ID with main's production files, and the one production line changed since cannot reach a dispatch. It is not counted against this PR. |
| Focused tests, merged tree | 7/7 passed (agc_buffer_pool 0.55 s). No VUID- lines and no was not found but was requested lines. These are mock-device tests. |
| Negative control A (release first) | agc_buffer_pool fails with the 3 new messages |
Negative control B (production from main) |
agc_buffer_pool fails with 6 messages |
| Worktree after restore | git status --porcelain empty |
Negative control output
A, release tried before keeping the host slot:
FAIL: a retained host-placed buffer was passed over for a texture-cache release
FAIL: taking a retained host-placed buffer asked the texture caches to release memory
FAIL: a new device buffer over the device-local budget did not get device-local memory after the texture caches released room
B, production files from main:
FAIL: a device buffer placed in host memory was not kept in the pool after its release
FAIL: a device buffer over the device-local budget did not reuse the retained host-placed buffer
FAIL: a retained host-placed buffer was passed over for a texture-cache release
FAIL: taking a retained host-placed buffer asked the texture caches to release memory
FAIL: a new device buffer over the device-local budget did not get device-local memory after the texture caches released room
FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local one
In both runs, agc_buffer_pool_small_device_shared and _no_staging passed. Control A confirms the author's statement that all three checks fail.
Previous findings
- A refused host-placed slot is put back as the newest slot and counted as a hit. Still open, non-blocking.
Resources.cppL179-L186 is unchanged. DeviceLocalFits(~0u, capacity)does not test what the fresh path tests (the fresh path usesmemoryTypeBitsandClassAllocationBytes). Still open, non-blocking. The code is unchanged.GPUs testedline. Resolved in my last review. Nothing changed.- Overlap with #4472. Still open, non-blocking. The description still records it, and the order still has to be agreed.
- The host-slot probe skips
main's texture-cache release. Resolved. The order is now intentional and documented in the description.HostSlotBeforeCacheReleasepins it, and that test fails when the order is reversed (control A). - Minor: the re-check after a release is written out by hand. Resolved. It now calls
after.Fits(bytes)(Context.hppL368-L371).
New findings
Blocking
None.
Non-blocking
None.
Not verified
- The performance numbers. The SuperTuxKart captures on the Radeon 860M are author-reported. I have no APU with a small carve-out, and the host-placement path runs here only in the mock tests.
- The cache-release order in a title. The author states this too: the captures predate
e2c1c305ff. - Windows and AMD/NVIDIA hardware drivers. I ran on lavapipe only, and launched no title. I did not rerun
agc_driver_native_depth_uniform_planeswithmain's files on this head; the attribution tomainrests on my previous run. - The author's 7/7 on the 860M is accepted as author-reported.
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 517 tests)Skipped (48)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
What
When a device buffer doesn't fit in the budget
VK_EXT_memory_budgetreports for the device-local heap,DeviceMemoryTypeplaces it in host memory (d04e983). On release such a buffer was freed rather than pooled, so that host memory would never be handed out as device memory later. That keeps placement right, but while the heap stays over budget, every request allocates host memory again and frees it on release.An APU with the common 512 MiB carve-out is always in that state. On a Radeon 860M (device-local heap 512 MiB, budget 486 MiB) the heap reports 512/486 MiB from the menu on. SuperTuxKart's tutorial race placed 8192 buffers in host memory per run, about 97–102 GiB, nearly all of them 8 MiB. A discrete GPU whose VRAM sits at its budget takes the same path.
hostPlaced, a new field ofBufferAllocationand of the pool's slot key.DeviceBufferasks for a device-local slot first. Only on a miss does it take a host-placed slot. It keeps that slot only whenContext::DeviceLocalFitssays a new allocation would not fit the device-local heap either; otherwise it puts the slot back and allocates as before. So a buffer gets device-local memory whenever the reported budget has room for it, and the budget is read only when a host-placed slot is there to take.DeviceMemoryTypeasks them before a new host placement (sincee2c1c305ff), but on a heap that stays over budget, a release for every such request would move the churn into the texture caches. A new allocation, with no host-placed slot to take, still asks the caches first.HostSlotBeforeCacheReleasepins both. This order was not measured in a title: the captures below predatee2c1c305ff.DeviceLocalFitsandDeviceMemoryTypeshare one budget read (Context::ReportedHeap) and its fit test; onlyDeviceMemoryTypegoes on to the texture-cache release.Tested
Head
28f80c25a9onmainaaccd0ba39.agc_buffer_poolpasses.HostPlacementandRefusedDevicePlacementcheck three things: a host-placed buffer is kept after release; it is reused while the device-local heap has no room; and a request that fits gets device-local memory, not the retained host memory. WithResources.cppfrommain, the first two checks fail.HostSlotBeforeCacheRelease(headd845d4bfc5, onmain4f41f4c375) retains a host-placed buffer, then sets a texture-cache release that would free any amount: the next request of that size takes the retained buffer without calling it, and a new request of another size calls it once and gets device-local memory. With the probe inResources.cppchanged to try the release before taking the slot, all three checks fail.agc_buffer_pool, its two small-device modes, the threeagc_memory_accountingtests andagc_device_memory_fallbackpass, 7/7, on the Radeon 860M laptop (Windows 11, WinLibs GCC, Release).ctest -R "buffer|pool|resources|device_memory|host_placement|budget"withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: 76/76 pass on Windows 11, i5-10600K, RTX 5060 Ti (driver 621.01), WinLibs GCC 15.2.0, Release.1002:1114, 512 MiB carve-out, driver 32.0.13058.8001), Windows 11 26300,APS5_TRACE_SECONDS=95:20,mainand this head alternating in one session. Summary lines, traces andtools/trace_digest.pyoutput for every run are in this comment.mainaaccd0ba3928f80c25a9The change removes the host-memory allocation churn. On current
mainthe frame rate difference is within run-to-run spread: both trees fall into the same two modes, about 27 and 44 ms of GPU time per present. An earlier comparison onec7eacc62, where the race ran at about 2.5 FPS, gave 2.47 FPS onmainand 2.94 with this change; that gain does not reproduce on currentmain.Overlap. #6553 changes the body of
DeviceMemoryType(host heap selection), so the two conflict textually there, not in what they do. #4472 stops pooling device buffers while the device-local heap is over budget. On a 512 MiB carve-out that is always the case, so as written it would drop these host-placed slots too and bring the churn back. They hold no device-local memory, so I think they could be left out of that check.tools/pr_overlap.pyfound no other overlap among the PRs it could compare.Idle device reclaim (#8672).
ReclaimIdleDevicenow skips host-placed slots. They live indeviceTier, but their memory is on the host heap.IdleReclaimSkipsHostPlacedretains an older host-placed slot and a younger device-local slot, and checks that the reclaim frees and counts only the device-local one. Without the skip it fails.agc_buffer_pooland its two small-device modes pass, 3/3.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)