安装 S3000 3.2.0(Ubuntu)
本节介绍在 Ubuntu 系统上安装Moore Threads GPU 驱动的安装与配置指南,涵盖驱动安装、Xorg 多显卡配置、显示设置和 DirectStream 功能配置等关键步骤。
安装驱动依赖包
安装依赖包
apt install dkms lightdm
关闭自动休眠
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
安装驱动
安装驱动
根据系统架构获取相应的驱动包,并执行以下命令安装:
dpkg -i musa_3.2.0-server.amd64.deb
驱动安装后,您可以选择重启操作系统以加载新的驱动,或者直接加载新的驱动而不重启系统。
重启系统加载驱动
通过以下命令重启系统以加载新的驱动:
shutdown -r now
不重启系统加载驱动
如果选择不重启系统,则需要执行以下步骤:
- 停止当前运行的相关业务,并暂停 Xorg 服务:
killall Xorgservice lightdm stop
- 卸载已加载的 kmd 模块:
rmmod mtgpu
- 检查是否成功卸载 mtgpu:
lsmod |grep mtgpu
- 重新加载 kmd:
modprobe mtgpu
- 查看是否成功加载 mtgpu:
lsmod |grep mtgpu
更换驱动
更换驱动,支持不重启系统加载。在更换驱动之前,执行以下步骤:
- 停止正在运行的相关业务,暂停 Xorg 服务:
pkill Xorgservice lightdm stop
- 卸载已经安装的原有驱动:
dpkg -P musa
- 安装新版本的驱动:
dpkg -i musa_3.2.0-server.amd64.deb
- 卸载已加载的 kmd 模块:
rmmod mtgpu
- 检查是否成功卸载 mtgpu:
lsmod |grep mtgpu
- 重新加载 kmd:
modprobe mtgpu
- 检查是否成功加载 mtgpu:
lsmod |grep mtgpu
配置 Xorg
配置 Xorg 需要修改配置文件,并在修改后重启 Xorg 以使配置生效。
配置 xorg.conf
在服务器环境中,通常存在集成显卡。当安装 MT 显卡用于图形渲染时,需要配置多显卡的 Xorg。此配置支持集成显卡用于 BMC 远程桌面显示,同时 MT 显卡可以用于图形渲染。
Xorg 的配置路径为 /etc/X11/xorg.conf,主要配置包括集成显卡、MT 显卡以及公共部分。集显和 MT 显卡的配置主要由 Device,Monitor,Screen 组成,公共部分配置由 OutputClass,ServerLayout,ServerFlags 组成。
集显配置
如果集显用作 BMC 远程桌面显示,则集显作为主显,Identifier 的编号都为 0,DISPLAY 为 :0.0。
Device 配置项说明:
- Identifier:指定 Device 的编号,如果集成显卡是主显,编号应为 "Video Device0"。
- Driver:指定集成显卡的驱动,设置为 "modesetting"。
- BusID:指定集成显卡的 PCIe BusID。使用 lspci 命令获取集成显卡的 PCIe 地址, 需要将 16 进制地址转换为 10 进制。例如,如果 lspci 输出的地址是 "05:00.0",则 BusID 配置为 "PCI:5:00:0"。
要获取显卡的 PCIe 地址,可以使用以下命令:
# lspci | grep -E 'VGA|3D|Display'
这将输出类似以下的信息:
02:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200e [Pilot] ServerEngines (SEP1) (rev 42)
19:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
1a:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
1b:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
1c:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
b3:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
b4:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
b5:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
b6:00.0 3D controller: Moore Threads Technology Co.,Ltd MTT S3000
要将 16 进制地址转换为 10 进制,可以使用如下命令:
# echo $((16#1a))
例如,对于 "1a",上述命令将输出:
26
Monitor 配置项说明:
- Identifier:指定 Monitor 的编号,如果集成显卡是主显,则编号应为 "Monitor0"。
Screen配置项说明:
- Identifier:指定 Screen 的编号,如果集成显卡是主显,则编号应为 "Screen0"。
- Monitor:配置 Monitor 部分 Identifier 的值,为 "Monitor0"。
- Device:配置 Device 部分 Identifier 的值,为 "Video Device0"。
集显为主显的配置示例:
Section "Device"
Identifier "Video Device0"
Driver "modesetting"
BusID "PCI:5:00:0"
EndSection
Section "Monitor"
Identifier "Monitor0"
EndSection
Section "Screen"
Identifier "Screen0"
Monitor "Monitor0"
Device "Video Device0"
EndSection
MT 显卡配置
每张 MT 显卡都由三个部分组成:Device、Monitor、Screen。有几张卡就有几组 Device、Monitor、Screen。在集成显卡作为主显的情况下,MT 显卡的 Device、Monitor、Screen 的 Identifier 编号 从1开始,每张卡依此递增。第一张 MT 显卡的显示器为 :0.1,第二张为 :0.2。
Device 配置项说明
- Identifier:指定 Device 的编号,例如:Video Device1。
- Driver:指定 MT 显卡的驱动,设置为 "mtgpu"。
- BusID:指定 MT 显卡的 PCIe BusID。获取 MT 显卡的 PCIe 地址,使用 lspci 命令获取的地址是16进制,BusID 需要配置为10进制。需要将16进制转换为10进制;另外,lspci 获取的地址分隔符为".",而 BusID 的分隔符为":"。例如,使用 lspci 获取 PCIe 地址为:"01:00.0",配置项则为 "PCI:1:00:0"。具体命令可以参考上节。
Monitor 配置项说明
- Identifier:指定 Monitor 的编号,例如:Monitor1。
- Modeline:指定显示器的显示模式。例如:"1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync。
- Option:指定偏好的显示模式,设置为:"PreferredMode" "1024x768_60.00"。
为了更好地支持集显作为 BMC 远程显示,建议将 MT 显卡和集显的分辨率和刷新率设置为相同。本指南推荐在 ServerLayout 部分将 Screen 叠加在一起,以避免不同分辨率可能导致小屏幕上的鼠标点击发生偏移。
Screen配置项说明:
- Identifier:指定 Screen 的编号,如果集成显卡是主显,则编号应为 Screen1。
- Monitor:配置 Monitor 部分 Identifier 的值,为 Monitor1。
- Device:配置 Device 部分 Identifier 的值,为 Video Device1。
示例:
Section "Device" Identifier "Video Device1"
Driver "mtgpu"
BusID "PCI:1:00:0"
EndSection
Section "Monitor"
Identifier "Monitor1"
Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
Option "PreferredMode" "1024x768_60.00"
EndSection
Section "Screen"
Identifier "Screen1"
Monitor "Monitor1"
Device "Video Device1"
EndSection
公共部分配置
公共部分配置由 OutputClass、ServerLayout 和 ServerFlags 组成。其中 OutputClass 和 ServerFlags 的配置无需单独修改;ServerLayout 将根据配置的显卡数量包括集显和 MT 显卡,实现屏幕叠加摆放。
OutputClass 配置
Section "OutputClass"
Identifier "mtgpu display"
MatchDriver "mtgpu"
EndSection
ServerLayout 配置
将所有显卡,包括集显和 mtgpu,叠加摆放在屏幕上。以下示例展示了三张卡的配置,其中一张为集显,两张为 MT 显卡。
Section "ServerLayout"
Identifier "Server Layout"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" 0 0
Screen 2 "Screen2" 0 0
EndSection
ServerFlags 配置
Section "ServerFlags"
Option "DefaultServerLayout" "Server Layout"
Option "PrimaryBusDriver" "mtgpu"
Option "AutoAddGPU" "off"
EndSection
请参考附录以获取完整的 Xorg 配置示例。
重启 Xorg 进程
停止Xorg进程
如果 Xorg 进程正在运行,先关闭它:
pkill Xorg
如果 Xorg 进程是由 lightdm 服务启动的,还需要关闭 lightdm 进程:
service lightdm stop
启动 Xorg 进程
如果只需要启动 Xorg 进程,可以使用以下命令:
Xorg &
如果需要启动窗口管理系统,可以使用如下命令:
service lightdm start
显示配置
S3000 显卡有 DP 显示接口,可以连接显示器。S3000 可以作为主显,也可以作为副显,两种方式的 Xorg 配置 不同。
驱动配置检查
S3000 用作显示,需要 MT 显卡驱动加载的 display 参数为 "mt",否则无法点亮显示器。以下命令可以检查当前加载驱动的 display 参数:
# cat /sys/module/mtgpu/parameters/display mt
设置display参数可以修改/etc/modprobe.d/mtgpu.conf配置文件:
# cat /etc/modprobe.d/mtgpu.conf options mtgpu display=mt
修改配置后,重启系统生效。
update-initramfs -u -k $(uname-r) shutdown -r now
MT 显卡作为主显
如果 MT 显卡被配置为主显,需要编辑 /etc/X11/xorg.conf 文件。将其中一张 MT 显卡配置为主显,而集显则配置为副显。具体配置,可参考附录MT显卡作为主显的内容。
完成 Xorg 配置的修改后,需要停止 Xorg 进程。具体内容,请参考重启 Xorg 进程。
通过以下命令启动 lightdm 服务,以确保显示器正常亮起:
service lightdm start
如果 MT 显卡被配置为主显,可能会导致 BMC 远程桌面显示为黑屏。
MT 显卡作为副显
安装依赖包 gnome-shell
apt install gnome-shell