Skip to content

obs-gpu-status: Classify GPU acceleration for the status light (1/4 of #846) - #890

Merged
zackees merged 2 commits into
masterfrom
fix/846-gpu-status
Oct 15, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/846-gpu-status

Conversation

@zackees

@zackees zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member

First of the four PRs planned in the claim on #846: a pure Rust core with no UI, logging or protocol changes yet.

What it adds

rust/obs-gpu-status:

  • classify(adapter, devices, frames): green when the adapter is a hardware GPU. Yellow when it is a software renderer (llvmpipe, softpipe, Microsoft Basic Render Driver, SwiftShader) while an NVIDIA, AMD or Intel GPU is present. Red for software rendering with no GPU, a failed graphics init, or a median frame time over the frame interval.
  • detect_devices(root): reads <root>/sys/class/drm/card*. A device counts as having a render node only when /dev/dri/renderD* also exists, which covers the sandbox case in frontend: GPU acceleration status light (green/yellow/red) in the status bar #846.
  • parse_nvidia_smi / query_nvidia_smi: a second presence signal from nvidia-smi --query-gpu=name,pci.device_id --format=csv,noheader, which also fills in GPU names.
  • platform::system_devices() is the only host-specific code: sysfs plus nvidia-smi on Linux, nvidia-smi only elsewhere. DXGI enumeration on Windows comes in a follow-up.

Tests

  • RED 58f4657: 12 Tier 1 tests against todo!() stubs, 0 passed / 12 failed.
  • GREEN: 12 of 12 pass. ./lint is ok.
  • Tiers 2 and 3: not applicable. This is new code with no C original, and no C source or header changes.
  • Tier 4 comes with the obs-websocket field in PR 3.
  • Checked on real hardware: cargo run --example probe lists the RTX 3060 and RTX 2080 Ti with names and render nodes.

Refs #846

…dia-smi (GREEN)

classify() returns green for a hardware adapter, yellow for a software
renderer while a GPU is present, and red for software rendering with no
GPU, a failed graphics init, or a median frame time over budget. GPUs come
from /sys/class/drm (render node needs /dev/dri too) and nvidia-smi.

Refs #846
@zackees
zackees enabled auto-merge October 15, 2026 21:13
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit f6651db Oct 15, 2026
23 checks passed
@zackees
zackees deleted the fix/846-gpu-status branch October 26, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant