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 ?

2 Answers 2


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 (requires Pi 3B+ or older), 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.

You can look into mesa-demos too, but it's understandable that these are not 1:1 replacements for the hello_pi examples.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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