Godot: can't run godot with nvidia optimus on linux

Created on 11 Mar 2019  路  3Comments  路  Source: godotengine/godot

Godot version:
3.1 RC2

...

OS/device including version:
$neofetch --backend off
ki@rapier
OS: Manjaro Linux x86_64
Host: X456UQ 1.0
Kernel: 4.19.24-1-MANJARO
Shell: zsh 5.7.1
Resolution: 1920x1080, 1366x768
DE: GNOME 3.30.2
WM: GNOME Shell
CPU: Intel i5-6200U (4) @ 2.800GHz
GPU: NVIDIA GeForce 940MX
GPU: Intel Skylake GT2 [HD Graphics 520]
Memory: 3405MiB / 7872MiB

GPU Driver = nonfree/nvidia
Optimus using bumblebee

...

Issue description:

I'm in optimus laptop. Godot can run well on normal mode (with intelHD) but not in GPU mode. These are the error:

  1. With primusrun

it just won't start

~/Applications >>> primusrun ./Godot_v3.1-rc2_x11.64                           
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":8"
      after 7 requests (7 known processed) with 0 events remaining.
XIO:  fatal IO error 2 (No such file or directory) on X server ":8"
      after 7 requests (7 known processed) with 0 events remaining.
  1. With optirun

I can run until the project list but when I opened a project, Godot closes itself.

~/Applications >>> optirun ./Godot_v3.1-rc2_x11.64                        [130]
OpenGL ES 3.0 Renderer: GeForce 940MX/PCIe/SSE2
Scanning projects at: /home/ki/Projects/Godot
Found 13 projects.
Editing project: /home/ki/Projects/_Structured/MMORPG/source2 (::home::ki::Projects::_Structured::MMORPG::source2)
OpenGL ES 3.0 Renderer: GeForce 940MX/PCIe/SSE2
~/Applications >>> XIO:  fatal IO error 2 (No such file or directory) on X server ":8"
      after 59 requests (59 known processed) with 0 events remaining.

...

I can run glxgears just fine with both of them (primusrun and optirun) and can play pc game run through wine with primusrun.

Here is when it works using integrated GPU

~/Applications >>> ./Godot_v3.1-rc2_x11.64                                [130]
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) 
Scanning projects at: /home/ki/Projects/Godot
Found 13 projects.
Editing project: /home/hitman/Source/Games/godot-demo-projects/3d/navmesh (::home::hitman::Source::Games::godot-demo-projects::3d::navmesh)
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)
bug linuxbsd porting

Most helpful comment

Thanks. The crash when opening a project is because it spawns a new process and doesn't pass the command line arguments. You can work it around with optirun ./Godot_v3.1-rc2_x11.64 -e --path path/to/project to open it directly.

Setting DRI_PRIME=0 in the environment should also work it around.

All 3 comments

Can you try running with these options?

  • ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES3
  • ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES2

1. ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES3

integrated gpu

works fine

~/Applications >>> ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES3
XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
Only one GPU found, using default.
Failed loading custom cursor: size_bdiag
Failed loading custom cursor: size_fdiag
Using GLES3 video driver
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) 
PulseAudio: detected 2 channels
PulseAudio: audio buffer frames: 512 calculated latency: 11ms
CORE API HASH: 4041032142084178815
EDITOR API HASH: 3460433989868662541
Loading resource: /home/ki/.config/godot/editor_settings-3.tres
EditorSettings: Load OK!
EditorSettings: Save OK!
Scanning projects at: /home/ki/Projects/Godot
Found 14 projects.
EditorSettings: Save OK!
EditorSettings: Save OK!
Loaded builtin certs
Editing project: /home/hitman/Source/Games/godot-demo-projects/3d/navmesh (::home::hitman::Source::Games::godot-demo-projects::3d::navmesh)
EditorSettings: Save OK!
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)

primusrun

does not start

~/Applications >>> primusrun ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES3
XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":8"
      after 7 requests (7 known processed) with 0 events remaining.
Found renderers:
Renderer 0: GeForce 940MX/PCIe/SSE2 with priority: 30
Renderer 1: Unknown with priority: 8
Using renderer: GeForce 940MX/PCIe/SSE2
XIO:  fatal IO error 2 (No such file or directory) on X server ":8"
      after 7 requests (7 known processed) with 0 events remaining.

optirun

crash when opening a project

~/Applications >>> optirun ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES3                      [1]
XInput: Refreshing devices.
XInput: No touch devices found.
Custom libGL override detected. Skipping GPU detection
Custom libGL override detected. Skipping GPU detection
Custom libGL override detected. Skipping GPU detection
Custom libGL override detected. Skipping GPU detection
Failed loading custom cursor: size_bdiag
Failed loading custom cursor: size_fdiag
Using GLES3 video driver
OpenGL ES 3.0 Renderer: GeForce 940MX/PCIe/SSE2
PulseAudio: detected 2 channels
PulseAudio: audio buffer frames: 512 calculated latency: 11ms
CORE API HASH: 4041032142084178815
EDITOR API HASH: 3460433989868662541
Loading resource: /home/ki/.config/godot/editor_settings-3.tres
EditorSettings: Load OK!
EditorSettings: Save OK!
Scanning projects at: /home/ki/Projects/Godot
Found 14 projects.
EditorSettings: Save OK!
EditorSettings: Save OK!
Loaded builtin certs
Editing project: /home/hitman/Source/Games/godot-demo-projects/3d/navmesh (::home::hitman::Source::Games::godot-demo-projects::3d::navmesh)
EditorSettings: Save OK!
OpenGL ES 3.0 Renderer: GeForce 940MX/PCIe/SSE2
~/Applications >>> XIO:  fatal IO error 2 (No such file or directory) on X server ":8"                    
      after 59 requests (59 known processed) with 0 events remaining.

2. ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES2

integrated gpu

works fine

~/Applications >>> ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES2      
XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
Only one GPU found, using default.
Failed loading custom cursor: size_bdiag
Failed loading custom cursor: size_fdiag
Using GLES2 video driver
OpenGL ES 2.0 Renderer: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) 
PulseAudio: detected 2 channels
PulseAudio: audio buffer frames: 512 calculated latency: 11ms
CORE API HASH: 4041032142084178815
EDITOR API HASH: 3460433989868662541
Loading resource: /home/ki/.config/godot/editor_settings-3.tres
EditorSettings: Load OK!
EditorSettings: Save OK!
Scanning projects at: /home/ki/Projects/Godot
Found 14 projects.
EditorSettings: Save OK!
EditorSettings: Save OK!
Loaded builtin certs
Editing project: /home/hitman/Source/Games/godot-demo-projects/3d/navmesh (::home::hitman::Source::Games::godot-demo-projects::3d::navmesh)
EditorSettings: Save OK!
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) 
~/Applications >>> WARNING: cleanup: ObjectDB Instances still exist!           
   At: core/object.cpp:2092.
ERROR: cleanup: There are still MemoryPool allocs in use at exit!
   At: core/pool_vector.cpp:70.

primusrun

does not start

primusrun ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES2
XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":8"
      after 7 requests (7 known processed) with 0 events remaining.
Found renderers:
Renderer 0: GeForce 940MX/PCIe/SSE2 with priority: 30
Renderer 1: Unknown with priority: 8
Using renderer: GeForce 940MX/PCIe/SSE2
XIO:  fatal IO error 2 (No such file or directory) on X server ":8"
      after 7 requests (7 known processed) with 0 events remaining.

optirun

crash when opening a project

optirun ./Godot_v3.1-rc2_x11.64 --verbose --video-driver GLES2
XInput: Refreshing devices.
XInput: No touch devices found.
Custom libGL override detected. Skipping GPU detection
Custom libGL override detected. Skipping GPU detection
Custom libGL override detected. Skipping GPU detection
Custom libGL override detected. Skipping GPU detection
Failed loading custom cursor: size_bdiag
Failed loading custom cursor: size_fdiag
Using GLES2 video driver
OpenGL ES 2.0 Renderer: GeForce 940MX/PCIe/SSE2
PulseAudio: detected 2 channels
PulseAudio: audio buffer frames: 512 calculated latency: 11ms
CORE API HASH: 4041032142084178815
EDITOR API HASH: 3460433989868662541
Loading resource: /home/ki/.config/godot/editor_settings-3.tres
EditorSettings: Load OK!
EditorSettings: Save OK!
Scanning projects at: /home/ki/Projects/Godot
Found 14 projects.
EditorSettings: Save OK!
EditorSettings: Save OK!
Loaded builtin certs
Editing project: /home/hitman/Source/Games/godot-demo-projects/3d/navmesh (::home::hitman::Source::Games::godot-demo-projects::3d::navmesh)
EditorSettings: Save OK!
OpenGL ES 3.0 Renderer: GeForce 940MX/PCIe/SSE2
XIO:  fatal IO error 2 (No such file or directory) on X server ":8"             
      after 59 requests (59 known processed) with 0 events remaining.

Thanks. The crash when opening a project is because it spawns a new process and doesn't pass the command line arguments. You can work it around with optirun ./Godot_v3.1-rc2_x11.64 -e --path path/to/project to open it directly.

Setting DRI_PRIME=0 in the environment should also work it around.

Was this page helpful?
0 / 5 - 0 ratings