Skip to content

ci(build): key the Mesa shader cache by the runner's CPU model too - #5653

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:ci-mesa-cache-cpu-model
Oct 14, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:ci-mesa-cache-cpu-model

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

What

Since 03:11 UTC today every Linux job that lands on the most common ubuntu-latest CPU profile (flags hash 9e64157087e3) fails agc_driver_tessellation with ***Exception: Illegal: main at 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/cpuinfo flags. 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_cpu in lp_screen.c). Two runners with the same flags but different models therefore share one cache. With CI's GALLIUM_OVERRIDE_CPU_CAPS=avx, the hull shaders of this test (draw_llvm_tcs_variant) compile to vgf2p8affineqb (GFNI) whenever the host name is znver4, znver5, icelake-server or sapphirerapids, and not for znver3; Zen 3 (EPYC 7763) has no GFNI, so loading such an object there is #UD, SIGILL. #5234 added one new hull variant; the first main push 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, model and flags (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 prints model name so a future mismatch can be read off the log. The old 9e64157087e3 caches no longer match any key, so nothing needs deleting; a stopgap without this change would be deleting mesa-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), main a14ae8e, Release, the Ubuntu 24.04 mesa-vulkan-drivers 25.2.8 lavapipe (LLVM 20.1.2) that CI installs, GALLIUM_OVERRIDE_CPU_CAPS=avx:

  • agc_driver_tessellation passes cold and from its own cache.
  • With getHostCPUName() interposed through LD_PRELOAD, fresh caches for znver3 and x86-64 contain no GFNI, VAES, AVX-512 or mask-register instructions; znver4, znver5, icelake-server and sapphirerapids caches contain vgf2p8affineqb in all six draw_llvm_tcs_variant objects and in no other object. A znver3 run restores the znver4 cache as hits (same keys), which is the cross-model load CI performs.
  • The run table (run, flags hash, cache restored, result) for every push and dispatch build since 02:20 UTC is below.
  • The new key command yields one 12-character hash locally and differs from the old one.
