安装 S3000 2.5.0(Kylin)
安装驱动依赖包
安装 dkms 依赖包
yum install dkms
安装驱动
安装驱动
根据系统架构获取相应驱动包,并安装,以 arm 版本为例:
rpm -ivh musa_2.5.0-server-Kylin_arm64.rpm
驱动安装后,可以重启操作系统使驱动加载,也可以不重启系统使驱动加载。
重启系统加载驱动
shutdown -r now
不重启系统加载驱动
不重启系统,则需要将当前的相关业务停止,并停止 Xorg,在驱动安装后,重新加载 kmd。
停止正在运行相关的业务,停止Xorg
killall Xorg
service lightdm stop
卸载已经加载的 kmd 模块
rmmod mtgpu
查看是否成功卸载 mtgpu
lsmod |grep mtgpu
重新加载 kmd
modprobe mtgpu
查看是否成功加载 mtgpu
lsmod |grep mtgpu
更换驱动
更换驱动,也支持不重启操作系统使驱动加载。更换驱动前需要停止相关业务,卸载原有驱动,安装新驱动,重新加载驱动。具体操作如下:
停止正在运行相关的业务,停止Xorg
pkill Xorg
service lightdm stop
卸载已经安装的驱动
rpm -e $(rpm -qa |grep musa)
安装新版本的驱动,以arm版本为例。
rpm -ivh musa_2.5.0-server-Kylin_arm64.rpm
卸载已经加载的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 地址,lspci 输出的地址为 16 进制,BusID 需要配置成 10 进制,需要将 16 进制转为10进制;另外 lspci 获取的地址分隔符为“.”,BusID 的分隔符为“:”。例如使用lspci获取pcie的地址为:“05:00.0” ,配置 项则为"PCI:5:00:0"
使用 lspci 获取显卡的 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进制,以“1a”为例:
# echo $((16#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 三个 section 组成,有几张卡则有几组 Device,Monitor,Screen。在集显做主显的场景下,MT显卡的 Device,Monitor,Screen 的 Identifier 编号从 1 开始,有几张卡依此类推。第一张MT显卡为 DISPLAY 的: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部分的sceen是叠加在一起的,如果分辨率不同,会导致分辨率小的屏幕鼠标点击发生偏移。
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进程启动,则关闭Xorg进程
pkill Xorg
如果Xorg进程是由lightdm服务启动的,则关闭lightdm进程。
service lightdm stop
启动Xorg进程
如果仅需要Xorg,则直接启动Xorg进程。
Xorg &
如果需要启动窗口管理系统,则使用如下命令
service lightdm start