From 0e635395038cf8572ea7f10a8b75b84286920b20 Mon Sep 17 00:00:00 2001 From: Chen Jiali Date: Wed, 16 Apr 2025 09:29:29 +0800 Subject: [PATCH] fix: mali-gpu: sync documentation updates with Radxa OS --- docs/common/radxa-os/_mali-gpu.mdx | 101 +++++++++++-- .../current/common/radxa-os/_mali-gpu.mdx | 142 ++++++++++++++---- 2 files changed, 196 insertions(+), 47 deletions(-) diff --git a/docs/common/radxa-os/_mali-gpu.mdx b/docs/common/radxa-os/_mali-gpu.mdx index fafb1be4b..3a225b10e 100644 --- a/docs/common/radxa-os/_mali-gpu.mdx +++ b/docs/common/radxa-os/_mali-gpu.mdx @@ -1,13 +1,13 @@ -搭载 RK3588(不包含 RK3582)系列 SOC 的产品在使用 Debian 12 (Bookworm) 版本系统时默认使用 Panthor GPU 驱动,您可根据需求依据下方教程操作进行 GPU 驱动切换。 +搭载 RK3588/RK356X/RK3576(不包含 RK3582)系列 SOC 的产品在使用 Debian 12 (Bookworm) 版本系统时默认使用 Panfrost/Panthor GPU 驱动,您可根据需求依据下方教程操作进行 GPU 驱动切换。 :::warning -本文档仅适用于搭载 RK3588(不包含 RK3582)系列 SOC 的产品。 +本文档仅适用于搭载 RK3588/RK356X/RK3576(不包含 RK3582)系列 SOC 的产品。 ::: -| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | -| :-----: | :----: | :-------: | :----: | :-----: | -| Mali | ❌ | ✔ | ✔ | ✔ | -| Panthor | ✔ | ✔ | ❌ | ❌ | +| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | Vulkan | +| :-----: | :----: | :-------: | :----: | :-----: | :----: | +| Mali | ❌ | ✔ | ✔ | ✔ | ✔ | +| Panthor | ✔ | ✔ | ❌ | ❌ | ❌ | @@ -18,6 +18,38 @@ 1. 添加 `/etc/apt/preferences.d/mali` 文件,内容为: ```bash +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 @@ -44,23 +76,57 @@ Pin-Priority: 1001 ```bash sudo apt-get update -sudo apt-get install libmali-valhall-g610-g13p0-x11-gbm + +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 ``` ## 开启 Mali GPU Overlay 参考 [Overlay 开启教程](./rsetup#overlays),开启 `Enable Arm Mali GPU driver` Overlay。 +## 修改模块黑名单 + +编辑 `/etc/modprobe.d/panfrost.conf` 文件: + +```bash +# 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 +``` + +## 关闭 Zink 支持 + +```bash +echo "LIBGL_KOPPER_DISABLE=true" | sudo tee -a /etc/environment +``` + - + ## 恢复使用 Debian 官方打包的主线 xorg-xserver 版本 -1. 删除 `/etc/apt/preferences.d/mali` 文件: +1. 删除相关文件: ```bash sudo rm /etc/apt/preferences.d/mali +sudo rm /etc/modprobe.d/panfrost.conf ``` 2.
@@ -72,7 +138,7 @@ sudo rm /etc/apt/preferences.d/mali ```bash sudo apt-get update -sudo apt-get remove libmali-valhall-g610-g13p0-x11-gbm +sudo apt-get remove libmali-* sudo apt-get install mesa-utils mesa-utils-extra libglx-mesa0 libgl1-mesa-dri ``` @@ -101,6 +167,12 @@ sudo reboot 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 @@ -112,7 +184,7 @@ gpu_sched 36864 1 panthor ### 验证 xorg-xserver 版本 -运行以下命令,查看当前 `[installed,automatic]` 对应的 xorg-xserver 来源。使用 mali 驱动时,为 `rk3588*-bookworm`,使用 Panthor 驱动时,为 `stable`。 +运行以下命令,查看当前 `[installed,automatic]` 对应的 xorg-xserver 来源。使用 mali 驱动时,为 `rk35*-bookworm`,使用 Panfrost/Panthor 驱动时,为 `stable`。 ```bash rock@radxa-cm5-io:~$ sudo apt list -a xserver-common xserver-xorg-core xserver-xorg-legacy @@ -129,11 +201,10 @@ xserver-xorg-legacy/rk3588s2-bookworm,now 2:21.1.7-3+deb12u2 arm64 [installed,au ### 验证用户层驱动 -运行以下命令,使用 mali 驱动则为 `[installed]` 字样,使用 Panthor 则没有 `[installed]` 字样: +运行以下命令,使用 mali 驱动则会列出 `libmali`,使用 Panfrost/Panthor 则不会列出任何包: ```bash -rock@radxa-cm5-io:~$ sudo apt list libmali-valhall-g610-g13p0-x11-gbm +sudo apt list libmali-* --installed Listing... Done -libmali-valhall-g610-g13p0-x11-gbm/rk3588s2-bookworm,now 1.9-1 arm64 [installed] -rock@radxa-cm5-io:~$ +libmali-bifrost-g52-g13p0-x11-wayland-gbm/rk3566-bookworm-test,now 1.9-1 arm64 [installed] ``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/radxa-os/_mali-gpu.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/radxa-os/_mali-gpu.mdx index 24507c329..89180c1ad 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/radxa-os/_mali-gpu.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/radxa-os/_mali-gpu.mdx @@ -1,79 +1,152 @@ -Products equipped with RK3588 (excluding RK3582) series SOCs use Panthor GPU driver by default when using Debian 12 (Bookworm) version system, you can follow the tutorial below to switch GPU driver according to your needs. +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. :::warning -This document applies only to products equipped with the RK3588 (excluding RK3582) series SOC. +This document applies only to products equipped with RK3588/RK356X/RK3576 (excluding RK3582) series SOCs. ::: -| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | -| :-----: | :----: | :-------: | :----: | :-----: | -| Mali | ❌ | ✔ | ✔ | ✔ | -| Panthor | ✔ | ✔ | ❌ | ❌ | +| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | Vulkan | +| :-----: | :----: | :-------: | :----: | :-----: | :----: | +| Mali | ❌ | ✔ | ✔ | ✔ | ✔ | +| Panthor | ✔ | ✔ | ❌ | ❌ | ❌ | -## Use Rockchip's proprietary xorg-xserver version +## Using Rockchip's proprietary xorg-xserver version -1. Add `/etc/apt/preferences.d/mali` file with the following contents: +1. Add the `/etc/apt/preferences.d/mali` file with the contents: ```bash +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 ``` 2.
- - **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to** - **reinstall the Rockchip proprietary software packages (if you don't** - **do this step the desktop will crash or flip the colors)** + **Then refer to [System Upgrade with `rsetup`](./rsetup#system-update) to + reinstall** **Rockchip proprietary package (failure to perform this step + may result in desktop flashing or color flipping)**
-## Installing the Mali User Level Driver +## Installing the Mali User-Level Driver ```bash sudo apt-get update -sudo apt-get install libmali-valhall-g610-g13p0-x11-gbm + +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 -Refer to [Overlay opening tutorial](./rsetup#overlays),enable `Enable Arm Mali GPU driver` Overlay. +Enable Arm Mali GPU driver`Overlay by referring to [Overlay Enablement Tutorial](./rsetup#overlays) to enable`Enable Arm Mali GPU driver` Overlay. + +## Modify Module Blacklist + +编辑 `/etc/modprobe.d/panfrost.conf` 文件: + +```bash +# 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 + +```bash +echo "LIBGL_KOPPER_DISABLE=true" | sudo tee -a /etc/environment +```
- + ## Revert to using Debian's officially packaged version of mainline xorg-xserver -1. Remove `/etc/apt/preferences.d/mali` file: +1. Delete the relevant config files: ```bash sudo rm /etc/apt/preferences.d/mali +sudo rm /etc/modprobe.d/panfrost.conf ``` 2.
- **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) - to** **reinstall the Debian's officially packages (if you don't do this** - **step the desktop will crash or flip the colors)** + **Then refer to [System Upgrade with `rsetup`](./rsetup#system-update) 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 ```bash sudo apt-get update -sudo apt-get remove libmali-valhall-g610-g13p0-x11-gbm +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 opening tutorial](./rsetup#overlays),disable `Enable Arm Mali GPU driver` Overlay. +Refer to [Overlay Enabling Tutorial](./rsetup#overlays) to turn off `Enable Arm Mali GPU driver` Overlay.
@@ -85,17 +158,23 @@ Refer to [Overlay opening tutorial](./rsetup#overlays),disable `Enable Arm Mal sudo reboot ``` -## Verify GPU drivers +### Verify GPU driver -### Verify the kernel driver +### Verify kernel driver -Check if the corresponding GPU driver is loaded: +Check to see if the corresponding GPU driver is loaded: ```bash # 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 @@ -105,9 +184,9 @@ drm_shmem_helper 20480 1 panthor gpu_sched 36864 1 panthor ``` -### Verify the xorg-xserver version +### Verify xorg-xserver version -Run the following command to see the current xorg-xserver source for `[installed,automatic]`. This is `rk3588*-bookworm` when using the mali driver, or `stable` when using the Panthor driver. +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. ```bash rock@radxa-cm5-io:~$ sudo apt list -a xserver-common xserver-xorg-core xserver-xorg-legacy @@ -122,13 +201,12 @@ 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 +### Verify the user-level driver -Run the following command with the word `[installed]` for mali drivers and without the word `[installed]` for Panthor: +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: ```bash -rock@radxa-cm5-io:~$ sudo apt list libmali-valhall-g610-g13p0-x11-gbm +sudo apt list libmali-* --installed Listing... Done -libmali-valhall-g610-g13p0-x11-gbm/rk3588s2-bookworm,now 1.9-1 arm64 [installed] -rock@radxa-cm5-io:~$ +libmali-bifrost-g52-g13p0-x11-wayland-gbm/rk3566-bookworm-test,now 1.9-1 arm64 [installed] ```