Skip to content

frontend: GPU acceleration status light (green/yellow/red) in the status bar #846

Closed

Description

@zackees

Problem

When OBS ends up on a software renderer (Mesa llvmpipe/softpipe, Microsoft Basic Render Driver, SwiftShader), the UI does not tell you. Video is choppy and the user cannot see why. The only hint is a couple of lines in the log.

Proposal

Add a status-bar indicator light showing GPU acceleration state. Clicking it opens a dialog that explains the state.

State Criteria
GREEN The active GL/D3D adapter is a hardware GPU.
YELLOW A hardware GPU is present on the system (Linux: /sys/class/drm, PCI vendor 10de NVIDIA / 1002 AMD / 8086 Intel, a render node in /dev/dri; Windows: DXGI adapter enumeration), but the active adapter is a software renderer (llvmpipe, softpipe, Microsoft Basic Render Driver, SwiftShader).
RED (proposal) No usable GPU and software rendering, or graphics init failed, or frames are far behind budget (e.g. obs_graphics_thread median > frame interval).

Yellow dialog text, plainly: "Your GPU () was detected, but OBS is not using its driver. Rendering on the CPU (llvmpipe); expect choppy video." It also lists likely causes (sandbox/container missing the vendor EGL/GLX libs or the egl-wayland external platform config, a missing or mismatched driver, a /dev/dri render node that isn't accessible) and quotes the log lines that explain it (e.g. Unable to open DRM render node., Loading up OpenGL on adapter ..., libEGL warnings).

Also:

  • Log a prominent warning at startup in the yellow and red cases.
  • Expose the state through obs-websocket (a field in GetStats, or a new vendor request) with the state, adapter name and detected GPUs, so tests can assert it.

Open questions

  • Exact RED criteria: is software rendering with no GPU red, or yellow? Should frame-budget overrun be part of this light, or stay a separate signal? What threshold and window to use?
  • Field name and shape in GetStats vs. a vendor request (protocol compatibility: additive fields only).

Motivation / evidence

Real investigation, 2026-10-15: NixOS 26.05, KDE Wayland, RTX 3060 + RTX 2080 Ti, driver 595.99.02, OBS-Studio-Rust 0.1.0-beta.20261014 launched through a Nix buildFHSEnv/bubblewrap wrapper.

  • Log: Unable to open DRM render node. then Loading up OpenGL on adapter Mesa llvmpipe (LLVM 21.1.8, 256 bits). stderr: libEGL warning: pci id for fd 34: 10de:2504, driver (null) / egl: failed to create dri2 screen.
  • libEGL_nvidia was loaded, but NVIDIA's egl-wayland external platform was not found inside the sandbox, so Mesa claimed the Wayland display and fell back to llvmpipe. Stock OBS 32.1.2 on the same machine used the RTX 3060.
  • Impact: obs_graphics_thread median 95 ms vs. a 33.3 ms budget, 2.1% of frames on time (~10 fps). perf shows 80.5% of CPU in 16 llvmpipe threads running JIT shaders.
  • Confirmed workaround: __EGL_EXTERNAL_PLATFORM_CONFIG_DIRS=/run/opengl-driver/share/egl/egl_external_platform.d gives adapter NVIDIA RTX 3060, 30.00 fps, 1.3–3 ms render, 0 skipped frames.
  • The user had no idea why OBS was choppy, and nothing in the UI pointed to software rendering. That is the core problem this issue fixes.
  • Reference report with flame graphs (private): https://claude.ai/artifact/86idqpedDE3sBXsK3XGQQ3

Testing (per docs/rust-port/testing-policy.md)

  • Tier 1 (Rust unit tests): a pure classifier classify(adapter_name, detected_devices, frame_stats) -> {Green, Yellow, Red}, with table tests for: NVIDIA/AMD/Intel adapter strings → green; llvmpipe/softpipe/Microsoft Basic Render Driver/SwiftShader with a 10de/1002/8086 device present → yellow; software adapter with no devices, or graphics init failure → red (per the resolved criteria). Device detection is parsed from a fake sysfs//dev/dri tree fixture (host-specific probing lives in src/platform/).
  • Tier 3 (differential): not applicable to the new classification. Confirm that existing libobs adapter-name reporting is unchanged against the C oracle.
  • Tier 4 (black-box protocol): start headless OBS forced onto llvmpipe (LIBGL_ALWAYS_SOFTWARE=1 / GALLIUM_DRIVER=llvmpipe) and assert the state over obs-websocket (GetStats or the vendor request) is not green. Assert the startup warning appears in the log.
  • Tier 2: existing C tests stay unchanged.

Activity

  1. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Claiming: GPU acceleration status light.

    Plan (one PR each):

    1. rust/obs-gpu-status: pure classify(adapter, devices, frame_stats) plus device detection from a sysfs//dev/dri root (fixture-tested) and nvidia-smi --query-gpu=name,pci.device_id --format=csv,noheader output parsing. Host probing lives in src/platform/. Tier 1 only (new code, no C original). PR today.
    2. Startup log warning for yellow and red (libobs-opengl/d3d11 adapter name, through a C ABI).
    3. obs-websocket: an additive GetStats field gpuAcceleration { state, adapter, detectedGpus }, with a Tier 4 test under LIBGL_ALWAYS_SOFTWARE=1.
    4. Frontend status-bar light and explanation dialog.

    Decisions:

    • Software renderer with no hardware GPU detected: red, because that machine cannot do better; yellow means it could do better. Graphics init failure: red.
    • Frame budget: red when the median obs_graphics_thread time over the supplied window is greater than the frame interval, as the proposal says. The window is whatever the caller passes in; PR 3 uses the last 300 frames.
    • GPU presence: sysfs PCI vendor (10de/1002/8086) with a render node, or nvidia-smi listing a GPU. The second covers sandboxes where sysfs is hidden but the NVIDIA tools are present.
    • Protocol: an additive GetStats field rather than a vendor request. Decision needed only if maintainers want the vendor request instead; that affects PR 3 alone.
  2. added
    claimed
    on Oct 15, 2026
  3. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Research on NixOS / non-FHS hardware acceleration gaps: #891. Its main finding is that #722 fixed the driver configs, but driver libraries (libcuda, libnvidia-encode, libwayland-client) still aren't on the loader path under nix-ld. When these fail, OBS falls back without saying so. The status light should detect each of these silent-fallback cases:

    1. Software GL with a GPU present. GL_RENDERER matches llvmpipe/softpipe/SwiftShader/Microsoft Basic Render Driver while /sys/class/drm shows PCI 10de/1002/8086 or a /dev/dri/renderD* exists. Today the only trace is a log line (libobs-opengl/gl-subsystem.c:277).
    2. GL on the wrong vendor. An NVIDIA GPU is driving the display but the renderer is Mesa (missing egl-wayland/egl-gbm external platform, or libEGL_nvidia not loadable).
    3. NVENC unavailable with an NVIDIA GPU present. libcuda.so.1 or libnvidia-encode.so.1 fails to dlopen (obs-nvenc/cuda-load.c:15, obs-ffmpeg.c:262). Today the encoder just disappears from the list and simple mode falls back to x264.
    4. VA-API missing on Intel/AMD. Either vaInitialize fails or no VAAPI encoder gets registered, and OBS falls back to software x264.
    5. NVDEC/VA-API hardware decode missing for media sources and v4l2 MJPEG, so decoding runs on the CPU.
    6. PipeWire DMA-BUF import disabled, so capture uses the SHM copy path. This usually follows from case 1.
    7. Browser source (CEF) on SwiftShader / GPU disabled.
    8. Vulkan consumers that picked lavapipe (lvp) over a hardware ICD.

    For cases 3 to 5, the dialog should name the library that was missing and the path searched (on NixOS: /run/opengl-driver/lib). I'd also suggest an OBS_REQUIRE_HW_GL=1 opt-in that refuses to start on case 1, so CI and packagers can enforce hardware rendering.

  4. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Progress: the work is up as #890 (classifier), #894 (stacked on #890: light, dialog, startup warning, GetStats.gpuAcceleration, Tier 4 test) and obs-rust/obs-websocket#14 (the GetStats field). I folded plan items 2–4 into #894 because they share one C ABI. The websocket data comes through a get_gpu_status proc on the global proc handler, so no public header changes. Waiting on CI's full Ubuntu build.

  5. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Fixed by #890 (classifier), #894 (status-bar light and dialog, startup warning, GetStats.gpuAcceleration, Tier 4 test) and obs-rust/obs-websocket#14. Worker docs for feature issues: #850.

    Left for follow-ups:

    • Windows GPU detection through DXGI (today only nvidia-smi).
    • The frame-budget check uses libobs' average frame time, not the median.
    • The dialog summary text is English only.
    • The Tier 4 suite is not wired into CI.
  6. removed
    claimed
    on Oct 15, 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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions