hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.58k stars 902 forks source link

error: EGL_BAD_PARAMETER , not starting anymore on asahi #2276

Closed nik012003 closed 1 year ago

nik012003 commented 1 year ago

After pulling the repo, and building the latest version on Hyprland, it doesn't start anymore and it prints this error:

00:00:00.051 [INFO] [backend/backend.c:219] Found 1 GPUs
00:00:00.051 [INFO] [backend/drm/backend.c:201] Initializing DRM backend for /dev/dri/card2 (apple)
00:00:00.051 [INFO] [backend/drm/drm.c:249] Found 1 DRM CRTCs
00:00:00.051 [INFO] [backend/drm/drm.c:207] Found 1 DRM planes
00:00:00.051 [INFO] [render/egl.c:206] Supported EGL client extensions: EGL_EXT_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_KHR_debug EGL_EXT_platform_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.052 [ERROR] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
00:00:00.052 [ERROR] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
MESA-LOADER: failed to open zink: /usr/local/lib64/dri/zink_dri.so: cannot open shared object file: No such file or directory (search paths /usr/local/lib64/dri, suffix _dri)
00:00:00.461 [ERROR] [render/egl.c:320] Software rendering detected, please use the WLR_RENDERER_ALLOW_SOFTWARE environment variable to proceed
00:00:00.461 [ERROR] [render/egl.c:567] Failed to initialize EGL context
00:00:00.461 [ERROR] [EGL] command: eglMakeCurrent, error: EGL_NOT_INITIALIZED (0x3001), message: "eglMakeCurrent"
00:00:00.461 [ERROR] [render/gles2/renderer.c:704] Could not initialize EGL
terminate called after throwing an instance of 'std::runtime_error'
  what():  wlr_gles2_renderer_create_with_drm_fd() failed!

To start Hyprland I use: env MESA_GL_VERSION_OVERRIDE=3.3 MESA_GLSL_VERSION_OVERRIDE=330 MESA_GLES_VERSION_OVERRIDE=3.1 Hyprland This is the crash report:

--------------------------------------------
   Hyprland Crash Report
--------------------------------------------
Who tried dividing by zero?!

Hyprland received signal 6 (Aborted)

Version: 7fde80f38eefef4ec1e682947c4ae152aa0974db

System info:
    System name: Linux
    Node name: fedora
    Release: 6.2.14-450.asahi.fc38.aarch64
    Version: #1 SMP PREEMPT_DYNAMIC Mon May  8 00:22:49 UTC 2023

GPU:

os-release:
    NAME="Fedora Linux Asahi Remix"
    VERSION="38 (Thirty Eight)"
    ID=fedora-asahi-remix
    ID_LIKE=fedora
    VERSION_ID=38
    VERSION_CODENAME=""
    PLATFORM_ID="platform:f38"
    PRETTY_NAME="Fedora Linux Asahi Remix 38 (Thirty Eight)"
    ANSI_COLOR="0;38;2;60;110;180"
    LOGO=fedora-logo-icon
    CPE_NAME="cpe:/o:fedoraproject:fedora-asahi-remix:38"
    DEFAULT_HOSTNAME="fedora"
    HOME_URL="https://pagure.io/fedora-asahi/project"
    DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f38/system-administrators-guide/"
    SUPPORT_URL="https://ask.fedoraproject.org/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    REDHAT_BUGZILLA_PRODUCT="Fedora"
    REDHAT_BUGZILLA_PRODUCT_VERSION=38
    REDHAT_SUPPORT_PRODUCT="Fedora"
    REDHAT_SUPPORT_PRODUCT_VERSION=38

