Repository navigation
Closed
9 / 99 of 9 issues completedClosed
9 / 99 of 9 issues completed
Copy link
Description
Goal
The status bar shows `CPU: 1.5%`, but nothing comparable for the GPU. Users want to see at a glance CPU %, GPU %, and whether OBS renders on the GPU at all. The plan is for the GPU readout to take over the current green/yellow/red acceleration light, with the color showing hardware vs. software rendering. "GPU acceleration" needs a clearer user-facing name.
This is a research issue. The output is a written proposal plus follow-up implementation issues, not code.
Questions to answer
- Which GPU's utilization? The adapter OBS renders on, which may not be the only GPU (multi-GPU systems: RTX 3060 + RTX 2080 Ti here). Per-process utilization (OBS's share), or whole-GPU?
- Sources per platform, with their cost (polling every 1–2 s from the UI) and whether they work in sandboxes (AppImage, Flatpak, Nix FHS):
- NVIDIA: NVML (`nvmlDeviceGetUtilizationRates`, per-process `nvmlDeviceGetProcessUtilization`), loaded dynamically, not `nvidia-smi` spawns.
- AMD/Intel on Linux: `/sys/class/drm/card*/device/gpu_busy_percent` (amdgpu), i915/xe PMU via perf or `/sys/class/drm//engine`, or DRM fdinfo (`/proc/self/fdinfo/`, `drm-engine-*`) for per-process usage.
- Windows: PDH "GPU Engine" counters (per-process, all vendors) or D3DKMT queries.
- macOS: IOKit `PerformanceStatistics` ("Device Utilization %").
- Software rendering: what to show when OBS is on llvmpipe or WARP. GPU % is meaningless there, so it should probably say "CPU rendering" in yellow or red.
- Naming: candidates such as "GPU: 23%" with a colored dot, "Render: GPU 23%" / "Render: CPU", or a tooltip-only explanation. It must work in all locales (feat: Localize the GPU status summary and causes #945).
- Where the logic lives: `rust/obs-gpu-status` (Tier 1-testable sampling and parsing, platform code behind `src/platform/`), plus the frontend widget next to the CPU label (sibling issue), and possibly a `GetStats` field (`gpuUsage`, additive only).
Deliverable
- A comment here or a doc under `docs/` answering 1–5, with measured overhead for each source on at least Linux NVIDIA and one other platform.
- Follow-up implementation issues (one per platform source, plus the UI change), each with a RED → GREEN test plan.
Related
- frontend: GPU acceleration status light (green/yellow/red) in the status bar #846, meta: GPU acceleration status light, follow-ups after #846 #939: the acceleration light this would absorb.
- Sibling issue: move the light next to the CPU usage.
- feat: Windows GPU detection through DXGI adapter enumeration #942: Windows DXGI adapter enumeration; the adapter identity is needed to pick the right GPU.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 9 sub-issues
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 16, 2026
Research result
Status: I measured NVML on real hardware and checked the kernel's DRM fdinfo spec. Claims marked unverified come from memory and need a check before implementing.
Measured (NixOS 26.05, kernel 6.18.48, RTX 3060 + RTX 2080 Ti, driver 595.99.02)
nvmlDeviceGetUtilizationRatesnvmlDeviceGetProcessUtilizationnvidia-smi --query-gpu=utilization.gpunvidia-smifor polling, so use it, loaded withdlopen, never by spawning a process.00000000:06:00.0,00000000:07:00.0). Match the render adapter by bus ID (nvmlDeviceGetHandleByPciBusId_v2), never by index.libnvidia-ml.so.1is not on the default loader path; it lives in/run/opengl-driver/lib. The loader must search that directory explicitly, as AppRun already does for the EGL configs.gpu_busy_percentexists on this host (NVIDIA only). That file is amdgpu-specific.Verified: kernel DRM fdinfo (
docs.kernel.org/gpu/drm-usage-stats.html)drm-driver.drm-pdev(PCI slot, which ties a fd to an adapter),drm-client-id(dedupes shared or duplicated fds),drm-engine-<name>(busy time in ns),drm-engine-capacity-<name>, anddrm-cycles-<name>withdrm-total-cycles-<name>.1. Which GPU, and what to show
/sys/class/drm/renderD*/device, giving the PCI address.registryID.2. Sources per platform
dlopengpu_busy_percentsysfs\GPU Engine(*)\Utilization PercentageIOAccelerator→PerformanceStatistics→Device Utilization %3. Software rendering (with the colors from #1005)
4. Naming
GPU: 23%with the colored dot. Keys:Basic.StatusBar.Gpu.Usage="GPU: %1%",.Unavailable="GPU: n/a",.Software="CPU rendering". The existingBasic.StatusBar.GpuStatus.*keys become the tooltip. Add keys only, so translations aren't broken (feat: Localize the GPU status summary and causes #945).Render: GPU 23%(clips in long-word locales) and a bare23%(doesn't say what it is).CPU:label is a hard-coded English string (OBSBasicStatusBar::UpdateCPUUsage). Don't copy that pattern; localizing it could be a small follow-up.5. Where the code goes
rust/obs-gpu-status, pure Tier 1 code:gpu_busy_percent.classifyplus a sample to what's displayed.src/platform/: host calls (NVMLdlopen, PDH, IOKit,/procscanning).src/ffi: a sampler C ABI for the frontend.UpdateGpuUsage()on the same timer as the CPU label, next to it (frontend: Put the GPU status light next to the CPU usage (#1003) #1010 already moves the light there). Sample off the UI thread, because the PDH and fdinfo scans aren't free.GetStats.gpuUsage.Proposed follow-ups, in order of value
dlopensampler with bus-ID matching and NixOS/run/opengl-driver/libsearch. Test: fake symbol table; a missing library givesUnavailable.gpu_busy_percentfallback. Test: fixture sysfs tree.GPU: x%label replaces the light. Test: injected sampler gives the right text and color for hardware, software and n/a.GetStats.gpuUsage. Test: Tier 4 shows existing fields unchanged.I'll file these as sub-issues once you agree with the two decisions above: whole-GPU as the headline, and "GPU: x%" as the name.
zackees commentedon Oct 16, 2026
Research done: result. NVML was measured on real hardware and the fdinfo spec checked. The implementation work is filed as sub-issues #1020–#1028. The two open choices (whole-GPU headline,
GPU: x%label) are recorded as editable defaults in each issue's Decisions section. Measuring a second platform moved to #1022 (Windows PDH) and #1023 (Linux fdinfo).test: obs-gpu-status readout for the GPU: x% label
obs-gpu-status: Readout for the GPU: x% label
obs-gpu-status: Sample the render GPU's utilization on a thread
test: obs-gpu-status readout for the GPU: x% label
obs-gpu-status: Readout for the GPU: x% label
obs-gpu-status: Sample the render GPU's utilization on a thread
test: obs-gpu-status readout for the GPU: x% label
obs-gpu-status: Readout for the GPU: x% label
obs-gpu-status: Sample the render GPU's utilization on a thread
frontend: GPU: x% label replaces the GPU status light text (obs-rust#…