Install torchaudio and torchvison from wheel

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_May__4_00:02:26_PDT_2022
Cuda compilation tools, release 11.4, V11.4.239
Build cuda_11.4.r11.4/compiler.31294910_0

cat /etc/nv_tegra_release

R35 (release), REVISION: 1.0, GCID: 31346300, BOARD: t186ref, EABI: aarch64, DATE: Thu Aug 25 18:41:45 UTC 2022

pip3 install torchaudio==0.12.0 torchvision-0.13.0-cp38-cp38-manylinux2014_aarch64.whl
Collecting torchaudio==0.12.0
Using cached torchaudio-0.12.0-cp38-cp38-manylinux2014_aarch64.whl (3.3 MB)
Requirement already satisfied: torchvision==0.13.0 from file:///home/nvidia/torchvision-0.13.0-cp38-cp38-manylinux2014_aarch64.whl in ./.local/lib/python3.8/site-packages/torchvision-0.13.0-py3.8-linux-aarch64.egg (0.13.0)
Requirement already satisfied: torch in ./.local/lib/python3.8/site-packages (from torchaudio==0.12.0) (1.12.0a0+2c916ef.nv22.3)
Requirement already satisfied: numpy in ./.local/lib/python3.8/site-packages (from torchvision==0.13.0) (1.23.4)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in ./.local/lib/python3.8/site-packages (from torchvision==0.13.0) (9.3.0)
Requirement already satisfied: requests in ./.local/lib/python3.8/site-packages (from torchvision==0.13.0) (2.28.1)
Requirement already satisfied: typing_extensions in ./.local/lib/python3.8/site-packages (from torchvision==0.13.0) (4.4.0)
Requirement already satisfied: charset-normalizer<3,>=2 in ./.local/lib/python3.8/site-packages (from requests->torchvision==0.13.0) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests->torchvision==0.13.0) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->torchvision==0.13.0) (2019.11.28)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.local/lib/python3.8/site-packages (from requests->torchvision==0.13.0) (1.26.12)
Installing collected packages: torchaudio
Successfully installed torchaudio-0.12.0
nvidia@nvidia-desktop:~$ python3
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import torchaudio
Traceback (most recent call last):
File “”, line 1, in
File “/home/nvidia/.local/lib/python3.8/site-packages/torchaudio/init.py”, line 1, in
from torchaudio import ( # noqa: F401
File “/home/nvidia/.local/lib/python3.8/site-packages/torchaudio/_extension.py”, line 103, in
_init_extension()
File “/home/nvidia/.local/lib/python3.8/site-packages/torchaudio/_extension.py”, line 88, in _init_extension
_load_lib(“libtorchaudio”)
File “/home/nvidia/.local/lib/python3.8/site-packages/torchaudio/_extension.py”, line 51, in _load_lib
torch.ops.load_library(path)
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/_ops.py”, line 244, 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/nvidia/.local/lib/python3.8/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv
I don’t use the Docker tool, so I hope the official can provide solutions. Most people are not used to using Docker

Hi @father, I think you may need to build/install torchaudio from source rather from the PyPi wheel. Even if you aren’t using Docker, you can follow along with the same commands that I run to compile torchaudio here:

https://github.com/dusty-nv/jetson-containers/blob/eb2307d40f0884d66310e9ac34633a4c5ef2e083/Dockerfile.pytorch#L130

  • Added CUDA NVCC flags for: -gencode;arch=compute_87,code=sm_87
    error: pathspec ‘.’ did not match any file(s) known to git
    – Configuring done
    CMake Error at third_party/kaldi/CMakeLists.txt:30 (add_library):
    Cannot find source file:

    submodule/src/base/kaldi-error.cc

    Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
    .hpp .hxx .in .txx

CMake Error at third_party/kenlm/CMakeLists.txt:45 (add_library):
Cannot find source file:

submodule/util/bit_packing.cc

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx

CMake Error at third_party/kaldi/CMakeLists.txt:30 (add_library):
No SOURCES given to target: kaldi

CMake Error at third_party/kenlm/CMakeLists.txt:45 (add_library):

Did you git clone torchaudio with the --recursive flag? It looks like it’s missing submodules from the repo.

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