pytorch - ✅(Solved) Fix ImportError: /usr/local/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclAlltoAll [1 pull requests, 5 comments, 5 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#176829Fetched 2026-04-08 00:24:16
View on GitHub
Comments
5
Participants
5
Timeline
63
Reactions
0
Timeline (top)
mentioned ×21subscribed ×21labeled ×7commented ×5

Error Message

ImportError: /usr/local/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclAlltoAll

Fix Action

Fixed

PR fix notes

PR #176904: [BE] Add in-place collect_env execution

Description (problem / solution / changelog)

Stack from ghstack (oldest at bottom):

  • -> #176904

First of all, fewer systems now how wget installed by default, but almost all Linux/MacOS comes with curl

If script with such name already exists, wget will download it with .${NUM} suffixed alias, which results in reporter posting results from something else, for example see https://github.com/pytorch/pytorch/issues/176829

wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
python collect_env.py
--2026-03-08 23:35:37--  https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8001::154, 2606:50c0:8003::154, 2606:50c0:8000::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31107 (30K) [text/plain]
Saving to: ‘collect_env.py.1’

collect_env.py.1            100%[==========================================>]  30.38K  --.-KB/s    in 0.04s

2026-03-08 23:35:38 (707 KB/s) - ‘collect_env.py.1’ saved [31107/31107]

Traceback (most recent call last):
  File "/mnt/d/my/work/study/ai/kaggle_code/aimo2/collect_env.py", line 15, in <module>

Changed files

  • .github/ISSUE_TEMPLATE/bug-report.yml (modified, +5/-1)
  • .github/ISSUE_TEMPLATE/pt2-bug-report.yml (modified, +4/-0)

Code Example

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130

---

ImportError: /usr/local/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclAlltoAll

---

wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
--2026-03-08 23:35:37--  https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8001::154, 2606:50c0:8003::154, 2606:50c0:8000::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31107 (30K) [text/plain]
Saving to: ‘collect_env.py.1
collect_env.py.1            100%[==========================================>]  30.38K  --.-KB/s    in 0.04s   

2026-03-08 23:35:38 (707 KB/s) - ‘collect_env.py.1’ saved [31107/31107]

Traceback (most recent call last):
  File "/mnt/d/my/work/study/ai/kaggle_code/aimo2/collect_env.py", line 15, in <module>
    from vllm.envs import environment_variables
  File "/usr/local/lib/python3.12/site-packages/vllm/__init__.py", line 14, in <module>
    import vllm.env_override  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/vllm/env_override.py", line 87, in <module>
    import torch
  File "/usr/local/lib/python3.12/site-packages/torch/__init__.py", line 431, in <module>
    from torch._C import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^
ImportError: /usr/local/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclAlltoAll
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130

Official source. The Alibaba source does not have this problem. then get error

ImportError: /usr/local/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclAlltoAll

The same command didn't have this problem earlier, but there were the following incompatibility issues. However, the latest same link encountered this error. https://github.com/vllm-project/vllm/issues/36302

Versions

wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
--2026-03-08 23:35:37--  https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8001::154, 2606:50c0:8003::154, 2606:50c0:8000::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31107 (30K) [text/plain]
Saving to: ‘collect_env.py.1’

collect_env.py.1            100%[==========================================>]  30.38K  --.-KB/s    in 0.04s   

2026-03-08 23:35:38 (707 KB/s) - ‘collect_env.py.1’ saved [31107/31107]

Traceback (most recent call last):
  File "/mnt/d/my/work/study/ai/kaggle_code/aimo2/collect_env.py", line 15, in <module>
    from vllm.envs import environment_variables
  File "/usr/local/lib/python3.12/site-packages/vllm/__init__.py", line 14, in <module>
    import vllm.env_override  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/vllm/env_override.py", line 87, in <module>
    import torch
  File "/usr/local/lib/python3.12/site-packages/torch/__init__.py", line 431, in <module>
    from torch._C import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^
ImportError: /usr/local/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclAlltoAll

cc @ezyang @gchanan @kadeng @msaroufim @seemethere @malfet @atalman @tinglvv @nWEIdia @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta @dcci @aditvenk @xmfan

extent analysis

Fix Plan

1. Update PyTorch and Torchvision

Update PyTorch and torchvision to the latest version using pip. This might resolve the issue.

pip3 install --upgrade torch torchvision --index-url https://download.pytorch.org/whl/cu130

2. Check for Conflicting Packages

Run the collect_env.py script to check for any conflicting packages. If the script reports any issues, try to resolve them before proceeding.

wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
python collect_env.py

3. Remove Conflicting Packages

If the collect_env.py script reports any conflicting packages, try to remove them. For example, if it reports a conflict with vllm, try to uninstall it.

pip3 uninstall vllm

4. Reinstall PyTorch and Torchvision

After removing any conflicting packages, try reinstalling PyTorch and torchvision.

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130

Verification

To verify that the fix worked, try running the original command again.

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130

If the installation completes successfully, the issue should be resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - ✅(Solved) Fix ImportError: /usr/local/lib/python3.12/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclAlltoAll [1 pull requests, 5 comments, 5 participants]