Skip to content

Instantly share code, notes, and snippets.

@tstellanova
Last active July 21, 2024 19:09
Show Gist options
  • Save tstellanova/6f7844379e358ee81b89cf6937ea8139 to your computer and use it in GitHub Desktop.
Save tstellanova/6f7844379e358ee81b89cf6937ea8139 to your computer and use it in GitHub Desktop.
Building panfrost natively on armv8 (rockpi4b / RK3399) on Debian "buster"
  • sudo apt install python3-pip
  • Install python3 packages:
pip3 install  setuptools mako
  • Install many, many packages not included with armbian "buster":
sudo apt-get install meson ninja-build
sudo apt-get install pkg-config zlib1g-dev libexpat-dev libdrm-dev libunwind-dev 
sudo apt-get install libwayland-dev wayland-protocols libwayland-egl-backend-dev
sudo apt-get install libx11-dev libxext-dev libxdamage-dev libxcb-glx0-dev libx11-xcb-dev libxcb-dri2-dev libxcb-dri2-0-dev libxcb-dri3-0-dev
  • Grab mesa sources
$ git clone https://gitlab.freedesktop.org/mesa/mesa -b master

Configure, build, and install mesa

cd mesa
mkdir build
meson build/ -Dgallium-drivers=lima,panfrost,kmsro,swrast -Dplatforms=x11,drm,surfaceless -Dvulkan-drivers= -Ddri-drivers= -Dllvm=false

ninja -C build/
sudo ninja -C build/ install
  • Test it out:
sudo apt install mesa-utils
glxinfo |grep render

(Use a framebuffer if necessary: sudo apt install xvfb

Then you can run eg:

Xvfb :1 -screen 1 1600x1200x16&
export DISPLAY=:1
@findyy99
Copy link

Hi, after install mesa and panfrost, why the GPU is still not work?

[    7.290383] panfrost ff9a0000.gpu: clock rate = 500000000
[    7.355452] panfrost ff9a0000.gpu: mali-t860 id 0x860 major 0x2 minor 0x0 status 0x0
[    7.355465] panfrost ff9a0000.gpu: features: 00000000,00000407, issues: 00000000,24040400
[    7.355470] panfrost ff9a0000.gpu: Features: L2:0x07120206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7
[    7.355476] panfrost ff9a0000.gpu: shader_present=0xf l2_present=0x1
[    7.398061] [drm] Initialized panfrost 1.2.0 20180908 for ff9a0000.gpu on minor 1

@defencedog
Copy link

defencedog commented Jul 21, 2024

Thanks @tstellanova .. this line git clone https://gitlab.freedesktop.org/mesa/mesa -b main not master ... secondly instead of cloning whole thing can I use a portion of git for instance for G52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment