Skip to content

Instantly share code, notes, and snippets.

@adelyser
Last active April 24, 2024 17:32
Show Gist options
  • Save adelyser/e814dd7737026765a3ab390ec21f78cc to your computer and use it in GitHub Desktop.
Save adelyser/e814dd7737026765a3ab390ec21f78cc to your computer and use it in GitHub Desktop.
BTT PAD7 Panfrost drivers

Enabling panfrost GPU acceleration on the Bigtreetech PAD7

REQUIREMENT: You must have compiled the Panfrost drivers into the kernel!

The Panfrost drivers for the PAD7 requires a newer version of the mesa binaries. You have 2 options:

  1. Bullseye You have to download the sources for mesa and glmark2 and build them locally. This will take awhile|
  2. Bookworm The alternative is to update to Bookworm (still compatible with the 5.16.17 kernel), and install the libraries using apt. This will also take awhile to update to Bookworm|

Bullseye

Update the system

sudo apt update
sudo apt upgrade

Install dependencies

sudo apt install build-essential meson git python3-mako libexpat1-dev bison flex libwayland-egl-backend-dev libxext-dev libxfixes-dev libxcb-glx0-dev libxcb-shm0-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev libxshmfence-dev libxxf86vm-dev libxrandr-dev pkg-config libdrm-dev libwayland-dev wayland-protocols libx11-xcb-dev libjpeg-dev libpng-dev libgbm-dev libudev-dev mesa-utils screenfetch

Install a desktop and wayland

  1. PLASMA KDE sudo apt install kde-plasma-desktop plasma-workspace-wayland sddm
  2. GNOME sudo apt install gnome

Reboot into desktop

reboot

Download mesa and build

git clone https://gitlab.freedesktop.org/mesa/mesa.git
mkdir mesa/build
cd mesa/build
git checkout 21.3
meson -Dgallium-drivers=panfrost -Dvulkan-drivers= -Dllvm=disabled --prefix=/opt/panfrost
sudo ninja -j3 install

Set the global environment to mesa

echo /opt/panfrost/lib/aarch64-linux-gnu | sudo tee /etc/ld.so.conf.d/0-panfrost.conf
sudo ldconfig

Build and install benchmarking tools

git clone https://github.com/glmark2/glmark2.git
mkdir glmark2/build
cd glmark2/build
meson setup -Dflavors=drm-gl,drm-glesv2,wayland-gl,wayland-glesv2,x11-gl,x11-glesv2
sudo ninja install

OR.....

Bookworm

Replace Bullseye with Bookworm in /etc/apt/sources.list:

biqu@BTT-CB1:~$ cat /etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main contrib non-free
#deb-src http://deb.debian.org/debian bookworm main contrib non-free

deb http://deb.debian.org/debian bookworm-updates main contrib non-free
#deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free

deb http://deb.debian.org/debian bookworm-backports main contrib non-free
#deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free

deb http://deb.debian.org/debian-security bookworm-security main contrib non-free
#deb-src http://deb.debian.org/debian-security bookworm-security main contrib non-free

Update the system

sudo apt update
sudo apt upgrade

Install a desktop

  1. PLASMA KDE sudo apt install kde-plasma-desktop plasma-workspace-wayland sddm
  2. GNOME sudo apt install gnome

Install benchmarking tools

sudo apt install mesa-utils glmark2-es2-wayland glmark2-wayland glmark2-x11 glmark2-es2-x11 glmark2-drm glmark2-es2-drm screenfetch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment