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

4.3.dev - Problems with launching Godot/launching projects in a compositor with Xwayland disabled #92014

Closed
Tracked by #88346
chinatsu opened this issue May 16, 2024 · 9 comments · Fixed by #92663
Closed
Tracked by #88346

Comments

@chinatsu
Copy link

chinatsu commented May 16, 2024

Tested versions

  • Reproducible in 4.3.beta.custom_build.5708a3a02 (built from godot-git from the AUR).

System information

Godot v4.3.beta (5708a3a) - Arch Linux #1 SMP PREEMPT_DYNAMIC Tue, 07 May 2024 21:35:54 +0000 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XTX (RADV NAVI31) () - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)

Issue description

I use niri as my daily window manager, and I'm interested in using Godot. As far as I understand, Wayland support is worked on for version 4.3 of Godot, so I'm testing it out. A thing to note about niri is that it does not have built-in Xwayland support, I'm not sure if that contributes to some of the strangeness experienced here.

I have had a couple of issues related to launching the editor, and running projects. I think they may be related, so I'm combining them all in one issue.

Some context; what eglinfo -B outputs:

~> eglinfo -B
GBM platform:
eglinfo: eglInitialize failed

Wayland platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

X11 platform:
eglinfo: eglInitialize failed

Surfaceless platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device platform:
Device #0:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: AMD
OpenGL core profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: AMD
OpenGL compatibility profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: AMD
OpenGL ES profile renderer: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 17.0.6, DRM 3.57, 6.8.9-arch1-2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #1:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

I am pretty sure all of the OpenGL versions and OpenGL ES versions are up to date here, in the context of the Wayland platform in any case.


Running with --rendering-driver opengl3

~ > godot --display-driver wayland --rendering-driver opengl3
Godot Engine v4.3.beta.custom_build.5708a3a02 (2024-05-16 07:32:11 UTC) - https://godotengine.org
WARNING: Can't obtain the XDG activation global. Attention requesting won't work!
     at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3564)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta.custom_build (5708a3a02e00061e03366f2dabf8942df66fedca)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x7b847ed6cae0] (??:0)
-- END OF BACKTRACE --
================================================================

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta.custom_build (5708a3a02e00061e03366f2dabf8942df66fedca)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x7b847ed6cae0] (??:0)
-- END OF BACKTRACE --
================================================================

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta.custom_build (5708a3a02e00061e03366f2dabf8942df66fedca)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x7b847ed6cae0] (??:0)
-- END OF BACKTRACE --
================================================================

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta.custom_build (5708a3a02e00061e03366f2dabf8942df66fedca)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x7b847ed6cae0] (??:0)
-- END OF BACKTRACE --
================================================================
ERROR: EGL version is too old!
   at: initialize (drivers/egl/egl_manager.cpp:352)
WARNING: Your video card drivers seem not to support the required OpenGL version, switching to OpenGLES.
     at: DisplayServerWayland (platform/linuxbsd/wayland/display_server_wayland.cpp:1348)
ERROR: EGL version is too old!
   at: initialize (drivers/egl/egl_manager.cpp:352)
ERROR: Could not initialize GLES3.
   at: DisplayServerWayland (platform/linuxbsd/wayland/display_server_wayland.cpp:1366)
ERROR: Can't create the Wayland display server.
   at: create_func (platform/linuxbsd/wayland/display_server_wayland.cpp:1230)
ERROR: X11 Display is not available
   at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:5876)
ERROR: Unable to create DisplayServer, all display drivers failed.
Use "--headless" command line argument to run the engine in headless mode if this is desired (e.g. for continuous integration).
   at: setup2 (main/main.cpp:2708)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketLargeE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools12BucketMediumE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketSmallE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: BUG: Unreferenced static string to 0: TextServerDummy
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: IPUnix
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ResourceFormatImporterSaver
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: MovieWriterMJPEG
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: interface_added
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: TextServerAdvanced
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ImageFormatLoader
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ResourceFormatSaver
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: GDScriptEditorTranslationParserPlugin
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: MovieWriterPNGWAV
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ResourceFormatLoader
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ScriptLanguage
   at: unref (core/string/string_name.cpp:129)

I get a dialog error saying

Your video card drivers seem not to support the required OpenGL 3.3 version.
If possible, consider updating your video card drivers.
If you recently updated your video card drivers, try rebooting.

The editor is unable to launch at all.

Running with --rendering-driver opengl3_es

Pretty much the same as above, as running it with opengl3 falls back to trying OpenGL ES as well.

Running with --rendering-driver vulkan

The editor launches, and I seem to be able to do everything I want. I do notice a warning, but it is related to a known issue in niri.

~> godot --display-driver wayland --rendering-driver vulkan
Godot Engine v4.3.beta.custom_build.5708a3a02 (2024-05-16 07:32:11 UTC) - https://godotengine.org
WARNING: Can't obtain the XDG activation global. Attention requesting won't work!
     at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3564)
Vulkan 1.3.274 - Forward+ - Using Device #0: AMD - AMD Radeon RX 7900 XTX (RADV NAVI31)

Editing project: /home/cn/code/godot-demo-projects/3d/platformer
Godot Engine v4.3.beta.custom_build.5708a3a02 (2024-05-16 07:32:11 UTC) - https://godotengine.org
WARNING: Can't obtain the XDG activation global. Attention requesting won't work!
     at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3564)
Vulkan 1.3.274 - Forward+ - Using Device #0: AMD - AMD Radeon RX 7900 XTX (RADV NAVI31)

However, upon running a project, I get this snippet in the terminal:

Godot Engine v4.3.beta.custom_build.5708a3a02 (2024-05-16 07:32:11 UTC) - https://godotengine.org
ERROR: X11 Display is not available
   at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:5876)

And this dialog error saying:

Your video card drivers seem not to support the required Vulkan version.
If possible, consider updating your video card drivers or using the OpenGL 3 driver.
You can enable the OpenGL 3 driver by starting the engine from command line with the command:
"godot" --rendering-driver opengl3
If you recently updated your video card drivers, try rebooting.

But when I click OK, the project window opens anyway, and I'm able to play and interact with the window as expected.

I'm unsure why it's requesting an X11 environment upon running the project. That seems like an erroneous routine to me.

Steps to reproduce

For the happiest case:

For the unhappiest case, redo the steps above but omit the rendering driver flag. Observe that the editor does not launch at all.

Minimal reproduction project (MRP)

No specific project is required, although for my tests I used godotengine/godot-demo-projects/3d/platformer.

@chinatsu chinatsu changed the title 4.3.dev - Problems with launching Godot/launching projects in niri 4.3.dev - Problems with launching Godot/launching projects in niri (Wayland) May 16, 2024
@Gnumaru
Copy link
Contributor

Gnumaru commented May 16, 2024

Are you able to test in a different wayland tiling window manager? Just to be sure it is related to this specific scenario (wayland with niri) instead of a broader scenario like wayland with any tiling window manager, or wayland with any kind of window manager, be it tiling, stacking or anything else.

@chinatsu
Copy link
Author

chinatsu commented May 16, 2024

I have now tried it with a couple of compositors other than niri. My hypothesis is that the lack of "native" Xwayland support is what's causing these problems, so I tried two others based on the same framework as niri (Smithay).

  • MagmaWM, lacks Xwayland support. I get the same issues here.
  • Pinnacle, has "scuffed Xwayland support". Godot works fine here, with either OpenGL, OpenGL ES or Vulkan rendering drivers.

The compositor based on Smithay with the largest community behind it is Cosmic, I've just finished compiling it so I'll give that a quick spin as well, although I expect Godot to work at least as well as it does on Pinnacle. I'll edit this comment in a bit.

Edit: I've now tried Cosmic as well as Hyprland (a tiling Wayland compositor not based on Smithay). Godot works fine on these as well. I'm not sure if I can find a Wayland compositor not based on Smithay without Xwayland support to try that out as well.

@chinatsu
Copy link
Author

chinatsu commented May 16, 2024

I'm fairly certain now that the issues are entirely dependent on whether or not Xwayland is supported. This can easily be reproduced if you use sway, which is a widely available window manager.

Add xwayland disable to your ~/.config/sway/config and see the issues described in the original post. Change the config line to enable Xwayland, and observe that none of the issues occur. Is it possible at all for Godot to not depend on Xwayland? I mean, it already works with the Vulkan rendering driver, but the emitted error message upon running a project is not correct in my opinion.

@chinatsu chinatsu changed the title 4.3.dev - Problems with launching Godot/launching projects in niri (Wayland) 4.3.dev - Problems with launching Godot/launching projects in a compositor with Xwayland disabled May 16, 2024
@sullyj3
Copy link

sullyj3 commented Jun 1, 2024

Another niri user here, having the same issue. I can reproduce that it works in sway with xwayland enabled and doesn't work with it disabled. And that adding --rendering-driver vulkan makes it mostly work except for an error dialog that doesn't actually stop the game from running.

@Riteo
Copy link
Contributor

Riteo commented Jun 1, 2024

Thanks for the report (and all the confirmations)! I can't replicate the worst part of the issue personally (not running at all) on sway with Xwayland disabled but let's try to gather some more info :D

But when I click OK, the project window opens anyway, and I'm able to play and interact with the window as expected.

I'm unsure why it's requesting an X11 environment upon running the project. That seems like an erroneous routine to me.

So, this part is due to a shortcoming in the way DisplayServer fallbacks are handled. The default logic is to try running X11 (as it's the default) and, if it fails, fall back to Wayland (a very common approach). Stuff is not very polished yet so it has a lot of quirks, like not "propagating" from the project manager or making that annoying and actually misleading popup. It will get improved over time and it's not intrinsic to Wayland support, so don't worry too much about that.

So, nothing too out of the ordinary here luckily.

A workaround for now is to change the default editor backend with the editor setting Run -> Platforms -> Prefer Wayland or, if you want, the display/display_server/driver.linuxbsd project setting.

With that out of the way, let's focus on the real bad part.

The editor is unable to launch at all.

The real issue here is that EGL fails to intialize, due to a failed version check.

ERROR: EGL version is too old!
   at: initialize (drivers/egl/egl_manager.cpp:352)

The weird thing is that your eglinfo snippet indeed reports 1.5, the latest EGL version.

Could you try attaching a --verbose log?

@sullyj3
Copy link

sullyj3 commented Jun 1, 2024

Here's mine if that's helpful:

eglinfo -B
✖ eglinfo -B

GBM platform:
eglinfo: eglInitialize failed

Wayland platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

X11 platform:
eglinfo: eglInitialize failed

Surfaceless platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device platform:
Device #0:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20

Device #1:

Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES 
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 24.0.7-arch1.3
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.0.7-arch1.3
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.7-arch1.3
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
godot --display-driver wayland --rendering-driver opengl3 --verbose
▷ godot --display-driver wayland --rendering-driver opengl3 --verbose
Godot Engine v4.3.beta1.official.a4f2ea91a - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
JoypadLinux: udev enabled and loaded successfully.
WARNING: Can't obtain the XDG decoration manager. Libdecor will be used for drawing CSDs, if available.
     at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3557)
WARNING: Can't obtain the XDG activation global. Attention requesting won't work!
     at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3564)
Output 2ab332f0 scale 1
Output 2ab332f0 done.

(godot:599625): Gtk-WARNING **: 23:59:02.834: Theme parsing error: gtk.css:6691:68: Invalid name of pseudo-class
Loading cursor theme "default" size 24.
Failed loading cursor: crossed_circle
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta1.official (a4f2ea91a1bd18f70a43ff4c1377db49b56bc3f0)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x737f683aeae0] (??:0)
-- END OF BACKTRACE --
================================================================
Text-to-Speech: Speech Dispatcher initialized.

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta1.official (a4f2ea91a1bd18f70a43ff4c1377db49b56bc3f0)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x737f683aeae0] (??:0)
-- END OF BACKTRACE --
================================================================

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta1.official (a4f2ea91a1bd18f70a43ff4c1377db49b56bc3f0)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x737f683aeae0] (??:0)
-- END OF BACKTRACE --
================================================================

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta1.official (a4f2ea91a1bd18f70a43ff4c1377db49b56bc3f0)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3cae0) [0x737f683aeae0] (??:0)
-- END OF BACKTRACE --
================================================================
Only one GPU found, using default.
Loaded EGL 1.0
ERROR: EGL version is too old!
   at: initialize (drivers/egl/egl_manager.cpp:352)
