When called on a PI3, eglGetDisplay(EGM_DEFAULT_DISPLAY) stops the program (tried with some test programs like hello_triangle2) and displays this message:

* failed to add service - already in use ?

I tried to modify the memory allowed to the GPU (from 16 to 512 megs) but without any success.

It occurs in both console mode and X mode.

uname -a returns:

Linux raspberrypi 4.4.23-v7+ #913 SMP Tue Oct 4 14:16:19 BST 2016 armv71 GNU/Linux

A pretty fresh kernel.

The experimental video driver is installed too and works properly, glxgears runs at 60fps as expected.

EDIT: The video driver doesn't like OpenGL ES (glxgears only uses plain OGL) which seems to be the problem here.

Is there's a way to enable the video acceleration driver and run OpenGL ES programs yet or do we have to wait for the next version of Raspbian ?


The hello_* programs are built against Raspberry Pi's closed source driver's EGL platform ("dispmanx"). The open source driver doesn't implement that EGL platform, and instead implements EGL on X11, drm, or wayland.

For equivalent GLES2 demos that run on the open source driver, you could look into the mesa-demos package.


Update: With three lines of code, hello_triangle and other examples can be made to run with the Mesa EGL driver. See the answer to my "failed to add service" question.

To run these examples on the old proprietary driver, my original answer is below.

One workaround on Raspbian Stretch is to edit /boot/config.txt and comment out dtoverlay=vc4-kms-v3d. This will not only enable the hello_pi examples, but also Quake 3 and other applications known to encounter this issue.

While you could look into mesa-demos, it's understandable that those are not perfect replacements. Mesa has some support for VC4, but being a software renderer with compatibility as its main priority, it's not as fast as the legacy closed-source driver just yet.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.