IB驱动及IB交换机模式切换
1、GPU驱动安装
步骤如下:
参考之前安装GPU 驱动:[链接]
注意:A100 等nvlink版本的GPU需要安装额外的驱动包cuda-drivers-fabricmanager,否者无法调用GPU
[root@gpu-a100-2 ~]# yum-config-manager --add-repo https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
Loaded plugins: fastestmirror, nvidia
adding repo from: https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
grabbing file https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo to /etc/yum.repos.d/cuda-rhel7.repo
Could not fetch/save url https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo to file /etc/yum.repos.d/cuda-rhel7.repo: [Errno 14] curl#7 - "Failed connect to developer.download.nvidia.cn:443; Connection refused"
[root@gpu-a100-2 ~]# source /etc/profile
[root@gpu-a100-2 ~]# yum-config-manager --add-repo https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
Loaded plugins: fastestmirror, nvidia
adding repo from: https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
grabbing file https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo to /etc/yum.repos.d/cuda-rhel7.repo
repo saved to /etc/yum.repos.d/cuda-rhel7.repo
[root@gpu-a100-2 ~]# yum install cuda-drivers-fabricmanager-460.106.00-1 -y
Loaded plugins: fastestmirror, nvidia
Loading mirror speeds from cached hostfile
cuda-rhel7-x86_64 | 3.0 kB 00:00:00
cuda-rhel7-x86_64/primary_db | 1.2 MB 00:00:07
Resolving Dependencies
--> Running transaction check
---> Package cuda-drivers-fabricmanager.x86_64 0:460.106.00-1 will be installed
--> Processing Dependency: cuda-drivers-fabricmanager-460 = 460.106.00 for package: cuda-drivers-fabricmanager-460.106.00-1.x86_64
--> Running transaction check
---> Package cuda-drivers-fabricmanager-460.x86_64 0:460.106.00-1 will be installed
--> Processing Dependency: nvidia-fabric-manager = 460.106.00 for package: cuda-drivers-fabricmanager-460-460.106.00-1.x86_64
--> Running transaction check
---> Package nvidia-fabric-manager.x86_64 0:460.106.00-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================
Installing:
cuda-drivers-fabricmanager x86_64 460.106.00-1 cuda-rhel7-x86_64 3.1 k
Installing for dependencies:
cuda-drivers-fabricmanager-460 x86_64 460.106.00-1 cuda-rhel7-x86_64 3.3 k
nvidia-fabric-manager x86_64 460.106.00-1 cuda-rhel7-x86_64 1.1 M
Transaction Summary
================================================================================================================================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 1.1 M
Installed size: 4.9 M
Downloading packages:
(1/3): cuda-drivers-fabricmanager-460-460.106.00-1.x86_64.rpm | 3.3 kB 00:00:02
(2/3): cuda-drivers-fabricmanager-460.106.00-1.x86_64.rpm | 3.1 kB 00:00:02
(3/3): nvidia-fabric-manager-460.106.00-1.x86_64.rpm | 1.1 MB 00:00:03
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 193 kB/s | 1.1 MB 00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : nvidia-fabric-manager-460.106.00-1.x86_64 1/3
Installing : cuda-drivers-fabricmanager-460-460.106.00-1.x86_64 2/3
Installing : cuda-drivers-fabricmanager-460.106.00-1.x86_64 3/3
Verifying : nvidia-fabric-manager-460.106.00-1.x86_64 1/3
Verifying : cuda-drivers-fabricmanager-460.106.00-1.x86_64 2/3
Verifying : cuda-drivers-fabricmanager-460-460.106.00-1.x86_64 3/3
Installed:
cuda-drivers-fabricmanager.x86_64 0:460.106.00-1
Dependency Installed:
cuda-drivers-fabricmanager-460.x86_64 0:460.106.00-1 nvidia-fabric-manager.x86_64 0:460.106.00-1
Complete!
[root@gpu-a100-2 ~]# systemctl daemon-reload
[root@gpu-a100-2 ~]# systemctl start nvidia-fabricmanager
[root@gpu-a100-2 ~]# systemctl enable nvidia-fabricmanager
2、IB驱动安装
下载链接https://www.mellanox.com/products/infiniband-drivers/linux/mlnx_ofed

