Skip to content

feat: auto-detect Intel graphics and the Quick Sync runtime — show install instructions only when they are relevant #1925

Open

Description

@zackees

Why

#1720's reporter had an Intel HD Graphics 530 and lost a whole back-and-forth
round because the only feedback was a generic "encoder missing". #1862 fixed
half of this: profile_vaapi_diagnose() now names the VA-API cause and the
exact install command. The QSV half is still a single generic string —
CheckHardwareEncoder()'s PROFILE_MISSING_ENCODER_NO_QSV_DEVICE branch
returns EncoderMissing.QSV.NoDevice and nothing else.

So: auto-detect Intel graphics and the Quick Sync runtime, and show
installation instructions only when they're actually relevant.
No bundled
Intel Media SDK, no separate binary repository to maintain.

Recommended detection flow

Detect graphics hardware
  └─ PCI vendor ID == 0x8086 (Intel)?
       ├─ no  → no Intel GPU → NO QSV prompt at all
       └─ yes → check hardware generation / encoder support
                 └─ probe Quick Sync availability
                      (runtime, driver, encoder initialization)
                      ├─ QSV fine → no warning
                      └─ unavailable → explain what's missing
                                        └─ offer the correct distro-specific
                                           install instructions

For the HD 530 user from #1720 the message would be:

Intel Quick Sync unavailable

OBS-Rust detected Intel HD Graphics 530, but the legacy Intel Media SDK
runtime is missing.

On Ubuntu, install it with:
sudo apt install libmfx1

Illustrative wording — show it only after confirming the runtime is actually
missing and the package is appropriate for the detected distribution.

Detecting Intel hardware on Linux is easy

GPU information is already exposed under /sys/class/drm/:

for f in /sys/class/drm/card[0-9]*/device/vendor; do
    [ -f "$f" ] || continue
    [ "$(cat "$f")" = "0x8086" ] && echo "Intel GPU detected: $f"
done

For production code, prefer libdrm's drmGetDevices2() to enumerate GPUs and
read PCI vendor + device ids — it also disambiguates hybrid multi-GPU
systems. We already do the sysfs variant: profile_vaapi_diagnose()
walks /dev/dri/renderD128..135 and reads
/sys/class/drm/renderD<N>/device/vendor (it already knows 0x8086,
0x1002, 0x10de), and rust/obs-gpu-status enumerates /sys/class/drm
too. The QSV diagnosis should reuse that machinery, not add a second
enumerator.

Don't prompt every Intel user

Not all Intel GPUs need the same runtime:

GPU generation Runtime to check
Skylake / HD 530 legacy Media SDK (libmfx1)
other older supported Intel GPUs legacy Media SDK, depending on generation
newer Intel Xe / Arc oneVPL runtime
Intel GPU without supported hardware encoding no QSV installation prompt

Intel documents the legacy Media SDK vs oneVPL hardware-support distinction;
the generation decision must come from a documented device-id table with a
citable comment, not a guess.

More importantly: finding Intel hardware does not mean QSV is usable.
You also need the OBS QSV plugin, a compatible runtime, a GPU driver, device
access permissions, and a successful encoding capability check.

Suggested implementation: a Hardware Encoding Diagnostics routine

Runs on first use of a hardware encoder, and can also be opened manually.
It must distinguish these conditions:

  1. Intel GPU detected, QSV fully operational → no warning.
  2. Runtime missing → show the distro-specific installation command.
  3. Intel graphics driver missing → explain which driver component is needed.
  4. QSV plugin not packaged → report an OBS-Rust packaging problem, not a
    user dependency (the AppImage case, already surfaced as
    EncoderMissing.QSV.NotInBuild).
  5. GPU inaccessible → report the permission / container-device issue
    (same "add your user to the render group" class as VA-API's
    PROFILE_VAAPI_NO_ACCESS).
  6. Unsupported GPU → offer software encoding or another available hardware
    encoder, never an install command.

Do not show a warning simply because libmfx1 is missing if VA-API
encoding is working and the user isn't trying to use QSV. The diagnosis is
only relevant when the user selected a QSV encoder — it must never become a
startup or first-run nag.

Where this fits in the tree (verified)

  • frontend/utility/profile-activate.{h,c.h} — profile_vaapi_diagnose()
    is the template: struct profile_vaapi_host fakes the filesystem
    (read_file / exists / can_open_rw) so cmocka tests drive it. A
    profile_qsv_diagnose() belongs right beside it: same host, same
    profile_detect_distro() + profile_install_prefix[] for
    sudo apt/dnf/pacman, plus a device-id → generation classifier and a
    runtime library probe (libmfx.so.1 for the legacy family, the oneVPL
    SONAMEs for the new family — verify the real SONAMEs against what each
    distro package ships rather than assuming).
  • frontend/widgets/OBSBasic_Profiles.cpp.hpp — QsvMissingDetails() next
    to VaapiMissingDetails(), returned from the
    PROFILE_MISSING_ENCODER_NO_QSV_DEVICE branch of CheckHardwareEncoder(),
    with a blog(LOG_WARNING, …) line so the log records it (the AnduinOS - Appimage build Missing Encoders linux ffmpeg_vaapi_tex, obs_qsv11_v2 #1720
    workflow reads logs).
  • Locale: new EncoderMissing.QSV.* keys mirroring the
    EncoderMissing.VAAPI.* set added by frontend: Name the cause and the fix when a VA-API encoder is missing #1872.
  • test/cmocka/test_profile_activate.c — where the fake-host tests go.

