问题现象描述
- 启动任务时,任务无法拉起。
- 任务执行时,突然中断或服务突然终止。
原因分析
NPU网络通信存在问题。
解决措施
- 查看防火墙是否关闭。
firewall-cmd –state
已关闭显示如下:
- 未关闭执行如下命令:
systemctl stop firewalld
检测卡状态。
for i in {0..7}; do hccn_tool -i $i -link -g ; done
- 显示up为正常
其他状态可以通过如下命令重启卡(-i 后面填写卡的ID)
npu-smi set -t reset -i {RankId} -c 0 -m 1
检测卡的IP是否配置。
for i in {0..7}; do hccn_tool -i $i -ip -g ; done
检测多节点的每个卡TLS开关是否一致。
for i in {0..7}; do hccn_tool -i $i -tls -g ; done | grep switch
- 所有机器的所有卡要么为1,要么为0。建议修改为0进行关闭
TLS关闭方法(-i 后面填写卡的ID)
hccn_tool -i {RankId} -tls -s enable 0
- 本机卡间通信检测。
- 进入任意目录创建一个 test.py文件
- 文件加入如下脚本:
import subprocess
ip_list = []
for i in range(8):
try:
cmd = ['hccn_tool', '-i', str(i), '-ip', '-g']
res = subprocess.run(cmd, capture_output=True, text=True, check=True)
res_str = res.stdout.strip()
if 'ipaddr' in res_str:
ip_list.append(res_str.split('\n')[0].split(':')[1])
except subprocess.CalledProcessError as e:
print(e)
for i in range(8):
for other_ip in ip_list:
try:
cmd = ['hccn_tool', '-i', str(i), '-ping', '-g', 'address', str(other_ip), 'pkt', '3']
res = subprocess.run(cmd, capture_output=True, text=True, check=True)
print(ip_list[i], '==>', res.stdout.strip())
except subprocess.CalledProcessError as e:
print(e)
print(f'========{ip_list[i]} is OK========')
print(f'========ALL is OK========')
- 在当前目录执行脚本
- python test.py
- 出现ALL is OK 代表本机所有卡通讯正常
- 检测无误后,重新执行AI任务。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。