Headless RPi 4 RendererGlLinux initialization failed

Hi all,

I’m trying to get BasicApp running on a headless Raspberry Pi 4. It doesn’t run a desktop environment as I don’t need it, this is the output of name -a:

Linux raspberrypi 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux

The first issue I ran into was something to do with path which I fixed using this post: Trying to build the BasicApp sample on Raspberry Pi 4 (rpi os / Linux)

After that, I’ve build both Cinder and BasicApp headless using this:

cmake .. -DCINDER_TARGET_GL=es3-rpi -DCINDER_HEADLESS_GL=egl

All of this works fine, and my build succeeds. However, when I try to run BasicApp I get the following error:

pi@raspberrypi:~/Cinder/samples/BasicApp/proj/cmake/build $ ./Debug/BasicApp/BasicApp
|info   | virtual bool cinder::app::RendererGlLinux::initialize(ci::ivec2, cinder::app::RendererRef)[61] Supported EGL extensions : EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11 EGL_MESA_platform_gbm EGL_MESA_platform_surfaceless EGL_EXT_platform_device
libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device.
|error  | virtual bool cinder::app::RendererGlLinux::initialize(ci::ivec2, cinder::app::RendererRef)[124] Failed to initialize EGL!
terminate called after throwing an instance of 'cinder::app::ExcRendererAllocation'
  what():  RendererGlLinux initialization failed.
Aborted

Anyone seen something similar or have any pointers?

I have never run Cinder on headless RPI4…

A wild guess: Have you tried to switch your GL Driver?:

raspi-config
SystemOptions->AdvanceOptions->GL Driver

I’ve not - didn’t know that was a thing. I’ll give it a go when I’m back!

Update: I did this, it installed a few dependencies (namely gldriver-test), I then selected the GL driver. After rebuilding BasicApp I still got the exact same error.

Hey,

the headless target is meant to be used either with the NVidia drivers through the EGL_EXT_platform_device extension for hardware accelerated offscreen rendering or through osmesa for pure offscreen software rendering on the CPU(s).

You can find more info on this in the PR notes .

In your case since you are on a headless RPi you could try the osmesa path and see what that gives. You would need to have a recent version of llvm and Mesa installed for trying this out.

HTH,
Petros

1 Like

Thanks for clarifying - I just assumed it would work on any graphics card! Should have had a closer look at the PR notes :slight_smile:
OK I might try osmesa in that case and see if I can notice a performance difference.