Sorry to hear it took you so long to find Armbian. You'll find an entirely different culture here than what you might be used to. Armbian is centered around working software, not marketing hype. While you still might be struggling with HW/SW bought 2 years ago as the seller's website is a sadly abandoned construction site ( with the notable exception of the excellent OpenElec ) Armbian turns useless OPI bricks into well-performing little jewels with predictable behaviour. I'm strictly speaking as a user and my contribution to the project is some forum help, tutorials and documenting successfully solved use cases.
So why not download a current Armbian, spend some time in reading documentation and forum help ? You spent 2 years on '99% fully working stable' , why not invest some hours to experience a stable and tested solution ?
I wish to share my research on getting OpenGL to work on Mali GPU. I realize Armbian focuses on server images, but I suppose many people would be interested nevertheless. I have a Banana Pi Pro and an Orange Pi PC, which both have a compatible GPU. Perhaps it will work on other boards as well.
Here are the commands I used to get OpenGL to work.
1. Install:
# install GLX Gears, mesa GL and GLU libraries
apt-get -y install mesa-utils
# install development tools
apt-get -y install build-essential automake pkg-config libtool ca-certificates git cmake subversion
# install required libraries
apt-get install libx11-dev libxext-dev xutils-dev libdrm-dev x11proto-xf86dri-dev libxfixes-dev
# get source code
git clone https://github.com/robclark/libdri2
git clone https://github.com/linux-sunxi/libump
git clone https://github.com/linux-sunxi/sunxi-mali
git clone https://github.com/ssvb/xf86-video-fbturbo
git clone https://github.com/ptitSeb/glshim
# install mali driver
cd sunxi-mali
git submodule init
git submodule update
git pull
wget http://pastebin.com/raw.php?i=hHKVQfrh -O ./include/GLES2/gl2.h
wget http://pastebin.com/raw.php?i=ShQXc6jy -O ./include/GLES2/gl2ext.h
make config ABI=armhf VERSION=r3p0
mkdir /usr/lib/mali
echo "/usr/lib/mali" > /etc/ld.so.conf.d/1-mali.conf
make -C include install
make -C lib/mali prefix=/usr libdir='$(prefix)/lib/mali/' install
cd ..
2. Build
# Step 1: build and install helper libraries
cd libdri2
autoreconf -i
./configure --prefix=/usr
make
make install
cd ..
cd libump
autoreconf -i
./configure --prefix=/usr
make
make install
cd ..
# Step 2: build video driver
cd xf86-video-fbturbo
autoreconf -i
./configure --prefix=/usr
make
make install
cd ..
# Step 3: build GL wrapper
cd glshim
cmake .
make
cp lib/libGL.so.1 /usr/lib/ # replace the software GL library with the wrapper
cd ..
3. Configure your system
- configure your kernel to allocate memory for the GPU
- make sure mali and mali_drm kernel modules are loaded
- give your user permissions to access /dev/ump and /dev/mali
- configure Xorg to use fbturbo driver
4. Test:
# run a basic test
glxgears
# install and run a GL benchmark
apt-get -y install globs
/usr/lib/globs/benchmarks/GL_pointz/gl_pointz
# try to run a real game
apt-get -y install billard-gl
billard-gl
This all worked out for me rather nicely. The only issue I have encountered is a segfault that many GL programs get when they shut down. I'm currently debugging this issue, but it would be helpful to know others experience it as well, and perhaps get some advice from people experienced in GLX or SDL.
Edit: I know glxgears is not a real benchmark, but let me give you some numbers to make it clear what I'm talking about. Results are from Orange Pi PC clocked at 1296000 Hz (and are CPU-bound):
user@bananapi:~$ glxgears
LIBGL: Initialising glshim
libGL: built on Jun 12 2016 06:12:01
LIBGL: Current folder is:/home/user
libGL:loaded: libGLESv1_CM.so
libGL:loaded: libEGL.so
2074 frames in 5.0 seconds = 414.688 FPS
2071 frames in 5.0 seconds = 414.085 FPS
2070 frames in 5.0 seconds = 413.915 FPS
^C