Skip to content

NixGL, Nvidia 570 Drivers, and Sway Causing GBM Errors #203

@therobotreader

Description

@therobotreader

Hi,
I'm running into some weird errors trying to get the combination of nixGL and Nvidia and sway to work.

version info:
nixGL: sha256 1crnbv3mdx83xjwl2j63rwwl9qfgi2f1lr53zzjlby5lh50xjz4n from main.tar.gz.
sway: git hash 0e19d85d37e556721f982c3f63d4e2927f306b18, version 1.11
wlroots: git hash 78aaaaf7b62334fae673dec7b0ff2d5942b78041 (pulled same time as the sway one).
nvidia driver version: 570.144
cuda version 12.8

That version of sway/wlroots works outside of nix.

When I try nixGL sway I get the following errors:

MESA-LOADER: failed to open dri: /run/opengl-driver/lib/gbm/dri_gbm.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/gbm, suffix _gbm)
00:00:00.035 [wlr] [render/egl.c:593] Failed to create GBM device
00:00:00.035 [wlr] [render/egl.c:609] Failed to initialize EGL context
00:00:00.035 [wlr] [render/gles2/renderer.c:499] Could not initialize EGL
00:00:00.035 [wlr] [render/wlr_renderer.c:279] Could not initialize renderer
00:00:00.035 [sway/server.c:255] Failed to create renderer

If I manually build the drivers with

{ pkgs ? import <nixpkgs> {} }:

pkgs.buildEnv {
  name = "graphics-drivers";
  paths = [ pkgs.mesa pkgs.linuxPackages.nvidia_x11.out pkgs.nvidia-vaapi-driver ];
}

and link them with sudo ln -s "$(pwd)/result" /run/opengl-driver it gets rid of the MESA-LOADER error and shows:

00:00:00.002 [wlr] [render/egl.c:208] EGL_EXT_platform_base not supported
00:00:00.002 [wlr] [render/egl.c:561] Failed to create EGL context
00:00:00.002 [wlr] [render/gles2/renderer.c:499] Could not initialize EGL
00:00:00.002 [wlr] [render/wlr_renderer.c:279] Could not initialize renderer
00:00:00.002 [sway/server.c:255] Failed to create renderer

If it's relevant, I tried using the same nixgl with ffmpeg and it worked successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions