You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在MPI中禁用RDMA,仅通过TCP接口运行程序?

禁用RDMA,仅通过TCP运行MPI程序的方法

问题重现

我们有两台MPI互联节点,配备ib0(InfiniBand)、eth10(以太网)和lo接口。此前通过RDMA运行MPI的命令为:

mpirun --allow-run-as-root --host host1,host2 --mca btl openib,self,vader --mca btl_openib_allow_ib true --mca btl_openib_if_include mlx4_0:1 ~/hellompi

尝试切换到TCP模式时使用命令:

mpirun --allow-run-as-root --host host1,host2 --mca btl "^openib" ~/hellompi

出现连接错误:

WARNING: Open MPI failed to TCP connect to a peer MPI process. This
should not happen.

Your Open MPI job may now hang or fail.

Local host: h2
PID: 3219
Message: connect() to 12.12.12.3:1024 failed
Error: Operation now in progress (115)

已知eth10接口对应IP为12.12.12.2和12.12.12.3,添加--mca btl_tcp_if_include eth10后仍报错。

解决方案

  • 显式指定非RDMA的BTL模块:不要用排除法,直接指定启用tcp,self,vader模块,同时限定TCP接口:
    mpirun --allow-run-as-root --host host1,host2 --mca btl tcp,self,vader --mca btl_tcp_if_include eth10 ~/hellompi
    
  • 检查基础网络连通性:
    • 在两节点上互相ping对方eth10的IP,确认网络链路正常;
    • 检查防火墙/安全组规则,确保MPI动态端口(或指定端口)未被阻断。
  • 修正主机名映射:确保host1和host2在两台节点的/etc/hosts中均指向eth10对应的IP,避免MPI解析到其他接口地址。
  • 同步OOB通信接口:如果仍有问题,强制MPI的带外通信也使用eth10:
    mpirun --allow-run-as-root --host host1,host2 --mca btl tcp,self,vader --mca btl_tcp_if_include eth10 --mca oob_tcp_if_include eth10 ~/hellompi
    

内容的提问来源于stack exchange,提问作者Ilya Timokhin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 01:10:35