godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.04k stars 21.18k forks source link

Godot crashes along with Nvidia driver making system unstable on Nivdia Optimus Linux system #82161

Open MateusRodCosta opened 1 year ago

MateusRodCosta commented 1 year ago

Godot version

v4.1.1.stable.flathub [bd6af8e0e]

System information

Godot v4.1.1.stable (bd6af8e0e) - Freedesktop SDK 23.08 (Flatpak runtime) - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 Ti (nvidia) - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 Threads)

Issue description

Apparently currently running Godot 4.1.1 (Flatpak, host is Fedora Silverblue 39 Beta) on my system always ends up with eventually Godot stopping responding and the Nvidia card (driver is 535.104.05) crashing until I reboot.

I do not know if it's a bug in the Nvidia driver or in Godot, so I'm filling an issue here.

set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: handle_crash: Program crashed with signal 11
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: Engine version: Godot Engine v4.1.1.stable.flathub (bd6af8e0ea69167dd0627f3bd54f9105bda0f8b5)
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: Dumping the backtrace. Please include this when reporting the bug to the project developer.
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: ERROR: FATAL: Index p_index = 1 is out of bounds (size() = 0).
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]:    at: get (./core/templates/cowdata.h:155)
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: ================================================================
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: handle_crash: Program crashed with signal 4
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: Engine version: Godot Engine v4.1.1.stable.flathub (bd6af8e0ea69167dd0627f3bd54f9105bda0f8b5)
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: Dumping the backtrace. Please include this when reporting the bug to the project developer.
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]: ERROR: FATAL: Index p_index = 1 is out of bounds (size() = 0).
set 22 20:43:57 centauro org.godotengine.Godot.desktop[16003]:    at: get (./core/templates/cowdata.h:155)

This Godot crash apparently can bork both the iGPU and the dGPU:

set 22 20:43:46 centauro kernel: NVRM: GPU at PCI:0000:01:00: GPU-60a9bb49-90ee-5995-7b62-7b249c46239d
set 22 20:43:46 centauro kernel: NVRM: Xid (PCI:0000:01:00): 79, pid='<unknown>', name=<unknown>, GPU has fallen off the bus.
set 22 20:43:46 centauro kernel: NVRM: GPU 0000:01:00.0: GPU has fallen off the bus.
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57d:0:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:0:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:1:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:2:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:3:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:4:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:5:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:6:0:0x0000000f
set 22 20:43:57 centauro kernel: nvidia-modeset: ERROR: GPU:0: Failed to query display engine channel state: 0x0000c57e:7:0:0x0000000f
set 22 20:44:05 centauro kernel: nvidia-modeset: ERROR: GPU:0: Error while waiting for GPU progress: 0x0000c57d:0 2:0:4048:4040
set 22 20:44:13 centauro kernel: i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe A (start=53185 end=53186) time 232 us, min 1073, max 1079, scanline start 1066, end 1081
set 22 20:44:15 centauro kernel: nvidia-modeset: ERROR: GPU:0: Error while waiting for GPU progress: 0x0000c57d:0 2:0:4048:4040

Steps to reproduce

Basically, opening my current project (It's a Godot 3.5 project I converted to Godot 4.x) and trying to do stuff for a while (for example, I have been working on improving the graphics on that project).

After a while Godot freezes and, when it is killed, the Nvidia card is borked.

Minimal reproduction project

N/A

s0ra commented 1 year ago

I'm using Godot 4.1.1 and NVIDIA GeForce GTX 1660 on Ubuntu 22.04.3 LTS with the proprietary driver. Also I'm using dual screen and x.org desktop. Occasionally the editor will freeze mostly during debugging and the screen will appear glitched from top left to bottom right. I had to logout and login back to recover the computer. This issue never happened to other applications.

Calinou commented 1 year ago

Can you test https://github.com/godotengine/godot/pull/80566 locally to see if it resolves the issue?

Also, can you reproduce this using all rendering methods, or only Forward+/Mobile?

MateusRodCosta commented 11 months ago

I actually have been using v4.1.3.stable.flathub [f06b6836a] for a tutorial recently and I had no issue with crashes.

One thing to note was that the project was set to Compatibility renderer, so I have yet to test if the issue is specific to the Forward+ renderer.