ARM Mali GPU
Upstream software, aka Lima/Panfrost
Kernel modules
Kernel modules are included from kernel 5.2+. But, you will need kernel 5.10+ for Bifrost: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=72ef7fe96fd20d3d0e538e165b393819f99870ad
- Lima supports Utgard Mali GPU: Mali-400 / Mali-450 GPU
- Panfrost supports Bifrost, Midgard and Valhalla Mali GPU: Mali-Gxx GPU and Mali-T6xx / Mali-T7xx / Mali-T8xx GPU
User-space
For user-space, you need Mesa 19.2+ (19.1.x is not very stable nor usable for lima/panfrost) and kernel 5.2+. The package to install is Mesa-gallium.
You can install some test binaries to try it, such as kmscube, glmark2, Mesa-demo or Mesa-demo-x.
Mesa/Lima
Mesa/Lima supports Arm Mali Utgard 400/450 embedded GPUs.
For LIMA, you may need to tweak the xorg configuration by creating /etc/X11/xorg.conf.d/20-lima.conf file: (Source: https://gitlab.freedesktop.org/lima/web/-/blob/519a5b26596cfe46c3e4dc80d802780b2b3c61b1/README.md#xorgconf)
Section "ServerFlags" Option "AutoAddGPU" "off" Option "Debug" "dmabuf_capable" EndSection Section "OutputClass" Identifier "Lima" MatchDriver "<display DRM driver>" Driver "modesetting" Option "PrimaryGPU" "true" EndSection
Where you replace <display DRM driver> with the right DRM driver name, depending on your SoC:
- Allwinner: sun4i-drm
- Amlogic: meson
- Ericsson MCDE: mcde
- Exynos: exynos
- Rockchip: rockchip
- Tinydrm: tinydrm
Mesa/Panfrost
Mesa/Panfrost supports Arm Mali Midgard, Bifrost and Valhalla GPUs.
GPU | Found in SoC | Mesa version | Notes |
---|---|---|---|
T600 | Exynos 5250 | 24.1+ | |
T620 | Exynos 5420/5422/5430/5800 | 22.3+ | |
T720 | Exynos 7580, MT6735, and MT6753 | 20.0+ | |
T760 | RK3288 | 19.3+ | |
T820 | S912 | 19.3+ | |
T830 | Kirin 65x | 22.0+ | |
T860 | RK3399 | 19.3+ | |
T880 | Kirin 95x and MediaTek Helio X20/X27 | 22.0+ | |
G31 | Amlogic S905, RK3326 and Allwinner H616 SoC | 20.3 | kernel 5.10+ |
G51 | Kirin 710 | 22.0 | |
G52 | Amlogic S922, RK3530, Kirin 810 and Helio P65/G70/G80/G85 | 20.3 | kernel 5.10+ |
G52r1 | RK3566 and RK3568 | 21.2 | |
G57 | MediaTek MT8192 | 22.2+ | kernel 5.20+ |
G71 | Exynos 8895 | 22.0 | |
G72 | Exynos 7 9610, Exynos 9 9810, Helio P60/P70 and Kirin 970 | 20.3 | kernel 5.10+ |
G76 | Helio G90T/G95 | 22.0 | |
G310 | RK3688 | 24.1+ | kernel 6.10+ |
G610 | RK3588 | 24.1+ | kernel 6.10+ |
If you try to run it on an unsupported Mali version, you will get panfrost: Unsupported model %X error message. (See pan_props.c#L49).
Downstream software
Kernel modules
Installation
Mali kernel packages are available in devel:ARM:Factory:Contrib:Mali:
- mali-bifrost-kmp: Mali-Gxx GPU kernel modules
- mali-midgard-kmp: Mali-T6xx / Mali-T7xx / Mali-T8xx GPU kernel modules. Please note that mali-bifrost-kmp should also work on those plaforms as the kernel driver sources are shared so far
- mali-utgard-kmp: Mali-400 / Mali-450 GPU kernel modules
You may need to update your device tree to enable it. You can check if mali node is already in your Device Tree with:
sudo dtc -I fs /proc/device-tree | grep mali
For details to add the mali node, see driver/product/kernel/Documentation/devicetree/bindings/* files in packages sources: devel:ARM:Factory:Contrib:Mali
Here is an example how to add the mali node for HiKey960: https://git.linaro.org/people/manivannan.sadhasivam/hikey.git/commit/?id=a20633b159f885bc8a62234831e9b7a0151a151b
Parameters
You can set power_policy with /sys/module/mali_kbase/drivers/platform:mali/e82c0000.mali/power_policy on:
- coarse_demand (default)
- always_on
Binary user-space
Installation
See https://developer.arm.com/products/software/mali-drivers/user-space to download and install binaries libraries which depends on your board.
Enable OpenCL
Once kernel driver and user-space libraries are installed, you can enable OpenCL support with:
echo "libmali.so" | sudo tee /etc/OpenCL/vendors/mali.icd
And check it is found with:
sudo clinfo