Skip to content

frontend: Fix the GPU light reading "OpenGL" as the adapter, and the startup red flash (#846) - #929

Merged
zackees merged 4 commits into
masterfrom
fix/846-gpu-status-adapter
Oct 16, 2026
Merged

zackees merged 4 commits into
masterfrom
fix/846-gpu-status-adapter

Conversation

@zackees

@zackees zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Two bugs found by trying the AppImage on a real NixOS machine (RTX 3060):

  1. llvmpipe showed green. gs_get_device_name() names the API (OpenGL, Direct3D 11), not the adapter, so the classifier never saw llvmpipe. The log said GPU acceleration: green: Rendering on OpenGL. The frontend now reads GL_VENDOR/GL_RENDERER on OpenGL, through GetGlGetStringProc() in the platform facade, and the active adapter from gs_enum_adapters on Direct3D 11.
  2. Red flash at launch. The light judged a single one-second average, and one slow startup second turned it red until the next refresh. The frontend now samples every second, and FrameStats::from_samples judges the median of the last 15 samples, needing at least 5.

RED → GREEN

  • Tier 4 RED, on the real machine. I ran test_gpu_acceleration_software against the installed AppImage of master e747db4 with LIBGL_ALWAYS_SOFTWARE=1. The log said Loading up OpenGL on adapter Mesa llvmpipe, yet GetStats.gpuAcceleration was {"adapter":"OpenGL","state":"green"} and no startup warning appeared. The check failed.
  • Tier 1 RED fd28bca: 5 frame-window tests fail, and the ffi tests abort on the todo!().
  • GREEN 70c83bd + f3baeea: 36 Tier 1 tests pass, including a free median() with its own tests. GpuStatus.cpp compiles cleanly with -Wall against Qt 6.11, and ci/platform_ifdef_ratchet.py passes.
  • Tier 4 GREEN: to be rerun on the same machine with this branch's AppImage; the result goes in a comment below.

Refs #846

A single slow second after launch turned the light red until the next
refresh. The light should judge the median of one-second samples, with
at least MIN_FRAME_SAMPLES of them. The C ABI now takes the samples.

Refs #846
…REEN)

gs_get_device_name() names the API ("OpenGL", "Direct3D 11"), not the
adapter, so llvmpipe showed green: the Tier 4 check failed on a real
NixOS machine forced onto llvmpipe. Read GL_VENDOR/GL_RENDERER on OpenGL
and the active DXGI adapter on Direct3D 11 instead.

The light also flashed red for one refresh after launch, judging a
single slow second. Sample libobs' one-second average every second and
classify the median of the last 15 (at least 5).

Refs #846
…atform facade

median() is a free function with its own unit tests (odd and even
counts, rounding, overflow at u64::MAX, input order); the even case uses
u64::midpoint. GetGlGetStringProc() lives in platform-x11.cpp,
platform-windows.cpp and platform-osx.mm, so GpuStatus.cpp gains no
platform #ifdefs (ci/platform_ifdef_ratchet.py).

Refs #846
@zackees
zackees enabled auto-merge October 16, 2026 00:30
It landed inside the FreeBSD-only include block; the AppImage build
failed with dlopen not declared.

Refs #846
@zackees
zackees added this pull request to the merge queue Oct 16, 2026
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Tier 4 GREEN on the same NixOS machine (RTX 3060 + RTX 2080 Ti), with this branch's AppImage from run 38830318777, wrapped with appimageTools.wrapType2:

  • Forced llvmpipe (LIBGL_ALWAYS_SOFTWARE=1): all 4 checks pass. The log shows Loading up OpenGL on adapter Mesa llvmpipe … and then ==== GPU acceleration: YELLOW ====. Before this PR, the same check reported green with adapter OpenGL.
  • Xvfb without forcing: Xvfb has no GPU, so OBS still uses llvmpipe. GetStats reports adapter Mesa llvmpipe (LLVM 21.1.8, 256 bits) and lists both NVIDIA GPUs. Once 5 samples are in, it turns red ("Frames take 75.2 ms to render against a 33.3 ms budget"), which is correct.

The AppImage build passed, as did its distro tests (Ubuntu 22.04, Debian trixie, Fedora, Arch). Green on real hardware still needs a manual check in a desktop session.

Merged via the queue into master with commit 6423c6b Oct 16, 2026
29 checks passed
zackees added a commit that referenced this pull request Oct 16, 2026
…ag (RED)

The one-second sampler lived only in frontend C++ with no test, and a
frontend that passes "OpenGL" as the adapter went unnoticed (#929).

Refs #943
zackees added a commit that referenced this pull request Oct 16, 2026
…uild

The GPU status light shipped calling llvmpipe green (#846, fixed in
#929) because Tier 4 never ran in CI. run_tier4.py --only gpu runs just
that group; the Ubuntu (Rust libobs) job installs the build into /usr
and runs it under Xvfb, where OBS renders on llvmpipe.

Fixes #940
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 16, 2026
…e adapters (obs-rust#943) (obs-rust#960)

* obs-gpu-status: Add failing tests for FrameWindow and the API-name flag (RED)

The one-second sampler lived only in frontend C++ with no test, and a
frontend that passes "OpenGL" as the adapter went unnoticed (obs-rust#929).

Refs obs-rust#943

* obs-gpu-status: Move the frame-time window into Rust and flag API-name adapters (GREEN)

FrameWindow keeps the last 15 non-zero one-second samples; the frontend
only calls obs_gpu_status_sample() each second, and
obs_gpu_status_report() reads the window. The JSON's adapterIsApiName
is true when the frontend passed gs_get_device_name()'s API name, and
the Tier 4 GPU check requires it to be false.

Fixes obs-rust#943
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 16, 2026
…-rust#990)

obs-rust#846 closed with unit tests, Tier 2 and full builds green while the
light it added called llvmpipe green; its Tier 4 test had never run
(obs-rust#929). The worker skill, coordination.md and the PR template now ask
for one real run (Tier 4 or by hand) before Fixes #N on UI, protocol
output or logging changes.

Fixes obs-rust#948
zackees added a commit that referenced this pull request Oct 16, 2026
…uild (#940) (#952)

* ci: Run the Tier 4 GPU acceleration check on the Rust libobs Ubuntu build

The GPU status light shipped calling llvmpipe green (#846, fixed in
#929) because Tier 4 never ran in CI. run_tier4.py --only gpu runs just
that group; the Ubuntu (Rust libobs) job installs the build into /usr
and runs it under Xvfb, where OBS renders on llvmpipe.

Fixes #940

* ci: Run the Tier 4 GPU check after packaging and uploads

Review finding: the check installs the build into /usr, and running it
before Package OBS Studio could let CPack/dpkg-shlibdeps see the
system-wide libobs.

Refs #940
zackees added a commit that referenced this pull request Oct 16, 2026
Describe the frame window from #929 (median of the last 15 one-second
averages, at least 5) and where the adapter name comes from. The
mockup's wording still matches report.rs.

Fixes #947
@zackees
zackees deleted the fix/846-gpu-status-adapter 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