cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.27k stars 939 forks source link

Raspberry Pi 4 "Failed to choose appropriate EGL config!" #2258

Closed willemkempers closed 2 years ago

willemkempers commented 2 years ago

Whenever I try to build a headless app on my Raspberry Pi 4 I receive the same error:

pi@raspberrypi:~/Cinder/test/Linux/HeadlessTestApp/proj/cmake/build $ ./Debug/HeadlessTest/HeadlessTest
|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
|error  | virtual bool cinder::app::RendererGlLinux::initialize(ci::ivec2, cinder::app::RendererRef)[154] Failed to choose appropriate EGL config!
terminate called after throwing an instance of 'cinder::app::ExcRendererAllocation'
  what():  RendererGlLinux initialization failed.
Aborted

This is on a fresh install of Raspberry Pi OS (regular, not lite):

pi@raspberrypi:~/Cinder/test/Linux/HeadlessTestApp/proj/cmake/build $ uname -a
Linux raspberrypi 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux

I tried building both samples/BasicApp and /test/Linux/HeadlessTestApp.

I build both Cinder and the apps using the following CMake flags:

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

I've made a forum post about this issue as well, it's here: https://discourse.libcinder.org/t/headless-rpi-4-renderergllinux-initialization-failed/1878

willemkempers commented 2 years ago

Petros answered this on the forum. Hardware accelerated off-screen rendering requires NVidia drivers so the only way to get this working on a Pi would be to use osmesa. See PR notes: https://github.com/cinder/Cinder/pull/1997