godot: Vulkan: Editor freezes when system wakes up from sleep
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version
4.0.dev (5179124f)
System information
Linux 5.13.13, Ryzen 5800X, GTX 1060, Vulkan
Issue description
When my Linux system goes to sleep and later wakes up, any currently running Godot 4.0.dev editors are completely frozen, and I need to kill -9
their processes.
Steps to reproduce
- Start the editor with any project
- Put the system to sleep
- Wake the system up from sleep
- Godot editor is now entirely frozen
Minimal reproduction project
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (8 by maintainers)
Given how this isn’t a Godot-specific issue and large sweeping changes are required to support suspend on Linux, it’s fair to document this for now.
This definitely seems to be a wider problem than Godot. I booted up Valheim on Pop! OS and put my computer into sleep mode. The Vulkan version of Valheim behaved just like Godot 4 (entire window stopped rendering), whereas OpenGL version of Valheim behaved more like Godot 3 (2D UI continued to render, but 3D meshes were completely black)
Also since I don’t think it was mentioned in this thread yet: this problem affects not just the editor but any games made with Godot as well
Regarding NVIDIA GPUs, it seems this is currently a limitation of the driver. There is an experimental option you can enable to copy VRAM to RAM before suspending: https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend
This also explains why the issue could only be reproduced on NVIDIA GPUs so far.
Can anyone try this and see if it works?
I am also experiencing this issue with the recently released godot 4 alpha build. So far, this issue has happened every time I have slept/resumed my system.
Godot Engine v4.0.alpha1.official.31a7ddbf8 Linux 5.15.16-1-MANJARO x86_64; GNOME Shell 41.3 Vulkan API 1.2.202 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce MX150
Godot Engine v3.4.2.stable.official.45eaa2daf does not have the same problem for me and I haven’t noticed any material problems like the one @hmans mentioned.
As @fwsGonzo said, the editor still responds to mouse clicks, but the window shows a ghost of the last rendered content. Also, a project does not need to be opened (stay at project manager window) before sleeping/resuming breaks godot’s window rendering.
Running from the terminal shows lots of these errors whenever a re-render event is triggered (such as resizing the window or hovering over components inside):
I also saw this error in one of my tests, but it may not be related.
Lspci shows:
See also https://github.com/godotengine/godot/issues/41559.
@hmans Can you reproduce this with Godot 3.3.3?
Note that in general, NVIDIA + suspend on Linux is not very reliable. Open source drivers generally fare better here, but there are no viable open source drivers available for Maxwell 2 and newer GPUs due to NVIDIA’s signed firmware requirement.