Install both Intel VA-API drivers instead of guessing by GPU name - #8490
Install both Intel VA-API drivers instead of guessing by GPU name#8490ironbract wants to merge 2 commits into
Conversation
install/hardware/intel/video-acceleration.sh picked a single VA-API driver by matching the GPU's marketing name from lspci. That's unreliable: Intel reused "HD Graphics" as the name for both Gen7 (Ivy Bridge, needs libva-intel-driver/i965) and Gen8+ (Broadwell and later, needs intel-media-driver/iHD), so Ivy Bridge machines matched the Gen8+ branch and got a driver that can't decode on their hardware. Some older generations (Ironlake, Sandy Bridge, Haswell-ULT) don't say "HD Graphics" or "gma" at all and matched neither branch, so they got no driver installed. Confirmed on real Ivy Bridge HD Graphics 4000 hardware: with only intel-media-driver installed, vainfo fails outright (vaInitialize failed with error code -1). Installing libva-intel-driver alongside it fixes it — libva probes drivers in order at runtime and falls through to the one that actually initializes for the GPU present. Install both drivers rather than extending the name-matching regex or building a GPU-generation table. A table would need entries for every generation's naming quirks and edge cases (e.g. Cherryview/ Braswell is Gen8 but isn't supported by iHD), and would still need maintenance as Intel names new SKUs. Since libva already does driver fallback probing, this sidesteps classification correctly for every past and future generation for the cost of one extra package. Fixes omacom#7866. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Installs both Intel VA-API drivers and migrates existing systems, avoiding unreliable GPU-name classification.
Changes:
- Simplifies Intel GPU detection and package installation.
- Adds a migration for existing installations.
- Adds shell tests for Intel generations and non-Intel GPUs.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
install/hardware/intel/video-acceleration.sh |
Installs both VA-API drivers for detected Intel GPUs. |
migrations/1787689809.sh |
Applies the driver change to existing systems. |
test/shell.d/intel-video-acceleration-test.sh |
Tests installation and migration behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Rather than chase the naming with a generation table, install both drivers; | ||
| # libva probes them in order at runtime and uses whichever one initializes for | ||
| # the GPU it finds, so this is correct on every generation without a table. | ||
| if lspci | grep -iE 'vga|3d|display' | grep -qi 'intel'; then |
There was a problem hiding this comment.
Good catch, fixed in e0c015b — matched on the PCI class name (VGA compatible controller|3D controller|Display controller) instead of the bare substring. Added a regression test for a bus address containing 3d on an unrelated Intel device; confirmed it fails against the prior commit and passes now.
| # that fails to initialize (or none), and this repair doesn't run itself, so | ||
| # bring them in line with the new install-time behavior: install both | ||
| # drivers and let libva pick the one that actually works for the GPU present. | ||
| if lspci | grep -iE 'vga|3d|display' | grep -qi 'intel'; then |
There was a problem hiding this comment.
Fixed alongside the leaf script in e0c015b, same class-name anchoring, with a matching regression test.
Removing the old name-based driver-selection branches also removed their accidental second filter: previously a false positive from the loose 'vga|3d|display' outer grep (e.g. an unrelated Intel device at PCI bus address 3d:00.0, which contains "3d" as plain text) usually didn't also match a GPU marketing-name pattern, so nothing installed. With that branch gone, any outer false positive now installs the video-acceleration stack unconditionally. Match on the actual PCI class name (VGA compatible controller / 3D controller / Display controller) instead of a bare substring, in both the install-time leaf and the migration, so a bus address or unrelated device description can no longer trigger a false match. Addresses review feedback on PR omacom#8490. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Reviewed by Claude Opus 5 in Claude Code, with an independent second opinion from Codex at xhigh reasoning. The approach holds up and I found nothing that blocks it. Note this competes with #8514, which fixes the same bug by deciding from the PCI device id instead; which one lands is the maintainer's call, and I have left the comparison in both. What I checkedThe install-both design rests on two claims, and both turned out to be true rather than merely plausible. The two packages genuinely coexist. libva really does try iHD first and fall through to i965. I recovered libva 2.24.1's driver-name map from Both fail there because the VM has no Intel GPU, but the ordering and the fall-through are exactly what this PR depends on. The important consequence is that a Broadwell-or-newer machine cannot be silently demoted to i965 by having it installed: a healthy iHD is tried first and wins. Tests ran on that disposable worker rather than here: Worth knowing, none of it blockingThe cost is larger than the PR body says. Measured installed sizes: i965 can now mask an iHD failure on modern hardware. Codex raised this and it holds: i965's supported range runs up through Broadwell and later, so if iHD ever fails to initialize on a modern chip, i965 now quietly takes over and the application sees a working but less capable driver where it previously saw a hard failure. libva logs the iHD failure to stderr, so it stays diagnosable, but it is a behaviour change on new hardware and not only on old. Detection still shells out to A failed Things I looked at and found nothing wrong withThe The test file's negative assertions ( On the issues this touches#8388, the offline case: this fixes the symptom, and the issue's stated cause does not hold. #7851 and #8215: complementary, not conflicting. Nothing here sets Where this standsNothing pushed to your branch; there was nothing I found that warranted it. Waiting on the maintainer to choose between this and #8514. Where Codex agreed with conclusions I had already reached, note that its independence is not currently guaranteed — it can read this session's transcript. The i965-masking-iHD mechanism and the pciutils HWDB fallback are things it contributed that I had not reasoned about, and those stand on their own. |
|
Closing this in favour of #8514, which fixes #7866 more precisely. Both PRs target the same bug in
I verified #8514 at Thanks for the reviews here. (Disclosure: AI agent — Claude Code — under this account holder's direction, per the project's documented AI-assisted contribution workflow.) |
Problem
install/hardware/intel/video-acceleration.shpicks a single VA-API driver by pattern-matching the GPU's marketing name fromlspci:This misclassifies real hardware:
libva-intel-driver/i965) and Gen8+ (Broadwell+, needsintel-media-driver/iHD). Ivy Bridge's lspci string (Ivy Bridge mobile GT2 [HD Graphics 4000]) matches the first branch and installs a driver that can't decode on Gen7 hardware at all.xepattern also matches "Xeon", which is presumably unintended and happens to route some Xeon-graphics strings into the Broadwell+ branch too.Fixes #7866. #8388 independently identified the same misclassification on Haswell/Iris 5100 (its "Secondary: driver selection on Haswell" section) — this PR fixes that part too. #8388's primary problem, offline installs getting no VA-API driver at all because the packages aren't in the ISO's offline mirror and the script has no
set -eto surface the failure, is a separate issue and is not addressed here.Fix
Install both
intel-media-driverandlibva-intel-driver(withlibvpl/vpl-gpu-rt) whenever any Intel GPU is present, instead of picking one by name:Why install both instead of fixing the classification
The obvious "proper" fix looks like replacing the name regex with a GPU-generation table. I didn't do that, on purpose:
libva-intel-driveris ~2.4MB) versus a correctness-critical script staying in a state where it's plausible to get subtly wrong again for the next naming surprise.In short: matching on marketing names to predict which driver will work is inherently fragile, when we can just ask — install candidates and let libva's own probing decide. This trades a small amount of disk for driver selection that's correct on every past and future Intel generation without needing to track Intel's naming history.
Verification
Reproduced and fixed on real hardware — a Dell Latitude E6430s (Intel Core i7-3520M, Ivy Bridge, HD Graphics 4000):
Before (only
intel-media-driverinstalled, matching currentmainbehavior):After (
libva-intel-driverinstalled alongside it):libva logs the iHD init failure (harmless) and falls through to i965, which initializes correctly with the full expected profile list.
Existing installs
Added
migrations/1787689809.shso machines that already ran the old install-time logic pick uplibva-intel-drivertoo, since this repair doesn't apply itself.Testing
Added
test/shell.d/intel-video-acceleration-test.shcovering: both drivers installed on an Ivy Bridge HD Graphics 4000 string, both drivers installed on a Haswell-ULT string that previously matched neither branch, no-op on non-Intel GPUs, and the same coverage for the migration. Ran the full./test/allsuite; 5 pre-existing failures remain (all due to a missing localomarchy-pkgscheckout in this sandbox) and reproduce identically on a clean checkout ofquattrowith no changes applied — none touch this code path.This PR was prepared with AI assistance (Claude Code), including reproducing the bug on real Ivy Bridge hardware before and after the fix, per this project's documented AI-assisted contribution workflow.