WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.41k stars 177 forks source link

[render/gles2/renderer.c:679] Could not initialize EGL / Seg fault #2180

Closed Marietto2008 closed 8 months ago

Marietto2008 commented 8 months ago

Today,when I started again Wayland / wayfire , it didn't work. I don't remember that yesterday I've applied hard changes,so I'm not able to understand if and what changes can I revert to make it work again. The startup script that I use :

#!/usr/local/bin/zsh
# env WLR_DRM_NO_MODIFIERS=1
env WLR_NO_HARDWARE_CURSORS=1 LIBSEAT_BACKEND=consolekit2 ck-launch-session dbus-run-session wayfire

log of the error :

src/main.cpp:334] Starting wayfire version v0.8.0
[libseat] [libseat/libseat.c:66] Seat opened with backend 'consolekit2'
[libseat] [libseat/backend/consolekit2.c:92] Ping failed: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.9" (uid=1001 pid=25032 comm="") interface="org.freedesktop.DBus.Peer" member="Ping" error name="(unset)" requested_reply="0" destination="org.freedesktop.ConsoleKit" (uid=0 pid=90025 comm="")
[backend/session/session.c:109] Successfully loaded libseat session
[backend/backend.c:220] Found 1 GPUs
[backend/drm/backend.c:200] Initializing DRM backend for /dev/dri/card0 (nvidia-drm)
[backend/drm/drm.c:253] Found 4 DRM CRTCs
[backend/drm/drm.c:180] Found 12 DRM planes
[render/egl.c:201] Supported EGL client extensions: EGL_EXT_platform_base EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_KHR_platform_x11 EGL_EXT_platform_x11 EGL_EXT_platform_device EGL_MESA_platform_surfaceless EGL_EXT_explicit_device EGL_KHR_platform_wayland EGL_EXT_platform_wayland EGL_KHR_platform_gbm EGL_MESA_platform_gbm EGL_EXT_platform_xcb
EE 06-03-24 10:23:41.031 - [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "EGL_BAD_PARAMETER error: In internal function: Additional INFO may be available"
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "EGL_BAD_PARAMETER error: In function eglQueryDeviceStringEXT(), string query failed at backend"
[EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
[EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
[EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
[EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
[render/egl.c:264] Failed to initialize EGL
[render/egl.c:554] Failed to initialize EGL context
[render/gles2/renderer.c:679] Could not initialize EGL
[src/main.cpp:134] Fatal error: Segmentation fault
#1  0x363b40 <main+0x1580> at /usr/local/bin/wayfire
#2  0x82bdcb53f <pthread_sigmask+0x53f> at /lib/libthr.so.3
#3  0x82bdcaafb <pthread_setschedparam+0x83b> at /lib/libthr.so.3
#4  0x8215222d3 <???> at ???
#5  0x8223fb9c4 <wlr_renderer_get_render_formats+0x24> at /usr/local/wlroots016/lib/libwlroots.so.11
#6  0x82240af23 <wlr_allocator_init+0x83> at /usr/local/wlroots016/lib/libwlroots.so.11
#7  0x362a59 <main+0x499> at /usr/local/bin/wayfire
#8  0x82ae5dafa <__libc_start1+0x12a> at /lib/libc.so.7
ammen99 commented 8 months ago

I would try the following things:

Otherwise I gotta mention that the proprietary nvidia driver is not officially supported by wlroots, and all of these issues that you're having are actually wlroots related xD But as long as nvidia doesn't have bugs, wlroots should just work even without explicit support.

Marietto2008 commented 8 months ago

Actually I'm using wayfire-0.8.0_2 and wayfire-plugins-extra-0.80_1 :

[root@marietto-I5 /usr/home/marietto/Desktop]==> pkg search wayfire

wayfire-0.8.0_2                3D Wayland compositor
wayfire-plugins-extra-0.8.0_1  Additional plugins for Wayfire

if I want to install wayfire 0.9 from git,it will go in conflict with the wayfire-plugins-extra-0.8.0_1 because they are not compatible with each other. I can do it if I can install wayfire-plugins-extra-0.9,to say,from git. Please explain if I can do this. Otherwise this experiment will fail,since I've already tried.

ammen99 commented 8 months ago

Please explain if I can do this.

Yes, you can install wayfire-plugins-extra from git as well, it should work together with Wayfire-git.

Also note that you can install to a particular prefix so that the two installations do not conflict with each other. See for example wf-install (https://github.com/WayfireWM/wf-install): just make sure to pay attention to the output and make sure that it is not missing important dependencies for the DRM backend or Xwayland (wlroots can build even without DRM and Xwayland support, but then it will not start from a TTY ...)

Marietto2008 commented 8 months ago

maybe I'm lucky. From ports there is a newer version of wayfire. 0.8.0.3...let's see if it works...

Marietto2008 commented 8 months ago

It didn't work. These are the ports that I should install :

wayfire: 0.8.0_2
wayfire-plugins-extra: 0.8.0_1
wcm: 0.8.0_1
wf-config: 0.8.0
wf-shell: 0.8.0

Is this what I should do to upgrade everything ?

wayfire :

# git clone https://github.com/WayfireWM/wayfire.git && cd wayfire
# meson build --prefix=/usr/local --buildtype=release
# ninja -C build && sudo ninja -C build install

wayfire-plugins-extra :

# git clone https://github.com/WayfireWM/wayfire-plugins-extra && cd wayfire-plugins-extra
# meson build --prefix=/usr/local --buildtype=release
# ninja -C build && sudo ninja -C build install

wcm :

# git clone https://github.com/WayfireWM/wcm && cd wcm
# meson build --prefix=/usr/local --buildtype=release
# ninja -C build && sudo ninja -C build install

wf-config :

# git clone https://github.com/WayfireWM/wf-config && cd wf-config
# meson build --prefix=/usr/local --buildtype=release
# ninja -C build && sudo ninja -C build install

wf-shell :

# git clone https://github.com/WayfireWM/wf-shell && cd wf-shell
# meson build --prefix=/usr/local --buildtype=release
# ninja -C build && sudo ninja -C build install
soreau commented 8 months ago

If you install to /usr/local/, make sure you don't have another installation in /usr/ because they might conflict. Another option might be to use the wf-install script, so everything is installed to the disposable prefix /opt/wayfire/ where you run the install script and start wayfire with /opt/wayfire/bin/startwayfire and it will not interfere with any installation in /usr/. If you want to get rid of it, simply delete /opt/wayfire/ directory.

Marietto2008 commented 8 months ago

should I install a new version of wlroots,too ?

soreau commented 8 months ago

The wf-install script will install wlroots from a subproject, so it too will be contained in /opt/wayfire/.

Marietto2008 commented 8 months ago

I'm not sure that I can install all the components in /opt ; FreeBSD is not Linux. It wants /usr/local.

soreau commented 8 months ago

wf-install has a --prefix option, so you can install it wherever you want.

Marietto2008 commented 8 months ago
[root@marietto-I5 /usr/home/marietto/Scaricati/wf-install]==> ./install.sh --prefix /opt/wayfire --stream 0.9.x
Building Wayfire 0.9.x

Installation prefix: /opt/wayfire
Clone in 'wayfire' in corso...
remote: Enumerating objects: 26068, done.
remote: Counting objects: 100% (4255/4255), done.
remote: Compressing objects: 100% (530/530), done.
remote: Total 26068 (delta 3848), reused 3821 (delta 3711), pack-reused 21813
Ricezione degli oggetti: 100% (26068/26068), 6.40 MiB | 7.74 MiB/s, fatto.
Risoluzione dei delta: 100% (19978/19978), fatto.
error: lo specificatore percorso 'origin/0.9.x' non corrisponde ad alcun file noto a git

it won't install 0.9 ; but yesterday I've been able to install 0.9 with meson. it makes no sense to install 0.8 with this method,since freebsd already provide 0.8.

soreau commented 8 months ago

If you omit --stream, it should install latest git. There is no 0.9.x branch yet.

Marietto2008 commented 8 months ago

These commands will install 0.9. I did it yesterday :

# git clone https://github.com/WayfireWM/wayfire.git && cd wayfire
# meson build --prefix=/usr/local --buildtype=release
# ninja -C build && sudo ninja -C build install

maybe the wf-install script should be upgraded ? give a look here :

https://github.com/WayfireWM/wayfire/issues/2171#issuecomment-1974873447

can you read by yourself from my log that it has installed 0.9.0 :

[src/main.cpp:334] Starting wayfire version 0.9.0

Marietto2008 commented 8 months ago

Let's say that I want to install everything in /opt/wayfire. I did :


# git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git && cd wayland-protocols
# meson setup build --prefix=/opt/wayfire --buildtype=release
# ninja -C build && sudo ninja -C build/ install

# git clone https://gitlab.freedesktop.org/wlroots/wlroots.git && cd wlroots
# meson setup build --prefix=/opt/wayfire --buildtype=release
# ninja -C build && sudo ninja -C build/ install

but I get this error :

Dependency wayland-protocols found: NO found 1.32 but need: '>=1.33'

soreau commented 8 months ago

You will need to install additional dependencies, wf-install does not do this for you. But you can easily install it manually to the same prefix and set PKG_CONFIG_PATH to the directory containing wayland-protocols.pc before running the script again, so it can find the updated package. You also might want to use the -c option to clean the source files when running the script again.

Marietto2008 commented 8 months ago
# export PKG_CONFIG_PATH=/opt/wayfire/share/pkgconfig
# git clone https://github.com/WayfireWM/wayfire.git && cd wayfire
# meson build --prefix=/opt/wayfire --buildtype=release
# ninja -C build && sudo ninja -C build install

......
Installing /usr/home/marietto/Scaricati/wayfire/metadata/wsets.xml to /opt/wayfire/share/wayfire/metadata
Installing /usr/home/marietto/Scaricati/wayfire/metadata/wayfire-shell.xml to /opt/wayfire/share/wayfire/metadata
Installing /usr/home/marietto/Scaricati/wayfire/metadata/xdg-activation.xml to /opt/wayfire/share/wayfire/metadata
Installing /usr/home/marietto/Scaricati/wayfire/wayfire.desktop to /opt/wayfire/share/wayland-sessions
Installing symlink pointing to libwf-config.so.0.9.0 to /opt/wayfire/lib/libwf-config.so.1
Installing symlink pointing to libwf-config.so.1 to /opt/wayfire/lib/libwf-config.so
Installing symlink pointing to libwf-utils.so.0.4.0 to /opt/wayfire/lib/libwf-utils.so.0
Installing symlink pointing to libwf-utils.so.0 to /opt/wayfire/lib/libwf-utils.so
OK

# git clone https://github.com/WayfireWM/wf-shell && cd wf-shell
# meson setup build --prefix=/opt/wayfire --buildtype=release

Run-time dependency wayfire found: NO (tried pkgconfig and cmake)

meson.build:16:17: ERROR: Dependency "wayfire" not found, tried pkgconfig and cmake
soreau commented 8 months ago

export PKG_CONFIG_PATH=/opt/wayfire/share/pkgconfig

PKG_CONFIG_PATH is a colon-separated list of directories. You need to add the directory containing wayfire.pc as well.

Marietto2008 commented 8 months ago
[root@marietto-I5 /usr/home/marietto/Scaricati/wayfire-plugins-extra]==> git clone https://github.com/WayfireWM/wayfire-plugins-extra && cd wayfire-plugins-extra

[root@marietto-I5 /usr/home/marietto/Scaricati/wayfire-plugins-extra]==> meson build --prefix=/opt/wayfire --buildtype=release

The Meson build system
Version: 1.3.1
Source dir: /usr/home/marietto/Scaricati/wayfire-plugins-extra
Build dir: /usr/home/marietto/Scaricati/wayfire-plugins-extra/build
Build type: native build
Project name: wayfire-plugins-extra
Project version: 0.9.0
C compiler for the host machine: cc (clang 16.0.6 "FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)")
C linker for the host machine: cc ld.lld 16.0.6
C++ compiler for the host machine: c++ (clang 16.0.6 "FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)")
C++ linker for the host machine: c++ ld.lld 16.0.6
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/usr/local/bin/pkg-config) 2.0.3
Run-time dependency wayfire found: YES 0.9.0
Run-time dependency giomm-2.4 found: YES 2.66.6
Run-time dependency wayland-protocols found: YES 1.33
Run-time dependency wayland-server found: YES 1.22.0
Run-time dependency libevdev found: YES 1.9.1
Run-time dependency nlohmann_json found: YES 3.11.3
Program wayland-scanner found: YES (/usr/local/bin/wayland-scanner)
Message: 
----------------
wayfire-plugins-extra 0.9.0
----------------

Build targets in project: 22
NOTICE: Future-deprecated features used:
 * 1.1.0: {'"boolean option" keyword argument "value" of type str'}

wayfire-plugins-extra 0.9.0

  User defined options
    buildtype: release
    prefix   : /opt/wayfire

Found ninja-1.11.1 at /usr/local/bin/ninja
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
[root@marietto-I5 /usr/home/marietto/Scaricati/wayfire-plugins-extra]==> ninja -C build && sudo ninja -C build install
ninja: Entering directory `build'
[24/47] Compiling C++ object src/libfocus-steal-prevent.so.p/focus-steal-prevent.cpp.o
../src/focus-steal-prevent.cpp:202:31: warning: comparison of different enumeration types ('enum wl_pointer_button_state' and 'wlr_button_state') [-Wenum-compare]
        if ((ev->event->state == WLR_BUTTON_RELEASED) || !prevent_focus_steal)
             ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
../src/focus-steal-prevent.cpp:209:31: warning: comparison of different enumeration types ('enum wl_pointer_button_state' and 'wlr_button_state') [-Wenum-compare]
            (ev->event->state == WLR_BUTTON_PRESSED) && prevent_focus_steal)
             ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~
2 warnings generated.
[26/47] Compiling C++ object src/libbench.so.p/bench.cpp.o
../src/bench.cpp:56:9: warning: private field 'frames_since_last_update' is not used [-Wunused-private-field]
    int frames_since_last_update = 0;
        ^
1 warning generated.
[30/47] Compiling C++ object src/libwater.so.p/water.cpp.o
../src/water.cpp:229:25: warning: comparison of different enumeration types ('enum wl_pointer_button_state' and 'wlr_button_state') [-Wenum-compare]
        if (event.state == WLR_BUTTON_RELEASED)
            ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
1 warning generated.
[36/47] Compiling C++ object src/libbackground-view.so.p/background-view.cpp.o
../src/background-view.cpp:181:18: warning: 'get_keyboard_focus_surface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
    wlr_surface *get_keyboard_focus_surface()
                 ^
/opt/wayfire/include/wayfire/unstable/xdg-toplevel-base.hpp:21:18: note: overridden virtual function is here
    wlr_surface *get_keyboard_focus_surface() override;
                 ^
../src/background-view.cpp:204:18: warning: 'get_keyboard_focus_surface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
    wlr_surface *get_keyboard_focus_surface()
                 ^
/opt/wayfire/include/wayfire/unstable/xwl-toplevel-base.hpp:36:18: note: overridden virtual function is here
    wlr_surface *get_keyboard_focus_surface() override;
                 ^
2 warnings generated.
[40/47] Compiling C++ object src/libwinzoom.so.p/window-zoom.cpp.o
FAILED: src/libwinzoom.so.p/window-zoom.cpp.o 
c++ -Isrc/libwinzoom.so.p -Isrc -I../src -I/opt/wayfire/include -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/harfbuzz -I/usr/local/include/cairo -I/usr/local/include/freetype2 -I/usr/local/include/pixman-1 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/libxml2 -I/usr/local/include/libevdev-1.0 -I/usr/local/include/libdrm -I/usr/local/include/libepoll-shim -I/usr/local/include/fribidi -I/usr/local/include/libpng16 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN -Wno-unused-parameter -fPIC -pthread -D_THREAD_SAFE -MD -MQ src/libwinzoom.so.p/window-zoom.cpp.o -MF src/libwinzoom.so.p/window-zoom.cpp.o.d -o src/libwinzoom.so.p/window-zoom.cpp.o -c ../src/window-zoom.cpp

../src/window-zoom.cpp:320:32: error: use of undeclared identifier 'WLR_AXIS_ORIENTATION_VERTICAL'
        if (ev->orientation == WLR_AXIS_ORIENTATION_VERTICAL)

                               ^
1 error generated.
[41/47] Compiling C++ object src/libannotate.so.p/annotate.cpp.o
../src/annotate.cpp:249:54: warning: comparison of different enumeration types ('enum wl_pointer_button_state' and 'wlr_button_state') [-Wenum-compare]
        if ((event.button == button) && (event.state == WLR_BUTTON_RELEASED))
                                         ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
1 warning generated.
[43/47] Compiling C++ object src/libworkspace-names.so.p/workspace-names.cpp.o
ninja: build stopped: subcommand failed.
soreau commented 8 months ago

If you run grep -Rn WLR_AXIS_ORIENTATION_VERTICAL /opt/wayfire, does it show any output? Here it shows /opt/wayfire/include/wlr/types/wlr_pointer.h:77: WLR_AXIS_ORIENTATION_VERTICAL,

Marietto2008 commented 8 months ago

[root@marietto-I5 /usr/home/marietto/Scaricati/wayfire-plugins-extra]==> grep -Rn WLR_AXIS_ORIENTATION_VERTICAL /opt/wayfire

no output.

soreau commented 8 months ago

I think you should build wayfire with -Duse_system_wlroots=disabled so it installs to /opt/wayfire/ instead of picking up the wlroots in /usr/.

Marietto2008 commented 8 months ago

ok. very thanks. I have configured and built everything. Now I'm going to run this script to start wayland + wayfire :

#!/usr/local/bin/zsh
env WLR_DRM_NO_MODIFIERS=1 WLR_NO_HARDWARE_CURSORS=1 LIBSEAT_BACKEND=consolekit2 ck-launch-session dbus-run-session /opt/wayfire/bin/./wayfire

is this correct ?

soreau commented 8 months ago

You will also need to set LD_LIBRARY_PATH to the library directory, something like LD_LIBRARY_PATH=/opt/wayfire/lib/$libdir where $libdir might be custom to your system.

soreau commented 8 months ago

And you probably want to set PATH=/opt/wayfire/bin:$PATH, so it can find wf-shell and anything else you have installed there.

ammen99 commented 8 months ago

Just a note, it might be easier for you to copy the start-up script /opt/wayfire/bin/startwayfire and adjust it for your needs. @Marietto2008

Marietto2008 commented 8 months ago

Inside the directory /opt I haven't any startwayfire script.

soreau commented 8 months ago

If you used the wf-install script, it would have installed the startwayfire runtime script. As @ammen99 stated, you would have to tailor it for your setup.

Marietto2008 commented 8 months ago

I haven't installed the wf-install script,because it is not able to install wayfire 0.9,but only 0.8. But I don't need 0.8 because it is already provided by FreeBSD.

soreau commented 8 months ago

By default, wf-install installs latest wayfire and everything you need from git master. You don't have to specify --stream or --prefix as the defaults are master and /opt/wayfire.

Marietto2008 commented 8 months ago
[root@marietto-I5 /usr/home/marietto/Scaricati/wf-install]==> ./install.sh --prefix /opt/wayfire
......
ninja: Entering directory `build'
[3/3] Linking target src/panel/wf-panel
ninja: Entering directory `build'
[0/1] Installing files.
Installing subprojects/wayland-logout/wayland-logout to /opt/wayfire/bin
Installing src/panel/wf-panel to /opt/wayfire/bin
Installing src/background/wf-background to /opt/wayfire/bin
Installing src/dock/wf-dock to /opt/wayfire/bin
Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/subprojects/wayland-logout/wayland-logout.1 to /opt/wayfire/share/man/man1
Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/build/metadata/background.xml to /opt/wayfire/share/wayfire/metadata/wf-shell
Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/metadata/dock.xml to /opt/wayfire/share/wayfire/metadata/wf-shell
Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/metadata/panel.xml to /opt/wayfire/share/wayfire/metadata/wf-shell
Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/data/wayfire.png to /opt/wayfire/share/wayfire/icons
Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/data/wallpaper.jpg to /opt/wayfire/share/wayfire
Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/build/meson-private/wf-shell.pc to /opt/wayfire/libdata/pkgconfig
cp: --backup=t is not a directory

is that an error ? the installation process stopped abnormally ?

Marietto2008 commented 8 months ago

the script is bugged :


Installing /usr/home/marietto/Scaricati/wf-install/wf-shell/build/meson-private/wf-shell.pc to /opt/wayfire/libdata/pkgconfig
Do you want to override the existing config file /root/.config/wayfire.ini [y/n]? n
Do you want to override the existing config file /root/.config/wf-shell.ini [y/n]? n

sed: 1: "/usr/home/marietto/Scar ...": extra characters at the end of h command
soreau commented 8 months ago

I'm not sure why you are getting these errors but the script is meant to run as user, not root. It will attempt to use sudo as needed.

ammen99 commented 8 months ago

Also @Marietto2008 please use IRC/Matrix/Discord for support. We're spamming everybody subscribed to the GitHub repository :)

ammen99 commented 8 months ago

Or alternatively: open a GitHub discussion if none of the above are an option for you.

Marietto2008 commented 8 months ago

I'm waiting for you here : https://github.com/WayfireWM/wayfire/discussions/2182