Repository navigation
drm/asahi: g17: grow busy tiler heaps on the 25G83 firmware too - #1986
AxxzyWasTaken wants to merge 2 commits into
Conversation
The host grows a render pair's tiler heap ahead of a render only when the render is submitted to an idle pair: host_growth_target() returns early while the pair has work in flight, and leaves growth to the firmware's grow requests. A pair that is never idle, because renders are queued back to back, keeps the heap its first render left. On the A18 Pro the next tiling pass then waits for the previous scene's pages to be freed instead of asking for growth, so tiling and the previous fragment pass run one after the other. One drain of the pair is enough to size the heap for two scenes, after which they overlap. Grow a busy A18 Pro pair's heap ahead of the render as well, through the path a firmware grow request already takes while work is in flight: - the target is the layout's blocks, or the automatic target from the page high-water (three times the high-water once twice it no longer fits), capped at the heap's capacity. The high-water is read without requesting its reset, so the idle growth check and the shrink period keep their samples; - prepare_growth() without a descriptor snapshot, then commit_growth(): new blocks are appended to the inventory ring after the committed cursor and published by advancing it. The firmware-owned page list, PB state and PB descriptor are left alone and existing blocks never move. The firmware takes the new blocks without a grow reply; - the growth is skipped while the device's GPU memory, or the client's, would come within an eighth of its limit. A growth that cannot be prepared or committed keeps the heap and publishes the render as before. Either case retries a shrink period later; - the idle shrink may give busy growth back down to the size the heap had before it. That growth only serves renders in flight together. The A18 Pro firmware build (26A428) takes it. The 25G83/25F84 builds, where it is not measured, and the M5 heaps, which are never shrunk, keep growing on idle submissions only. aurora.g17_busy_tvb_grow (0644, default 1) turns it off at run time for an A/B. Report every tiler heap size change through the asahi_g17_message tracepoint as kind 3: source << 56 | changed << 48 | blocks before << 24 | blocks after, with source 1 an idle host growth, 2 a busy host growth (changed 0: refused or failed), 3 a granted firmware request, 4 a refused or capped one and 5 a shrink. On the A18 Pro, rt.scene raster at queue depth 2 runs about 18 % faster: the heap grows within the first frames instead of waiting for a drain. The light and medium presets are unchanged. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Measured on the 25G83 M4 Pro (J616s, 48 GiB), the heavier scene this asks for. Test: off-screen GLES, N screen-spanning triangles into a stored 3456x2234 RGBA8 + D24S8 target. Two frames in flight (fences, no
Without it, the busy pair keeps its first-frame heap for every frame (10.5-11 us per triangle). With it on, the heap grows within two frames, and later frames run at 2.75 us per triangle, the same as an idle pair. 0 GPU recoveries. It is now our daily kernel. Past 1,118 blocks the cap is the next limit; #2186 scales it with memory. |
903b561 to
885580a
Compare
7771d2f to
6d406e1
Compare
|
Heads-up: per the review on #1902, its rework (6d406e1, force-pushed to Assisted-by: LLM (Claude:Opus 5.5) |
Commit 7771d2f ("drm/asahi: g17: grow a busy render pair's tiler heap ahead of the render") grows a busy render pair's tiler heap ahead of the render on the A18 Pro firmware (26A428) only. 25G83, the firmware the M4 Pro and the M4 Max (T6040, T6041) run, kept growing on idle submissions only, because it was not measured. Turn it on for 25G83. 25F84, which takes the rest of its variant from 25G83, keeps it off: nothing has run it there. The J616c (M4 Max, 32 cores, 25G83) has run with it for about 13 hours, including a Minecraft session and the GL and Vulkan off-screen tests, with no GPU faults, recoveries or timeouts. aurora.g17_busy_tvb_grow=0 still turns it off at run time. Not shown: a speed-up. An off-screen A/B on the J616c (7,000 small draws per frame, full-screen passes, a depth-only pass switch; three runs each with the run-time switch off and on) stayed within its own run-to-run spread. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
885580a to
96d1a97
Compare
|
Superseded. The #1902 rework (6d406e1) drops Assisted-by: LLM (Claude:Opus 5.5) |
Stacked on #1902 (base:
gpuperf/g17-busy-tvb-grow), so the diff shows only this commit.#1902 grows a busy render pair's tiler heap ahead of the render on the A18 Pro firmware (26A428) and leaves 25G83, the firmware of the M4 Pro and the M4 Max, on idle growth only because it wasn't measured there. This turns it on for 25G83. 25F84, which takes the rest of its
Variantfrom 25G83, keeps it off: nothing has run it there.Tested on the J616c (M4 Max, 32 cores, 25G83):
tools/asahi/run-host-tests.py: 320/320 pass on this branch.Not shown: a speed-up. An off-screen A/B on the J616c, three runs each with
aurora.g17_busy_tvb_growoff and on (run-time switch), stayed within its own run-to-run spread:So this is the M4 Pro/Max side of #1902 for whoever can measure a heavier scene.
aurora.g17_busy_tvb_grow=0still turns it off at run time.Assisted-by: LLM (Anthropic:Claude Opus 5.5)