Accelerated Networking with H-series VMs on Azure for older OS distributions

Published Mar 12 2021 08:32 AM 1,396 Views
Microsoft

The accelerated networking update for the HPC SKUs on Azure has caused problems for older OS distributions or any MPI versions that do not use the latest UCX. This is due to inconsistent naming for the IB devices. My recent patch to rdma-core can be used to provide consistent naming with udev rules. This following script can be used when building an image:

 

yum install -y cmake libnl3-devel
git clone https://github.com/linux-rdma/rdma-core.git
cd rdma-core
bash build.sh
cp build/bin/rdma_rename /usr/lib/udev/
cat <<EOF >/etc/udev/rules.d/60-ib.rules
# Accelnet board
ACTION=="add", ATTR{board_id}=="MSF0010110035", SUBSYSTEM=="infiniband", PROGRAM="rdma_rename %k NAME_FIXED mlx5_an0"
# HBv2 board
ACTION=="add", ATTR{board_id}=="MT_0000000223", SUBSYSTEM=="infiniband", PROGRAM="rdma_rename %k NAME_FIXED mlx5_ib0"
# HC board
ACTION=="add", ATTR{board_id}=="MT_0000000010", SUBSYSTEM=="infiniband", PROGRAM="rdma_rename %k NAME_FIXED mlx5_ib0"
EOF

This will name the accelerated networking mlx5_an0 and the infiniband to mlx5_ib0. Now, you can use the older MPI/UCX versions by setting:

 

export UCX_NET_DEVICES=mlx5_ib0:1

The script includes rules that will work for HB, HC, HBv2 and NDv2.

%3CLINGO-SUB%20id%3D%22lingo-sub-2205464%22%20slang%3D%22en-US%22%3EAccelerated%20Networking%20with%20H-series%20VMs%20on%20Azure%20for%20older%20OS%20distributions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205464%22%20slang%3D%22en-US%22%3E%3CDIV%3E%0A%3CP%3EThe%20%3CA%20tabindex%3D%22-1%22%20title%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-compute%2Faccelerated-networking-on-hb-hc-hbv2-and-ndv2%2Fba-p%2F2067965%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-compute%2Faccelerated-networking-on-hb-hc-hbv2-and-ndv2%2Fba-p%2F2067965%22%20target%3D%22_blank%22%3Eaccelerated%20networking%3C%2FA%3E%20update%20for%20the%20HPC%20SKUs%20on%20Azure%20has%20caused%20problems%20for%20older%20OS%20distributions%20or%20any%20MPI%20versions%20that%20do%20not%20use%20the%20latest%20UCX.%20This%20is%20due%20to%20inconsistent%20naming%20for%20the%20IB%20devices.%20My%20recent%20%3CA%20tabindex%3D%22-1%22%20title%3D%22https%3A%2F%2Fgithub.com%2Flinux-rdma%2Frdma-core%2Fpull%2F937%22%20href%3D%22https%3A%2F%2Fgithub.com%2Flinux-rdma%2Frdma-core%2Fpull%2F937%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%22%3Epatch%20to%20rdma-core%20%3C%2FA%3Ecan%20be%20used%20to%20provide%20consistent%20naming%20with%20udev%20rules.%20This%20following%20script%20can%20be%20used%20when%20building%20an%20image%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3Eyum%20install%20-y%20cmake%20libnl3-devel%0Agit%20clone%20%3CA%20tabindex%3D%22-1%22%20title%3D%22https%3A%2F%2Fgithub.com%2Flinux-rdma%2Frdma-core.git%22%20href%3D%22https%3A%2F%2Fgithub.com%2Flinux-rdma%2Frdma-core.git%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%22%3Ehttps%3A%2F%2Fgithub.com%2Flinux-rdma%2Frdma-core.git%3C%2FA%3E%0Acd%20rdma-core%0Abash%20build.sh%0Acp%20build%2Fbin%2Frdma_rename%20%2Fusr%2Flib%2Fudev%2F%0Acat%20%26lt%3B%26lt%3BEOF%20%26gt%3B%2Fetc%2Fudev%2Frules.d%2F60-ib.rules%0A%23%20Accelnet%20board%0AACTION%3D%3D%22add%22%2C%20ATTR%7Bboard_id%7D%3D%3D%22MSF0010110035%22%2C%20SUBSYSTEM%3D%3D%22infiniband%22%2C%20PROGRAM%3D%22rdma_rename%20%25k%20NAME_FIXED%20mlx5_an0%22%0A%23%20HBv2%20board%0AACTION%3D%3D%22add%22%2C%20ATTR%7Bboard_id%7D%3D%3D%22MT_0000000223%22%2C%20SUBSYSTEM%3D%3D%22infiniband%22%2C%20PROGRAM%3D%22rdma_rename%20%25k%20NAME_FIXED%20mlx5_ib0%22%0A%23%20HC%20board%0AACTION%3D%3D%22add%22%2C%20ATTR%7Bboard_id%7D%3D%3D%22MT_0000000010%22%2C%20SUBSYSTEM%3D%3D%22infiniband%22%2C%20PROGRAM%3D%22rdma_rename%20%25k%20NAME_FIXED%20mlx5_ib0%22%0AEOF%3C%2FPRE%3E%0A%3CP%3EThis%20will%20name%20the%20accelerated%20networking%20mlx5_an0%20and%20the%20infiniband%20to%20mlx5_ib0.%20Now%2C%20you%20can%20use%20the%20older%20MPI%2FUCX%20versions%20by%20setting%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3Eexport%20UCX_NET_DEVICES%3Dmlx5_ib0%3A1%3C%2FPRE%3E%0A%3CP%3EThe%20script%20includes%20rules%20that%20will%20work%20for%20HB%2C%20HC%2C%20HBv2%20and%20NDv2.%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2205464%22%20slang%3D%22en-US%22%3E%3CDIV%3EA%20workaround%20is%20provided%20for%20using%20older%20OS%20distributions%20or%20MPI%20versions%20relying%20on%20older%20UCX%20versions.%3C%2FDIV%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2205464%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHPC%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Mar 12 2021 08:40 AM
Updated by: