[Tutorial] - Activate OpenGL driver for ubuntu mate 16.04

Warning : opengl driver is experimental, it can be unstable and have some bugs !

Update the system and kernel :

sudo apt update
sudo apt upgrade
sudo BRANCH=next rpi-update

then reboot.

Edit file /boot/config.txt and add this two lines :

dtoverlay=vc4-kms-v3d
gpu_mem=128

Disable the old driver, open a terminal then :

cd /usr/share/X11/xorg.conf.d/
sudo mv 99-fbturbo.conf 99-fbturbo.conf.bak

For people (like me) who have an old monitor with no 1920x1080 resolution, you have to set the resolution.
I think this step is not needed if you have a 1920x1080 monitor (someone can confirm that please ?)
Edit file /boot/cmdline.txt and add video=[w]x[h] !
Exemple for 1280x1024 :

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait quiet splash video=1280x1024

reboot and enjoy !

Edit : changed update to stable kernel because of black screen issue.

Aworan

5 Likes

This runs lovely on my pi 3, but now Plank isn’t showing icons or themes. Does anyone know how to fix this? Cheers, Caleb

The output of plank is as follows.
[email protected]:~$ plank
[WARN 12:33:36.708516] [Environment:161] XDG_SESSION_CLASS not set in this environment!
[WARN 12:33:41.822616] [SurfaceCache:196] Creating surface took WAY TOO LONG (255ms), enabled downscaling for this cache!
[WARN 12:33:41.890470] [SurfaceCache:196] Creating surface took WAY TOO LONG (46ms), enabled downscaling for this cache!
[WARN 12:33:41.954726] [SurfaceCache:196] Creating surface took WAY TOO LONG (32ms), enabled downscaling for this cache!
[WARN 12:33:42.015740] [SurfaceCache:196] Creating surface took WAY TOO LONG (43ms), enabled downscaling for this cache!
[WARN 12:33:42.078018] [SurfaceCache:196] Creating surface took WAY TOO LONG (42ms), enabled downscaling for this cache!
[WARN 12:33:42.140793] [SurfaceCache:196] Creating surface took WAY TOO LONG (45ms), enabled downscaling for this cache!
[WARN 12:33:42.209100] [SurfaceCache:196] Creating surface took WAY TOO LONG (30ms), enabled downscaling for this cache!
[WARN 12:33:42.266109] [SurfaceCache:196] Creating surface took WAY TOO LONG (34ms), enabled downscaling for this cache!
[WARN 12:33:52.159281] [SurfaceCache:196] Creating surface took WAY TOO LONG (62ms), enabled downscaling for this cache!

I don’t know, driver is experimental so there are some bugs :slight_smile:

But I had make some tests and a lot of things work !

I played to some games like Quake 3 without any bug !
Tuxracer works good to with some bugs somethimes (transparency).
I try mame standard emulation too and it work perfectly !
I play videos in standard mode (opengl output) with vlc, mpv and gnome player.
So you can resize go fullscreen and windowed mode with all this video players !
With the rpi3 even 720p work without any hardware acceleration decoding (not implemented in driver at this time).
With 1080p videos it skips 3.5fps when playing with mpv so maybe with some overcloaking it can be !
Vlc had a bug when you try to go forward or backward in the timeline, but it work good with mpv or gnome player.
WebGl on chromium work good too (with some bugs but it depends on the webgl demo), youtube works better than never and I can read 720p videos smoothly too on my rpi3.
I need to disable media api for that …

By the way, raspberry pi software using fullscreen old driver output don’t work anymore with the opengl driver activate, this is normal and not a bug. The framebuffer output video mode is not enable. So tools like omxplayer cannot work.

I do a lot of tests and the dirver is stable (no crash) but somes icons disapear sometimes or some little display bugs.

I thought it was advised not to upgrade on Raspberry? That the kernel wasn’t made for that, or something?

No you are wrong.
It is not recommanded to update distribution version (like 15.10 to 16.04) with dist-update.
But it is recommended to do the packages updates with upgrade !!!
Updating the kernel with rpi-update is not recommended while the kernel of raspbian version is not. Because other kernels are beta but for enabling the opengl driver it is recommaded to have the last one until the driver would be stable.

