From c30caa3f818e6f3da65e1f70c35ea55178056ba6 Mon Sep 17 00:00:00 2001 From: Chen Jiali Date: Thu, 17 Oct 2024 19:51:01 +0800 Subject: [PATCH 1/4] fix: mali-gpu: optimize GPU driver switching documentation * highlight easily overlooked details * add documentation for checking driver status --- docs/common/radxa-os/_mali-gpu.mdx | 86 ++++++++++++++++--- .../current/common/radxa-os/_mali-gpu.mdx | 78 ++++++++++++++--- 2 files changed, 144 insertions(+), 20 deletions(-) diff --git a/docs/common/radxa-os/_mali-gpu.mdx b/docs/common/radxa-os/_mali-gpu.mdx index acd8dc65a..6cdb33b2f 100644 --- a/docs/common/radxa-os/_mali-gpu.mdx +++ b/docs/common/radxa-os/_mali-gpu.mdx @@ -1,9 +1,13 @@ -ROCK 5 系列在 Debian 12 (Bookworm) 版本默认使用 Panthor GPU 驱动,您可根据需求依据下方教程操作进行 GPU 驱动切换。 +搭载 RK3588(不包含 RK3582)系列 SOC 的产品在使用 Debian 12 (Bookworm) 版本系统时默认使用 Panthor GPU 驱动,您可根据需求依据下方教程操作进行 GPU 驱动切换。 -| Driver | OpenGL | OpenGL ES | OpenCL | -| :-----: | :----: | :-------: | :----: | -| Mali | ❌ | ✔ | ✔ | -| Panthor | ✔ | ✔ | ❌ | +::: warn +本文档仅适用于搭载 RK3588(不包含 RK3582)系列 SOC 的产品。 +::: + +| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | +| :-----: | :----: | :-------: | :----: | :-----: | +| Mali | ❌ | ✔ | ✔ | ✔ | +| Panthor | ✔ | ✔ | ❌ | ❌ | @@ -11,19 +15,30 @@ ROCK 5 系列在 Debian 12 (Bookworm) 版本默认使用 Panthor GPU 驱动, ## 使用 Rockchip 专有 xorg-xserver 版本 -添加 `/etc/apt/preferences.d/mali` 文件,内容为: +1. 添加 `/etc/apt/preferences.d/mali` 文件,内容为: ```bash 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 ``` -然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 Rockchip 专有软件包。 +2.
+ **然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 + Rockchip 专有软件包。** +
## 安装 Mali 用户层驱动 @@ -42,13 +57,16 @@ sudo apt-get install libmali-valhall-g610-g13p0-x11-gbm ## 恢复使用 Debian 官方打包的主线 xorg-xserver 版本 -删除 `/etc/apt/preferences.d/mali` 文件: +1. 删除 `/etc/apt/preferences.d/mali` 文件: ```bash sudo rm /etc/apt/preferences.d/mali ``` -然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 Debian 官方软件包。 +2.
+ **然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 + Debian 官方软件包。** +
## 卸载 Mali 用户层驱动,并安装上游 Mesa 驱动 @@ -68,6 +86,54 @@ sudo apt-get install mesa-utils mesa-utils-extra libglx-mesa0 libgl1-mesa-dri ## 重启系统 -``` +```bash sudo reboot ``` + +## 验证 GPU 驱动 + +### 验证内核驱动 + +查看是否有对应的 GPU 驱动加载信息: + +```bash +# mali +rock@radxa-cm5-io:~$ lsmod | grep bifrost_kbase +bifrost_kbase 1015808 3 + +# 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 +``` + +### 验证 xorg-xserver 版本 + +运行以下命令,查看当前 `[installed,automatic]` 对应的 xorg-xserver 来源。使用 mali 驱动时,为 `rk3588*-bookworm`,使用 Panthor 驱动时,为 `stable`。 + +```bash +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] +``` + +### 验证用户层驱动 + +运行以下命令,使用 mali 驱动则为 `[installed]` 字样,使用 Panthor 则没有 `[installed]` 字样: + +```bash +rock@radxa-cm5-io:~$ sudo apt list libmali-valhall-g610-g13p0-x11-gbm +Listing... Done +libmali-valhall-g610-g13p0-x11-gbm/rk3588s2-bookworm,now 1.9-1 arm64 [installed] +rock@radxa-cm5-io:~$ +``` 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 622700a7f..ee2341e62 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,9 +1,13 @@ -ROCK 5 series uses Panthor GPU driver by default in Debian 12 (Bookworm) version, you can follow the tutorial to switch GPU driver according to your needs. +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. -| Driver | OpenGL | OpenGL ES | OpenCL | -| :-----: | :----: | :-------: | :----: | -| Mali | ❌ | ✔ | ✔ | -| Panthor | ✔ | ✔ | ❌ | +::: warn +This document applies only to products equipped with the RK3588 (excluding RK3582) series SOC. +::: + +| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | +| :-----: | :----: | :-------: | :----: | :-----: | +| Mali | ❌ | ✔ | ✔ | ✔ | +| Panthor | ✔ | ✔ | ❌ | ❌ | @@ -11,7 +15,7 @@ ROCK 5 series uses Panthor GPU driver by default in Debian 12 (Bookworm) version ## Use Rockchip's proprietary xorg-xserver version -Add `/etc/apt/preferences.d/mali` file with the following contents: +1. Add `/etc/apt/preferences.d/mali` file with the following contents: ```bash Package: *xserver* @@ -23,7 +27,10 @@ Pin: release a=rk3588s2-bookworm Pin-Priority: 1001 ``` -Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to reinstall Rockchip proprietary packages. +2.
+ **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to + reinstall the Rockchip proprietary software packages. ** +
## Installing the Mali User Level Driver @@ -42,13 +49,16 @@ Refer to [Overlay opening tutorial](./rsetup#overlays),enable `Enable Arm Mali ## Revert to using Debian's officially packaged version of mainline xorg-xserver -Remove `/etc/apt/preferences.d/mali` file: +1. Remove `/etc/apt/preferences.d/mali` file: ```bash sudo rm /etc/apt/preferences.d/mali ``` -Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to reinstall Debian's officially packages. +2.
+ **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to + reinstall the Debian's officially packages. ** +
## Uninstall the Mali user level driver and install the upstream Mesa driver @@ -68,6 +78,54 @@ Refer to [Overlay opening tutorial](./rsetup#overlays),disable `Enable Arm Mal ## Reboot system -``` +```bash sudo reboot ``` + +## Verify GPU drivers + +### Verify the kernel driver + +Check if the corresponding GPU driver is loaded: + +```bash +# mali +rock@radxa-cm5-io:~$ lsmod | grep bifrost_kbase +bifrost_kbase 1015808 3 + +# 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 the 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. + +```bash +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 + +Run the following command with the word `[installed]` for mali drivers and without the word `[installed]` for Panthor: + +```bash +rock@radxa-cm5-io:~$ sudo apt list libmali-valhall-g610-g13p0-x11-gbm +Listing... Done +libmali-valhall-g610-g13p0-x11-gbm/rk3588s2-bookworm,now 1.9-1 arm64 [installed] +rock@radxa-cm5-io:~$ +``` From 330af67a2eca085cfe9f711d7fdc55a4541a6742 Mon Sep 17 00:00:00 2001 From: Chen Jiali Date: Fri, 18 Oct 2024 17:03:41 +0800 Subject: [PATCH 2/4] chore: add some codeowners --- .github/CODEOWNERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9df95b122..f964e6d0b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -337,3 +337,12 @@ static/img/rock5c/rk3588s2_blockdiagram.webp @vamrs-feng i18n/en/docusaurus-plugin-content-docs/current/compute-module/cm3i/app-development/README.md @nascs docs/compute-module/cm3/app-development/rtsp.md @nascs i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3b/getting-started/interface-usage/hdmi.md @nascs +docs/rock5/rock5a/getting-started/interface-usage/README.md @nascs +docs/rock5/rock5c/low-level-dev/README.md @vamrs-feng +docs/accessories/camera_8m_219.md @melooooooooooo +static/img/accessories/penta/case/case-2.webp @u7985 +static/img/general-tutorial/rknn/rkllm_1.webp @vamrs-feng +docs/sophon/airbox/local-ai-deploy/ai-tools/memory_allocate.md @peterwang2050 +i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3b/radxa-os/backup.md @nascs +docs/common/radxa-os/_mali-gpu.mdx @CodeChenL +i18n/en/docusaurus-plugin-content-docs/current/docs/common/radxa-os/_mali-gpu.mdx @CodeChenL From 83445982ad7f5acce18b554f56f9a5453c280215 Mon Sep 17 00:00:00 2001 From: Chen Jiali Date: Wed, 23 Oct 2024 11:44:25 +0800 Subject: [PATCH 3/4] fix: mali-gpu: fix some syntax errors --- docs/common/radxa-os/_mali-gpu.mdx | 14 +++++++++----- .../current/common/radxa-os/_mali-gpu.mdx | 16 +++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/common/radxa-os/_mali-gpu.mdx b/docs/common/radxa-os/_mali-gpu.mdx index 6cdb33b2f..6d03a7f7c 100644 --- a/docs/common/radxa-os/_mali-gpu.mdx +++ b/docs/common/radxa-os/_mali-gpu.mdx @@ -1,6 +1,6 @@ 搭载 RK3588(不包含 RK3582)系列 SOC 的产品在使用 Debian 12 (Bookworm) 版本系统时默认使用 Panthor GPU 驱动,您可根据需求依据下方教程操作进行 GPU 驱动切换。 -::: warn +:::warning 本文档仅适用于搭载 RK3588(不包含 RK3582)系列 SOC 的产品。 ::: @@ -36,8 +36,10 @@ Pin-Priority: 1001 ``` 2.
- **然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 - Rockchip 专有软件包。** + + 然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 + Rockchip 专有软件包,如果不执行此步骤会导致桌面闪退或者颜色翻转。 +
## 安装 Mali 用户层驱动 @@ -64,8 +66,10 @@ sudo rm /etc/apt/preferences.d/mali ``` 2.
- **然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 - Debian 官方软件包。** + + 然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 + Debian 官方软件包,如果不执行此步骤会导致桌面闪退或者颜色翻转。 +
## 卸载 Mali 用户层驱动,并安装上游 Mesa 驱动 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 ee2341e62..b72eab5ee 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,6 +1,6 @@ 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. -::: warn +:::warning This document applies only to products equipped with the RK3588 (excluding RK3582) series SOC. ::: @@ -28,8 +28,11 @@ Pin-Priority: 1001 ``` 2.
- **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to - reinstall the Rockchip proprietary software packages. ** + + Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to + reinstall the Rockchip proprietary software packages, if you don't + perform this step it will crash the desktop or flip the colors.{" "} +
## Installing the Mali User Level Driver @@ -56,8 +59,11 @@ sudo rm /etc/apt/preferences.d/mali ``` 2.
- **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to - reinstall the Debian's officially packages. ** + + Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to + reinstall the Debian's officially packages, if you don't perform this + step it will crash the desktop or flip the colors.{" "} +
## Uninstall the Mali user level driver and install the upstream Mesa driver From c0270b4e9f98f9f084f9aa6a6047448094fb6b1f Mon Sep 17 00:00:00 2001 From: Chen Jiali Date: Wed, 23 Oct 2024 15:03:01 +0800 Subject: [PATCH 4/4] fix: mali-gpu: fix some syntax errors --- docs/common/radxa-os/_mali-gpu.mdx | 12 ++++-------- .../current/common/radxa-os/_mali-gpu.mdx | 17 +++++++---------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/docs/common/radxa-os/_mali-gpu.mdx b/docs/common/radxa-os/_mali-gpu.mdx index 6d03a7f7c..fa48e3b2c 100644 --- a/docs/common/radxa-os/_mali-gpu.mdx +++ b/docs/common/radxa-os/_mali-gpu.mdx @@ -36,10 +36,8 @@ Pin-Priority: 1001 ``` 2.
- - 然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 - Rockchip 专有软件包,如果不执行此步骤会导致桌面闪退或者颜色翻转。 - + **然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装** + **Rockchip 专有软件包,如果不执行此步骤会导致桌面闪退或者颜色翻转。**
## 安装 Mali 用户层驱动 @@ -66,10 +64,8 @@ sudo rm /etc/apt/preferences.d/mali ``` 2.
- - 然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装 - Debian 官方软件包,如果不执行此步骤会导致桌面闪退或者颜色翻转。 - + **然后参考[使用 `rsetup` 进行系统升级](./rsetup#system-update)来重新安装** + **Debian 官方软件包,如果不执行此步骤会导致桌面闪退或者颜色翻转。**
## 卸载 Mali 用户层驱动,并安装上游 Mesa 驱动 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 b72eab5ee..bed4ff40b 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 @@ -28,11 +28,10 @@ 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 - perform this step it will crash the desktop or flip the colors.{" "} - + + **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to** + **reinstall the Rockchip proprietary software packages, if you don't** + **perform this step it will crash the desktop or flip the colors.**
## Installing the Mali User Level Driver @@ -59,11 +58,9 @@ sudo rm /etc/apt/preferences.d/mali ``` 2.
- - Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to - reinstall the Debian's officially packages, if you don't perform this - step it will crash the desktop or flip the colors.{" "} - + **Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) + to** **reinstall the Debian's officially packages, if you don't perform + this** **step it will crash the desktop or flip the colors.**
## Uninstall the Mali user level driver and install the upstream Mesa driver