Help with mesa lima compilation. RetroArch freezing screen when loading a saved state

I wanted to recompile my version of RetroArch because I use it as the main menu, kind of Lakka for clockworkpi (showing battery info, wifi, power off option…). The advantage is that I don’t need to run Xorg, and I reduced boot time. Retroarch is the only thing that I use.

The problem is that compiling RetroArch in the OS v0.5 with lima I get a black screen, so I decided to compile my lima mesa driver because probably some dev libraries were missing in the v0.5.

I compiled the mesa drivers, and I got my custom retroarch working together with my mesa driver (v 20.0) compiled with:

meson build/ --optimization s --buildtype release --prefix=/usr --libdir=lib/arm-linux-gnueabihf -Dgallium-drivers=lima,panfrost,kmsro,swrast -Dplatforms=x11,drm,surfaceless -Dvulkan-drivers= -Ddri-drivers= -Dllvm=false

like described here:

Everything works fine except when I try to load a save state . My screen start to flicker and frezzes. I get this message if I run dmesg:

[  176.939174] lima 1c40000.gpu: gp error irq state=400000 status=b 

[ 176.945589] lima 1c40000.gpu: gp task error int_state=0 status=8a

Do you guys know what maybe I’m doing wrong when I compiled the mesa?

for retroarch compilation I used:

CFLAGS=-mfpu=neon ./configure --enable-udev --enable-floathard --enable-neon --disable-oss --disable-vulkan --disable-xmb --disable-ozone --disable-discord --disable-materialui --disable-qt --enable-pulse --disable-jack --disable-wayland --enable-opengles --enable-kms

I’m compiling retroarch v1.8.4, I tried a clean compilation (without my modifications) with the same results.

Thanks in advance

i was got the same trouble with mainline retroarch, it seem have issue when combining two options,

try disable “Savestate Thumbnails” and/or “Menu Widget”

The problem is that compiling RetroArch in the OS v0.5 with lima I get a black screen

first delete/rename your conf file, it seem be incompatible

still black screen with rgui, using xmb will show you gray moving 3d lines in bg but no menu

i stopped here in my previous test, maybe lacks of fresh assets or need a full manual reconf

1 Like


“save thumbnails” was disabled, but the menu widget was enabled. I disabled and now works fine.

I noticed that maybe it had to do when Retroarch tries to write the notification on the screen but didn’t’ know how to disable that.

Thank you!

settings > onscreen display > on screen notification > on screen notification > off


Just for testing, but does changing the video driver from gl to sdl2 have any differences? I recall animated Xbox style pop ups happen with gl drivers, and with anything else, it’s just a low res text prompt.

I tried to switch to SDL2 but probably I have to compile SDL2 libraries as well because my retroarch doesn’t load. I’m also not using X11; I don’t remember if in the actual stage of lima SDL2 can use KMS with lima.

From what I remember only gl driver shows the fancier notification style as you said. To be honest I prefer the old-style yellow text. It is much more responsive and even with a more powerful device I always notice a very short freeze on retroarch, maybe it is something that they need to optimize in future versions.

For our small screen (and diamond pixels :frowning:) the yellow text is readable whereas the notification widget is most of the time impossible to read unless you make the fonts very big, and possibly doesn’t fit on the screen.

I will try to recompile everything later SDL2+retroarch and see

1 Like

Would you be open to write a small “Tutorial” on how to setup the GS the way you do ?
I believe that running only Retroarch in Lakka style would be interesting for some of us…

I’ll try to make one if this could help someone.

I have working for now:

  • battery meter with charging info
  • power off/ reboot options
  • Screen brightness adjustment

Working on:

  • wifi option to connect/scan networks



I tried to compile SDL2 v. 2.0.10 to have opengles and KMS support but I got errors:

In file included from include/SDL_opengles.h:33:0,
             from /home/cpi/src/SDL2-2.0.10/src/video/SDL_video.c:41:
/usr/include/GLES/gl.h:63:25: error: conflicting types for 'GLsizeiptr'
 typedef khronos_ssize_t GLsizeiptr;
In file included from include/SDL_opengl.h:2105:0,
             from /home/cpi/src/SDL2-2.0.10/src/video/SDL_video.c:37:
include/SDL_opengl_glext.h:472:19: note: previous declaration of 'GLsizeiptr' was here
 typedef ptrdiff_t GLsizeiptr;
In file included from include/SDL_opengles.h:33:0,
             from /home/cpi/src/SDL2-2.0.10/src/video/SDL_video.c:41:
/usr/include/GLES/gl.h:64:26: error: conflicting types for 'GLintptr'
 typedef khronos_intptr_t GLintptr;
In file included from include/SDL_opengl.h:2105:0,
             from /home/cpi/src/SDL2-2.0.10/src/video/SDL_video.c:37:
include/SDL_opengl_glext.h:473:19: note: previous declaration of 'GLintptr' was here
 typedef ptrdiff_t GLintptr;

Makefile:551: recipe for target ‘build/SDL_video.lo’ failed

I used the following options:

./configure --disable-esd --disable-video-x11 --disable-video-wayland --enable-video-kmsdrm --disable-video-vulkan

Do you have a suggestion to compile SDL2 with our Lima driver? A quick search on google and looks like this could be because of recent changes after MESA 18, but not sure. I’ll try to see what I can do to fix it. Maybe disabling/enabling some options.

1 Like

I got SDL2 working with KMS, probably the previously libraries were compiled without the option --enable-video-kmsdrm and works only inside x11. Not sure, never tested.

I needed to change the file:

commenting the lines 63, 64 for the compilation time only

//typedef khronos_ssize_t GLsizeiptr;
//typedef khronos_intptr_t GLintptr;

after that, and installing the compiled libraries, I recompiled retroarch to make sure that it used the recently compiled libraries, I also used --disable-x11 for retroarch options, otherwise, it would try to compile SDL2 driver with x11 support that is unavailable since I disabled.

I confirm that for the actual retroarch version (1.8.4) the option “menu widget” doesn’t make any difference when using SDL2, and I got the yellow text notification. No trouble loading, saving states here as well.

I also didn’t notice any improvement in performance for what I tried. I could try another games to check.

1 Like