银河麒麟服务器系统sp2-arm版本安装mlnx网卡驱动
银河麒麟服务器系统sp2-arm版本安装mlnx网卡驱动
一、基本环境1.1 操作系统版本信息1.2 驱动版本信息1.3 网卡型号
二、未升级内核驱动安装步骤2.1 安装依赖包2.2 挂载官网下载的iso驱动文件到/mnt目录2.3 执行安装脚本
三、升级过内核驱动安装步骤3.1 安装依赖包3.2 挂载官网下载的iso驱动文件到/mnt目录3.3 直接执行安装脚本,会有报错3.4 重新编译驱动文件并安装
四、安装过程中遇到的问题汇总4.1 tmp目录过小4.2 参数注解
一、基本环境
1.1 操作系统版本信息
Kylin Linux Version #
Release:
Kylin Linux Advanced Server release V10 (Sword)
Kernel:
4.19.90-24.4.v2101.ky10.aarch64
Build:
Kylin Linux Advanced Server
release V10 (SP2) /(Sword)-aarch64-Build09/20210524
#
1.2 驱动版本信息
5.4-3.7.5.0
驱动下载地址:https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/
下载对应系统版本以及架构的驱动包,下面示例是下载的银河麒麟V10-SP2-0524-arm版本对应的驱动iso文件:
1.3 网卡型号
华为SP380/SP333
二、未升级内核驱动安装步骤
2.1 安装依赖包
yum install tcsh rpm-build elfutils-devel createrepo -y
2.2 挂载官网下载的iso驱动文件到/mnt目录
[root@localhost ~]# mount MLNX_OFED_LINUX-5.4-3.7.5.0-kylin10sp2-aarch64.iso /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# cd /mnt/
[root@localhost mnt]# ls
common_installers.pl create_mlnx_ofed_installers.pl docs LICENSE mlnxofedinstall RPMS uninstall.sh
common.pl distro is_kmp_compat.sh mlnx_add_kernel_support.sh RPM-GPG-KEY-Mellanox src
2.3 执行安装脚本
[root@localhost mnt]#./mlnxofedinstall --skip-distro-check --without-fw-update
Logs dir: /tmp/MLNX_OFED_LINUX.7290.logs
General log file: /tmp/MLNX_OFED_LINUX.7290.logs/general.log
This program will install the MLNX_OFED_LINUX package on your machine.
Note that all other Mellanox, OEM, OFED, RDMA or Distribution IB packages will be removed.
Those packages are removed due to conflicts with MLNX_OFED_LINUX, do not reinstall them.
Do you want to continue?[y/N]:y
Starting MLNX_OFED_LINUX-5.4-3.7.5.0 installation ...
Verifying...
Preparing...
Verifying...
Preparing...
Installing mlnx-ofa_kernel 5.4 RPM
Verifying...
Preparing...
Updating / installing...
mlnx-ofa_kernel-5.4-OFED.5.4.3.7.5.1.k
Configured /etc/security/limits.conf
/sbin/ldconfig: /usr/lib64/libLLVM-7.so is not a symbolic link
Installing mlnx-ofa_kernel-modules 5.4 RPM
Verifying...
Preparing...
Updating / installing...
mlnx-ofa_kernel-modules-5.4-OFED.5.4.3
/sbin/ldconfig: /usr/lib64/libLLVM-7.so is not a symbolic link
Installing mlnx-ofa_kernel-devel 5.4 RPM
Verifying...
Preparing...
Updating / installing...
mlnx-ofa_kernel-devel-5.4-OFED.5.4.3.7
Installing kernel-mft 4.21.0 RPM
Verifying...
Preparing...
Updating / installing...
kernel-mft-4.21.0-102.kver.4.19.90_24.
/sbin/ldconfig: /usr/lib64/libLLVM-7.so is not a symbolic link
Installing knem 1.1.4.90mlnx2 RPM
Verifying...
Preparing...
Updating / installing...
knem-1.1.4.90mlnx2-OFED.23.04.0.5.2.1.
/sbin/ldconfig: /usr/lib64/libLLVM-7.so is not a symbolic link
Installing knem-modules 1.1.4.90mlnx2 RPM
Verifying...
Preparing...
Updating / installing...
knem-modules-1.1.4.90mlnx2-OFED.23.04.
/sbin/ldconfig: /usr/lib64/libLLVM-7.so is not a symbolic link
Verifying...
Preparing...
Installing user level RPMs:
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Verifying...
Preparing...
Installation finished successfully.
Verifying... # [100%]
Preparing... # [100%]
Updating / installing...
1:mlnx-fw-updater-5.4-3.7.5.0 # [100%]
Added 'RUN_FW_UPDATER_ONBOOT=no to /etc/infiniband/openib.conf
Initializing...
Attempting to perform Firmware update...
No devices found!
You may need to update your initramfs before next boot. To do that, run:
dracut -f
To load the new driver, run:
/etc/init.d/openibd restart
三、升级过内核驱动安装步骤
如果升级过内核的话,直接执行安装脚本是不可行的,因为里面的rpm包是在安装完毕的默认内核版本上(kernel-4.19.90-24.4.v2101.ky10.aarch64)编译的
下面示例中我将内核升级到了外网源中25.29版本:kernel-4.19.90-25.29.v2101.ky10.aarch64
rpm -qa | grep kernel-4.19
kernel-4.19.90-24.4.v2101.ky10.aarch64
kernel-4.19.90-25.29.v2101.ky10.aarch64
uname -r
kernel-4.19.90-25.29.v2101.ky10.aarch64
3.1 安装依赖包
yum install tcsh rpm-build elfutils-devel createrepo -y
3.2 挂载官网下载的iso驱动文件到/mnt目录
[root@localhost ~]# mount MLNX_OFED_LINUX-5.4-3.7.5.0-kylin10sp2-aarch64.iso /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# cd /mnt/
[root@localhost mnt]# ls
common_installers.pl create_mlnx_ofed_installers.pl docs LICENSE mlnxofedinstall RPMS uninstall.sh
common.pl distro is_kmp_compat.sh mlnx_add_kernel_support.sh RPM-GPG-KEY-Mellanox src
3.3 直接执行安装脚本,会有报错
以上报错:已安装kernel-4.19.90-25.29.v2101.ky10.aarch64内核,MLNX_OFED_LINUX没有可用于该内核的驱动程序。
问题原因:1.系统版本不一致;2.内核版本不支持
3.4 重新编译驱动文件并安装
镜像中有提供编译适合当前系统内核版本的驱动的sh脚本(mlnx_add_kernel_support.sh)
执行./mlnx_add_kernel_support.sh -m ./命令添加针对当前内核版本的驱动;
./mlnx_add_kernel_support.sh -m ./
编译完成后的驱动默认存放在/tmp目录,编译完成后进入到/tmp目录,执行tar命令进行解压,在执行./mlnxofedinstall --skip-distro-check --without-fw-update命令进行驱动安装
四、安装过程中遇到的问题汇总
4.1 tmp目录过小
编译生成的文件和日志在/tmp目录下产生,/tmp目录过小的话需要执行mount命令重新将tmpfs进行挂载。如果/tmp目录在系统安装过程中有分配具体的分区挂载到/tmp目录,空间不够则需要进行扩容
mount -o remount,size=4G tmpfs /tmp
4.2 参数注解
执行./mlnxofedinstall --skip-distro-check --without-fw-update进行驱动安装
--skip-distro-check跳过distro匹配检查
--without-fw-update跳过固件升级