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

Open
chinatsu opened this issue May 16, 2024 · 4 comments

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.

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

No branches or pull requests

4 participants