Godot: Trouble running on RPI4

Created on 31 Jul 2019  路  12Comments  路  Source: godotengine/godot

Hi,

I am playing with Godot, and I was able to run Godot on a Ubuntu arm on Galaxy Tab4, it's slow but It's usable.

I receive recently the RPI4 and I was able to build Godot using the same command of the RPI3, but unfortunately when I try to run I receive this error :

   Condition 'ctxErrorOccurred || !p->glx_context is true. returned: ERR_UNCONFIGURED.

I am almost sure it's a small stuff but I cannot figure out why the RPI4 return this error.

If someone has some suggestion I will take it.

Thanks

discussion linuxbsd

Most helpful comment

It鈥檚 totally free, you just install the apk and then you use an image of Ubuntu provide by the website.

All 12 comments

Run godot with -v flag to get more information if it exists, and paste here all the terminal output. Like this godot.x11.tools.64 -v

hi @santouits, I forgot to mention I build godot with mono, and the error happen with this command :

 ./bin/godot.x11.opt.tools.32.llvm.mono --generate-mono-glue modules/mono/glue/ -v

XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  28
  Current serial number in output stream:  25
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  28
  Current serial number in output stream:  25
Only one GPU found, using default.
ERROR: initialize: Condition ' ctxErrorOccurred || !p->glx_context ' is true. returned: 
ERR_UNCONFIGURED
At: platform/x11/context_gl_x11.cpp:188.
ERROR: is_viable: Error initializing GLAD
At: drivers/gles3/rasterizer_gles3.cpp:142.

If I just run without the generate-mono-glue godot start:

./bin/godot.x11.opt.tools.32.llvm.mono -v

XInput: Refreshing devices.
XInput: No touch devices found.
Detecting GPUs, set DRI_PRIME in the environment to override GPU detection logic.
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  28
  Current serial number in output stream:  25
X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  28
  Current serial number in output stream:  25
Only one GPU found, using default.
ERROR: initialize: Condition ' ctxErrorOccurred || !p->glx_context ' is true. returned:             
ERR_UNCONFIGURED
   At: platform/x11/context_gl_x11.cpp:188.
Using GLES2 video driver
OpenGL ES 2.0 Renderer: V3D 4.2
Audio buffer frames: 512 calculated latency: 11ms
Mono: Initializing module...
Mono: Logfile is: /home/pi/.local/share/godot/mono/mono_logs/2019_07_31 12.45.14 (7660).txt
Mono: Runtime initialized
Mono: Loading assembly mscorlib...
Mono: Assembly mscorlib loaded from path: /usr/lib/mono/4.5/mscorlib.dll
Mono: Loading tools domain...
Mono: Loading assembly GodotSharpTools...
Mono: Assembly GodotSharpTools loaded from path:     
/home/pi/Desktop/godot/godot/bin/GodotSharp/Tools/GodotSharpTools.dll
Mono: Loading scripts domain...
Mono: Debugger wait timeout
Mono: Glue disabled, ignoring script assemblies.
Mono: INITIALIZED
WARNING: init: This binary is built with `mono_glue=no` and cannot be used for scripting
At: modules/mono/csharp_script.cpp:113.
CORE API HASH: 8218728203440207103
EDITOR API HASH: -9081789893281576196
Loading resource: /home/pi/.config/godot/editor_settings-3.tres
EditorSettings: Load OK!
EditorSettings: Save OK!
Loaded builtin certs

I follow the online docs for build with mono, Am i doing the process corrector ?

No it seems a video driver problem or something. Restart your pi and run glxinfo and paste it in a text file and drag it here to upload it, though someone would propably need a pi to debug it.

glxinfo.txt
Here the glxinfo.

It seems the driver supports OpenGL 2.1, but also supports OpenGL ES 3.0, but on linux we don't use the OpenGL ES contexts, only on mobiles. What I don't get is why when the second time you ran it without the mono flag it tried to use the OpenGL 2.1 context, but the first time that didn't happen. Restart your pi and run
DRI_PRIME=0 bin/godot.x11.opt.tools.32.llvm.mono -v --video-driver GLES2
, and paste here the contents.

With DRI_PRIME=0 godot will not run some code that checks your drivers and maybe messes them. With --video-driver GLES2 it will also not try to get an OpenGL 3 context but will try the OpenGL 2.1 first.

If it starts just run
DRI_PRIME=0 bin/godot.x11.opt.tools.32.llvm.mono -v --video-driver GLES2 --generate-mono-glue modules/mono/glue/

Hi @santouits,

I was able to start godot editor with your command, I download an example (Particle System), unfortunately when I try to run it give me the same kind of error regarding the video driver.

Here the two files:
monoglue.txt
launchtest.txt

You mention you support opengles3 for android, it could be interesting to add in scons a way to specify that to force the use fo opengles3 instead of opengl2.1

Yes that happens because when you start godot it starts the project manager. You start the project manager with the OpenGl 2.1 context because you asked for that in the command line, but when you select to edit or run a project from there it starts a new godot instance which again doesn't have those flags and messes your drivers somehow. I don't see a way to give those commands inside the project manager.

Whenever you run the project manager, or the editor, or run the game it starts a new godot instance and it needs to add those flags.

What you can do for now is to run the project manager to download the demos you want or create a new project and then close it. Then go to the folders of the demos or the one you created and open a terminal and run godot inside there using the absolute path of the godot binary like DRI_PRIME=0 /home/pi/......../godot/bin/godot.x11.opt.tools.32.llvm.mono -v --video-driver GLES2 -e. -e tells it you want to open the game in the editor. Without it it will run the game. Then inside the editor you go to Project/Project Settings/Rendering/quality/driver name and choose the gles2 option and if you run the game it should start.

If you do these, then everytime you want to open the game you will have to go to its folder and just run DRI_PRIME=0 /home/pi/...../godot...... -e and it should work. All the commands above may work without using DRI_PRIME=0 too, I'm not sure, it will just spit some errors maybe.

Now for the fix, no you don't need GLES3, anyway it would be deprecated after the vulkan port. If there would be some change there it would be to make scons to compile a build to use GLES2 instead of OpenGL 2.1.

The problem here is that godot wants to use the OpenGL 3 renderer though the raspberry doesn't support it and I guess from the logs if you try to open godot many times it will lock the drivers and will then use the OpenGL 2.1 renderer and it will start.

Some possible fixes could be:
Find out why the Godot thinks the pi supports OpenGL 3 renderer even if it doesn't have one and fails.
Add some code that detects it is a rasberry pi 4 and always choose the OpenGL 2.1 renderer.

Well, obviously the first option better, but we may have to wait for someone to get a rpi 4 in their hands. Or maybe it will be fixed when new drivers come.

@wolfviking0 can you point a guide on installing Ubuntu on GalaxyTab 4? I've been wondering this performance and considering get one depending on how 2D version of Godot runs in a tablet...

Hi @vini-guerrero, I just install an app call Linux on DeX : https://www.linuxondex.com

Here you have just to install a container with ubuntu and then you can almost do everything like a normal linux. I install just the minimum required to build Godot.

Is that like a monthly payed service or free app @wolfviking0? Thanks for the tip, I'll try that out...

It鈥檚 totally free, you just install the apk and then you use an image of Ubuntu provide by the website.

For some reasons, it seems that using clang (use_llvm=yes) fixes the OpenGL problem:

https://old.reddit.com/r/godot/comments/eag6qb/godot_312_compiled_for_the_raspberry_pi_4/

Was this page helpful?
0 / 5 - 0 ratings