godot icon indicating copy to clipboard operation
godot copied to clipboard

Lags when focussing the editor on Fedora 41 on Gnome Wayland

Open carringtonevent opened this issue 10 months ago • 10 comments

Tested versions

Reproduceable in Godot 4.4 Beta 1, Beta 2, and Beta 3

System information

Godot v4.4.beta3.mono - Fedora Linux 41 (Workstation Edition) on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 565.77) - Intel(R) Core(TM) i9-14900K (32 threads)

Issue description

When checking both checkboxes of the running tab (Embed Game on Next Play, Make Game Workspace Floating on Next Play), I expect no lags when focussing back to the editor while the game is running. This happens only on Wayland.

Steps to reproduce

  • Go to the new Game tab and press the 3 dots
  • Make sure that both checkboxes (Embed Game on Next Play, Make Game Workspace Floating on Next Play) are checked. If one of them are not checked, the bug does not happen
  • This bug only happens on Wayland. If I switch to X11, everything is fine.
  • Press run Project (f5)
  • Focus the Godot editor, below the running floating game.
  • Clicking buttons in the editor (regardless which one) is very laggy and uses a lot of time. Debugging is not possible while the game is running.
  • This effect is most strong if you press the "Remote" Button left next to the "Local" Button to view the complete running scene (even if the scene is only one node)

Workarrounds: uncheck one of the running checkboxes (Godot) or switch back to the x11 display server (Gnome)

Minimal reproduction project (MRP)

Not needed, a new empty project with one empty scene is also causing the issue.

carringtonevent avatar Feb 08 '25 11:02 carringtonevent

Thanks for reporting the issue.

I was able to reproduce on Fedora 41 + Gnome on Wayland. Was not able to reproduce on Ubuntu 24.04 + Gnome 46 on Wayland.

I'll take a look into it.

Hilderin avatar Feb 09 '25 00:02 Hilderin

After some testing on Fedora 41+Gnome on Wayland, I find out that any second window (ex: opening the script editor in a second window) causes serious lags in Godot. This issue is also reproductible on Godot 4.3 stable. All I have to do to reproduce it is to open the script editor in a separate window and try to move a Sprite in the 2D editor with the mouse.

I think the issue could be related to Fedora 41 and Wayland. I also see a couple of posts on Fedora forum talking about lags on Wayland since Fedora 41.

@carringtonevent Can you test Godot 4.3 stable and 4.4 beta 3 with an empty project and the script editor on a separate window to see if you have the same result as me?

Hilderin avatar Feb 09 '25 01:02 Hilderin

Hello @Hilderin, Thank you for looking into the the issue. I find it mega impressive how active the Godot community is. I have just tried the floating script editor in 4.3 and 4.4 and have the same result as you. Since you found that the problem is not in Ubuntu I think it has something to do with Fedora 41. Since the update I have often had other Wayland problems. Looks like we have to wait for a Fedora update and it is not directly related to Godot. Thank you very much for your time!

carringtonevent avatar Feb 09 '25 12:02 carringtonevent

For the record, I don't seem to reproduce the issue on Fedora 41 KDE Wayland. I'll try to test on GNOME Wayland in coming days.

akien-mga avatar Feb 10 '25 23:02 akien-mga

I saw some posts saying that the problem with Fedora 41 and KDE Wayland was linked to NVIDIA Graphic cards. My laptop has an NVIDIA RTX 3070 and I see that the OR has a NVIDIA GeForce RTX 4090.

Hilderin avatar Feb 11 '25 00:02 Hilderin

I've also been running into this issue (4.4 beta 4, 4.4 rc1), making the "Make Game Workspace Floating on Next Play" feature basically unusable. For me, I'm using GNOME Wayland under ArchLinux, NVIDIA GeForce RTX 3060 (NVIDIA's official drivers: 570.86.16). @Hilderin Do you perhaps have the link to the posts that discuss this?

BanhmiDev avatar Feb 22 '25 15:02 BanhmiDev

  • Related to https://github.com/godotengine/godot/issues/103102.

Can you try disabling V-Sync in the Editor Settings and see if the issue persists? Also try setting a low FPS limit on the editor, e.g. by increasing Low Processor Mode Sleep Usec to 50000 (20 FPS).

Calinou avatar Feb 22 '25 16:02 Calinou

Can you try disabling V-Sync in the Editor Settings and see if the issue persists? Also try setting a low FPS limit on the editor, e.g. by increasing Low Processor Mode Sleep Usec to 50000 (20 FPS).

Issue sadly still persists for me with both suggested settings. Not sure if relevant, as I don't know how windows are managed under OS level for multi monitor setups, but:

  • When the editor is on one monitor, the lag only goes away when the floating window is partially/fully on the other monitor

EDIT: Tested it on an empty project, seems like it doesn't happen for the compatibility rendering method, or at least not visibly

BanhmiDev avatar Feb 22 '25 16:02 BanhmiDev

Here some links from the Fedora forums: https://discussion.fedoraproject.org/t/stuttering-and-bad-performance-across-entire-plasma-desktop-with-wayland-on-nvidia/140067/16

https://discussion.fedoraproject.org/t/fedora-kde-41-wayland-thoroughly-broken-for-me-nvidia/139486

https://discussion.fedoraproject.org/t/constant-stutter-and-mouse-lag-in-f41-w-nvidia-rtx-4060-ti/143843/5

Hilderin avatar Feb 22 '25 18:02 Hilderin

Can you try disabling V-Sync in the Editor Settings and see if the issue persists? Also try setting a low FPS limit on the editor, e.g. by increasing Low Processor Mode Sleep Usec to 50000 (20 FPS).

Alright, actual follow up again: stupid me didn't apply the V-Sync setting in the Editor Settings, but the Project Settings. The lag actually goes away by disabling V-Sync that way (GNOME Wayland, NVIDIA 570.86.16)

BanhmiDev avatar Feb 22 '25 23:02 BanhmiDev

I have this problem on nobara gnome wayland with an amd gpu. Disabling v-sync keeps the floating text editor on my second monitor speedy while the main editor is not focused. But the main editor still slows to a crawl if the floating text editor is obscured by a different window. I've had similar xwayland problems in other programs since switching to nobara gnome so I'm not sure it's godot's fault.

tarobic avatar Mar 26 '25 17:03 tarobic

Fedora 42, GNOME, disabling vsync fixes this for me also.

T00fy avatar May 14 '25 22:05 T00fy

i have the same issue, im using fedora 42 with gnome, but even with disabling V-sync the issue persists.

Gureenu avatar May 26 '25 17:05 Gureenu