Last active
April 16, 2026 12:48
-
-
Save igor-ramazanov/26dd5e90f7099b4e3eadffbc8c9d04c7 to your computer and use it in GitHub Desktop.
nixos-avf: attempt to set up sway with hardware acceleration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs, lib, ... }: | |
| { | |
| avf.enableGraphics = false; | |
| boot.kernelModules = [ "virtio_gpu" ]; | |
| environment = { | |
| variables = { | |
| LD_LIBRARY_PATH = "/run/opengl-driver/lib"; | |
| LIBGL_DRIVERS_PATH = "${pkgs.mesa.drivers}/lib/dri"; | |
| MESA_LOADER_DRIVER_OVERRIDE = ""; | |
| MESA_VK_WSI_DEBUG = "sw,linear"; | |
| VK_ICD_FILENAMES = "${pkgs.mesa}/share/vulkan/icd.d/gfxstream_vk_icd.${pkgs.stdenv.hostPlatform.uname.processor}.json"; | |
| }; | |
| systemPackages = [ | |
| pkgs.firefox | |
| pkgs.foot | |
| pkgs.mesa | |
| pkgs.libdrm | |
| ]; | |
| }; | |
| hardware.graphics = { | |
| enable = true; | |
| package = (pkgs.mesa.override { galliumDrivers = [ "i915" ]; }).drivers; | |
| }; | |
| programs = { | |
| sway = { | |
| enable = true; | |
| extraPackages = lib.mkForce [ | |
| pkgs.wmenu | |
| pkgs.wl-clipboard | |
| ]; | |
| xwayland.enable = false; | |
| wrapperFeatures = { | |
| base = true; | |
| gtk = true; | |
| }; | |
| extraOptions = [ | |
| "--debug" | |
| "--verbose" | |
| ]; | |
| }; | |
| }; | |
| services.seatd.enable = true; | |
| systemd.user = { | |
| tmpfiles.users.igor.rules = [ | |
| "L+ /home/igor/.config/sway/config 0400 - - - /home/igor/personal/dotfiles/hosts/michelangelo/sway.config" | |
| "L+ /home/igor/.config/foot/foot.ini 0400 - - - /home/igor/personal/dotfiles/hosts/michelangelo/foot.ini" | |
| ]; | |
| }; | |
| users.users.igor.extraGroups = [ | |
| "video" | |
| "render" | |
| "seat" | |
| ]; | |
| } |
Author
Author
Fails when running with OpenGL irrelevantly from whether MESA_LOADER_DRIVER_OVERRIDE="" or MESA_LOADER_DRIVER_OVERRIDE=zinc:
WLR_BACKENDS=drm \
WLR_DRM_DEVICES=/dev/dri/card0 \
WLR_RENDER_DRM_DEVICE=/dev/dri/renderD128 \
WLR_RENDERER=gles2 \
sway00:00:00.030 [wlr] [backend/backend.c:248] Found 1 GPUs
00:00:00.032 [wlr] [backend/drm/backend.c:225] Initializing DRM backend for /dev/dri/card0 (virtio_gpu)
00:00:00.032 [wlr] [backend/drm/drm.c:110] Using atomic DRM interface
00:00:00.032 [wlr] [backend/drm/drm.c:131] ADDFB2 modifiers unsupported
00:00:00.033 [wlr] [backend/drm/drm.c:310] Found 16 DRM CRTCs
00:00:00.033 [wlr] [backend/drm/drm.c:268] Found 32 DRM planes
00:00:00.037 [wlr] [util/env.c:25] Loading WLR_RENDERER option: gles2
00:00:00.037 [wlr] [render/wlr_renderer.c:157] Opening DRM render node '/dev/dri/renderD128' from WLR_RENDER_DRM_DEVICE
00:00:00.083 [wlr] [render/egl.c:205] Supported EGL client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_explicit_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
00:00:00.085 [wlr] [render/egl.c:523] Using EGL device /dev/dri/card0
libEGL warning: egl: failed to create dri2 screen
00:00:00.086 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create screen"
libEGL warning: egl: failed to create dri2 screen
00:00:00.088 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create screen"
00:00:00.088 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
00:00:00.088 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
00:00:00.088 [wlr] [render/egl.c:269] Failed to initialize EGL
00:00:00.088 [wlr] [render/egl.c:611] Failed to initialize EGL context
00:00:00.088 [wlr] [render/gles2/renderer.c:499] Could not initialize EGL
00:00:00.088 [wlr] [render/wlr_renderer.c:199] Failed to create a GLES2 renderer
00:00:00.088 [wlr] [render/wlr_renderer.c:279] Could not initialize renderer
00:00:00.088 [sway/server.c:255] Failed to create renderer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fails when running with Vulkan: