MellanoxInfiniband 安装&使用方法总结&问题解决

1,862 阅读1分钟

1. 基础知识

  1. RDMA技术详解(一):RDMA概述
  2. RDMA技术详解(二):RDMA Send Receive操作
  3. 深入浅出全面解析RDMA

#2. 安装指南

  1. 下载驱动,以Ubuntu18.04为例:

1640537144595.jpg 2. 检查PCIE 是否识别IB卡

lspci | grep -i Mellanox*
  1. 安装驱动
1. tar -zxvf MLNX_OFED_LINUX-5.5-1.0.3.2-ubuntu18.04-x86_64.tgz
2. cd MLNX_OFED_LINUX-5.5-1.0.3.2-ubuntu18.04-x86_64
3. sudo ./mlnxofedinstall --force
4. sudo /etc/init.d/openibd restart
5. sudo /etc/init.d/opensmd restart
  1. 检查IB状态
ibstat  // ib卡State为 active 并且 Link Layer 为: InfiniBand 则正常,如果Link Layer 为 Ethernet 模式,请见本文第三章节的FAQ
  1. 配置临时IP
sudo ifconfig ib0 11.1.1.15 up  //ib0为第一块IB卡, ip地址自己定义

6.测试读带宽

  • 前提: Server端和 Client 网络通常,ib卡已配置ip地址
  • mlx5 代表的iib卡的型号,具体型号根据请根据 ibstat 中显示的为准
  • ib_read_bw 是ib卡安装包自带的命令
  • 其他测试命令如下:
    • ib_atomic_bw ib_atomic_lat ib_read_bw ib_read_lat ib_send_bw ib_send_lat ib_write_bw ib_write_lat
1.ib_read_bw  //server 端执行
2.ib_read_bw -d mlx5_0 -a -F -i 1 11.1.1.15  // ip地址可以是网卡的ip地址,也可以是IB卡的 IP地址
3.等待结果输出

#3. RDMA 编程参考

  1. github.com/tarickb/the…
  2. github.com/jcxue/RDMA-…
  3. RDMA编程:事件通知机制
  4. RDMA read and write with IB verbs
  5. RDMA Aware Networks Programming User Manual

#4. FAQ

4.1切换IB卡模式为 InfiniBand

1. sudo mst start 
2. sudo mlxconfig  -y -d /dev/mst/mt4119_pciconf0 set LINK_TYPE_P1=1 
3. sudo reboot
3. ibstat  // 查看修改后的IB卡模式

4.2 查看IB 卡硬件型号信息

sudo mlxvpd -d mlx5_0  // -d  为 ib  hca_id, 可以通过ibstat中查看

4.3 NUMA 架构下IB卡带宽不稳定解决方法

// server 端执行
$ cat /sys/class/net/ib0/device/numa_node 
$ 3
$ numactl --cpunodebind=3 --membind=3  ib_read_bw -d mlx5_0

// client 端执行
$ cat /sys/class/net/ib0/device/numa_node 
$ 7
$ numactl --cpunodebind=7 --membind=7 ib_read_bw -a -F -d mlx5_0 10.0.0.1 --run_infinitely