Skip to content

Commit 0e63539

Browse files
committed
fix: mali-gpu: sync documentation updates with Radxa OS
1 parent 00e1bb8 commit 0e63539

File tree

2 files changed

+196
-47
lines changed

2 files changed

+196
-47
lines changed

docs/common/radxa-os/_mali-gpu.mdx

Lines changed: 86 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
搭载 RK3588(不包含 RK3582)系列 SOC 的产品在使用 Debian 12 (Bookworm) 版本系统时默认使用 Panthor GPU 驱动,您可根据需求依据下方教程操作进行 GPU 驱动切换。
1+
搭载 RK3588/RK356X/RK3576(不包含 RK3582)系列 SOC 的产品在使用 Debian 12 (Bookworm) 版本系统时默认使用 Panfrost/Panthor GPU 驱动,您可根据需求依据下方教程操作进行 GPU 驱动切换。
22

33
:::warning
4-
本文档仅适用于搭载 RK3588(不包含 RK3582)系列 SOC 的产品。
4+
本文档仅适用于搭载 RK3588/RK356X/RK3576(不包含 RK3582)系列 SOC 的产品。
55
:::
66

7-
| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI |
8-
| :-----: | :----: | :-------: | :----: | :-----: |
9-
| Mali |||||
10-
| Panthor |||||
7+
| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | Vulkan |
8+
| :-----: | :----: | :-------: | :----: | :-----: | :----: |
9+
| Mali ||||||
10+
| Panthor ||||||
1111

1212
<Tabs queryString="Driver">
1313

@@ -18,6 +18,38 @@
1818
1. 添加 `/etc/apt/preferences.d/mali` 文件,内容为:
1919