WARNING: Your video card drivers seem not to support the required OpenGL version, switching to OpenGLES.
     at: DisplayServerWayland (platform/linuxbsd/wayland/display_server_wayland.cpp:1365)
Loaded EGL 1.0
ERROR: EGL version is too old!
   at: initialize (drivers/egl/egl_manager.cpp:352)
ERROR: Could not initialize GLES3.
   at: DisplayServerWayland (platform/linuxbsd/wayland/display_server_wayland.cpp:1383)
ERROR: Can't create the Wayland display server.
   at: create_func (platform/linuxbsd/wayland/display_server_wayland.cpp:1246)
ERROR: X11 Display is not available
   at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:5904)
ERROR: Unable to create DisplayServer, all display drivers failed.
Use "--headless" command line argument to run the engine in headless mode if this is desired (e.g. for continuous integration).
   at: setup2 (main/main.cpp:2734)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketLargeE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools12BucketMediumE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketSmallE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: BUG: Unreferenced static string to 0: TextServerDummy
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: IPUnix
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: ResourceFormatImporterSaver
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: MovieWriterMJPEG
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: interface_added
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: TextServerAdvanced
   at: unref (core/string/string_name.cpp:129)
fish: Job 1, 'godot --display-driver wayland …' terminated by signal SIGSEGV (Address boundary error)

This bit seems weird:

Only one GPU found, using default.
Loaded EGL 1.0

@Riteo
Copy link
Contributor

Riteo commented Jun 1, 2024

@sullyj3 yeah that did it, thank you, I finally managed to understand what's going on!

So, here's how we load EGL:

	EGLDisplay tmp_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);

Can you spot the problem? Here's a bigger snippet:

	// NOTE: EGL_DEFAULT_DISPLAY returns whatever the O.S. deems suitable. I have
	// no idea if this may cause problems with multiple display servers and if we
	// should handle different EGL contexts in another way.
	EGLDisplay tmp_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);

Yeah, that's quite some foreshadowing LOL. After a quick search, it looks like Mesa's "default display" logic is way simpler than I thought.

I could finally replicate this by setting the EGL_PLATFORM1 environment variable to x11, which I suppose, internally, is the norm for most people (I mostly use a niche source-based distro).

Since you had Xwayland disabled, there was no X11 EGL display available (see the eglinfo output), we tried to load it (as it is the default) and all went south. With Xwayland on, it would load a practically equivalent display and work fine. What a thing!

The fix should be very easy, we just have to let the backend pass what kind of display it wants to load and we should be set! I'll work on this A-absolutely-SAP! This is quite high priority.

In the meantime, a workaround should be running Godot with EGL_PLATFORM=wayland, which sets the default display to the right one in this case. Please tell me if that works!

Edit: it might be even easier, I forgot that we already passed the platform display name :D

Footnotes

  1. https://docs.mesa3d.org/egl.html#environment-variables

@sullyj3
Copy link

sullyj3 commented Jun 1, 2024

That's fantastic news!

In the meantime, a workaround should be running Godot with EGL_PLATFORM=wayland, which sets the default display to the right one in this case. Please tell me if that works!

It does, yep.

@Riteo
Copy link
Contributor

Riteo commented Jun 1, 2024

Obviously, that "quick fix" became... Whatever #92663 is. I might have spent a bit more time on this than I expected.

That said, it should, on paper, fix this issue (mostly, due to a weird casting hack needed for compatibility) once and for all.

Please, test it and tell me whether it works for you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants