godotengine / godot

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

LLVM crash in Mesa AMD drivers on Ubuntu 22.10 #74485

Open NikolaLozanovski opened 1 year ago

NikolaLozanovski commented 1 year ago

Godot version

4.0.stable.official.92bee43ad

System information

Ubuntu 22.10, Intel i5-8250u, AMD HAINAN (RADEON 530, LLVM 15.0.6, DRM 2.50, 6.1.4-060104-generic) (0x6665) / Mesa Intel® UHD Graphics 620 (KBL GT2)

Issue description

Crash when starting up the editor with fresh download of Godot from the website. Prior to starting 4.0 I have opened 3.5 through steam.

command: DRI_PRIME=1 ./Godot_v4.0-stable_linux.x86_64 --verbose

Godot Engine v4.0.stable.official.92bee43ad - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
XInput: Refreshing devices.
XInput: Absolute pointing device: xwayland-pointer:14
XInput: No touch devices found.
Text-to-Speech: Speech Dispatcher initialized.
Using "default" pen tablet driver...
OpenGL API 4.5 (Core Profile) Mesa 23.1.0-devel (git-af95361 2023-03-05 kinetic-oibaf-ppa) - Compatibility - Using Device: AMD - HAINAN (, LLVM 15.0.6, DRM 2.50, 6.1.4-060104-generic)
JoypadLinux: udev enabled and loaded successfully.
PulseAudio: context other
PulseAudio: context other
PulseAudio: context other
PulseAudio: context ready
PulseAudio: Detecting channels for device: alsa_output.pci-0000_00_1f.3.analog-stereo
PulseAudio: detected 2 output channels
PulseAudio: audio buffer frames: 512 calculated output latency: 11ms

TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
LLVM ERROR: Cannot select: 0x7f9f18384d38: v3i32 = bitcast 0x7f9f18384928
  0x7f9f18384928: v4f32 = BUILD_VECTOR 0x7f9f1837f090, 0x7f9f1837ef58, 0x7f9f1837ea78, undef:f32
    0x7f9f1837f090: f32 = SBUFFER_LOAD<(dereferenceable invariant load (s32))> 0x7f9f1834a880, Constant:i32<400>, TargetConstant:i32<0>
      0x7f9f1834a880: v4i32,ch = CopyFromReg 0x8a2eea8, Register:v4i32 %9
        0x7f9f1834a8e8: v4i32 = Register %9
      0x7f9f18384e08: i32 = Constant<400>
      0x7f9f18384cd0: i32 = TargetConstant<0>
    0x7f9f1837ef58: f32 = SBUFFER_LOAD<(dereferenceable invariant load (s32))> 0x7f9f1834a880, Constant:i32<404>, TargetConstant:i32<0>
      0x7f9f1834a880: v4i32,ch = CopyFromReg 0x8a2eea8, Register:v4i32 %9
        0x7f9f1834a8e8: v4i32 = Register %9
      0x7f9f1837eae0: i32 = Constant<404>
      0x7f9f18384cd0: i32 = TargetConstant<0>
    0x7f9f1837ea78: f32 = SBUFFER_LOAD<(dereferenceable invariant load (s32))> 0x7f9f1834a880, Constant:i32<408>, TargetConstant:i32<0>
      0x7f9f1834a880: v4i32,ch = CopyFromReg 0x8a2eea8, Register:v4i32 %9
        0x7f9f1834a8e8: v4i32 = Register %9
      0x7f9f18384858: i32 = Constant<408>
      0x7f9f18384cd0: i32 = TargetConstant<0>
    0x7f9f1837edb8: f32 = undef
In function: main
Aborted (core dumped)

Steps to reproduce

  1. Download Godot from https://godotengine.org/download/linux/
  2. Extract Godot_v4.0-stable_linux.x86_64.zip
  3. Open application through file manager or command line

Minimal reproduction project

N/A

akien-mga commented 1 year ago

Do you use the standard Mesa from Ubuntu 22.10, or do you have a different version from a PPA?

The error looks like LLVM is crashing in the Mesa drivers, this is likely out of our hands and something that should be reported to Ubuntu and/or Mesa.