2020
```bash
21+
Package: *xserver*
22+
Pin: release a=rk3566-bookworm
23+
Pin-Priority: 1001
24+
25+
Package: *xserver*
26+
Pin: release a=rk3566-bookworm-test
27+
Pin-Priority: 1001
28+
29+
Package: *xserver*
30+
Pin: release a=rk3566t-bookworm
31+
Pin-Priority: 1001
32+
33+
Package: *xserver*
34+
Pin: release a=rk3566t-bookworm-test
35+
Pin-Priority: 1001
36+
37+
Package: *xserver*
38+
Pin: release a=rk3568-bookworm
39+
Pin-Priority: 1001
40+
41+
Package: *xserver*
42+
Pin: release a=rk3568-bookworm-test
43+
Pin-Priority: 1001
44+
45+
Package: *xserver*
46+
Pin: release a=rk3576-bookworm
47+
Pin-Priority: 1001
48+
49+
Package: *xserver*
50+
Pin: release a=rk3576-bookworm-test
51+
Pin-Priority: 1001
52+
2153
Package: *xserver*
2254
Pin: release a=rk3588-bookworm
2355
Pin-Priority: 1001
@@ -44,23 +76,57 @@ Pin-Priority: 1001
4476

4577
```bash
4678
sudo apt-get update
47-
sudo apt-get install libmali-valhall-g610-g13p0-x11-gbm
79+
80+
if grep -qE 'rk3588' <(rsetup get_product_ids)
81+
then
82+
sudo apt-get install libmali-valhall-g610-g24p0-x11-wayland-gbm # RK3588
83+
fi
84+
85+
if grep -qE 'rk3576|rk3568|rk3566' <(rsetup get_product_ids)
86+
then
87+
sudo apt-get install libmali-bifrost-g52-g13p0-x11-wayland-gbm # RK356X/RK3576
88+
fi
4889
```
4990

5091
## 开启 Mali GPU Overlay
5192

5293
参考 [Overlay 开启教程](./rsetup#overlays),开启 `Enable Arm Mali GPU driver` Overlay。
5394

95+
## 修改模块黑名单
96+
97+
编辑 `/etc/modprobe.d/panfrost.conf` 文件:
98+
99+
```bash
100+
# settings for panfrost
101+
102+
# Uncomment the following line and comment above lines
103+
# to use mali driver for GPU instead
104+
# You will have to install desktop from vendor repo
105+
blacklist panfrost
106+
107+
# Disable mali driver by default to prefer panfrost driver
108+
#blacklist mali
109+
#blacklist bifrost_kbase
110+
#blacklist midgard_kbase
111+
```
112+
113+
## 关闭 Zink 支持
114+
115+
```bash
116+
echo "LIBGL_KOPPER_DISABLE=true" | sudo tee -a /etc/environment
117+
```
118+
54119
</TabItem>
55120

56-
<TabItem value="Panthor">
121+
<TabItem value="Panfrost/Panthor">
57122

58123
## 恢复使用 Debian 官方打包的主线 xorg-xserver 版本
59124

60-
1. 删除 `/etc/apt/preferences.d/mali` 文件
125+
1. 删除相关文件
61126

62127
```bash
63128
sudo rm /etc/apt/preferences.d/mali
129+
sudo rm /etc/modprobe.d/panfrost.conf
64130
```
65131

66132
2. <div className="red">
@@ -72,7 +138,7 @@ sudo rm /etc/apt/preferences.d/mali
72138

73139
```bash
74140
sudo apt-get update
75-
sudo apt-get remove libmali-valhall-g610-g13p0-x11-gbm
141+
sudo apt-get remove libmali-*
76142
sudo apt-get install mesa-utils mesa-utils-extra libglx-mesa0 libgl1-mesa-dri
77143
```
78144

@@ -101,6 +167,12 @@ sudo reboot
101167
rock@radxa-cm5-io:~$ lsmod | grep bifrost_kbase
102168
bifrost_kbase 1015808 3
103169

170+
# Panfrost
171+
rock@rock-3c:~$ lsmod | grep panfrost
172+
panfrost 61440 5
173+
drm_shmem_helper 20480 1 panfrost
174+
gpu_sched 36864 1 panfrost
175+
104176
# Panthor
105177
rock@radxa-cm5-io:~$ lsmod | grep panthor
106178
panthor 98304 1
@@ -112,7 +184,7 @@ gpu_sched 36864 1 panthor
112184

113185
### 验证 xorg-xserver 版本
114186

115-
运行以下命令,查看当前 `[installed,automatic]` 对应的 xorg-xserver 来源。使用 mali 驱动时,为 `rk3588*-bookworm`,使用 Panthor 驱动时,为 `stable`
187+
运行以下命令,查看当前 `[installed,automatic]` 对应的 xorg-xserver 来源。使用 mali 驱动时,为 `rk35*-bookworm`,使用 Panfrost/Panthor 驱动时,为 `stable`
116188

117189
```bash
118190
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
129201

130202
### 验证用户层驱动
131203

132-
运行以下命令,使用 mali 驱动则为 `[installed]` 字样,使用 Panthor 则没有 `[installed]` 字样
204+
运行以下命令,使用 mali 驱动则会列出 `libmali`,使用 Panfrost/Panthor 则不会列出任何包
133205

134206
```bash
135-
rock@radxa-cm5-io:~$ sudo apt list libmali-valhall-g610-g13p0-x11-gbm
207+
sudo apt list libmali-* --installed
136208
Listing... Done
137-
libmali-valhall-g610-g13p0-x11-gbm/rk3588s2-bookworm,now 1.9-1 arm64 [installed]
138-
rock@radxa-cm5-io:~$
209+
libmali-bifrost-g52-g13p0-x11-wayland-gbm/rk3566-bookworm-test,now 1.9-1 arm64 [installed]
139210
```
Lines changed: 110 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,152 @@
1-
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.
1+
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.
22

33
:::warning
4-
This document applies only to products equipped with the RK3588 (excluding RK3582) series SOC.
4+
This document applies only to products equipped with RK3588/RK356X/RK3576 (excluding RK3582) series SOCs.
55
:::
66

7-
| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI |
8-
| :-----: | :----: | :-------: | :----: | :-----: |
9-
| Mali |||||
10-
| Panthor |||||
7+
| Driver | OpenGL | OpenGL ES | OpenCL | 8K HDMI | Vulkan |
8+
| :-----: | :----: | :-------: | :----: | :-----: | :----: |
9+
| Mali ||||||
10+
| Panthor ||||||
1111

1212
<Tabs queryString="Driver">
1313