Backtrace:
    #0 | Hyprland(_ZN13CrashReporter18createAndSaveCrashEi+0x52c) [0x4b3100]
        _ZN13CrashReporter18createAndSaveCrashEi
        ??:?
    #1 | Hyprland(_Z25handleUnrecoverableSignali+0x4c) [0x45dc7c]
        _Z25handleUnrecoverableSignali
        ??:?
    #2 | linux-vdso.so.1(__kernel_rt_sigreturn+0) [0xffff810b880c]
        ??
        ??:0
    #3 | /lib64/libc.so.6(+0x8d908) [0xffff7fecd908]
        ??
        ??:0
    #4 | /lib64/libc.so.6(gsignal+0x20) [0xffff7fe84980]
        ??
        ??:0
    #5 | /lib64/libc.so.6(abort+0xf4) [0xffff7fe70284]
        ??
        ??:0
    #6 | /lib64/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x184) [0xffff801cf3c4]
        ??
        ??:0
    #7 | /lib64/libstdc++.so.6(+0xacbe0) [0xffff801ccbe0]
        ??
        ??:0
    #8 | /lib64/libstdc++.so.6(+0xacc64) [0xffff801ccc64]
        ??
        ??:0
    #9 | /lib64/libstdc++.so.6(+0xacfb8) [0xffff801ccfb8]
        ??
        ??:0
    #10 | Hyprland(_ZN11CCompositor10initServerEv+0x52c) [0x46ba40]
        _ZN11CCompositor10initServerEv
        ??:?
    #11 | Hyprland(main+0x324) [0x44f504]
        main
        ??:?
    #12 | /lib64/libc.so.6(+0x30598) [0xffff7fe70598]
        ??
        ??:0
    #13 | /lib64/libc.so.6(__libc_start_main+0x9c) [0xffff7fe70670]
        ??
        ??:0
    #14 | Hyprland(_start+0x30) [0x45daf0]
        _start
        ??:?

Log tail:

[LOG] os-release:
NAME="Fedora Linux Asahi Remix"
VERSION="38 (Thirty Eight)"
ID=fedora-asahi-remix
ID_LIKE=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora Linux Asahi Remix 38 (Thirty Eight)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora-asahi-remix:38"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://pagure.io/fedora-asahi/project"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f38/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=38
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=38

[LOG] ========================

[INFO] If you are crashing, or encounter any bugs, please consult https://wiki.hyprland.org/Crashes-and-Bugs/

[LOG] 
Current splash: Ding ding pch n daa, bam-ba-ba-re-bam baram bom bom baba-bam-bam-bommm