Run table
Linux job of build.yml, 2026-10-14 UTC. cpu = flags hash in the Mesa cache key; mesa = sha of the restored shader cache; ccache = restored ccache key
start    run            sha       tree      cpu          mesa      ccache                   agc_driver_tessellation
02:21:41 38500617642    71c71f50b main      9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.53s
02:25:36 38500951495    71c71f50b PR #5596  c8543a3b59d7 016db923a 2026-10-14T01:59:35.612Z Passed 0.30s
02:25:57 38500981439    71c71f50b PR #4615  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.52s
02:26:01 38500988672    71c71f50b PR #4704  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.53s
02:26:06 38500995574    71c71f50b PR #4764  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.54s
02:26:11 38501002694    71c71f50b PR #4789  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.53s
02:26:15 38501010157    71c71f50b PR #4796  3283e687608a 0aa4cb1c2 2026-10-14T01:59:35.612Z Passed 0.47s
02:26:20 38501017227    71c71f50b PR #4822  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.53s
02:26:23 38501021213    71c71f50b PR #5190  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.53s
02:26:25 38501024415    71c71f50b PR #4825  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.51s
02:26:27 38501027660    71c71f50b PR #5199  9e64157087e3 feddf7f4c 2026-10-14T01:59:35.612Z Passed 0.51s
02:26:30 38501030933    71c71f50b PR #4930  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.38s
02:26:32 38501034731    71c71f50b PR #5219  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.40s
02:26:35 38501037756    71c71f50b PR #4950  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.39s
02:26:37 38501041946    71c71f50b PR #5262  c8543a3b59d7 016db923a 2026-10-14T02:28:36.861Z Passed 0.32s
02:26:39 38501044713    71c71f50b PR #4951  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.39s
02:26:42 38501049084    71c71f50b PR #5133  f71a44782921 5a81f6085 2026-10-14T02:28:36.861Z Passed 0.26s
02:26:44 38501051604    71c71f50b PR #4955  3283e687608a 0aa4cb1c2 2026-10-14T02:28:36.861Z Passed 0.51s
02:26:47 38501056103    71c71f50b PR #5158  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.40s
02:26:49 38501058380    71c71f50b PR #4986  f71a44782921 5a81f6085 2026-10-14T02:28:36.861Z Passed 0.26s
02:26:52 38501063385    71c71f50b PR #5197  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.39s
02:26:53 38501065692    71c71f50b PR #4988  c8543a3b59d7 016db923a 2026-10-14T02:28:36.861Z Passed 0.32s
02:26:56 38501070237    71c71f50b PR #5094  3283e687608a 0aa4cb1c2 2026-10-14T02:28:36.861Z Passed 0.52s
02:27:01 38501077514    71c71f50b PR #5255  4aece38d4747 ee9037d85 2026-10-14T02:28:36.861Z Passed 0.26s
02:27:22 38501106948    0df6e295c main      9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.39s
02:27:27 38501113730    0df6e295c PR #5152  c8543a3b59d7 016db923a 2026-10-14T02:28:36.861Z Passed 0.46s
02:27:31 38501120997    0df6e295c PR #5195  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.41s
02:27:36 38501128004    0df6e295c PR #5234  c8543a3b59d7 016db923a 2026-10-14T02:28:36.861Z Passed 0.46s
02:27:41 38501135182    0df6e295c PR #5284  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.41s
02:32:26 38501564588    2ba3147ac PR #5596  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.39s
02:38:30 38502093213    75ceccd5d PR #5219  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.42s
02:38:52 38502123547    75ceccd5d PR #4704  9e64157087e3 71c71f50b 2026-10-14T02:28:36.861Z Passed 0.39s
02:49:05 38503011090    d1b3aa137 main      86d6586a2900 83924acb1 2026-10-14T02:50:03.272Z Passed 0.48s
02:55:31 38503585293    970316ae0 PR #5152  9e64157087e3 0df6e295c 2026-10-14T02:55:46.997Z Passed 0.42s
02:55:53 38503614627    f265cd559 main      4aece38d4747 ee9037d85 2026-10-14T02:55:46.997Z Passed 0.35s
02:57:28 38503751093    f265cd559 PR #4446  9e64157087e3 0df6e295c 2026-10-14T02:55:46.997Z Passed 0.56s
02:59:13 38503896672    f265cd559 PR #5627  4aece38d4747 ee9037d85 2026-10-14T02:55:46.997Z Passed 0.33s
03:00:12 38503979375    f265cd559 PR #5109  9e64157087e3 0df6e295c 2026-10-14T02:55:46.997Z Passed 0.56s
03:05:04 38504402218    f5cda839e main      9e64157087e3 0df6e295c 2026-10-14T03:02:50.305Z Passed 0.52s
03:06:45 38504550021    a5f493f90 main      c8543a3b59d7 016db923a 2026-10-14T03:21:32.176Z Passed 0.56s
03:06:45 38504550021-a1 a5f493f90 main      9e64157087e3 f5cda839e 2026-10-14T03:11:23.703Z ***Exception: Illegal 2.87s
03:10:42 38504895798    a5f493f90 PR #5073  4aece38d4747 f265cd559 2026-10-14T03:11:23.703Z Passed 0.28s
03:10:47 38504901581    a5f493f90 PR #5160  4aece38d4747 f265cd559 2026-10-14T03:21:32.176Z Passed 0.31s
03:10:50 38504906985    a5f493f90 PR #5161  86d6586a2900 d1b3aa137 2026-10-14T03:11:23.703Z Passed 0.61s
03:10:54 38504912169    a5f493f90 PR #5176  4aece38d4747 f265cd559 2026-10-14T03:11:23.703Z Passed 0.30s
03:10:58 38504917803    a5f493f90 PR #5198  4aece38d4747 f265cd559 2026-10-14T03:11:23.703Z Passed 0.27s
03:11:07 38504929486    a5f493f90 PR #5371  c8543a3b59d7 016db923a 2026-10-14T03:11:23.703Z Passed 0.41s
03:11:11 38504934866    a5f493f90 PR #4593  9e64157087e3 f5cda839e 2026-10-14T03:11:23.703Z no result
03:11:14 38504940112    a5f493f90 PR #4767  9e64157087e3 f5cda839e 2026-10-14T03:11:23.703Z Passed 0.42s
03:11:18 38504945336    a5f493f90 PR #5181  c8543a3b59d7 016db923a 2026-10-14T03:11:23.703Z Passed 0.47s
03:11:22 38504950405    a5f493f90 PR #5214  4aece38d4747 f265cd559 2026-10-14T03:11:23.703Z Passed 0.28s
03:11:26 38504955924    a5f493f90 PR #5321  f71a44782921 5a81f6085 2026-10-14T03:11:23.703Z Passed 0.56s
03:11:34 38504966762    a5f493f90 PR #5384  9e64157087e3 a5f493f90 2026-10-14T03:21:32.176Z ***Exception: Illegal 2.67s
03:11:49 38504988802    a5f493f90 PR #4979  f71a44782921 5a81f6085 2026-10-14T03:11:23.703Z Passed 0.46s
03:12:01 38505005807    a5f493f90 PR #4931  4aece38d4747 f265cd559 2026-10-14T03:11:23.703Z Passed 0.31s
03:12:32 38505051182    a5f493f90 PR #5109  c8543a3b59d7 016db923a 2026-10-14T03:11:23.703Z Passed 0.44s
03:13:35 38505140772    a5f493f90 PR #5597  f71a44782921 5a81f6085 2026-10-14T03:11:23.703Z Passed 0.35s
03:13:45 38505156894    a5f493f90 PR #5137  c8543a3b59d7 016db923a 2026-10-14T03:11:23.703Z Passed 0.86s
03:13:56 38505172235    a5f493f90 PR #5290  9e64157087e3 f5cda839e 2026-10-14T03:11:23.703Z ***Exception: Illegal 2.50s
03:14:07 38505187416    a5f493f90 PR #5367  c8543a3b59d7 016db923a 2026-10-14T03:11:23.703Z Passed 0.41s
03:14:18 38505203208    a5f493f90 PR #4903  9e64157087e3 f5cda839e 2026-10-14T03:11:23.703Z ***Exception: Illegal 2.39s
03:14:29 38505218371    a5f493f90 PR #4914  9e64157087e3 f5cda839e 2026-10-14T03:11:23.703Z ***Exception: Illegal 2.72s
03:23:46 38506025099    a5f493f90 PR #5186  3283e687608a 0aa4cb1c2 2026-10-14T03:21:32.176Z Passed 0.60s
03:26:32 38506264570    a5f493f90 PR #5313  c8543a3b59d7 016db923a 2026-10-14T03:21:32.176Z Passed 0.87s
03:26:45 38506283339    a5f493f90 PR #5109  9e64157087e3 a5f493f90 2026-10-14T03:31:53.851Z ***Exception: Illegal 2.60s
03:29:39 38506528384    a5f493f90 PR #4681  9e64157087e3 a5f493f90 2026-10-14T03:21:32.176Z ***Exception: Illegal 2.61s
03:29:43 38506534282    a5f493f90 PR #4669  9e64157087e3 a5f493f90 2026-10-14T03:21:32.176Z ***Exception: Illegal 2.63s
03:29:48 38506539966    a5f493f90 PR #4628  9e64157087e3 a5f493f90 2026-10-14T03:21:32.176Z ***Exception: Illegal 2.32s
03:31:11 38506668760    a14ae8e23 main      9e64157087e3 a5f493f90 2026-10-14T03:31:53.851Z ***Exception: Illegal 2.47s

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none; every Linux CI run on the common runner profile
  • GPUs tested: n/a; lavapipe (Mesa 25.2.8, LLVM 20.1.2) on Linux
  • AI-assisted: yes

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.
@oneandonlydean
oneandonlydean merged commit f919033 into boykopovar:main Oct 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant