Install torchaudio and torchvison from wheel

Hi everyone,

I am trying to setting up environment on Nvidia Jetson Xavier NX(developer kit), I have successfully make cuda, pytorch working since torch.cuda.is_available() is True. The problem occurs when I am trying to import torchaudio which I have already successfully installed and I think it is with the correct version 0.12.0 for torch 1.12.0

I have flashed my sd card for Nvidia Jetson Xavier NX, and it seems like I am able to collect the results from collect_env file.
Collecting environment information…
PyTorch version: 1.12.0a0+2c916ef.nv22.3
Is debug build: False
CUDA used to build PyTorch: 11.4
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (aarch64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.10.104-tegra-aarch64-with-glibc2.29
Is CUDA available: True
CUDA runtime version: 11.4.239
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/lib/aarch64-linux-gnu/libcudnn.so.8.4.1
/usr/lib/aarch64-linux-gnu/libcudnn_adv_infer.so.8.4.1
/usr/lib/aarch64-linux-gnu/libcudnn_adv_train.so.8.4.1
/usr/lib/aarch64-linux-gnu/libcudnn_cnn_infer.so.8.4.1
/usr/lib/aarch64-linux-gnu/libcudnn_cnn_train.so.8.4.1
/usr/lib/aarch64-linux-gnu/libcudnn_ops_infer.so.8.4.1
/usr/lib/aarch64-linux-gnu/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False

Versions of relevant libraries:
[pip3] numpy==1.17.4
[pip3] torch==1.12.0a0+2c916ef.nv22.3
[pip3] torchaudio==0.12.0
[pip3] torchvision==0.13.0
[conda] Could not collect

To make reproducing this problem easier, you can flash jetpack 5.0.2 rev1 by using Nvidia SDK manager.
download wheels
for pytorch 1.12.0: https://developer.download.nvidia.com/compute/redist/jp/v50/pytorch/torch-1.12.0a0+2c916ef.nv22.3-cp38-cp38-linux_aarch64.whl
for torchaudio 0.12.0: https://download.pytorch.org/whl/torchaudio-0.12.0-cp38-cp38-manylinux2014_aarch64.whl
for torchvision 0.13.0: https://download.pytorch.org/whl/torchvision-0.13.0-cp38-cp38-manylinux2014_aarch64.whl

After I type python3

import torch
torch.cuda.is_available()
True

import torchaudio
Traceback (most recent call last):
File “”, line 1, in
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/init.py”, line 1, in
from torchaudio import ( # noqa: F401
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/_extension.py”, line 103, in
_init_extension()
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/_extension.py”, line 88, in _init_extension
_load_lib(“libtorchaudio”)
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/_extension.py”, line 51, in _load_lib
torch.ops.load_library(path)
File “/home/yilinw/astrtd/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/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv

import torchvision
/home/yilinw/astrtd/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")

Please let me know if there is any suggestion. Thank you very much.

Sincerely,
Yilin Wang

Hi,

Could you please give our nv22.09 PyTorch package a try?
We got some similar issues before but upgrading to the latest nv22.09 seems to solve the issue.

Thanks.

Hi,

Thank you for your immediate response.

Are you suggesting https://developer.download.nvidia.cn/compute/redist/jp/v502/pytorch/1.13.0a0+d0d6b1f2.nv22.09 ?

Since it is torch 1.13, I am not able to fine torchaudio 0.13.0 and torchvision 0.14.0, should I still give it a try?

Sincerely,
Yilin Wang


I reinstall the pytorch with wheel downloaded from
https://developer.download.nvidia.com/compute/redist/jp/v502/pytorch/torch-1.13.0a0+d0d6b1f2.nv22.09-cp38-cp38-linux_aarch64.whl

(astrtd) yilinw@ubuntu:~/Downloads$ pip3 list | grep torch
torch 1.13.0a0+d0d6b1f2.nv22.9
torchaudio 0.12.1
torchvision 0.13.0
(astrtd) yilinw@ubuntu:~/Downloads$ 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 torch
import torchvision
/home/yilinw/astrtd/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")
import torchaudio
Traceback (most recent call last):
File “”, line 1, in
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/init.py”, line 1, in
from torchaudio import ( # noqa: F401
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/_extension.py”, line 103, in
_init_extension()
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/_extension.py”, line 88, in _init_extension
_load_lib(“libtorchaudio”)
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/_extension.py”, line 51, in _load_lib
torch.ops.load_library(path)
File “/home/yilinw/astrtd/lib/python3.8/site-packages/torch/_ops.py”, line 293, 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/yilinw/astrtd/lib/python3.8/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZNK5torch8autograd4Node4nameEv

Problem remains the same.

I’m trying to use torch 1.12 on Jetson Xavier NX with JetPack 5.0.2 and obtain de same error with torchvision 0.13 when I import it.

UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")

I’ve tried with torch 1.13, but there is not torchvision compatible version available (or I haven’t found it).

Hi @rroldan @yilinw, can you try using the l4t-pytorch container and let me know if you encounter the same issue? Those have PyTorch + torchvision + torchaudio pre-installed in them.

I was tired of working on those packages by myself, so I have already pulled the l4t-pytorch container, and the container works perfectly.

I was tired of working on those packages by myself, so I have already pulled the l4t-pytorch container, and the container works perfectly.

The problem of installing torchaudio, torchvision by myself still remains the same.

Hi,

Based on the sharing below, do you mind giving TorchVision v0.15.0 a try?

Thanks.

Hi,

Thank you for the suggestion, but I would like get more help in terms of installing torchaudio. Thank you.

Sincerely,
Yilin Wang

Hi. Finally, I could install it natively building from source. This method installs torchvision 0.15.0a0+6e203b4 and it works perfectly with torch 1.12.0a0+2c916ef.nv22.3 on a virtualenv or Conda environment with Python 3.8.

1 Like

Hi,

You can try our l4t-ml container which has both TorchVision and TorchAudio installed.

Thanks.

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