1414
<TabItem value="Mali">
1515

16-
## Use Rockchip's proprietary xorg-xserver version
16+
## Using Rockchip's proprietary xorg-xserver version
1717

18-
1. Add `/etc/apt/preferences.d/mali` file with the following contents:
18+
1. Add the `/etc/apt/preferences.d/mali` file with the contents:
1919

2020
```bash
21+
Package: *xserver*
22+
Pin: release a=rk3566-bookworm
23+
Pin-Priority: 1001
24+
25+
Package: *xserver*
26+
Pin: release a=rk3566-bookworm-test
27+
Pin-Priority: 1001
28+
29+
Package: *xserver*
30+
Pin: release a=rk3566t-bookworm
31+
Pin-Priority: 1001
32+
33+
Package: *xserver*
34+
Pin: release a=rk3566t-bookworm-test
35+
Pin-Priority: 1001
36+
37+
Package: *xserver*
38+
Pin: release a=rk3568-bookworm
39+
Pin-Priority: 1001
40+
41+
Package: *xserver*
42+
Pin: release a=rk3568-bookworm-test
43+
Pin-Priority: 1001
44+
45+
Package: *xserver*
46+
Pin: release a=rk3576-bookworm
47+
Pin-Priority: 1001
48+
49+
Package: *xserver*
50+
Pin: release a=rk3576-bookworm-test
51+
Pin-Priority: 1001
52+
2153
Package: *xserver*
2254
Pin: release a=rk3588-bookworm
2355
Pin-Priority: 1001
2456

57+
Package: *xserver*
58+
Pin: release a=rk3588-bookworm-test
59+
Pin-Priority: 1001
60+
2561
Package: *xserver*
2662
Pin: release a=rk3588s2-bookworm
2763
Pin-Priority: 1001
64+
65+
Package: *xserver*
66+
Pin: release a=rk3588s2-bookworm-test
67+
Pin-Priority: 1001
2868
```
2969

