Disable OpenGL, for failed to add service error - Printable Version

+- Forums (
+-- Forum: Main Forums (
+--- Forum: Help my code won't work?? (
+--- Thread: Disable OpenGL, for failed to add service error (/showthread.php?tid=69)

Disable OpenGL, for failed to add service error - Brian Beuken - 04-15-2018

A new thing I wasn't aware of, since my Raspberry Pi's don't have the experimental version of OpenGL activated.

If your pi is currently running with "full" OpenGL enabled, then the OpenGLES2.0 demos in the book and on the site will most likely fail to run, giving a failed to add service error.

The fix is simple, you need to have a totally fresh install of Raspbian before you start working on the book. (this is by far the best option)


You have to disable the OpenGL drivers. You can do this by opening a terminal and entering

sudo raspi-config

use your keyboard to select Advanced options, 
select GL Driver
and then use Legacy Original non-GL drivers

(if you have OpenGL drivers installed it will say disable GL drivers instead)

Once done you are back in OpenGLES2.0 mode, and all OpenGLES2.0 projects should now work fine.

There are work rounds to get OpenGL to work, but really I would avoid that, the projects are all designed on OpenGLES2.0 so best to use it.

Reading the Pi forums, there may be other causes for this error, but for Stretch, this seems the most likely.

RE: Disable OpenGL, for failed to add service error - Brian Beuken - 04-15-2018

better make this a sticky

RE: Disable OpenGL, for failed to add service error - Brian Beuken - 07-02-2019

DO NOT DO THIS on a Raspberry Pi 4
The pi4 needs to have its projects built as if they are standard linux builds, which means different dirs and mesa EGL/GLES2/3 Libs... it does however need to have the GL fake kms drivers in place, to be replaced by the mesa libs...

RE: Disable OpenGL, for failed to add service error - Brian Beuken - 11-07-2021

A reader has contacted me to let me know that the Triangle code now does not work at all on Rpi4 Buster.. I've checked and yes sadly this is true so we need a new Hello Triangle system.
Sadly the book is becoming quite outdated now as the Rpi3 is not being used so much. And I am not 100% sure what changes Buster OS makes to it. but I will burn Buster on to a Pi3b and check soon.

The Rpi4 is asserting itself as the dominant system, and rightly so, it is a far more powerful graphics system. But I'm not going to abandon you.. it will take a bit of effort but we can get things going again, but typing in the hello triangle code is now a bit pointless as the set up for Rpi4 is quite different and much of the triangle setup code is now redundant..

The changes are a little more than just entered content, you will need to install mesa graphic libs as well as libRandR to set up resolutions in X11,
these libs are installed by opening a terminal (while the RPi4 is connected to the internet) and entering

sudo apt-get install libgles2-mesa-dev -y
sudo apt-get install libxrandr-dev -y

You also need to make sure you have default or legacy GPU drivers, (in terminal enter sudo raspi-config then go to advanced then gl drivers)
And in preferences from the desktop don't set the GPU memory to more than 100M (I have mine at 76) The Pi4 automatically uses what memory it has, but the preferences reserve some memory for the Os which reduces the memory the GPU can play with. The Pi3 however does require you to allocate as much as you can.

Now your Rpi is ready to work as a fully featured X11 OpenGLES2/3 system. I'm working on a new hello triangle project for you to download now, it will be ready in a few hours.

RE: Disable OpenGL, for failed to add service error - jomoengineer - 11-09-2021


You may want to pull down the latest RasPI OS image considering it is based on Bullseye (Debian 11).

* Based on Debian version 11 (bullseye)

It may be interesting to see if there were any changes that affect the OpenGL stuff in this image as well.

RE: Disable OpenGL, for failed to add service error - Brian Beuken - 11-09-2021

yes I saw that today, I'll pull it later and try it out.

RE: Disable OpenGL, for failed to add service error - Brian Beuken - 11-09-2021

Just finished installing Bullseye and updating etc and running my test projects on it.. all good, nothing throwing up errors, or any significant issues with it so far, which is great Big Grin But the base triangle project does still need to be redone as the old jessie code P3b just wont work on a 4 now even with new libs.

Bullseye seems a little slow and raggedy to me, but it does however support mesa 20.3.5 which was exciting to see, as I know there are several updates to OpenGLES3.x and I was kinda hoping to see either the android extention pack or full 3.2 but sadly not, its still 3.1 however... when I ran the list of extensions I saw this
GL_EXT_geometry_shader GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size GL_OES_geometry_shader

Geometry shaders Big Grin no idea of they are crippled software versions or fast GPU versions but I'll take some time soon using my particle system to see how well they work.

Sadly AA is still a perfomance killer so no change there.

RE: Disable OpenGL, for failed to add service error - Brian Beuken - 11-10-2021

Actually Bullseye is really quite chuggy on a Pi42GB, not sure how it will be on a 4Gb, I'll have to install it on the P400 at some point. I've decided to overclock my 2G for now even though I was keeping it at base speed, the lag in the OS itself is too annoying.