Repository navigation
perf(agc): size the device staging pool from the device-local heap - #1147
Conversation
e8979c8 to
2625e61
Compare
2625e61 to
be04d4a
Compare
|
Rebased onto current |
|
The linux failure on be04d4a is a timeout in |
|
Follow-up on the
|
be04d4a to
6d1cf27
Compare
|
Rebased onto |
adriadam10
left a comment
There was a problem hiding this comment.
This conflicts with main since commit 28345b0 (device size classes), and it isn't a mechanical rebase:
BufferPool::DeviceTieredandCapacity(bytes, properties)are static and callDeviceBudget()to know whether the device tier is enabled. WithDeviceBudget(memory)there is noContextthere, so they can't compute the heap-derived value. Keep the environment check (APS5_STAGING_POOL_MIB=0disables the tier) in a static helper that doesn't need the heap, and use the heap-derived value only fordeviceTier.budgetin the constructor, soCapacityandtierForstay consistent.- After the rebase, keep
stagingPoolBudgetTestsand make sure it still covers the 16 GiB / 2 GiB / host-only-heap cases. - The linux failure on the current head is the
agc_driver_buffer_formattimeout on lavapipe you already described (#1762), not this change; it should clear on a re-run after the rebase.
6d1cf27 to
77fd100
Compare
|
Rebased onto current
|
|
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.
|
The buffer pool's device tier (detiler scratch buffers and the staging shadows of written guest buffers) retained at most 512 MiB by default. A title whose working set of these buffers is larger allocates and frees device memory continually: PPSA14632 (LEGO Horizon Adventures) had 70761 misses and 69828 evictions per 10 s with 485 of 512 MiB retained, each a vkAllocateMemory or vkFreeMemory. The default budget is now an eighth of the largest device-local heap, and at least the old 512 MiB, so a 16 GiB card retains up to 2 GiB and an 8 GiB card 1 GiB. APS5_STAGING_POOL_MIB still sets it. Only the constructor knows the device, so only the budget comes from the heap. Whether the tier is in use at all (APS5_STAGING_POOL_MIB unset or not 0) stays a static check, DeviceTierEnabled, which Capacity, Usage and tierFor share, so the size classes and the tier stay consistent. On PPSA14632 with 2 GiB the device tier has 1312 misses and 99 evictions per 10 s (1628 MiB retained), and presents rise from about 34 to about 39 per 10 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
77fd100 to
3bb4494
Compare
adriadam10
left a comment
There was a problem hiding this comment.
Checked the rework against the size classes: DeviceTiered/Capacity only depend on the static DeviceTierEnabled(), the heap-derived budget is used only in the constructor. Built and ran agc_driver_graphics on RADV; the new stagingPoolBudgetTests don't compile without the change. Merging.
What
The buffer pool's device tier (the detiler's scratch buffers and the staging shadows of written guest buffers) kept at most 512 MiB by default. When a title's working set of these buffers is larger, the driver allocates and frees device memory continually. PPSA14632 had 70761 misses and 69828 evictions per 10 s with 485 of 512 MiB retained, and each one is a
vkAllocateMemoryorvkFreeMemory.APS5_STAGING_POOL_MIBstill sets it explicitly, and 0 still disables the tier.BufferPool::DeviceBudgettakes the memory properties and is public, so the rule can be tested.Tested
Linux 7.2.9 (Arch), Mesa 26.2.4 RADV, RX 9070 XT (16 GiB).
agc_driver_graphics: newstagingPoolBudgetTests(an eighth of a 16 GiB device-local heap is 2 GiB, a 2 GiB heap gives the 512 MiB floor, a host-only heap does not count).ctest: 463 of 463 pass on currentmain.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code