Switch GPU driver
Products equipped with RK3588/RK356X/RK3576 (excluding RK3582) series SOCs use Panfrost/Panthor GPU driver by default when using Debian 12 (Bookworm) version of the system, you can follow the tutorials below to switch the GPU driver according to your needs.
This document applies only to products equipped with RK3588/RK356X/RK3576 (excluding RK3582) series SOCs.
Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | Vulkan |
---|---|---|---|---|---|
Mali | ❌ | ✔ | ✔ | ✔ | ✔ |
Panthor | ✔ | ✔ | ❌ | ❌ | ❌ |
- Mali
- Panfrost/Panthor
Using Rockchip's proprietary xorg-xserver version
- Add the
/etc/apt/preferences.d/mali
file with the contents:
Package: *xserver*
Pin: release a=rk3566-bookworm
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3566-bookworm-test
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3566t-bookworm
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3566t-bookworm-test
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3568-bookworm
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3568-bookworm-test
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3576-bookworm
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3576-bookworm-test
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3588-bookworm
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3588-bookworm-test
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3588s2-bookworm
Pin-Priority: 1001
Package: *xserver*
Pin: release a=rk3588s2-bookworm-test
Pin-Priority: 1001
-
Then refer to System Upgrade with
rsetup
to reinstall Rockchip proprietary package (failure to perform this step may result in desktop flashing or color flipping)
Installing the Mali User-Level Driver
sudo apt-get update
if grep -qE 'rk3588' <(rsetup get_product_ids)
then
sudo apt-get install libmali-valhall-g610-g24p0-x11-wayland-gbm # RK3588
fi
if grep -qE 'rk3576|rk3568|rk3566' <(rsetup get_product_ids)
then
sudo apt-get install libmali-bifrost-g52-g13p0-x11-wayland-gbm # RK356X/RK3576
fi
Enable Mali GPU Overlay
Enable Arm Mali GPU driverOverlay by referring to [Overlay Enablement Tutorial](./rsetup#overlays) to enable
Enable Arm Mali GPU driver` Overlay.
Modify Module Blacklist
编辑 /etc/modprobe.d/panfrost.conf
文件:
# settings for panfrost
# Uncomment the following line and comment above lines
# to use mali driver for GPU instead
# You will have to install desktop from vendor repo
blacklist panfrost
# Disable mali driver by default to prefer panfrost driver
#blacklist mali
#blacklist bifrost_kbase
#blacklist midgard_kbase
Turn off Zink support
echo "LIBGL_KOPPER_DISABLE=true" | sudo tee -a /etc/environment
Revert to using Debian's officially packaged version of mainline xorg-xserver
- Delete the relevant config files:
sudo rm /etc/apt/preferences.d/mali
sudo rm /etc/modprobe.d/panfrost.conf
-
Then refer to System Upgrade with
rsetup
to reinstall Rockchip proprietary package (failure to perform this step may result in desktop flashing or color flipping)
Uninstall the Mali user level driver and install the upstream Mesa driver
sudo apt-get update
sudo apt-get remove libmali-*
sudo apt-get install mesa-utils mesa-utils-extra libglx-mesa0 libgl1-mesa-dri
Disable Mali GPU Overlay
Refer to Overlay Enabling Tutorial to turn off Enable Arm Mali GPU driver
Overlay.
Reboot system
sudo reboot
Verify GPU driver
Verify kernel driver
Check to see if the corresponding GPU driver is loaded:
# mali
rock@radxa-cm5-io:~$ lsmod | grep bifrost_kbase
bifrost_kbase 1015808 3
# Panfrost
rock@rock-3c:~$ lsmod | grep panfrost
panfrost 61440 5
drm_shmem_helper 20480 1 panfrost
gpu_sched 36864 1 panfrost
# Panthor
rock@radxa-cm5-io:~$ lsmod | grep panthor
panthor 98304 1
drm_gpuvm 24576 1 panthor
drm_exec 16384 2 drm_gpuvm,panthor
drm_shmem_helper 20480 1 panthor
gpu_sched 36864 1 panthor
Verify xorg-xserver version
Run the following command to see the current xorg-xserver source for the [installed,automatic]
counterpart. This is rk35*-bookworm
when using the mali driver, or stable
when using the Panfrost/Panthor driver.
rock@radxa-cm5-io:~$ sudo apt list -a xserver-common xserver-xorg-core xserver-xorg-legacy
Listing... Done
xserver-common/stable-security,stable 2:21.1.7-3+deb12u7 all
xserver-common/rk3588s2-bookworm,rk3588s2-bookworm,now 2:21.1.7-3+deb12u2 all [installed,automatic]
xserver-xorg-core/stable-security,stable 2:21.1.7-3+deb12u7 arm64
xserver-xorg-core/rk3588s2-bookworm,now 2:21.1.7-3+deb12u2 arm64 [installed,automatic]
xserver-xorg-legacy/stable-security,stable 2:21.1.7-3+deb12u7 arm64
xserver-xorg-legacy/rk3588s2-bookworm,now 2:21.1.7-3+deb12u2 arm64 [installed,automatic]
Verify the user-level driver
Running the following command will list libmali
if you are using the mali driver, and will not list any packages if you are using Panfrost/Panthor:
sudo apt list libmali-* --installed
Listing... Done
libmali-bifrost-g52-g13p0-x11-wayland-gbm/rk3566-bookworm-test,now 1.9-1 arm64 [installed]