Skip to content

feat(linux): render headless through EGL in utvio, replace OSMesa rvio_sw - #82

Merged
mcoliver merged 1 commit into
mainfrom
feat/linux-headless-egl
Oct 1, 2026
Merged

mcoliver merged 1 commit into
mainfrom
feat/linux-headless-egl

Conversation

@mcoliver

@mcoliver mcoliver commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

utvio / rvio no longer needs an X server on Linux, so it runs on render nodes and in containers without xvfb-run.

  • FBOVideoDevice: GLX when DISPLAY is set, otherwise EGL with no window system. EGL tries the device platform first (GPU), then Mesa's surfaceless platform (llvmpipe software rendering). If GLX fails with a display set, EGL is tried too.
  • utvio_sw / rvio_sw: kept as a command for existing farm scripts. It is now a small launcher that runs utvio with EGL and software rendering forced.
  • Removed: the OSMesa code (TwkGLFMesa, MovieRV, the rvio_sw executable). Mesa dropped OSMesa in 25.1. glfix.c moved to src/bin/imgtools/rvio/.
  • Environment variables: UTV_GL_PLATFORM=glx|egl, UTV_SOFTWARE_GL=1 (or LIBGL_ALWAYS_SOFTWARE=1), UTV_GL_DEBUG=1 to print the chosen context and renderer.
  • CI: the Linux test step runs cli-smoke and image-format-roundtrip a second time with no X server, and the smoke test checks utvio_sw and rvio_sw.
  • Docs: docs/headless-rendering.md, plus a README bullet.

Verification

  • The context-creation code, extracted verbatim from FBOVideoDevice.cpp into a test program, was compiled and run in containers with no GPU. Each case created a complete RGBA16F framebuffer and read back the float value written (4.0, 0.5):
Image Mesa No display Under Xvfb
Ubuntu 24.04 25.2 EGL, llvmpipe GLX, llvmpipe
Rocky Linux 9 25.2 EGL, llvmpipe not run
Rocky Linux 8 23.1 EGL, llvmpipe not run
  • UTV_GL_PLATFORM=egl under Xvfb selects EGL; UTV_GL_PLATFORM=glx with no display fails with a clear error (Ubuntu).
  • macOS: builds, 121/121 tests pass (the change is Linux-only apart from removing RVIO_HW conditionals).
  • Not verified locally: the full utvio build on Linux and the EGL device (GPU) path, which needs a machine with a GPU. Linux CI covers the build and the software path.

🤖 Generated with Claude Code

…o_sw

utvio needed an X display on Linux because its offscreen OpenGL context was
GLX only, so render nodes had to run it under Xvfb. The software-rendering
rvio_sw relied on OSMesa, which Mesa removed in 25.1.

FBOVideoDevice now uses GLX when DISPLAY is set and EGL otherwise: the EGL
device platform first (GPU), then Mesa's surfaceless platform (llvmpipe).
UTV_GL_PLATFORM=glx|egl forces one, UTV_SOFTWARE_GL / LIBGL_ALWAYS_SOFTWARE
select software rendering, and UTV_GL_DEBUG prints what was chosen.

utvio_sw (also installed as rvio_sw) is now a launcher that runs utvio with
EGL and software rendering forced, so existing farm scripts keep working.
The OSMesa code (TwkGLFMesa, MovieRV, the rvio_sw executable) is removed.

CI runs the CLI smoke and image round-trip tests a second time on Linux
with no X server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Signed-off-by: Michael Oliver <mcoliver@gmail.com>
@mcoliver
mcoliver marked this pull request as ready for review October 1, 2026 19:19
@mcoliver
mcoliver merged commit 8e5436d into main Oct 1, 2026
9 checks passed
@mcoliver mcoliver mentioned this pull request Oct 2, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant