libtorchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv
wolfviking0 opened this issue ยท 7 comments
๐ Describe the bug
Hi, I am facing an issue with torch audio, I am recently update my linux machine to use a more recent version of cuda.
I am currently using ubuntu 20.04.4 with cuda driver 510 (11.6) and cuda toolkit 11.6.
I am building my own version of torch / torch vision / torch audio for python 3.8
When testing torch audio always failed loading with this error :
>>> import torchvision
>>> torch.__version__
'1.12.0'
>>> torchvision.__version__
'0.13.0'
>>> import torchaudio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anthony.liot/.local/lib/python3.8/site-packages/torchaudio/__init__.py", line 1, in <module>
from torchaudio import ( # noqa: F401
File "/home/anthony.liot/.local/lib/python3.8/site-packages/torchaudio/_extension.py", line 103, in <module>
_init_extension()
File "/home/anthony.liot/.local/lib/python3.8/site-packages/torchaudio/_extension.py", line 88, in _init_extension
_load_lib("libtorchaudio")
File "/home/anthony.liot/.local/lib/python3.8/site-packages/torchaudio/_extension.py", line 51, in _load_lib
torch.ops.load_library(path)
File "/home/anthony.liot/.local/lib/python3.8/site-packages/torch/_ops.py", line 255, in load_library
ctypes.CDLL(path)
File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /home/anthony.liot/.local/lib/python3.8/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv
>>>
Versions
Here the current version I am using :
Ubuntu 20.04.4
Cuda driver 510 (11.6)
Cuda toolkit 11.6
torch 1.12.0
vision 0.13.0
audio 0.12.0
Here the config I am using when building torch:
export USE_ROCM=OFF
export USE_MPI=OFF
export USE_MKLDNN=OFF
export USE_FBGEMM=OFF
export USE_XNNPACK=OFF
export USE_DISTRIBUTED=ON
export USE_TENSORPIPE=ON
export USE_NATIVE_ARCH=ON
export USE_VULKAN=ON
export USE_VULKAN_SHADERC_RUNTIME=ON
export USE_VULKAN_WRAPPER=OFF
export USE_VULKAN_FP16_INFERENCE=ON
export USE_VULKAN_RELAXED_PRECISION=ON
export USE_TENSORRT=OFF
export BUILD_CAFFE2_MOBILE=OFF
export USE_GLOO=OFF
export USE_NCCL=ON
export BUILD_SHARED_LIBS=ON
export USE_CUDA=ON
export BUILD_PYTHON=ON
export BUILD_TEST=OFF
export USE_NUMPY=True
Here the config I am using when building audio:
BUILD_SOX=1 PYTORCH_VERSION=1.12.0
Hi @wolfviking0
If the build finished without any issue, then the error you are encountering suggests that the PyTorch you are using (linking at runtime) is different from the one you used for building. Perhaps you have the previous installation of torchaudio left in your environment?
@mthrok you right it's a good point but I uninstall all the python library related to torch, that what I think :)
But let me try to do a build from a docker container so I am sure I have nothing installed on it.
Unfortunately, after really cleaning everything and also trying to build from docker image I have the exact same issue :(
Would you be able to share the portion of Dockerfile?
Closing it due to lack of response. Feel free to reopen the issue.
getting same issue installing torchaudio==2.0.1 on top of existing torch==2.0.0
in an NGC container nvcr.io/nvidia/pytorch:23.05-py3
Sequence of actions to reproduce:
docker pull nvcr.io/nvidia/pytorch:23.05-py3
# run a container from the image above
# within the container, run:
pip install torchaudio==2.0.1
python -m 'torchaudio'
Error:
...
self._handle = _dlopen(self._name, mode)
OSError: ~/.local/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv
getting same issue installing torchaudio==2.0.1 on top of existing
torch==2.0.0
in an NGC container nvcr.io/nvidia/pytorch:23.05-py3
The error suggests that ABI is not compatible. Normally TorchAudio official distributions only works with PyTorch official distributions. Not sure how PyTorch is installed in NGC, but Nvidia might be doing custom installation from different commit than the one TorchAudio is compiled against.