注意:我们现在所有新机器的驱动都用了4.9-4.0.8.0的驱动,4.9的驱动要选择LTS才会有
驱动安装步骤
解压 MLNX_OFED_LINUX-4.9-4.0.8.0-rhel7.6-x86_64.tgz
安装依赖,如缺失会提示,建议使用本地或者相同版本的yum源,避免版本不匹配问题
yum install python-devel pciutils lsof redhat-rpm-config rpm-build libtool tcl gcc-gfortran fuse-libs tcsh tk yum install kernel-devel gcc gtk -y
[root@gpu-a100-4 ~]# cd driver/MLNX_OFED_LINUX-4.7-3.2.9.0-rhel7.6-x86_64
[root@gpu-a100-4 MLNX_OFED_LINUX-4.7-3.2.9.0-rhel7.6-x86_64]# ./mlnxofedinstall
Logs dir: /tmp/MLNX_OFED_LINUX.41492.logs
General log file: /tmp/MLNX_OFED_LINUX.41492.logs/general.log
Verifying KMP rpms compatibility with target kernel...
Error: One or more required packages for installing MLNX_OFED_LINUX are missing.
Please install the missing packages using your Linux distribution Package Management tool.
Run:
yum install gtk2
[root@gpu-a100-4 MLNX_OFED_LINUX-4.7-3.2.9.0-rhel7.6-x86_64]# yum install gtk2 -y
Loaded plugins: fastestmirror, nvidia
Loading mirror speeds from cached hostfile
local | 3.6 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package gtk2.x86_64 0:2.24.31-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================
Installing:
gtk2 x86_64 2.24.31-1.el7 local 3.4 M
Transaction Summary
================================================================================================================================================================================
Install 1 Package
Total download size: 3.4 M
Installed size: 13 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : gtk2-2.24.31-1.el7.x86_64 1/1
Verifying : gtk2-2.24.31-1.el7.x86_64 1/1
Installed:
gtk2.x86_64 0:2.24.31-1.el7
Complete!
[root@gpu-a100-4 MLNX_OFED_LINUX-4.7-3.2.9.0-rhel7.6-x86_64]# ./mlnxofedinstall
Logs dir: /tmp/MLNX_OFED_LINUX.43198.logs
General log file: /tmp/MLNX_OFED_LINUX.43198.logs/general.log
Verifying KMP rpms compatibility with target kernel...
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
Uninstalling MLNX_EN driver
Uninstalling the previous version of MLNX_OFED_LINUX
rpm --nosignature -e --allmatches --nodeps mft
Starting MLNX_OFED_LINUX-4.7-3.2.9.0 installation ...
Installing mlnx-ofa_kernel RPM
Preparing... ########################################
Updating / installing...
mlnx-ofa_kernel-4.7-OFED.4.7.3.2.9.1.g########################################
Installing kmod-mlnx-ofa_kernel 4.7 RPM
Preparing... ########################################
kmod-mlnx-ofa_kernel-4.7-OFED.4.7.3.2.########################################
Installing mlnx-ofa_kernel-devel RPM
Preparing... ########################################
Updating / installing...
mlnx-ofa_kernel-devel-4.7-OFED.4.7.3.2########################################
Installing kmod-kernel-mft-mlnx 4.13.3 RPM
Preparing... ########################################
kmod-kernel-mft-mlnx-4.13.3-1.rhel7u6 ########################################
Installing knem RPM
Preparing... ########################################
Updating / installing...
knem-1.1.3.90mlnx1-OFED.4.7.2.0.7.1.ge########################################
Installing kmod-knem 1.1.3.90mlnx1 RPM
Preparing... ########################################
kmod-knem-1.1.3.90mlnx1-OFED.4.7.2.0.7########################################
Installing kmod-iser 4.7 RPM
Preparing... ########################################
kmod-iser-4.7-OFED.4.7.3.2.9.1.g457f06########################################
Installing kmod-srp 4.7 RPM
Preparing... ########################################
kmod-srp-4.7-OFED.4.7.3.2.9.1.g457f064########################################
Installing kmod-isert 4.7 RPM
Preparing... ########################################
kmod-isert-4.7-OFED.4.7.3.2.9.1.g457f0########################################
Installing kmod-rshim 1.16 RPM
Preparing... ########################################
kmod-rshim-1.16-0.ga7ad4e6.rhel7u6 ########################################
Installing mpi-selector RPM
Preparing... ########################################
Updating / installing...
mpi-selector-1.0.3-1.47329 ########################################
Cleaning up / removing...
mpi-selector-1.0.3-1.54303 ########################################
Installing user level RPMs:
Preparing... ########################################
ofed-scripts-4.7-OFED.4.7.3.2.9 ########################################
Preparing... ########################################
libibverbs-41mlnx1-OFED.4.7.0.0.2.4732########################################
Preparing... ########################################
libibverbs-devel-41mlnx1-OFED.4.7.0.0.########################################
Preparing... ########################################
libibverbs-devel-static-41mlnx1-OFED.4########################################
Preparing... ########################################
libibverbs-utils-41mlnx1-OFED.4.7.0.0.########################################
Preparing... ########################################
libmlx4-41mlnx1-OFED.4.7.3.0.3.47329 ########################################
Preparing... ########################################
libmlx4-devel-41mlnx1-OFED.4.7.3.0.3.4########################################
Preparing... ########################################
libmlx5-41mlnx1-OFED.4.7.0.3.3.47329 ########################################
Preparing... ########################################
libmlx5-devel-41mlnx1-OFED.4.7.0.3.3.4########################################
Preparing... ########################################
librxe-41mlnx1-OFED.4.4.2.4.6.47329 ########################################
Preparing... ########################################
librxe-devel-static-41mlnx1-OFED.4.4.2########################################
Preparing... ########################################
libibcm-41mlnx1-OFED.4.1.0.1.0.47329 ########################################
Preparing... ########################################
libibcm-devel-41mlnx1-OFED.4.1.0.1.0.4########################################
Preparing... ########################################
libibumad-43.1.1.MLNX20190905.1080879-########################################
Preparing... ########################################
libibumad-devel-43.1.1.MLNX20190905.10########################################
Preparing... ########################################
libibumad-static-43.1.1.MLNX20190905.1########################################
Preparing... ########################################
libibmad-5.4.0.MLNX20190423.1d917ae-0.########################################
Preparing... ########################################
libibmad-devel-5.4.0.MLNX20190423.1d91########################################
Preparing... ########################################
libibmad-static-5.4.0.MLNX20190423.1d9########################################
Preparing... ########################################
ibsim-0.7mlnx1-0.11.g85c342b.47329 ########################################
Preparing... ########################################
ibacm-41mlnx1-OFED.4.3.3.0.0.47329 ########################################
Preparing... ########################################
librdmacm-41mlnx1-OFED.4.7.3.0.6.47329########################################
Preparing... ########################################
librdmacm-utils-41mlnx1-OFED.4.7.3.0.6########################################
Preparing... ########################################
librdmacm-devel-41mlnx1-OFED.4.7.3.0.6########################################
Preparing... ########################################
opensm-libs-5.5.1.MLNX20191120.0c8dde0########################################
Preparing... ########################################
opensm-5.5.1.MLNX20191120.0c8dde0-0.1.########################################
Preparing... ########################################
opensm-devel-5.5.1.MLNX20191120.0c8dde########################################
Preparing... ########################################
opensm-static-5.5.1.MLNX20191120.0c8dd########################################
Preparing... ########################################
dapl-2.1.10mlnx-OFED.3.4.2.1.0.47329 ########################################
Preparing... ########################################
dapl-devel-2.1.10mlnx-OFED.3.4.2.1.0.4########################################
Preparing... ########################################
dapl-devel-static-2.1.10mlnx-OFED.3.4.########################################
Preparing... ########################################
dapl-utils-2.1.10mlnx-OFED.3.4.2.1.0.4########################################
Preparing... ########################################
perftest-4.4-0.11.gd240b65.47329 ########################################
Preparing... ########################################
mstflint-4.13.0-1.41.g4e8819c.47329 ########################################
Preparing... ########################################
mft-4.13.3-6 ########################################
Preparing... ########################################
srptools-41mlnx1-5.47329 ########################################
Preparing... ########################################
infiniband-diags-5.4.0.MLNX20190908.5f########################################
Preparing... ########################################
ibutils2-2.1.1-0.113.MLNX20191121.g1c2########################################
Preparing... ########################################
ibutils-1.5.7.1-0.12.gdcaeae2.47329 ########################################
Preparing... ########################################
cc_mgr-1.0-0.46.MLNX20191120.gf30d03a.########################################
Preparing... ########################################
dump_pr-1.0-0.42.MLNX20191120.gf30d03a########################################
Preparing... ########################################
ar_mgr-1.0-0.47.MLNX20191120.gf30d03a.########################################
Preparing... ########################################
ibdump-5.0.0-3.47329 ########################################
Preparing... ########################################
infiniband-diags-compat-5.4.0.MLNX2019########################################
Preparing... ########################################
qperf-0.4.9-9.47329 ########################################
Preparing... ########################################
mxm-3.7.3112-1.47329 ########################################
Preparing... ########################################
ucx-1.7.0-1.47329 ########################################
Preparing... ########################################
ucx-devel-1.7.0-1.47329 ########################################
Preparing... ########################################
sharp-2.0.0.MLNX20190922.a9ebf22-1.473########################################
Preparing... ########################################
ucx-cma-1.7.0-1.47329 ########################################
Preparing... ########################################
ucx-ib-1.7.0-1.47329 ########################################
Preparing... ########################################
ucx-ib-cm-1.7.0-1.47329 ########################################
Preparing... ########################################
ucx-rdmacm-1.7.0-1.47329 ########################################
Preparing... ########################################
ucx-knem-1.7.0-1.47329 ########################################
Preparing... ########################################
hcoll-4.4.2938-1.47329 ########################################
Preparing... ########################################
openmpi-4.0.2rc3-1.47329 ########################################
Preparing... ########################################
mlnx-ethtool-5.1-1.47329 ########################################
Preparing... ########################################
mlnx-iproute2-5.2.0-1.47329 ########################################
Preparing... ########################################
mlnxofed-docs-4.7-3.2.9.0 ########################################
Preparing... ########################################
mpitests_openmpi-3.2.20-e1a0676.47329 ########################################
Device (2e:00.0):
2e:00.0 Infiniband controller: Mellanox Technologies MT28908 Family [ConnectX-6]
Link Width: x16
PCI Link Speed: 16GT/s
Device (a8:00.0):
a8:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
Link Width: x8
PCI Link Speed: 8GT/s
Device (a8:00.1):
a8:00.1 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
Link Width: x8
PCI Link Speed: 8GT/s
Device (ce:00.0):
ce:00.0 Infiniband controller: Mellanox Technologies MT28908 Family [ConnectX-6]
Link Width: x16
PCI Link Speed: 16GT/s
Installation finished successfully.
Preparing... ################################# [100%]
Updating / installing...
1:mlnx-fw-updater-4.7-3.2.9.0 ################################# [100%]
Added 'RUN_FW_UPDATER_ONBOOT=no to /etc/infiniband/openib.conf
Attempting to perform Firmware update...
Querying Mellanox devices firmware ...
Device #1:
----------
Device Type: ConnectX6
Part Number: MCX653105A-HDA_Ax
Description: ConnectX-6 VPI adapter card; HDR IB (200Gb/s) and 200GbE; single-port QSFP56; PCIe4.0 x16; tall bracket; ROHS R6
PSID: MT_0000000223
PCI Device Name: 2e:00.0
Base GUID: b8cef60300025ca0
Versions: Current Available
FW 20.31.2006 20.26.4012
PXE 3.6.0404 3.5.0805
UEFI 14.24.0015 14.19.0017
Status: Up to date
Log File: /tmp/MLNX_OFED_LINUX.43198.logs/fw_update.log
Querying Mellanox devices firmware ...
Device #1:
----------
Device Type: ConnectX4LX
Part Number: MCX4121A-XCA_Ax
Description: ConnectX-4 Lx EN network interface card; 10GbE dual-port SFP28; PCIe3.0 x8; ROHS R6
PSID: MT_2420110004
PCI Device Name: a8:00.0
Base MAC: b8cef6d16caa
Versions: Current Available
FW 14.31.2006 14.26.4012
PXE 3.6.0404 3.5.0805
UEFI 14.24.0015 14.19.0017
Status: Up to date
Log File: /tmp/MLNX_OFED_LINUX.43198.logs/fw_update.log
Querying Mellanox devices firmware ...
Device #1:
----------
Device Type: ConnectX6
Part Number: MCX653105A-HDA_Ax
Description: ConnectX-6 VPI adapter card; HDR IB (200Gb/s) and 200GbE; single-port QSFP56; PCIe4.0 x16; tall bracket; ROHS R6
PSID: MT_0000000223
PCI Device Name: ce:00.0
Base GUID: b8cef60300025d00
Versions: Current Available
FW 20.31.2006 20.26.4012
PXE 3.6.0404 3.5.0805
UEFI 14.24.0015 14.19.0017
Status: Up to date
Log File: /tmp/MLNX_OFED_LINUX.43198.logs/fw_update.log
WARNING: Original /etc/infiniband/openib.conf saved as /etc/infiniband/openib.conf.rpmsave
To load the new driver, run:
/etc/init.d/openibd restart
[root@gpu-a100-4 MLNX_OFED_LINUX-4.7-3.2.9.0-rhel7.6-x86_64]# /etc/init.d/openibd restart
3、修改IB网络模式
查询 PCIEID,对应 200G 的
lspci | grep -i mellanox
切换为 IB 模式
mlxconfig -d PCIEID set LINK_TYPE_P1=1
重启,刷新配置
[root@gpu-a100-4 MLNX_OFED_LINUX-5.4-3.0.3.0-rhel7.6-x86_64]# lspci | grep -i mellanox
2e:00.0 Ethernet controller: Mellanox Technologies MT28908 Family [ConnectX-6]
a8:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
a8:00.1 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
ce:00.0 Ethernet controller: Mellanox Technologies MT28908 Family [ConnectX-6]
[root@gpu-a100-4 MLNX_OFED_LINUX-5.4-3.0.3.0-rhel7.6-x86_64]# mlxconfig -d 2e:00.0 set LINK_TYPE_P1=1
Device #1:
----------
Device type: ConnectX6
mlxconfig -d ce:00.0 set LINK_TYPE_P1=1Name: MCX653105A-HDA_Ax
Description: ConnectX-6 VPI adapter card; HDR IB (200Gb/s) and 200GbE; single-port QSFP56; PCIe4.0 x16; tall bracket; ROHS R6
Device: 2e:00.0
Configurations: Next Boot New
LINK_TYPE_P1 ETH(2) IB(1)
Apply new Configuration? (y/n) [n] : y
-E- Aborted by user.
[root@gpu-a100-4 MLNX_OFED_LINUX-5.4-3.0.3.0-rhel7.6-x86_64]# mlxconfig -d ce:00.0 set LINK_TYPE_P1=1
Device #1:
----------
Device type: ConnectX6
Name: MCX653105A-HDA_Ax
Description: ConnectX-6 VPI adapter card; HDR IB (200Gb/s) and 200GbE; single-port QSFP56; PCIe4.0 x16; tall bracket; ROHS R6
Device: ce:00.0
Configurations: Next Boot New
LINK_TYPE_P1 ETH(2) IB(1)
Apply new Configuration? (y/n) [n] : y
Applying... Done!
-I- Please reboot machine to load new configurations.
[root@gpu-a100-4 MLNX_OFED_LINUX-5.4-3.0.3.0-rhel7.6-x86_64]# lspci | grep -i mellanox
2e:00.0 Ethernet controller: Mellanox Technologies MT28908 Family [ConnectX-6]
a8:00.0 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
a8:00.1 Ethernet controller: Mellanox Technologies MT27710 Family [ConnectX-4 Lx]
ce:00.0 Ethernet controller: Mellanox Technologies MT28908 Family [ConnectX-6]
[root@gpu-a100-4 MLNX_OFED_LINUX-5.4-3.0.3.0-rhel7.6-x86_64]# mlxconfig -d 2e:00.0 set LINK_TYPE_P1=1
Device #1:
----------
Device type: ConnectX6
Name: MCX653105A-HDA_Ax
Description: ConnectX-6 VPI adapter card; HDR IB (200Gb/s) and 200GbE; single-port QSFP56; PCIe4.0 x16; tall bracket; ROHS R6
Device: 2e:00.0
Configurations: Next Boot New
LINK_TYPE_P1 ETH(2) IB(1)
Apply new Configuration? (y/n) [n] : y
Applying... Done!
-I- Please reboot machine to load new configurations.
4、测试
博客介绍了IB驱动及IB交换机模式切换的相关内容,包括GPU驱动安装,需注意A100等nvlink版本GPU要安装额外驱动包;IB驱动安装,给出下载链接及安装步骤;还说明了修改IB网络模式,如查询PCIEID、切换为IB模式及重启刷新配置,最后提及测试。
6065

被折叠的 条评论
为什么被折叠?



