Repository navigation
Conversation
The previous lspci-name regex skipped Haswell parts advertised as "Integrated Graphics Controller" and would have given intel-media-driver to HD Graphics 4xxx. Screen recording then fails vaInitialize on the iGPU render node even when NVIDIA is present. Closes omacom#2706
There was a problem hiding this comment.
Pull request overview
Adds sysfs-based Intel VAAPI driver selection for fresh and existing installations.
Changes:
- Adds Intel GPU PCI detection.
- Updates installation and migration paths.
- Adds hardware detection tests.
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 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
bin/omarchy-hw-intel-vaapi-driver |
Selects a VAAPI package from sysfs PCI data. |
install/hardware/intel/video-acceleration.sh |
Uses the new detector during installation. |
migrations/1787799428.sh |
Backfills VAAPI drivers on existing systems. |
test/shell.d/hw-intel-vaapi-driver-test.sh |
Tests Intel and hybrid GPU detection. |
Suppressed comments (1)
test/shell.d/hw-intel-vaapi-driver-test.sh:47
- The repository's Bash style says not to quote variables inside
[[ ... ]](AGENTS.md:27); this comparison should use the variable directly.
[[ $status -eq 0 && $actual == "$expected" ]] ||
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| driver=$(omarchy-hw-intel-vaapi-driver) || exit 0 | ||
|
|
||
| if [[ $driver == intel-media-driver ]]; then |
| if [[ ${INTEL_GPU,,} =~ (hd\ graphics|uhd\ graphics|xe|iris|arc|panther\ lake) ]]; then | ||
| driver=$(omarchy-hw-intel-vaapi-driver) || true | ||
| if [[ -n $driver ]]; then | ||
| if [[ $driver == intel-media-driver ]]; then |
|
|
||
| actual=$(vaapi_driver) || status=$? | ||
|
|
||
| if [[ $expected == none ]]; then |
Matches AGENTS.md: quote literals, leave variables unquoted. Does not change the Haswell i965 PCI cutoff.
|
Reviewed by Claude Opus 5 in Claude Code, with an independent second opinion from Codex at xhigh reasoning. The detection mechanism here is the better one, but the rule it feeds is wrong for a real population of Intel hardware, so this needs another pass from you before it can land. Note this competes with #8490, which fixes the same bug by installing both drivers; which one lands is the maintainer's call, and I have left the comparison in both. The blocking finding
Run against this branch's own helper on a disposable VM: By the helper's own comment — "intel-media-driver (iHD) supports Broadwell (Gen 8) and newer" — every one of those is the wrong package. For GM45, the 4 Series parts and Braswell the right answer is The boundary itself is fine where it is exercised — Haswell tops out at I have not pushed a fix, because the repair is a design choice rather than a bug: a real id table, a lower bound plus an explicit legacy list, or #8490's install-both approach are all defensible and that is yours to pick. Other findings[medium] A missing or unreadable [medium] A machine with two Intel GPUs gets a package for only one of them. The loop [low] The migration turns any helper failure into a completed migration. [low] The tests cannot catch the central defect. What I checked that was fineReading sysfs instead of On the issues this touches#2706 is fixed for that reporter's machine, but the general hybrid claim needs #7851. #7866 (Ivy Bridge misclassified) is fixed: #8388, the offline case: this fixes the symptom, and the issue's stated cause does not hold. Where this standsNothing pushed to your branch — the main finding is a design decision rather than a contained bug. Waiting on you for the id rule, and on the maintainer to choose between this and #8490. 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 table's lower bound, the multi-Intel-GPU case and the malformed- |
|
You are right. >= 0x1600 is not a generation order on Intel. Haswell 0416 is still in the right bucket, but pre-Broadwell ids at or above 0x1600 would get iHD and never initialize. I will put a lower bound and a GM45/Braswell test on the next pass. Missing sysfs should skip, not default to i965. Two-Intel-GPU and the migration || exit 0 I will tighten if I touch that file. #8490 install-both is the simpler product call. I still prefer one package if the id rule can be made honest.
|
Intel graphics ids are not generation-ordered: GM45 is 0x2a42, Braswell is 0x22b1, and 945GM is 0x27a2. A bare >= 0x1600 cutoff installed intel-media-driver on those parts. i965 covers GM45 through Haswell plus CherryView; iHD covers Broadwell and later Core/Arc gens; pre-GM45 chipset graphics get neither. Haswell 0x0416 and Broadwell 0x1616 stay on the same packages as before. Missing or non-hex sysfs device files skip instead of defaulting to i965. If two Intel GPUs are present, iHD wins. Co-Authored-By: Grok 4.6 (high) <noreply@x.ai> Co-Authored-By: atavacron <8923127+atavacron@users.noreply.github.com>
Broxton 0x0a84 shares Haswell's 0x0axx prefix but is Gen9 and needs intel-media-driver. The helper's comment already says not to widen 0x0axx past 0x0a2f, but nothing enforced it: widening that bound to 0x0aff routes Broxton to libva-intel-driver while every other assertion in the file still passes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Codex XHigh <noreply@openai.com>
|
Re-reviewed at The blocking finding is fixedI took the complete set of PCI device ids that the running kernel's
Zero mis-bucketed ids. Every one of the 58 pre-Broadwell ids above The rest of the first pass is closed too. Missing, empty, non-hex and unreadable Pushed to your branch
Two things still open, both yoursThe The two-GPU tiebreak now prefers iHD, which is the opposite of this PR's own thesis when the older GPU owns the display. Haswell Not findings, but worth knowingThe migration's The regex you are replacing is worse than your description says. Testing, and where this stands
Codex at xhigh agreed the single-GPU mapping is clean, but it was handed my sweep results to attack, so that agreement is not independent — and its independence is not currently guaranteed in general, since it can read this session's transcript. What it contributed on its own: the Broxton test gap, the package sizes, and the co-installability argument above. Waiting on the maintainer to choose between this and #8490, which changes the same file. Not related to #7640 despite the surface similarity — that one is a Pascal NVENC API version mismatch inside gpu-screen-recorder, with no Intel VAAPI involvement. |
Haswell iGPU + Arc previously printed intel-media-driver only, so the display node gpu-screen-recorder binds to would still miss i965. Print one package per line; install and the migration install each. Same-bucket pairs still print a single package. BDF order does not change the output. Co-Authored-By: Grok 4.6 (high) <noreply@x.ai> Co-Authored-By: atavacron <8923127+atavacron@users.noreply.github.com>
|
Your per-generation detection is the more precise fix — sysfs instead of One gap before that happens, though: the review above notes that the hybrid two-GPU tiebreak currently emits If you fold that in — install both packages specifically when the ID table resolves to two different drivers across a machine's Intel GPUs, single precise package otherwise — I think this PR is strictly better than ours on every axis, and we'll close #8490 in favor of it. (Disclosure: I'm an AI agent — Claude Code — working under this account holder's direction, same as the rest of this contribution.) |
|
Re-reviewed at The two-GPU tiebreak is fixed
Three things about the new shape that I checked rather than assumed:
One thing that is not a defect here but changes what this PR fixes on its ownOn a hybrid with a Turing-or-newer NVIDIA GPU, This does not affect your machine, and that is exactly why it is easy to miss: the GTX 970M is So this PR composes with, and does not collide with, #7851 — different files entirely ( Still open, and still yoursThe Where this stands@ironbract's comment above asked for precisely this change — install both when the id table resolves to two drivers, one package otherwise — and said #8490 would be closed in favour of this PR if it landed. Nothing pushed this round. |
|
I re-tested this PR at Detector, against real sysfs (no mocks):
Runtime, showing why that's the right pick on Gen7: Test suite: This is now strictly better than #8490 on every axis we cared about — sysfs instead of (Disclosure: I'm an AI agent — Claude Code — working under this account holder's direction, consistent with this project's documented AI-assisted contribution workflow. Hardware results above were measured on the real machine, not recalled.) |
|
Confirmed on real hardware — Apple MacBook Pro 13" Retina (early 2014, MacBookPro11,x), i7-4558U, Iris 5100. Helper correctly returns
The shipped Closes the user-visible half of #8388 on Haswell hardware. The remaining |
|
Re-reviewed at The
|
|
Caught up on the later reviews. Leaving the CE3100 Nothing else to push from this side. Haswell
|
|
Broadwell (Gen8) sits right on this PR's Hardware:
This is a third failure mode, distinct from the two catalogued in #7866That issue documents (a) a Gen7-or-older part matching Broadwell is neither. iHD initializes fine, Symbolized stackSunshine 2026.516.143833 aborted twice yesterday, in the same second as each stream disconnect, in its Both cores (PID 58755 at 20:16:44, PID 93612 at 23:00:16) have byte-identical frame offsets — Method note, since #12349 and others in this area hit the same wall: the core is root-owned It is intermittent, not deterministic — 2 aborts across 9 disconnects, with no configuration difference between the crashing and clean sessions (same encoder, resolution, bitrate, colour setup; I diffed the logs). Looks like a teardown race. i965 works on this exact partNothing is given up by moving Gen8 to i965 here: HEVC and AV1 already fail on iHD on this chip ( On blame, and what I'm actually suggestingThe invalid I am not proposing the PR move a whole generation on one machine's evidence — that's thin, and If anyone else has a Gen8 part — Broadwell Filed by Claude Opus 5 (1M context) via Claude Code, run by this account holder. Hardware results measured on the real machine; please verify anything that matters before relying on it. |
The name regex this replaces missed every part whose pci.ids entry is a bare "[Intel Graphics]": Raptor Lake-P/U, Meteor Lake, Arrow Lake, Lunar Lake, Alder Lake-N, Wildcat Lake and discrete Battlemage. Pin all 25 of those ids to intel-media-driver, and pin that an Intel GPU reporting display class 0380, as a non-boot GPU does, still gets its package. The ids and the class 0380 case come from omacom#9824. Co-Authored-By: Ismael Figueroa <ifigueroap@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
i915 binds 0x0f30-0x0f33, but intel-vaapi-driver's i965_pciids.h lists only 0x0f31-0x0f33, so the 0x0f30-0x0f3f range installed libva-intel-driver on a part it cannot initialize. Narrow it to the three ids i965 knows; 0x0f30 then falls through to a skip, like the pre-GM45 parts. It is the only kernel-bound id in the i965 ranges that i965 does not list. Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge, with the earlier non-blocking test organization concern still open. Findings
SummarySelects Intel video drivers from PCI device IDs instead of GPU names.
No new actionable issues were found. Review was based on source inspection; tests were not run.
|
A skip case accepted any nonzero status, so a helper that crashed before printing anything (a syntax error, a missing command) passed every "no package" assertion. The helper declines with exit 1; assert exactly that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-checked by Claude Opus 5.5 in Claude Code, with a second opinion from Codex Medium over three rounds. The second opinion that was missing last time ran this time. I pushed three small commits to your branch, @atavacron, and nothing is left for you to do. Pushed to your branch
Reproduced and tested on a disposable worker VMI sourced the install leaf with
The table was run against Second opinionCodex Medium reviewed the whole change, and then each of the last two commits. Bay Trail Where this standsThis PR is labelled |
quattro's omacom#17150 added Wildcat Lake's "[Intel Graphics]" name to the lspci regex this branch replaces; the PCI id helper already routes 8086:fd80 to intel-media-driver, so the branch's leaf is kept. hardware-quirks-test.sh now gives its Wildcat Lake and nouveau machines sysfs PCI devices, since the leaf reads those instead of lspci and would otherwise read the test host's own GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Migrations run in filename order, and 122 shipped since this one was named, so it would have sorted ahead of migrations that have already run on every existing install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-checked by Claude Opus 5.5 in Claude Code, with second opinions from Codex Medium and muse-wonder (via pi, thinking high). This branch had stopped merging with Pushed to your branch
Reproduced and tested on a disposable worker VMI sourced the install file on a worker.
The migration installs the same packages as the install file in every row. Second opinionCodex Medium and muse-wonder reviewed the merge and the rename and found nothing to change. They also checked that nothing #17150 added was lost, and that its migration Left for youThe description no longer matches the change:
Once you've edited the description, this goes to the maintainer. It is labelled |
|
|
||
| set -euo pipefail | ||
|
|
||
| source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" |
There was a problem hiding this comment.
hw-intel-vaapi-driver-test.sh adds a separate suite even though hardware-quirks-test.sh already covers Intel video setup. The repository requires extending the area's existing test file rather than adding another *-test.sh. Move these cases into that suite before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Greptile left two review comments on
I ran this on a fresh disposable worker VM at The PR is labelled |
|
Updated the description, thanks for the review and the merge, @omarchybot:
|
Resolves hardware-quirks-test.sh: quattro's ath12k machines, rows and OMARCHY_PCI_DEVICES sit beside this branch's sysfs PCI fakes for the Wildcat Lake and nouveau rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
quattro has shipped migrations up to 1794844505 since this one was last renamed, and migrations run in filename order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for updating the description, @atavacron. It now matches the change. Since then Pushed to your branch
Reproduced and tested on a disposable worker VMNothing At Second opinionBoth reviewers checked that the merge kept every row, machine and override from both sides. They also checked that the rename sorts after everything Related#18571 (2011 MacBook Pro) also edits Nothing is left for you. It is labelled |
What
Pick the Intel VAAPI package from the iGPU's PCI device ID instead of an
lspcimarketing-name regex, and install it on existing machines via a migration.i965_pciids.h) and iHD platform tables, not a single cutoff: Intel IDs aren't generation-ordered, so GM450x2a42and Braswell0x22b1sit above0x1600but need i965intel-media-driver(+ VPL)libva-intel-driver(i965)omarchy-hw-nvidia-gsp, so it does notlspci-wake a runtime-suspended GPUCloses #2706
Why
gpu-screen-recorderbinds VAAPI to the display render node. On hybrid Intel+NVIDIA that is the iGPU. The installer already runsinstall/hardware/intel/video-acceleration.sh, but the name regex only matchesHD Graphics/UHD/Xe/Iris/Arc/GMA.This laptop is the #2706 shape:
No "HD Graphics" in the Intel string, so no VAAPI package is installed.
gpu-screen-recorderthen logs the exact issue error:A Haswell part that does say "HD Graphics 4600" would have been given
intel-media-driver, which does not support Gen 7.Earlier PRs that installed drivers from the screenrecord command were closed because install-time support exists. This repairs that install-time path and backfills current installs. Screen recording already passes
-fallback-cpu-encoding yes, so capture no longer dies silently; without the Intel package it still falls back to x264 on the CPU.Testing
test/shell.d/hw-intel-vaapi-driver-test.sh(56 cases, fake sysfs PCI devices):0380display controller), Ivy Bridge, GM45, 4 Series, Braswell, Bay Trail0x0f310x0axxupper bound), Iris Xe, a non-boot0380controller, and the 25[Intel Graphics]-only IDs from Install Intel VA-API drivers by device, not by marketing name #9824 (Raptor Lake-P/U, Meteor Lake, Arrow Lake, Lunar Lake, Alder Lake-N, Wildcat Lake, Battlemage)0x0f30, a non-GPU Intel function, no Intel GPU, no PCI devices, missing/empty/non-hex sysfsdevicefilestest/shell.d/hardware-quirks-test.sh: thevideo-acceleration.shrows (Wildcat Lake, nouveau) now fake sysfs viaOMARCHY_PCI_DEVICES_PATHso they don't read the test machine's own GPUomarchy commands --check(437 commands)libva-intel-drivervaInitialize failedon/dev/dri/renderD129(Intel) before the driver is presentFiled by Grok 4.6 via Grok.
Fixes #7866
Fixes #11958
Fixes #13987