# Headless RPi 4 RendererGlLinux initialization failed

**URL:** <https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878>\
**Category:** Using Cinder\
**Created:** [October 27, 2021, 8:41am UTC](https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878 "2021-10-27T08:41:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![willem](https://avatars.discourse-cdn.com/v4/letter/w/898d66/32.png) [@willem](https://discourse.libcinder.org/u/willem)\
**Post date:** [October 27, 2021, 8:41am UTC](https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878/1 "2021-10-27T08:41:08Z")

</div>

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`:

```auto
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)](https://discourse.libcinder.org/t/trying-to-build-the-basicapp-sample-on-raspberry-pi-4-rpi-os-linux/1840)

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

```auto
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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Svintaj](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Svintaj](https://discourse.libcinder.org/u/Svintaj)\
**Post date:** [October 27, 2021, 10:02am UTC](https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878/2 "2021-10-27T10:02:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![willem](https://avatars.discourse-cdn.com/v4/letter/w/898d66/32.png) [@willem](https://discourse.libcinder.org/u/willem)\
**Post date:** [October 27, 2021, 11:02am UTC](https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878/3 "2021-10-27T11:02:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![petros](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/petros/32/26_2.png) [@petros](https://discourse.libcinder.org/u/petros)\
**Post date:** [November 2, 2021, 9:08am UTC](https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878/4 "2021-11-02T09:08:02Z")

</div>

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](https://github.com/cinder/Cinder/pull/1997) .

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

---

<div class="post-metadata">

**Author:** ![willem](https://avatars.discourse-cdn.com/v4/letter/w/898d66/32.png) [@willem](https://discourse.libcinder.org/u/willem)\
**Post date:** [November 2, 2021, 10:13am UTC](https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878/5 "2021-11-02T10:13:53Z")

</div>

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