swayfx icon indicating copy to clipboard operation
swayfx copied to clipboard

SwayFX Fails to Run on Ubuntu 24.04

Open FelixSchladt opened this issue 9 months ago • 10 comments

  • Swayfx Version:
    • 0.4

Hi All,

first, thanks for maintaining and providing SwayFx, I really would love to be able to run. I am running Ubuntu 24.04 and compiled swayfx using nix, which worked fine. Unfortunately I am unable to run it and get the following errors:

❯ nix develop .
felsch01@fw-felsch01:~/git/swayfx$ nix run .
00:00:00.003 [wlr] [render/egl.c:209] EGL_EXT_platform_base not supported
00:00:00.003 [wlr] [render/egl.c:524] Failed to create EGL context
00:00:00.003 [wlr] [render/fx_renderer/fx_renderer.c:607] Could not initialize EGL
00:00:00.003 [sway/server.c:150] Failed to create fx_renderer

This seems to be related to mesa/opengl

glxinfo -B

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: AMD Radeon 780M (radeonsi, gfx1103_r1, LLVM 19.1.1, DRM 3.57, 6.8.0-53-generic) (0x15bf)
    Version: 24.2.8
    Accelerated: yes
    Video memory: 2048MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 1386 MB, largest block: 1386 MB
    VBO free aux. memory - total: 30975 MB, largest block: 30975 MB
    Texture free memory - total: 1386 MB, largest block: 1386 MB
    Texture free aux. memory - total: 30975 MB, largest block: 30975 MB
    Renderbuffer free memory - total: 1386 MB, largest block: 1386 MB
    Renderbuffer free aux. memory - total: 30975 MB, largest block: 30975 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 2048 MB
    Total available memory: 33093 MB
    Currently available dedicated video memory: 1386 MB
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon 780M (radeonsi, gfx1103_r1, LLVM 19.1.1, DRM 3.57, 6.8.0-53-generic)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.2.8-1ubuntu1~24.04.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.2.8-1ubuntu1~24.04.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.2.8-1ubuntu1~24.04.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Did anyone manage to get it running on ubuntu? Is this a bug or a bad setup? SwayWm from the ubuntu repositories runs just fine on my system.

I would really appreciate any help, greetings Felix :)

FelixSchladt avatar Feb 16 '25 13:02 FelixSchladt

You're using nix to run it, right? Does it run without nix?

ErikReider avatar Feb 16 '25 14:02 ErikReider

Same issue, it does not make a difference wether I run it from inside the nix devshell or in the system env:

❯ swayfx
00:00:00.003 [wlr] [render/egl.c:209] EGL_EXT_platform_base not supported
00:00:00.003 [wlr] [render/egl.c:524] Failed to create EGL context
00:00:00.003 [wlr] [render/fx_renderer/fx_renderer.c:607] Could not initialize EGL
00:00:00.003 [sway/server.c:145] Failed to create fx_renderer

FelixSchladt avatar Feb 16 '25 14:02 FelixSchladt

Seems like you're missing a driver? You're rocking an AMD IGPU, so Mesa is fine. I'm guessing that trying to run regular Sway is also a problem? What Mesa drivers do you have installed?

ErikReider avatar Feb 16 '25 14:02 ErikReider

I am currently using sway from the Ubuntu repositories and it works just fine.

My installed mesa driver is Mesa 24.2.8-1ubuntu1~24.04.1

glxinfo -B
[...]
OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.2.8-1ubuntu1~24.04.1
[...]
``

FelixSchladt avatar Feb 16 '25 16:02 FelixSchladt

Unfortunately a known nix issue, I should add a bit to the README about it. This happens when the nix version of egl is out of sync with your system's version. NixGL is the solution: https://github.com/nix-community/nixGL

WillPower3309 avatar Feb 16 '25 19:02 WillPower3309

Feel free to reopen or add more info if nixGL doesn't work!

WillPower3309 avatar Feb 16 '25 19:02 WillPower3309

Maybe this would help? https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3612

ErikReider avatar Feb 16 '25 19:02 ErikReider

Thanks for the tip with NixGL, unfortunately this still does not fix the issue for me

> nix profile install github:guibou/nixGL --impure
> nixGL -- swayfx
amdgpu: unknown (family_id, chip_external_rev): (148, 10)
libEGL warning: egl: failed to create dri2 screen
00:00:00.023 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create screen"
amdgpu: unknown (family_id, chip_external_rev): (148, 10)
libEGL warning: egl: failed to create dri2 screen
00:00:00.028 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create screen"
00:00:00.028 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
00:00:00.028 [wlr] [render/egl.c:269] Failed to initialize EGL
00:00:00.028 [wlr] [render/egl.c:572] Failed to initialize EGL context
00:00:00.028 [wlr] [render/fx_renderer/fx_renderer.c:607] Could not initialize EGL
00:00:00.028 [sway/server.c:145] Failed to create fx_renderer

FelixSchladt avatar Feb 17 '25 18:02 FelixSchladt

Thanks for the tip with NixGL, unfortunately this still does not fix the issue for me

nix profile install github:guibou/nixGL --impure nixGL -- swayfx amdgpu: unknown (family_id, chip_external_rev): (148, 10) libEGL warning: egl: failed to create dri2 screen 00:00:00.023 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create screen" amdgpu: unknown (family_id, chip_external_rev): (148, 10) libEGL warning: egl: failed to create dri2 screen 00:00:00.028 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create screen" 00:00:00.028 [wlr] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize" 00:00:00.028 [wlr] [render/egl.c:269] Failed to initialize EGL 00:00:00.028 [wlr] [render/egl.c:572] Failed to initialize EGL context 00:00:00.028 [wlr] [render/fx_renderer/fx_renderer.c:607] Could not initialize EGL 00:00:00.028 [sway/server.c:145] Failed to create fx_renderer

At least a new error 🤷

ErikReider avatar Feb 17 '25 21:02 ErikReider

@ErikReider You could try the version from Git--- SwayFX has been rebased off a newer Sway version, 1.10.1.

markstos avatar Feb 18 '25 14:02 markstos