Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sway does not start with EGL_NOT_INITIALIZED error #128469

Closed
lunik1 opened this issue Jun 28, 2021 · 6 comments
Closed

sway does not start with EGL_NOT_INITIALIZED error #128469

lunik1 opened this issue Jun 28, 2021 · 6 comments
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@lunik1
Copy link
Contributor

lunik1 commented Jun 28, 2021

Describe the bug

When trying to launch sway (from tty) I get the error

libEGL warning: MESA-LOADER: failed to open : /run/opengl-driver/lib/dri/_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri)

00:00:00.276 [ERROR] [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
libEGL warning: MESA-LOADER: failed to open : /run/opengl-driver/lib/dri/_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri)

00:00:00.276 [ERROR] [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
00:00:00.276 [ERROR] [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
00:00:00.276 [ERROR] [wlr] [render/egl.c:217] Failed to initialize EGL
00:00:00.276 [ERROR] [wlr] [EGL] command: eglMakeCurrent, error: EGL_BAD_DISPLAY (0x3008), message: "Invalid display (nil)"
00:00:00.276 [ERROR] [wlr] [render/wlr_renderer.c:263] Could not initialize EGL
00:00:00.283 [ERROR] [wlr] [backend/drm/renderer.c:34] Failed to create EGL/WLR renderer
00:00:00.291 [ERROR] [wlr] [backend/drm/backend.c:201] Failed to initialize renderer
00:00:00.293 [ERROR] [wlr] [backend/backend.c:174] Failed to create DRM backend
00:00:00.293 [ERROR] [wlr] [backend/backend.c:312] Failed to open any DRM device
00:00:00.371 [ERROR] [sway/server.c:55] Unable to create backend

(It seems strange that sway is trying to use _dri.so)

I'm not completely sure whether this is nixpkgs or home-manager's issue, but it seems to have occurred when bumping nixpkgs from 51bb9f3 to b27eaa1. If I pin nixpkgs at b27eaa1 and just update home-manager sway still runs. I am working on finding the specific commit with the breakage.

To Reproduce
Steps to reproduce the behaviour:

  1. Try to launch sway from tty

Expected behavior
Sway should launch

Additional context
I am using home-manager to manage sway, tracking nixpkgs-unstable but my system configuration tracks 21.05. My flake-based config can be found here.

Notify maintainers

@primeos @Synthetica @Ma27

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.12.9-zen1, NixOS, 21.05.20210623.0ccd0d9 (Okapi)
  • multi-user?: yes
  • sandbox: relaxed
  • version: nix-env (Nix) 2.4pre20210601_5985b8b
  • channels(root): "nixos-20.09.3332.d303eee16ce, nixos-unstable-21.05pre272380.f6b5bfdb470"
  • channels(corin): "nixpkgs-21.05pre286925.3e62e383f4b"
  • nixpkgs: /home/corin/.nix-defexpr/channels/nixpkgs

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: sway
# a list of nixos modules affected by the problem
module:
@lunik1 lunik1 added the 0.kind: bug Something is broken label Jun 28, 2021
@primeos
Copy link
Member

primeos commented Jun 28, 2021

Seems like you're hitting the issues described in #119558 and #120325. Try to make sure to use the same Nixpkgs revisions for NixOS and home-manager, that should fix it. This new limitation should likely also be mentioned in the home-manager documentation for Sway.

@lunik1
Copy link
Contributor Author

lunik1 commented Jun 28, 2021

Another fix (for sway at least) is to set wayland.windowManager.sway.package to null and then enable the sway module in NixOS. Although form what I understand while this allows sway to work other programs depending on mesa can also break?

@primeos
Copy link
Member

primeos commented Jun 28, 2021

Another fix (for sway at least) is to set wayland.windowManager.sway.package to null and then enable the sway module in NixOS.

Good idea. IMO that's preferable anyway. I once suggested that in nix-community/home-manager#1288 (comment) but I'm not sure if it was ever documented.

Although form what I understand while this allows sway to work other programs depending on mesa can also break?

Yes, unfortunately (IIRC I also observed this issue with XWayland).

@tuxinaut
Copy link
Contributor

tuxinaut commented Jul 12, 2021

@primeos

Seems like you're hitting the issues described in #119558 and #120325. Try to make sure to use the same Nixpkgs revisions for NixOS and home-manager, that should fix it. This new limitation should likely also be mentioned in the home-manager documentation for Sway.

First, thank you very much for spending time on this issue. Second I don't get what you exactly mean 😢

To use e.g 21.05 version for both nixos and home-manage 🤔 ?

Sorry for the noise, I answered my question myself. I switched back from unstable to 21.05 and forgot to switch the sway package back from unstable to normal in my home-manager configuration 🤦 after doing this everything works as expected 😄

@stale
Copy link

stale bot commented Jan 9, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 9, 2022
@primeos
Copy link
Member

primeos commented Jan 9, 2022

Seems like this issue can be closed.

@primeos primeos closed this as completed Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants