Supertuxkart on Raspberry Pi

Supertuxkart on Raspberry Pi

Postby deve » 17 Oct 2017, 23:22

I think that current git version should work on Raspberry Pi.

One thing that I'm not sure is if creating GLES context using EGL is enough to get hardware acceleration on RPi. It's probably true for vc4 driver, but I have no idea what about the proprietary one. Last time when I made something hardware-accelerated for RPi, I was using SDL2 configured with GLES+DirectFB. So I'm not sure if it will work with X11, or maybe DirectFB is needed.

And second thing is that I'm not sure if STK will automatically fallback to legacy device (OpenGL ES 2.0), or maybe it will try to use GLES 3.0. AFAIK the Raspberry Pi GPU is only GLES 2.0, but I remember that glxinfo was reporting GLES 3.0 for me... So if it will try to use GLES 3.0, then we need to add ForceLegacyDevice in graphical_restrictions.xml.

It would be nice if someone could test it, because currently I don't have access to any RPi device. And I can make some fixes before the 0.9.3 release. To enable GLES renderer in STK, you have to compile it with:

cmake .. -DUSE_GLES2=1
deve
 
Posts: 200
Joined: 23 Jan 2014, 13:45

Re: Supertuxkart on Raspberry Pi

Postby deve » 18 Oct 2017, 20:27

Ok, someone confirmed that it works on RPi. Only max texture size had to be set to lower value to make it working. And it gives ~30 fps for Cornfield Crossing in 1280x720 with Raspberry Pi 3, so it's not that bad :) Here is a video with Scotland track:
https://www.youtube.com/watch?v=fPd2G_q ... e=youtu.be

And old proprietary driver hasn't been tested, but I suppose that it won't work with X11 anyway.
deve
 
Posts: 200
Joined: 23 Jan 2014, 13:45

Re: Supertuxkart on Raspberry Pi

Postby yannos » 29 Dec 2017, 23:32

I’m trying to compile stk on a fresh Raspbian Stretch Lite install on a Pi3 but it fails apparently still expecting GLES3. Can you offer any pointers?

Firstly the cmake command I used needed to define a couple of locations for it not to fail. I used:
{l Code}: {l Select All Code}
cmake .. -DUSE_GLES2=1 -DEGL_INCLUDE_DIR=/opt/vc/include -DEGL_LIBRARY=/usr/lib/arm-linux-gnueabihf/libEGL.so.1

Which worked fine but make then fails as the gl_renders.hpp include GLES3/gl3.h despite the -DUSE_GLES2=1.

Anyone here got any ideas?

The full street output is here:

{l Code}: {l Select All Code}
In file included from /home/pi/supertuxkart/stk-code/src/graphics/abstract_renderer.hpp:21:0,
                 from /home/pi/supertuxkart/stk-code/src/graphics/irr_driver.hpp:36,
                 from /home/pi/supertuxkart/stk-code/src/addons/zip.cpp:22:
/home/pi/supertuxkart/stk-code/src/graphics/gl_headers.hpp:47:27: fatal error: GLES3/gl3.h: No such file or directory
 #    include <GLES3/gl3.h>
                           ^
compilation terminated.
make[2]: *** [CMakeFiles/supertuxkart.dir/src/addons/zip.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/pi/supertuxkart/stk-code/src/graphics/abstract_renderer.hpp:21:0,
                 from /home/pi/supertuxkart/stk-code/src/graphics/irr_driver.hpp:36,
                 from /home/pi/supertuxkart/stk-code/src/guiengine/widgets/model_view_widget.hpp:25,
                 from /home/pi/supertuxkart/stk-code/src/guiengine/widgets.hpp:29,
                 from /home/pi/supertuxkart/stk-code/src/states_screens/dialogs/addons_loading.hpp:24,
                 from /home/pi/supertuxkart/stk-code/src/states_screens/addons_screen.hpp:24,
                 from /home/pi/supertuxkart/stk-code/src/addons/news_manager.cpp:24:
/home/pi/supertuxkart/stk-code/src/graphics/gl_headers.hpp:47:27: fatal error: GLES3/gl3.h: No such file or directory
 #    include <GLES3/gl3.h>
                           ^
compilation terminated.
make[2]: *** [CMakeFiles/supertuxkart.dir/src/addons/news_manager.cpp.o] Error 1
make[1]: *** [CMakeFiles/supertuxkart.dir/all] Error 2
make: *** [all] Error 2
yannos
 
Posts: 1
Joined: 29 Dec 2017, 23:16

Re: Supertuxkart on Raspberry Pi

Postby QwertyChouskie » 12 Jan 2018, 18:30

yannos- Try switching to the VC4 drivers (they are better anyways) in raspi-config.
User avatar
QwertyChouskie
 
Posts: 130
Joined: 29 Jun 2016, 14:57

Re: Supertuxkart on Raspberry Pi

Postby deve » 13 Jan 2018, 23:28

Indeed the "USE_GLES2=1" uses gl3 headers. It detects in runtime if GLES 3.0 is available. If not, then fallback with GLES 2.0 is used.

There is a branch that I use for my phone. It's patched STK 0.9.3, that uses only GLES 2.0.
https://github.com/deveee/stk-code/tree/android-4.2

But anyway it should be possible to install mesa headers and gl3.h will be available.

And as I said at the beginning, I suppose that it won't work if you don't use VC4 drivers.
deve
 
Posts: 200
Joined: 23 Jan 2014, 13:45

Who is online

Users browsing this forum: Arthur and 1 guest