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: Editor freezes when system wakes up from sleep #52738

Closed
hmans opened this issue Sep 16, 2021 · 17 comments · Fixed by godotengine/godot-docs#7305
Closed

Vulkan: Editor freezes when system wakes up from sleep #52738

hmans opened this issue Sep 16, 2021 · 17 comments · Fixed by godotengine/godot-docs#7305

Comments

@hmans
Copy link

hmans commented Sep 16, 2021


Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version

4.0.dev (5179124)

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

@Calinou
Copy link
Member

Calinou commented Sep 16, 2021

See also #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.

@Calinou Calinou changed the title [4.0] [Linux] Crash when system wakes up from sleep Crash when system wakes up from sleep Sep 16, 2021
@Calinou Calinou changed the title Crash when system wakes up from sleep Editor freezes when system wakes up from sleep Sep 16, 2021
@hmans
Copy link
Author

hmans commented Sep 16, 2021

3.3.3 doesn't freeze, but seems to get confused about materials (the cube that I've added to the scene is completely black.) Closing and re-opening the scene does not fix it, but restarting the editor obviously does.

image

@fwsGonzo
Copy link

fwsGonzo commented Dec 3, 2021

I can confirm that this still happens on latest. I am on Linux Mint with amd64 Linux 5.13.

The issue says that the editor freezes, however for me it still works. It just fails to render new dialogues. Windows appear empty but are still interactive.
Other GPU applications do not necessarily have this problem, and it's not a driver issue. It's likely a windowing thing.

@Calinou
Copy link
Member

Calinou commented Dec 3, 2021

I can confirm that this still happens on latest. I am on Linux Mint with amd64 Linux 5.13.

Which Godot version do you refer by "latest"? The master branch uses an entirely different windowing system than 3.x (with multi-window support, unless single window mode is enforced in the Editor Settings).

Does the issue go away if you resize the window?

@DragonAxe
Copy link

DragonAxe commented Jan 26, 2022

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):

ERROR: Condition "err" is true. Returning: ERR_CANT_CREATE
   at: swap_buffers (drivers/vulkan/vulkan_context.cpp:1956)
ERROR: Vulkan: Did not create swapchain successfully.
   at: prepare_buffers (drivers/vulkan/vulkan_context.cpp:1880)

I also saw this error in one of my tests, but it may not be related.

ERROR: Condition "!material" is true.
   at: material_set_shader (servers/rendering/renderer_rd/renderer_storage_rd.cpp:1570)

Lspci shows:

01:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev a1)
        Subsystem: Lenovo ThinkPad T480
        Flags: bus master, fast devsel, latency 0, IRQ 159
        Memory at dc000000 (32-bit, non-prefetchable) [size=16M]
        Memory at 80000000 (64-bit, prefetchable) [size=256M]
        Memory at 90000000 (64-bit, prefetchable) [size=32M]
        I/O ports at d000 [size=128]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [250] Latency Tolerance Reporting
        Capabilities: [258] L1 PM Substates
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia

@alex9099
Copy link

Can reproduce with 4.0 alpha 6 on a laptop with linux 5.17.3-arch1-1, driver nvidia 510.60.02 with a nvidia geforce gtx 1060

This is a prime setup (nvidia is not the display gpu), not sure if that changes anything

@mdlsvensson
Copy link

mdlsvensson commented May 8, 2022

Happens to me as well. NVIDIA GeForce GT 1030/PCIe/SSE2. 5.10.109-1-MANJARO (linux510). On both alpha 6 and 3.4.4. Not a huge problem, just relaunch the editor when I come back from suspend.

@DragonAxe
Copy link

I am no longer experiencing the issue with Godot v4.0.alpha14.official [106b680].

@Calinou
Copy link
Member

Calinou commented Aug 18, 2022

Closing per @DragonAxe's comment. Please comment if you can still reproduce this on the latest 4.0 alpha and a recent graphics driver.

@Calinou Calinou closed this as completed Aug 18, 2022
@DragonAxe
Copy link

I may have spoke too soon. I am still experiencing this issue on v4.0.alpha15.official [432b25d]

@clayjohn clayjohn modified the milestones: 4.0, 4.x Feb 23, 2023
@hsandt
Copy link
Contributor

hsandt commented Feb 24, 2023

nvidia-suspend.service and others seemed already enabled on my Ubuntu 20.04 running Nvidia continuously (Performance Mode), and, in fact trying to enable it anyway will cause black screen.

So I just followed the 2nd instruction, setting /etc/modprobe.d/nvidia-power-management.conf to options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=$HOME/temp/nvidia

but it still froze Godot after sleep and re-awake.

Maybe reboot is needed... I'll try again later, or rather, I'll work normally until it happens again or it is fixed.

UPDATE 2023-03-26:
After rebooting, and later also upgrading to Ubuntu 22.04, still using Nvidia in Performance Mode, I have no issues on wake up anymore.

@aekobear
Copy link
Contributor

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

@Calinou
Copy link
Member

Calinou commented Mar 24, 2023

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.

@DeeJayLSP
Copy link
Contributor

DeeJayLSP commented May 8, 2023

This is likely valid for #55389 too (doesn't happen in my machine after doing the suspend workaround)

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.