Scope guard: the sysfs probing is Linux. On Windows and macOS the new
diagnose must not run and the existing generic QSV message must remain — no
apt command on a Windows box.

Acceptance criteria

  • Intel GPU + missing legacy runtime on Debian/Ubuntu → the dialog names
    libmfx1 and shows sudo apt install libmfx1, and nothing else is
    prompted on a machine that isn't using QSV.
  • Same machine with the runtime installed and the render node openable →
    silent.
  • No Intel GPU at all → no QSV prompt.
  • Xe/Arc-class device id → oneVPL runtime family, not libmfx1.
  • Intel GPU too old to encode → "use software encoding / another
    encoder", never an install command.
  • QSV plugin absent from the build → stays the packaging message
    (EncoderMissing.QSV.NotInBuild), not a user-facing dependency error.
  • Unit tests cover every cause through the fake host, RED-first, and the
    diagnosis is logged to the OBS log.
  • Never shown unless the user selected a QSV encoder.

Related

Activity

  1. zackees commented on Oct 23, 2026

    @zackees
    MemberAuthor

    Claiming: #1925 (Linux QSV diagnosis).

    1. PR 1: profile_qsv_diagnose() beside profile_vaapi_diagnose() in frontend/utility/profile-activate.{h,c.h}. It uses the same fake host, plus a dlopen-style has_library probe and a device-id classifier. Tests: cmocka cases in a new test file, RED first, one per cause in the acceptance list.
    2. PR 2: QsvMissingDetails() in CheckHardwareEncoder()'s NO_QSV_DEVICE branch, the EncoderMissing.QSV.* locale keys and the blog line. Run once in the real app; output in the PR.

    Decisions:

    • Generation table: built from Mesa's include/pci_ids/iris_pci_ids.h (Gen8+, by platform code name) and crocus_pci_ids.h/i965_pci_ids.h (Gen4-7.5 → unsupported, software or other encoder). It is pinned to a cited Mesa commit in a comment. BDW..ICL/JSL/EHL → legacy Media SDK. TGL and newer (TGL/RKL/DG1/ADL/RPL/DG2/MTL/ARL/LNL/BMG) → oneVPL GPU runtime, which Intel recommends for Gen12+. An Intel id missing from the table → oneVPL (it's newer than the table).
    • Runtime probe: either runtime present counts as available (the oneVPL dispatcher loads both). Package names per distro are checked against each distro's package index and cited.
    • Runs only from the QSV-selected encoder path, Linux only (the existing host split). It never runs at startup.

    First PR: within a day.

  2. added
    claimed
    on Oct 23, 2026
  3. zackees commented on Oct 23, 2026

    @zackees
    MemberAuthor

    Progress: the diagnosis core landed in #1962 (12 cmocka cases, run in CI Tier 2). The dialog and log line are in #1963, rebased onto master. #1963 stays a draft until someone runs it in the real app on an Intel Linux host (my host has only NVIDIA GPUs). Anyone with an Intel iGPU: select a QSV encoder in a profile, remove libmfx1 or libmfx-gen1.2, start OBS, and paste the dialog text and the QSV: log line on #1963.

  4. moved this from In progress to Triage in obs-rust Multiviewon Oct 25, 2026
  5. removed
    claimed
    on Oct 25, 2026
  6. added
    P3
    size:S
    on Oct 25, 2026
  7. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    /ready

    Triage: half delivered (#1962, the diagnosis core with 12 cmocka cases). Left: #1963 (the dialog and log line), which is a draft until it's run in the real app on an Intel Linux host. Acceptance: a run on Intel hardware where a missing Quick Sync runtime produces the specific install message, recorded in #1963. Same hardware need as #1863. P3, size:S.

  8. added
    ready
    on Oct 25, 2026
  9. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: #1925 (continuing the draft PR #1963).

    The diagnosis core landed in #1962; the cause-to-message mapping (dialog strings and the QSV: encoder "<id>" missing: <cause> ... log line) is in PR #1963, rebased onto master and green in CI, held as a draft because this checkout has only NVIDIA GPUs (no /dev/dri Intel) and cannot produce an Intel cause.

    Blocked: needs one run on an Intel Linux host with a QSV profile and the runtime removed, capturing the dialog and the QSV: log line in the PR. #1863 tracks that hardware validation. Nothing else in the PR is outstanding; the mechanical merge work is the coordinator's.

  10. moved this from Ready to In progress in obs-rust Multiviewon Oct 27, 2026
  11. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Blocked: waiting on an Intel GPU host to run the real app once for the new missing-encoder dialog and its QSV: encoder "<id>" missing: <cause> log line. The diagnosis core (#1962) and the cause-to-message mapping (PR #1963) are complete, CI-green and rebased on master, and #1963 stays a draft for exactly this reason: this worker's host has only NVIDIA GPUs, so it cannot show an Intel cause. #1863 tracks the QSV-on-real-hardware validation that unblocks it. No code work is pending in the meantime.

  12. added
    claim-blocked
    on Oct 27, 2026
  13. moved this from In progress to Blocked in obs-rust Multiviewon Oct 27, 2026
  14. removed
    claim-blocked
    on Oct 28, 2026
  15. moved this from Blocked to In progress in obs-rust Multiviewon Oct 28, 2026
  16. removed their assignment
    on Oct 29, 2026
  17. moved this from In progress to Ready in obs-rust Multiviewon Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3readysize:S

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions