Problems with torchaudio install in ubuntu 20 and python38

Use jetson nano
Flash the mirror GitHub - Qengineering/Jetson-Nano-Ubuntu-20-image: Jetson Nano with Ubuntu 20.04 image
And it already installed pytorch like below

cat /usr/local/lib/python3.8/dist-packages/torch/version.py
__version__ = '1.9.0a0+gitd69c22d'
debug = False
cuda = '10.2'
git_version = 'd69c22dd61a2f006dcfe1e3ea8468a3ecaf931aa'
hip = None

But it seems like I can use pytorch but torchaudio

error like below

Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torchaudio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jetson/.local/lib/python3.8/site-packages/torchaudio/__init__.py", line 1, in <module>
    from . import extension  # noqa: F401
  File "/home/jetson/.local/lib/python3.8/site-packages/torchaudio/extension/__init__.py", line 5, in <module>
    _init_extension()
  File "/home/jetson/.local/lib/python3.8/site-packages/torchaudio/extension/extension.py", line 11, in _init_extension
    _init_script_module(ext)
  File "/home/jetson/.local/lib/python3.8/site-packages/torchaudio/extension/extension.py", line 19, in _init_script_module
    torch.classes.load_library(path)
  File "/usr/local/lib/python3.8/dist-packages/torch/_classes.py", line 46, in load_library
    torch.ops.load_library(path)
  File "/usr/local/lib/python3.8/dist-packages/torch/_ops.py", line 104, 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/jetson/.local/lib/python3.8/site-packages/torchaudio/_torchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv

and after some search, found that


and it seems I need to install torchaudio==0.9.0

I installed that by

pip install torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

But finally the problem still exits, I could not import torchaudio

OSError: /home/jetson/.local/lib/python3.8/site-packages/torchaudio/_torchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv

I want to train something with speechbrain, so I have to use py38 with pytorch and torchaudio

struggled here for several days, also turn to compile the torchaudio0.9.0 but still also failed.

FAILED: third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o

anyone have idea to help me out?
Thanks a lot!

Hi,

Would you mind trying torchaudio==0.9.1?
Based on the following link, it’s possible that the installed PyTorch is version 1.9.1 rather than 1.9.0.

Thanks.

I first try to install with pip and said no version here

 pip install torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Looking in links: https://download.pytorch.org/whl/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torchaudio==0.9.1 (from versions: 0.9.0, 0.10.0, 0.10.1, 0.10.2)
ERROR: No matching distribution found for torchaudio==0.9.1

And then I just tried 0.10.0, still not solved, but the error type seems different

    self._handle = _dlopen(self._name, mode)
OSError: /home/jetson/.local/lib/python3.8/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv

the error file is libtorchaudio

Then I turn to compimiling 0.9.1 with source code
I cloned the code from github
Uploading: image.png…
I checked out to 0.9.1 like above.
And when run the build cmd
got error

-- Build files have been written to: /home/jetson/audio/build/temp.linux-aarch64-3.8
[1/14] /usr/bin/c++  -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -I../../third_party/kaldi/src -I../../third_party/kaldi/submodule/src -isystem ../../venv/lib/python3.8/site-packages/torch/include -isystem ../../venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -Wall -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -O3 -DNDEBUG -fPIC   -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++14 -MD -MT third_party/kaldi/CMakeFiles/kaldi.dir/submodule/src/base/kaldi-math.cc.o -MF third_party/kaldi/CMakeFiles/kaldi.dir/submodule/src/base/kaldi-math.cc.o.d -o third_party/kaldi/CMakeFiles/kaldi.dir/submodule/src/base/kaldi-math.cc.o -c ../../third_party/kaldi/submodule/src/base/kaldi-math.cc
[2/14] /usr/bin/c++  -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -I../../third_party/kaldi/src -I../../third_party/kaldi/submodule/src -isystem ../../venv/lib/python3.8/site-packages/torch/include -isystem ../../venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -Wall -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -O3 -DNDEBUG -fPIC   -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++14 -MD -MT third_party/kaldi/CMakeFiles/kaldi.dir/submodule/src/base/kaldi-error.cc.o -MF third_party/kaldi/CMakeFiles/kaldi.dir/submodule/src/base/kaldi-error.cc.o.d -o third_party/kaldi/CMakeFiles/kaldi.dir/submodule/src/base/kaldi-error.cc.o -c ../../third_party/kaldi/submodule/src/base/kaldi-error.cc
[3/14] /usr/bin/c++  -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -I../../third_party/kaldi/src -I../../third_party/kaldi/submodule/src -isystem ../../venv/lib/python3.8/site-packages/torch/include -isystem ../../venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -Wall -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -O3 -DNDEBUG -fPIC   -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++14 -MD -MT third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o -MF third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o.d -o third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o -c ../../third_party/kaldi/src/matrix/kaldi-matrix.cc
FAILED: third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o 
/usr/bin/c++  -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -I../../third_party/kaldi/src -I../../third_party/kaldi/submodule/src -isystem ../../venv/lib/python3.8/site-packages/torch/include -isystem ../../venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -Wall -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -O3 -DNDEBUG -fPIC   -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++14 -MD -MT third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o -MF third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o.d -o third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-matrix.cc.o -c ../../third_party/kaldi/src/matrix/kaldi-matrix.cc
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[4/14] /usr/bin/c++  -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -I../../third_party/kaldi/src -I../../third_party/kaldi/submodule/src -isystem ../../venv/lib/python3.8/site-packages/torch/include -isystem ../../venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -Wall -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -O3 -DNDEBUG -fPIC   -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++14 -MD -MT third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-vector.cc.o -MF third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-vector.cc.o.d -o third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-vector.cc.o -c ../../third_party/kaldi/src/matrix/kaldi-vector.cc
FAILED: third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-vector.cc.o 
/usr/bin/c++  -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -I../../third_party/kaldi/src -I../../third_party/kaldi/submodule/src -isystem ../../venv/lib/python3.8/site-packages/torch/include -isystem ../../venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -Wall -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility=hidden -O3 -DNDEBUG -fPIC   -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++14 -MD -MT third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-vector.cc.o -MF third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-vector.cc.o.d -o third_party/kaldi/CMakeFiles/kaldi.dir/src/matrix/kaldi-vector.cc.o -c ../../third_party/kaldi/src/matrix/kaldi-vector.cc
c++: fatal error: Killed signal terminated program cc1plus

I don’t know how to fix it, or any other way to install 0.9.1.
Thanks a lot!

Hi @yingxiaohao, killed typically means that your system ran out of memory - have you tried mounting swap?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.