Repository navigation
ci(build): key the Mesa shader cache by the runner's CPU model too - #5653
Merged
oneandonlydean merged 1 commit intoOct 14, 2026
Merged
Conversation
Since boykopovar#5263 the Linux job restores a lavapipe shader cache keyed by the runner's /proc/cpuinfo flags. llvmpipe compiles shaders with LLVM's host CPU *name* (from vendor, family and model) plus the detected feature bits, and keys its cache only by the feature bits, so two runners with the same flags but different models share cached code. A hull shader JIT-compiled on a znver4/znver5 or Ice Lake class host uses GFNI (vgf2p8affineqb); loaded on a Zen 3 host with the same flags it raises SIGILL, which is what agc_driver_tessellation has been hitting on main and on dispatched builds since the first main build after boykopovar#5234 saved that hull variant. Hash vendor_id, cpu family, model and flags into the key, so a runner only restores code compiled for its own CPU model, and print the model name so a future mismatch can be read off the log.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Since 03:11 UTC today every Linux job that lands on the most common
ubuntu-latestCPU profile (flags hash9e64157087e3) failsagc_driver_tessellationwith***Exception: Illegal:mainat a5f493f (first attempt) and a14ae8e, and the dispatched builds of #5109, #4681, #4669, #4628, #5384, #5290, #4903 and #4914. The same jobs pass on every other CPU profile, and the same profile passed 26 of 26 times before 03:11, including builds that already contained #5234.The cause is the lavapipe shader cache that #5263 keys by the runner's
/proc/cpuinfoflags. That is not enough: llvmpipe compiles shaders with LLVM's host CPU name (getHostCPUName(), derived from vendor, family and model) plus the feature bits Mesa detects, and its own cache id covers only the feature bits (update_cache_sha1_cpuinlp_screen.c). Two runners with the same flags but different models therefore share one cache. With CI'sGALLIUM_OVERRIDE_CPU_CAPS=avx, the hull shaders of this test (draw_llvm_tcs_variant) compile tovgf2p8affineqb(GFNI) whenever the host name isznver4,znver5,icelake-serverorsapphirerapids, and not forznver3; Zen 3 (EPYC 7763) has no GFNI, so loading such an object there is#UD, SIGILL. #5234 added one new hull variant; the firstmainpush that compiled it on this profile and saved the cache (f5cda83, 03:11:23) evidently ran on a GFNI-capable host, and every Zen 3 runner since restores that object. The one pass since then (PR #4767's build) is consistent with landing on a GFNI host. This is the same mechanism as #5107, one level down.The key now hashes
vendor_id,cpu family,modelandflags(the inputs of both the host name and the feature bits), so a runner only restores code compiled for its own model, and the step printsmodel nameso a future mismatch can be read off the log. The old9e64157087e3caches no longer match any key, so nothing needs deleting; a stopgap without this change would be deletingmesa-25.2.8-0ubuntu0.24.04.4-9e64157087e3-*entries saved from 03:11 on, but the next save from a GFNI host would poison them again.Nothing points at #5234 or #4772 as the cause: the failure is tied to the cache chain, not the code.
Tested
Not tested in CI (cannot be without pushing). Local evidence, Linux x86-64 (i9-14900KF),
maina14ae8e, Release, the Ubuntu 24.04mesa-vulkan-drivers25.2.8 lavapipe (LLVM 20.1.2) that CI installs,GALLIUM_OVERRIDE_CPU_CAPS=avx:agc_driver_tessellationpasses cold and from its own cache.getHostCPUName()interposed throughLD_PRELOAD, fresh caches forznver3andx86-64contain no GFNI, VAES, AVX-512 or mask-register instructions;znver4,znver5,icelake-serverandsapphirerapidscaches containvgf2p8affineqbin all sixdraw_llvm_tcs_variantobjects and in no other object. Aznver3run restores theznver4cache as hits (same keys), which is the cross-model load CI performs.Run table
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)