[LOG] Creating the HookSystem!
[LOG] Creating the KeybindManager!
[LOG] Creating the AnimationManager!
[LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 12.38µs. Estimated average calc time: 0.00µs.
[LOG] Creating the ConfigManager!
[LOG] Creating the CHyprError!
[LOG]  [hookSystem] New hook event registered: focusedMon
[LOG]  [hookSystem] New hook event registered: preRender
[LOG] Creating the LayoutManager!
[LOG] Reloading the config!
[LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 7.67µs. Estimated average calc time: 0.00µs.
[LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 7.67µs. Estimated average calc time: 0.00µs.
[LOG] Registered dynamic var "$mainMod" -> SUPER
[LOG] Disabling stdout logs! Check the log for further logs.
[CRITICAL] m_sWLRRenderer was NULL!

sway works fine, with graphic acceleration working, with the same env variables. Older versions of hyprland (~1 month ago) worked fine too. The problem persists also when trying the legacyrenderer (without the MESA OVERRIDES ofc).

The hyrpland config is the stock config.

vaxerski commented 1 year ago

does sway-git work? This looks like a wlroots issue.

kangaro0 commented 1 year ago

hey, I have the same problem. Any clues on how you fixed it, nik012003?

nik012003 commented 1 year ago

Turs out it was comiling against a bad version of mesa, that didn't have the asahi gl driver. So I just removed that libraries from /usr/local/lib64, recompiled and it worked. For some reason sway and other things compiled and worked fine anyway, they were probably using the working libs

ZerdoX-x commented 1 year ago

Hi. A bit late to the party

Sorry, but for some reason I can not make it. Could anyone please explain me which files/packages do I need to delete/rebuild? In /usr/local/lib64 I only had old libwlroots, it stayed here from when I was using self compiled version of Hyprland. I deleted it, completely reinstalled mesa::asahi, recompiled hyprland (from gentoo package) but it still asks me to enable software rendering environment variable. With this env variable everything works of course, but slow. How do I ensure that hyprland uses correct drivers? Thank you for any response (PS everything was working till I did world update. hyprland was self compiled in /usr/local/bin so it was not even updated at first)

UPD: I resolved my issue. I needed to recompile kernel with proper support for Asahi drivers support. You need to enable RUST in kernel and some other params. Yeah, I am on gentoo.

nik012003 commented 1 year ago

Hi. A bit late to the party

Sorry, but for some reason I can not make it. Could anyone please explain me which files/packages do I need to delete/rebuild? In /usr/local/lib64 I only had old libwlroots, it stayed here from when I was using self compiled version of Hyprland. I deleted it, completely reinstalled mesa::asahi, recompiled hyprland (from gentoo package) but it still asks me to enable software rendering environment variable. With this env variable everything works of course, but slow. How do I ensure that hyprland uses correct drivers? Thank you for any response (PS everything was working till I did world update. hyprland was self compiled in /usr/local/bin so it was not even updated at first)

Here's the stuff I removed to get it to compile against the right libs: rm libEG* libGL* libOSMesa*

fabianmuehlberger commented 1 year ago

Facing the same issue on a fresh arch linux install on a pc with an nvidia 3060ti I think I followed the notes regarding nvidia drivers correctly. Set the environment variable in the hyprland.conf, edited the files according to the wiki.

hyprland only loaded once correctly, but after a reboot it always fails with the same error. Removing the hyprland.conf does not make a difference. log

...
[LOG] Using config: /home/fabian/.config/hypr/hyprland.conf
[LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 10.78µs. Estimated average calc time: 0.03µs.
[LOG] Registered dynamic var "$mainMod" -> SUPER
[LOG] Disabling stdout logs! Check the log for further logs.
[wlr] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[wlr] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
KirilStrezikozin commented 1 year ago

After an update to the latest Hyprland v0.31.0 on Arch Hyprland didn't start, reported with the shared library error: libwlroots.so.12032 not found: file does not exist. The libwlroots.so existed in /usr/lib/. Copying it under the libwlroots.so.12032 and rerunning Hyprland made it crash with a segfault and showing logs similar to @fabianmuehlberger. Reinstalling hyprland-nvidia didn't help either (I'm on Nvidia GPU)

Tried to recompile the latest Hyprland from source - the issue is gone now.

Reading hyprland-nvidia AUR thread points out the issue too. There was a newer patch that should fix it.

ZerdoX-x commented 1 year ago

@fabianmuehlberger @KirilStrezikozin this is not related to current issue. We all here use Asahi Linux on M1/M2 Apple devices.

This is other issue which needs to be opened separately, especially if this is not a single case and you both in the same time bumped into it.

fabianmuehlberger commented 1 year ago

I understand that, but since it was the same error message, I thought it might have a similar root cause. I resolved the issue by adding the line env = WLR_RENDERER_ALLOW_SOFTWARE,1 as recommended here.

Should I still open a issue ?

ZerdoX-x commented 1 year ago

I thought it might have a similar root cause

You can see how OP and me resolved this issue, and also what vaxerski replied.

I resolved the issue by adding the line env = WLR_RENDERER_ALLOW_SOFTWARE,1

For me it was causing input lag, maybe glitches, very high CPU usage and other not cool stuff. See how it works for you.. I hope you understand what this parameter does and what is software rendering and how it differs from hardware rendering.

Should I still open a issue?

If you think so. I don't know anything about your problem and I didn't make any research of existing issues or other forums where nvidia+wayland may be discussed.

fabianmuehlberger commented 1 year ago

Chapeau, well explained, got i!

dxwil commented 5 months ago

I just got the same problem today, everything was working yesterday, I don't think any update caused this. Sway seems to launch but not Hyprland

raisinbl commented 3 months ago

I just got the same problem today, everything was working yesterday, I don't think any update caused this. Sway seems to launch but not Hyprland

same here, did you find any solution or work around for it

dxwil commented 3 months ago

I just got the same problem today, everything was working yesterday, I don't think any update caused this. Sway seems to launch but not Hyprland

same here, did you find any solution or work around for it

I ended up reinstalling asahi, and restoring my home folder from a backup