-
Notifications
You must be signed in to change notification settings - Fork 566
Open
Labels
2.8 releasebugSomething isn't workingSomething isn't workinginstallPyTorch/XLA installation related issues.PyTorch/XLA installation related issues.
Description
🐛 Bug
I've been using torch_xla 2.7 without issues, but when I try to use torch_xla 2.8 I run into undefined symbol: _ZN3c104cuda10set_deviceEa
errors.
The corresponding c++filt demangled symbol name is c10::cuda::set_device(signed char)
To Reproduce
Steps to reproduce the behavior:
- Create a
repro.sh
containing:
#!/bin/sh
set -eu
# Using https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
for pyver in 3.11 3.12 3.13
do
python$pyver -m venv .venv-py$pyver
. .venv-py$pyver/bin/activate
test -d "$VIRTUAL_ENV"
uv pip install -q torch==2.8.0 'torch_xla[tpu]==2.8.0'
pyver_major=$(python -c 'import sys; print(sys.version_info[0])')
pyver_minor=$(python -c 'import sys; print(sys.version_info[1])')
LD_LIBRARY_PATH=$VIRTUAL_ENV/lib/python${pyver_major}.${pyver_minor}/site-packages/torch/lib ldd -r $VIRTUAL_ENV/lib/python${pyver_major}.${pyver_minor}/site-packages/_XLAC.cpython-${pyver_major}${pyver_minor}-x86_64-linux-gnu.so
python -c 'import torch_xla' || true
deactivate
done
- Run it as
$ ./repro.sh > /dev/null
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../.venv-py3.11/lib/python3.11/site-packages/torch_xla/__init__.py", line 20, in <module>
import _XLAC
ImportError: .../.venv-py3.11/lib/python3.11/site-packages/_XLAC.cpython-311-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda10set_deviceEa
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../.venv-py3.12/lib/python3.12/site-packages/torch_xla/__init__.py", line 20, in <module>
import _XLAC
ImportError: .../.venv-py3.12/lib/python3.12/site-packages/_XLAC.cpython-312-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda10set_deviceEa
Traceback (most recent call last):
File "<string>", line 1, in <module>
import torch_xla
File ".../.venv-py3.13/lib/python3.13/site-packages/torch_xla/__init__.py", line 20, in <module>
import _XLAC
ImportError: .../.venv-py3.13/lib/python3.13/site-packages/_XLAC.cpython-313-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda10set_deviceEa
Expected behavior
torch_xla
successfully imported without missing symbols errors
Environment
- Ubuntu 24.04 (includes Python 3.12)
- Additional Python versions from https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
- Reproducible on XLA backend [CPU/TPU]: both?
- torch_xla version: 2.8
Additional context
This happens no matter what Python version I use.
I also tried to use the torch_xla packages from https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/...
without success.
It seems that torch_xla packages were built against a pytorch binaries significantly different from the ones available from PyPi?
Metadata
Metadata
Assignees
Labels
2.8 releasebugSomething isn't workingSomething isn't workinginstallPyTorch/XLA installation related issues.PyTorch/XLA installation related issues.