For the record, Godot 4.0 works fine for me on Mageia 9 with Mesa 23.0.0 (as well as previous versions I had before 23.0.0 was released).

$ inxi -CSG
System:
  Host: cauldron Kernel: 6.2.2-desktop-2.mga9 arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.27.2 Distro: Mageia 9
CPU:
  Info: quad core model: Intel Core i7-8705G bits: 64 type: MT MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 3099 min/max: 800/4100 cores: 1: 3100 2: 3099 3: 3100
    4: 3100 5: 3100 6: 3100 7: 3100 8: 3100
Graphics:
  Device-1: Intel HD Graphics 630 driver: i915 v: kernel
  Device-2: AMD Polaris 22 XL [Radeon RX Vega M GL] driver: amdgpu v: kernel
  Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision FHD Camera
    type: USB driver: uvcvideo
  Display: x11 server: X.org v: 1.21.1.7 with: Xwayland v: 22.1.8 driver: X:
    loaded: intel,v4l dri: i965 gpu: i915 resolution: 1920x1080
  API: OpenGL v: 4.6 Mesa 23.0.0 renderer: Mesa Intel HD Graphics 630 (KBL
    GT2)
NikolaLozanovski commented 1 year ago

I am using oibaf's PPA, not the standard Mesa from Ubuntu 22.10.

NikolaLozanovski commented 1 year ago
inxi -CSG
System:
  Host: nikola-Inspiron-3576 Kernel: 6.1.4-060104-generic arch: x86_64
    bits: 64 Desktop: GNOME v: 43.1 Distro: Ubuntu 22.10 (Kinetic Kudu)
CPU:
  Info: quad core model: Intel Core i5-8250U bits: 64 type: MT MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 700 min/max: 400/3400 cores: 1: 700 2: 700 3: 700
    4: 700 5: 700 6: 700 7: 700 8: 700
Graphics:
  Device-1: Intel UHD Graphics 620 driver: i915 v: kernel
  Device-2: AMD Jet PRO [Radeon R5 M230 / R7 M260DX Radeon 520 Mobile]
    driver: radeon v: kernel
  Device-3: Realtek Integrated Webcam type: USB driver: uvcvideo
  Display: wayland server: X.Org v: 1.22.1.3 with: Xwayland v: 22.1.3
    compositor: gnome-shell driver: X: loaded: modesetting,radeon
    unloaded: fbdev,vesa gpu: i915 resolution: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2) v: 4.6 Mesa
    23.1.0-devel (git-af95361 2023-03-05 kinetic-oibaf-ppa)
akien-mga commented 1 year ago

Can you downgrade to Ubuntu's Mesa to see if this is the culprit?

If so, the bug should be reported at Mesa so they're aware that 23.1.0 is causing a crash: https://gitlab.freedesktop.org/mesa/mesa

To report a bug with a helpful stacktrace to the Mesa developers, you'll need to build Godot from source with scons target=editor dev_build=yes, to have no optimization and full debug symbols. Then you should get a good stacktrace through gdb (possibly after installing -dbg packages for Mesa, see the README in oibaf's PPA).

NikolaLozanovski commented 1 year ago

Thanks @akien-mga I have another machine that also have Ubuntu 22.10 installed but with stock Mesa and Nvidia gpu, with mesa 22.2.5 the editor started successfully on that machine. Most likely there has been some regression in 23.1 Mesa I hope.

akien-mga commented 1 year ago

The Nvidia GPU wouldn't use the Mesa Radv driver which is crashing here, so it doesn't help confirm if the problem comes from the 23.1.0-dev version from the PPA.

NikolaLozanovski commented 1 year ago

Indeed that's correct. I was able to start Godot with DRI_PRIME=0 (with Intel's integrated gpu).

akien-mga commented 1 year ago

To be clear, the crash is happening in your AMD GPU's drivers. So to know if the problem comes from Mesa 23.1.0-dev for this specific AMD HAINAN, we'd really need you to try to downgrade back to the official Ubuntu drivers.

It's good to know it works fine on Nvidia and on Intel, but that doesn't help confirm the bug with AMD.

NikolaLozanovski commented 1 year ago

Correct! I did the downgrade to 22.2.5, Godot was launching with that Mesa. I will be reporting a bug.