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"; };