1 Like

Just want to say thank you for showing how to enable OpenGL acceleration. Now my RPi3 can be put to good use.

1 Like

A post was split to a new topic: HDMI sound not working

Hi,

I had a fully functioning OpenGL, however I did an apt-get upgrade and a rpi-update today. Now I’m just getting a black screen on boot.
I went into config.txt and disabled it there and I can now boot.

But if anybody has any clues as to how to fix it, I’d be very appreciative.

Thanks In Advance

sudo rpi-update

Is this command for a kernel update? Is it stable and safe to do, or shall it be used with caution?

They have must done some regression on the driver. I am in vacation for now, I will test when I am back, it happened before but they fix it. I found a workaround disabling some libs in ld.conf but I don’t remember exactly and I don’t have my pi.
You can go back to official kernel which work with :
sudo BRANCH=next rpi-update
Or
sudo branch=NEXT rpi-update
I don’t remember which is the good syntax :slight_smile:

Aworan

Yes it is command for updating kernel.
You will download beta kernel, but because the driver is still beta I think it is a good practice to have the last beta kernel until opengl driver will be stable !

This is still broken I believe, I followed the same steps on pi3 and after reboot black screen , ssh services are also down :frowning: I tried this more than once but no luck…

Can you please post what exactly you did, I am seeing a black screen after reboot with no ssh connectivity if I follow the above mentioned steps… Thanks a lot for your help and time…

Hey abhisek,

if you have a blank screen after running rpi-update from the steps above, first you need to pop out your SD into another laptop / computer to that you can open /boot/config.txt in an editor and comment the line; dtoverlay=vc4-kms-v3d to #dtoverlay=vc4-kms-v3d

Save the file and put the SD back in your PI and this should allow your PI to boot without HW acceleration.

When you have done that running the command ; sudo BRANCH=next rpi-update should take you back to 4.4.17-v7+ or you can choose from the git-hub page (https://github.com/raspberrypi/firmware/commits/master) whichever you would like to go back to with the command rpi-update followed by Hash file name for whichever bump you would like.

So for example for 4.4.17 rpi-update 2cf8fd5ba0b195e16627df6a5b45f47c0edc3a54

Once you have gone back to a kernel that has a working Opengl, you then need to go back into /boot/config.txt and uncomment again dtoverlay=vc4-kms-v3d

Rebooting now should hopefully allow you to have HW with Opengl. Hopefully it works for you.

Thanks a lot Damien this worked for me, thanks again for your prompt help :slight_smile: You owe me a treat :slight_smile:

Hi,
I’m having the same issue, but your workaround to get the PI to boot again did not work for me.
After I first noticed that the PI was not booting again, I mounted the SD card in my laptop and found that the boot folder was empty, but there was folder boot.bak with all the files in it. However the changes I made to config.txt and cmdline.txt were not in there. I tried copying all the files from the boot.bak folder into the boot folder, but the PI still would not boot. What can I do now?

One more thing , when I enable the OpenGL driver I see
OpenGL version supported by this platform (2.1 Mesa 11.2.0):

But without enabling OpenGL Driver I see
OpenGL version supported by this platform (3.3 (Core Profile) Mesa 11.2.0):

Any guess on timeline when we can see openGL3.3 with openGL Driver enabled…

Hey Entropy, i think what you are referring to is the boot folder on the PI_ROOT partition, this should be empty. (so i would delete the files you copied over)

But you should have another Partition showing on your SD card PI_BOOT this is where the changes to the config.txt file will show and what you need to locate and comment the dtoverlay=vc4-kms-v3d to #dtoverlay=vc4-kms-v3d so that you can boot to a working PI again without the HW acceleration.

Incidentally the boot.bak file you mention on the root partition essentially mirrors what you should see on the PI_BOOT partition.

Hope it helps.

A very long time, haha :slight_smile: Honestly i have no idea, atm i’m just happy the have got at least a working-ish driver option, the latest rpi-update giving a blank screen, even tho it is not good for use it may mean some work has been done, but tbh i’m happy with anything the contiubutors do that gives me a bit more functionality. I still find it incredible that you can get so much out of a little single board computer like the PI