In-game hitches are pipelines re-created from blobs on title threads (~1,450 per scene); LARP_PIPELINE_WAIT_MS=8 removes the ≥500 ms ones (RX 7700 XT, Linux/RADV) #51
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/iceboerg00--larp-amd#51
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Raptorbk45 on GitHub · 2026-12-05 23:36 UTC · original
Summary
In-game hitches that look like "shader compilation" are not compilations: they are graphics pipelines being re-created from their on-disk blob, one at a time, on the title's own threads. With a warm cache each scene re-creates about 1,450 pipelines at ~1.6–2 ms each (longest 16 ms), ~2.4–3 s in total. They pile up mainly at world entry (550–830 re-creations inside the same 5 s window as a 400–900 ms freeze) and at scene cuts (frames of 90–115 ms). Meanwhile the 9 pipeline workers that built everything in the menu sit idle.
Cause, as read in
crates/larp-gpu/src/pipeline/make.rs: in the menu every graphics pipeline is built only to write its blob and is then released (the "disk-backed PSO release"). The first draw that uses a released pipeline re-creates it from the blob (CreateGraphicsPipelineStatewithCachedPSO) on the drawing thread, and since the build knows the title's watchdog, draws wait for every pipeline. Nothing remembers between sessions which pipelines were drawn, so every session pays it again.LARP_PIPELINE_WAIT_MS=8(already in the tree, off by default) removes almost all of it with no visible missing draws.Setup
stable257438a(amd-4.2) plus part of gamingwithhomie/larp#183 (faces/jaw/FP16 wave sums only, no pipeline changes).listed=count andcache_uuid); cold runs discarded.Measurement
To count this I added a small diagnostic behind an env var (
LARP_HITCH_MS=<ms>, no effect when unset): every 5 s it prints pipeline requests on title threads split into created from blob / compiled / waited for a worker (count, total ms, longest), plus one line per request and per frame (present to present) ≥<ms>. Happy to open a PR with it if useful.VKD3D_DEBUG=fixme)LARP_PIPELINE_WAIT_MS=8LARP_PIPELINE_WAIT_MS=8VKD3D_DEBUG=fixme: 0 (late variant compiles are not the cause).LARP_CARD_TIMES=1at the world-entry freeze: GPU 40–48 % busy, graphics queue 5.8 ms per frame. The GPU is idle; the freeze is CPU work (the re-creations).WAIT_MS=8the remaining 230–290 ms worst frame is at world entry and is the rest of the load, not re-creations. Comparing internal captures of equivalent frames (world entry, prison, police, beach, title card) I could not see missing draws; skipped draws stayed at 0 except three windows with 1–10 per frame.cache_uuidchanges when Mesa is rebuilt or another ICD is used) had freezes of 1–3 s.ExecuteCommandListstakes ~7.4 ms per frame, so these scenes are CPU-bound.Suggestions
LARP_PIPELINE_WAIT_MS=8(or similar) as the default, at least on AMD/Linux. These numbers are from one machine; worth measuring elsewhere.created::note_quadalready does for quad variants) to a list with a seen-count, and at start-up re-create those from their blobs on the idle workers during the menu / "render phases" wait without releasing them, with a RAM cap. Estimate: ~1,500 pipelines per scene × ~2 ms / 9 workers ≈ 0.3 s more menu time, ~0.2 GB RAM per scene (0.4–0.75 GB for a 3,000–6,000 pipeline session, at the ~123 KB per pipeline the code comments cite). I'm implementing this locally and can report back / open a PR.