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

Vulkan: Moving editor's windows is very laggy on linux #60106

Open
mrvladus opened this issue Apr 10, 2022 · 12 comments
Open

Vulkan: Moving editor's windows is very laggy on linux #60106

mrvladus opened this issue Apr 10, 2022 · 12 comments

Comments

@mrvladus
Copy link

Godot version

4.0 alpha 6

System information

Arch Linux, NVIDIA GTX750Ti, driver 510.60.02, Xorg

Issue description

Very laggy windows with Godot 4. No such problem with version 3.4.4. Could be a problem with Vulkan render. No window lags on wayland, but there is a input delay about half a second, probably because of NVIDIA poor wayland support.
Here is video:
https://youtu.be/2nGjznv3seU

Steps to reproduce

Just open Godot 4 on linux.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Apr 10, 2022

Can you reproduce this on another desktop environment/window manager combination, such as KDE or Xfce?

Also, can you reproduce this when starting the project manager with the --rendering-driver opengl3 --single-window command line arguments?

@Calinou Calinou changed the title Moving editor's windows is very laggy on linux Vulkan: Moving editor's windows is very laggy on linux Apr 10, 2022
@mrvladus
Copy link
Author

mrvladus commented Apr 10, 2022

Tried to launch on KDE - works great! So I guess it's GNOME's WM (Mutter) problem. Which is sucks, because I like working in GNOME.
Btw got this error when launched with the --rendering-driver opengl3 --single-window.

[vlad@arch Godot]$ ./Godot_v4.0-alpha6_linux.64 --rendering-driver opengl3 --single-window 
Godot Engine v4.0.alpha6.official.e4f0fc50f - https://godotengine.org
ERROR: BUG: Unreferenced static string to 0: interface_added
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: interface_added
   at: unref (core/string/string_name.cpp:131)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.alpha6.official (e4f0fc50f79336cf76beec40e5e8e5164b288714)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x42560) [0x7f9d2f579560] (??:0)
-- END OF BACKTRACE --
================================================================

@Sauermann
Copy link
Contributor

I can confirm this laggy behavior in v4.0 alpha 1-6 on
Debain 11, Xorg, Xfce, Nvidia RTX 2070, driver 460.91.03, Vulkan

--rendering-driver opengl3 --single-window does not show the laggy behavior in v4.0 alpha 1-5.

On alpha 6 --rendering-driver opengl3 --single-window results in a similar crash for me as the one in the previous post.

@Calinou
Copy link
Member

Calinou commented Apr 10, 2022

Btw got this error when launched with the --rendering-driver opengl3 --single-window.

#59807 or #59385 likely broke the OpenGL renderer.

@akien-mga
Copy link
Member

It would be good to have a dedicated bug report for the OpenGL crash, it's not related to this issue.

@omenos
Copy link

omenos commented Sep 16, 2022

I'm not experiencing the OpenGL crash with Godot 4.0-beta1, but the stuttering behavior with the Vulkan renderer is still present. Reverting to OpenGL resolves the issue for the time being.

I am also a GNOME user.

Component Version
OS Fedora 36 Workstation
Desktop Environment GNOME 42
Session Type X11
GPU NVIDIA GTX 1070
Driver 515.65.01

I could not find any related tickets in the Mutter issue tracker, but there is one in GNOME Shell about the input delay from two weeks ago.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5817

@purkhusid
Copy link

Also experiencing this on Fedora 36 with Gnome using Wayland.

@purkhusid
Copy link

Note: If I use x11 instead of Wayland everything is pretty smooth. So my guess is that this is some issue with Wayland/XWayland.

@shibacomputer
Copy link

shibacomputer commented Dec 28, 2022

I have this exact issue too, and it extends to 500ms-1sec delays typing text into the editor. Using beta 10. GNOME/Mutter/Wayland and Fedora 37. NVIDIA 3060 dGPU and AMD Radeon iGPU.

➜  Godot ./Godot_v4.0-beta10_linux.x86_64 --rendering-driver opengl3 --single-window
Godot Engine v4.0.beta10.official.d0398f62f - https://godotengine.org
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: nouveau
OpenGL Renderer: AMD Radeon Graphics (renoir, LLVM 15.0.6, DRM 3.48, 6.0.14-300.fc37.x86_64)

Running Godot with these flags set default to the AMD GPU, which is significantly underpowered but also completely solves the extreme lag.

@ErenBikmaz
Copy link

I have this exact issue too, and it extends to 500ms-1sec delays typing text into the editor. Using beta 10. GNOME/Mutter/Wayland and Fedora 37. NVIDIA 3060 dGPU and AMD Radeon iGPU.

➜  Godot ./Godot_v4.0-beta10_linux.x86_64 --rendering-driver opengl3 --single-window
Godot Engine v4.0.beta10.official.d0398f62f - https://godotengine.org
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: nouveau
OpenGL Renderer: AMD Radeon Graphics (renoir, LLVM 15.0.6, DRM 3.48, 6.0.14-300.fc37.x86_64)

Running Godot with these flags set default to the AMD GPU, which is significantly underpowered but also completely solves the extreme lag.

Fedora 36/Cinnamon here, I had similar lag, but ONLY when I had a project open. the window could be moved around smoothly but Godot's UI was laggy. This fix solved the issue for me.

@Edenshaw
Copy link

Edenshaw commented Feb 17, 2023

I use Linux Lite 6.2 (it uses xfce with X11, NVIDIA GeForce RTX 2060, nvidia-driver-510 (proprietary)) and the main window is very laggy.

  • If I run Godot with the command --rendering-driver opengl3 --single-window, it runs smooth but when I run the game, the game window is very laggy when moving around (using Forward+ mode).

  • If I run Godot without any command and choose the Compatibility mode, both, the main window and the game window (when run) move smoothly.

@Calinou
Copy link
Member

Calinou commented Feb 18, 2023

I can confirm this on 4.0.rc 15a97a2 (Fedora 37, GeForce RTX 4090 with NVIDIA 525.85.05), on both Vulkan and OpenGL. I'm using KDE 5.26.5 with KWin and compositing disabled.

On Vulkan, this is caused by low processor mode (which is always enabled in the project manager, but can be disabled by changing this line to false then recompiling), as the issue is gone when continuous updates are performed (even at the same effective FPS). On OpenGL, performing this change does not resolve the issue.

The videos below are recorded at 120 FPS, so the stuttering may not be obvious when viewed on a 60 Hz monitor. I recommend viewing them in fullscreen in slow motion, or using a video viewer such as mpv to perform frame-by-frame stepping. This way, you can notice when the moved window goes out of sync with the mouse cursor (which updates at a constant rate).

A suggested workaround is to trigger a redraw when the window is moved, even though this is technically not necessary (as nothing within the window is changing). This workaround may only be needed on Linux, so we don't need to suffer the increased resource usage on other platforms 🙂

If anyone is interested in reproducing the results below, you can test the project manager with Vulkan using the --rendering-method mobile command line argument, and disabling V-Sync with --disable-vsync.

OpenGL with V-Sync (default project manager behavior)

project_manager_opengl_vsync_on.mp4

OpenGL, continuous updates with V-Sync

project_manager_opengl_vsync_on_force_draw.mp4

Vulkan mobile with V-Sync

project_manager_vulkan_vsync_on.mp4

Vulkan mobile, continuous updates with V-Sync

project_manager_vulkan_vsync_on_force_draw.mp4

Vulkan mobile, continuous updates, no V-Sync

project_manager_vulkan_vsync_off_force_draw.mp4

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

10 participants