github selkies-project/selkies e8e47a9

pre-releaseone hour ago

fix(pixelflux): Decline the GPU paths where libEGL is missing, not panic

smithay opens libEGL.so.1 the first time any of its EGL calls runs and
panics where it cannot (ffi.rs: "Failed to load LibEGL"). On a host
without libEGL that took down selkies gpu-probe (Ubuntu 24.04 without
libegl1 and Alpine without mesa-egl, Tesla K80), the Wayland compositor's
GPU bring-up, and the X11 DRI3 capture's NVENC import: the whole server,
where every other library the server opens at run time only turns its
path down.

EGL displays are made through egl_display, which opens libEGL.so.1 first
(once, and keeps it open for smithay's own open) and returns an error where
it is missing; gpu_render_init and the DRI3 capture decline on it as on any
other EGL failure. crates/pixelflux/clippy.toml disallows smithay's EGL
entry points elsewhere: EGLDisplay::new, EGLDevice::enumerate,
make_sure_egl_is_loaded and get_proc_address (the one call left is made
under a current context, so libEGL is open).

Every other library opened with dlopen already fails without a panic:
pixelflux's and the server's own opens of CUDA, NVENC, NvFBC, VA-API,
Vulkan, PipeWire, X11 and XCB, and the GPU probe's GL and EGL, return
errors; nvml-wrapper's Nvml::init returns one; wayland-backend checks for
libwayland-server before its Display::new and returns NoWaylandLib.

tests/tools/hide_libs.so makes dlopen fail for the libraries HIDE_LIBS
names, and test_missing_libraries runs gpu-probe and an X11 and a Wayland
WebSockets session with each of them hidden, with all of them at once and
with none: the probe exits 0, the sessions send frames and the server stays
up without a panic (without libwayland-server the Wayland server says it
has no compositor). On an NVIDIA L4 with Xvfb, main fails exactly four of
its 65 checks (gpu-probe with EGL hidden and with everything hidden, and
the Wayland session's server panicking with EGL hidden) and this passes
all 65. On a private NVIDIA Xorg (DRI3, NV-GLX), main's X11 session with
libEGL hidden panics in two capture threads and sends nothing; with this
the DRI3 capture declines ("no EGL display ... for the NVENC import"),
NvFBC takes the capture and the frames flow, and with everything hidden it
streams on x264. Without a render node, as on CI, the sessions run with
nothing and with everything hidden.

Don't miss a new selkies release

NewReleases is sending notifications on new releases.