# 运行时错误：NCCL错误：版本不匹配，期望2.18.5但得到2.19.1

- **ID:** `cuda/nccl-version-mismatch`
- **领域:** cuda
- **类别:** config_error
- **错误码:** `ncclSystemError`
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

运行时使用的NCCL库版本与PyTorch期望的版本不同，通常是由于多个NCCL安装或LD_LIBRARY_PATH错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| NCCL 2.18.5 | active | — | — |
| NCCL 2.19.1 | active | — | — |
| PyTorch 2.1.0 | active | — | — |

## 解决方案

1. ```
   Set the environment variable `LD_LIBRARY_PATH` to point to the correct NCCL installation. For example: `export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/nccl:$LD_LIBRARY_PATH`. Alternatively, use `conda install -c conda-forge nccl` to ensure consistency.
   ```

## 无效尝试

- **** — Debugging does not resolve binary incompatibility. (95% 失败率)
- **** — PyTorch bundles its own NCCL, but system paths can override it. (70% 失败率)
