From 4d5590c73e5ae164ef0645904eff673b95d1f5d5 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sun, 11 Oct 2026 10:01:33 +0000 Subject: [PATCH] fix(compositor): allow the software renderer when asked, and ask in the VM QEMU's default virtio-gpu has no 3D acceleration, so Mesa offers only a software EGL device, which the DRM backend refused; the compositor took the display but had no renderer for its output. WEFT_ALLOW_SOFTWARE_RENDERING lets it use that device, and the VM's compositor unit sets it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QS8QcxvhVJwU3X2qhPamUW --- crates/weft-compositor/src/backend/drm.rs | 6 ++++-- infra/nixos/configuration.nix | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/weft-compositor/src/backend/drm.rs b/crates/weft-compositor/src/backend/drm.rs index 755b50f..e2b5ee4 100644 --- a/crates/weft-compositor/src/backend/drm.rs +++ b/crates/weft-compositor/src/backend/drm.rs @@ -311,8 +311,10 @@ fn device_added(state: &mut WeftCompositorState, node: DrmNode, path: &Path) -> let egl_display = unsafe { EGLDisplay::new(gbm.clone()).context("EGLDisplay::new failed")? }; let egl_device = EGLDevice::device_for_display(&egl_display).context("no EGL device")?; - if egl_device.is_software() { - anyhow::bail!("software renderer"); + // A software renderer is refused unless asked for: it is the only + // one a virtual GPU without 3D acceleration offers. + if egl_device.is_software() && std::env::var_os("WEFT_ALLOW_SOFTWARE_RENDERING").is_none() { + anyhow::bail!("software renderer (set WEFT_ALLOW_SOFTWARE_RENDERING to use it)"); } let rn = egl_device .try_get_render_node() diff --git a/infra/nixos/configuration.nix b/infra/nixos/configuration.nix index 703b9f7..b08f2e6 100644 --- a/infra/nixos/configuration.nix +++ b/infra/nixos/configuration.nix @@ -119,7 +119,12 @@ # units after it; a restarted compositor must not inherit it, or an # X11 DISPLAY, or it would pick the nested backend. UnsetEnvironment = "WAYLAND_DISPLAY DISPLAY"; - Environment = "LIBSEAT_BACKEND=seatd"; + Environment = [ + "LIBSEAT_BACKEND=seatd" + # QEMU's default virtio-gpu has no 3D acceleration; Mesa renders in + # software. + "WEFT_ALLOW_SOFTWARE_RENDERING=1" + ]; Restart = "on-failure"; RestartSec = "1"; };