3070
2. <div className="red">
31-
<!-- prettier-ignore -->
32-
**Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update) to**
33-
**reinstall the Rockchip proprietary software packages (if you don't**
34-
**do this step the desktop will crash or flip the colors)**
71+
**Then refer to [System Upgrade with `rsetup`](./rsetup#system-update) to
72+
reinstall** **Rockchip proprietary package (failure to perform this step
73+
may result in desktop flashing or color flipping)**
3574
</div>
3675

37-
## Installing the Mali User Level Driver
76+
## Installing the Mali User-Level Driver
3877

3978
```bash
4079
sudo apt-get update
41-
sudo apt-get install libmali-valhall-g610-g13p0-x11-gbm
80+
81+
if grep -qE 'rk3588' <(rsetup get_product_ids)
82+
then
83+
sudo apt-get install libmali-valhall-g610-g24p0-x11-wayland-gbm # RK3588
84+
fi
85+
86+
if grep -qE 'rk3576|rk3568|rk3566' <(rsetup get_product_ids)
87+
then
88+
sudo apt-get install libmali-bifrost-g52-g13p0-x11-wayland-gbm # RK356X/RK3576
89+
fi
4290
```
4391

4492
## Enable Mali GPU Overlay
4593

46-
Refer to [Overlay opening tutorial](./rsetup#overlays),enable `Enable Arm Mali GPU driver` Overlay.
94+
Enable Arm Mali GPU driver`Overlay by referring to [Overlay Enablement Tutorial](./rsetup#overlays) to enable`Enable Arm Mali GPU driver` Overlay.
95+
96+
## Modify Module Blacklist
97+
98+
编辑 `/etc/modprobe.d/panfrost.conf` 文件:
99+
100+
```bash
101+
# settings for panfrost
102+
103+
# Uncomment the following line and comment above lines
104+
# to use mali driver for GPU instead
105+
# You will have to install desktop from vendor repo
106+
blacklist panfrost
107+
108+
# Disable mali driver by default to prefer panfrost driver
109+
#blacklist mali
110+
#blacklist bifrost_kbase
111+
#blacklist midgard_kbase
112+
```
113+
114+
## Turn off Zink support
115+
116+
```bash
117+
echo "LIBGL_KOPPER_DISABLE=true" | sudo tee -a /etc/environment
118+
```
47119

48120
</TabItem>
49121

50-
<TabItem value="Panthor">
122+
<TabItem value="Panfrost/Panthor">
51123

52124
## Revert to using Debian's officially packaged version of mainline xorg-xserver
53125

54-
1. Remove `/etc/apt/preferences.d/mali` file:
126+
1. Delete the relevant config files:
55127

56128
```bash
57129
sudo rm /etc/apt/preferences.d/mali
130+
sudo rm /etc/modprobe.d/panfrost.conf
58131
```
59132

60133
2. <div className="red">
61-
**Then refer to [System Upgrade Using `rsetup`](./rsetup#system-update)
62-
to** **reinstall the Debian's officially packages (if you don't do this**
63-
**step the desktop will crash or flip the colors)**
134+
**Then refer to [System Upgrade with `rsetup`](./rsetup#system-update) to
135+
reinstall** **Rockchip proprietary package (failure to perform this step
136+
may result in desktop flashing or color flipping)**
64137
</div>
65138

66139
## Uninstall the Mali user level driver and install the upstream Mesa driver
67140

68141
```bash
69142
sudo apt-get update
70-
sudo apt-get remove libmali-valhall-g610-g13p0-x11-gbm
143+
sudo apt-get remove libmali-*
71144
sudo apt-get install mesa-utils mesa-utils-extra libglx-mesa0 libgl1-mesa-dri
72145
```
73146

74147
## Disable Mali GPU Overlay
75148

76-
Refer to [Overlay opening tutorial](./rsetup#overlays),disable `Enable Arm Mali GPU driver` Overlay.
149+
Refer to [Overlay Enabling Tutorial](./rsetup#overlays) to turn off `Enable Arm Mali GPU driver` Overlay.
77150

78151
</TabItem>
79152

@@ -85,17 +158,23 @@ Refer to [Overlay opening tutorial](./rsetup#overlays),disable `Enable Arm Mal
85158
sudo reboot
86159
```
87160

88-
## Verify GPU drivers
161+
### Verify GPU driver
89162

90-
### Verify the kernel driver
163+
### Verify kernel driver
91164

92-
Check if the corresponding GPU driver is loaded:
165+
Check to see if the corresponding GPU driver is loaded:
93166

94167
```bash
95168
# mali
96169
rock@radxa-cm5-io:~$ lsmod | grep bifrost_kbase
97170
bifrost_kbase 1015808 3
98171

172+
# Panfrost
173+
rock@rock-3c:~$ lsmod | grep panfrost
174+
panfrost 61440 5
175+
drm_shmem_helper 20480 1 panfrost
176+
gpu_sched 36864 1 panfrost
177+
99178
# Panthor
100179
rock@radxa-cm5-io:~$ lsmod | grep panthor
101180
panthor 98304 1
@@ -105,9 +184,9 @@ drm_shmem_helper 20480 1 panthor
105184
gpu_sched 36864 1 panthor
106185
```
107186

108-
### Verify the xorg-xserver version
187+
### Verify xorg-xserver version
109188

110-
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.
189+
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.
111190

112191
```bash
113192
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
122201
xserver-xorg-legacy/rk3588s2-bookworm,now 2:21.1.7-3+deb12u2 arm64 [installed,automatic]
123202
```
124203

125-
### Verify the user level driver
204+
### Verify the user-level driver
126205

127-
Run the following command with the word `[installed]` for mali drivers and without the word `[installed]` for Panthor:
206+
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:
128207

129208
```bash
130-
rock@radxa-cm5-io:~$ sudo apt list libmali-valhall-g610-g13p0-x11-gbm
209+
sudo apt list libmali-* --installed
131210
Listing... Done
132-
libmali-valhall-g610-g13p0-x11-gbm/rk3588s2-bookworm,now 1.9-1 arm64 [installed]
133-
rock@radxa-cm5-io:~$
211+
libmali-bifrost-g52-g13p0-x11-wayland-gbm/rk3566-bookworm-test,now 1.9-1 arm64 [installed]
134212
```

0 commit comments

Comments
 (0)