{
  "schema_version": "1.0",
  "id": "T-cc04fdd4b14c",
  "url": "https://gpuatlas.top/articles/T-cc04fdd4b14c/",
  "title": "多卡一直卡在 NCCL 初始化，应该从哪里查？",
  "summary": "NCCL初始化卡住先收集所有rank最早错误，再用最小通信定位绑定、网络或系统条件。",
  "language": "zh-Hans",
  "category": {
    "id": "c-04",
    "name": "多卡与多机",
    "url": "https://gpuatlas.top/categories/c-04/"
  },
  "topics": [
    {
      "id": "task-b96aecbcf0",
      "name": "多卡",
      "kind": "task",
      "description": "需要把模型拆到多张卡，还是各卡独立提供服务？查阅并行方式、通信初始化与利用率问题。",
      "url": "https://gpuatlas.top/topics/task-b96aecbcf0/"
    }
  ],
  "body_text": "NCCL初始化一直卡住，先不要同时尝试一串环境变量。某rank没有成功启动或先OOM，其他进程等在通信，看起来也像初始化失败，最早异常比主进程最后超时更关键。\n\n收集各rank日志，核对进程数、设备绑定与启动参数，确认是否都到同一阶段。模型下载、读盘、主存或加载失败先单独处理，不能把这些等待统一算通信慢。\n\n需要时临时启用NCCL_DEBUG=INFO，按文档选择更细子系统日志，避免海量无关输出掩盖第一条错误。调试结束恢复，不在高开销模式下比较性能，也不把延长超时当找到根因。\n\n单机缩到两卡最小通信，多机再核节点连接、实际网卡和进程发现地址。按框架支持测试，再查容器、系统共享资源、拓扑与软件组合，不反复加载完整大模型增加变量。\n\n最小通信通过后，先用简单的受支持模型确认加载与执行，再回到原模型和目标负载。记录最早错误、复现条件及唯一有效改动，调试日志在排障后恢复。若只是延长超时才不再立即报错，还要确认原请求确实完成，并检查后续请求能否正常运行，不能把等待更久当作修复。",
  "published_at": null,
  "modified_at": "2026-11-26T15:17:38.690397+00:00",
  "evidence": {
    "type": "documentation_and_conditional_estimates",
    "hardware_tested": false,
    "note": "资料解释与条件估算，非硬件实测。"
  },
  "sources": [
    {
      "id": "torch-distributed",
      "url": "https://docs.pytorch.org/docs/2.15/distributed.html",
      "retrieved_at": "2026-11-25T10:16:15.738480+00:00"
    },
    {
      "id": "vllm-troubleshooting",
      "url": "https://raw.githubusercontent.com/vllm-project/vllm/main/docs/usage/troubleshooting.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "nccl-troubleshooting",
      "url": "https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/troubleshooting.html",
      "retrieved_at": "2026-11-25T10:16:15.738480+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-cc04fdd4b14c/",
    "json": "https://gpuatlas.top/data/articles/T-cc04fdd4b14c.json",
    "markdown": "https://gpuatlas.top/data/articles/T-cc04fdd4b14c.md"
  }
}
