在-x UCX_IB_GID_INDEX命令中指定GID后报错
现象描述
在-x UCX_IB_GID_INDEX命令中指定无效GID后报错:
ib_device.c:848 UCX ERROR ibv_query_gid(dev=mlx5_0 port=1 index=10) failed: No such file or directory
在-x UCX_IB_GID_INDEX命令中指定GID后报Destination is unreachable错误:
pml_ucx.c:384 Error: ucp_ep_create(proc=1) failed: Destination is unreachable
可能原因
- 命令行指定的GID与服务器GID不一致。
- 多台作业执行节点GID不一致。
恢复步骤
- 命令行指定的GID与服务器GID不一致。
- 使用PuTTY工具,以Hyper MPI普通用户,如“hmpi_user”登录作业执行节点。
- 执行以下命令,查询GID值。其中“mlx5_0”为网络设备名称,“1”为网络设备端口,请根据实际情况进行替换。
cd /sys/class/infiniband/mlx5_0/ports/1
grep -r 0000:0000:0000:0000:0000 gids/ | grep -v 0000:0000:0000:0000:0000:0000:0000:0000 | awk -F: '{print $1}' | awk -F/ '{print $2}' 2>/dev/null | xargs -i grep --with-filename -o "[Vv].*" "gid_attrs/types/"{}
gid_attrs/types/5:v2
“5”为查询到的GID值。
- 执行以下命令,指定GID值等于5。
- 多台作业执行节点GID不一致。
- 使用PuTTY工具,以Hyper MPI普通用户,如“hmpi_user”登录作业执行节点。
- 将已编辑好的“show-gids”脚本上传至作业执行节点根目录下。
“show-gids”脚本内容如下:
#!/bin/bash black='\E[30;50m' red='\E[31;50m' green='\E[32;50m' yellow='\E[33;50m' blue='\E[34;50m' magenta='\E[35;50m' cyan='\E[36;50m' white='\E[37;50m' bold='\033[1m' gid_count=0 # cecho (color echo) prints text in color. # first parameter should be the desired color followed by text function cecho () { echo -en $1 shift echo -n $* tput sgr0 } # becho (color echo) prints text in bold. becho () { echo -en $bold echo -n $* tput sgr0 } function print_gids() { dev=$1 port=$2 for gf in /sys/class/infiniband/$dev/ports/$port/gids/* ; do gid=$(cat $gf); if [ $gid = 0000:0000:0000:0000:0000:0000:0000:0000 ] ; then continue fi echo -e $(basename $gf) "\t" $gid done } echo -e "DEV\tPORT\tINDEX\tGID\t\t\t\t\tIPv4 \t\tVER\tDEV" echo -e "---\t----\t-----\t---\t\t\t\t\t------------ \t---\t---" DEVS=$1 if [ -z "$DEVS" ] ; then DEVS=$(ls /sys/class/infiniband/) fi for d in $DEVS ; do for p in $(ls /sys/class/infiniband/$d/ports/) ; do for g in $(ls /sys/class/infiniband/$d/ports/$p/gids/) ; do gid=$(cat /sys/class/infiniband/$d/ports/$p/gids/$g); if [ $gid = 0000:0000:0000:0000:0000:0000:0000:0000 ] ; then continue fi if [ $gid = fe80:0000:0000:0000:0000:0000:0000:0000 ] ; then continue fi _ndev=$(cat /sys/class/infiniband/$d/ports/$p/gid_attrs/ndevs/$g 2>/dev/null) __type=$(cat /sys/class/infiniband/$d/ports/$p/gid_attrs/types/$g 2>/dev/null) _type=$(echo $__type| grep -o "[Vv].*") if [ $(echo $gid | cut -d ":" -f -1) = "0000" ] ; then ipv4=$(printf "%d.%d.%d.%d" 0x${gid:30:2} 0x${gid:32:2} 0x${gid:35:2} 0x${gid:37:2}) echo -e "$d\t$p\t$g\t$gid\t$ipv4 \t$_type\t$_ndev" else echo -e "$d\t$p\t$g\t$gid\t\t\t$_type\t$_ndev" fi gid_count=$(expr 1 + $gid_count) done #g (gid) done #p (port) done #d (dev) echo n_gids_found=$gid_count
- 执行以下命令,修改“~/.bashrc”文件。
- 执行以下命令,使配置生效。
父主题: FAQ