Install torchaudio in Jetson Orin AGX with Pytorch

Hi ,

How do I install torchaudio inside my Jetson Orin AGX dev kit?

I have installed my pytorch from the below link.

I also tried installing torch and torchaudio from jp6/cu126 index . That too did not work. When I tried executing my application it resulted in:

import torch
File “/home/orin/miniconda3/envs/genai/lib/python3.10/site-packages/torch/init.py”, line 415, in from torch._C import *  # noqa: F403ImportError: libnccl.so.2: cannot open shared object file: No such file or directory. 

Please guide me where and how I can install a correct version of both.

*** Please note that this reply is generated by LLM automatically ***

Installing torchaudio on a Jetson Orin AGX dev kit can be a bit tricky, but I’ll guide you through the process.

Prerequisites:

  1. You have installed PyTorch from the NVIDIA Developer Jetson Download Center.
  2. You have a Jetson Orin AGX dev kit with JetPack 6.2/Jetson Linux 36.4.3 installed.

Installing torchaudio:

Since you’ve already installed PyTorch, you can install torchaudio using pip. However, you need to make sure you’re installing the correct version compatible with your PyTorch installation.

  1. Check your PyTorch version:
python -c "import torch; print(torch.__version__)"

This should output the version of PyTorch you installed (e.g., 1.12.1).

  1. Install torchaudio using pip:
pip3 install torchaudio --extra-index-url https://download.pytorch.org/whl/cu113

Here, we’re using the --extra-index-url flag to specify the PyTorch wheel repository, which contains the torchaudio package. The cu113 part specifies the CUDA version (11.3) compatible with your JetPack 6.2 installation.

Alternative installation method:

If the above method doesn’t work, you can try installing torchaudio from the PyTorch repository directly:

git clone https://github.com/pytorch/audio.git
cd audio
python setup.py install

This will clone the torchaudio repository and install it using the setup.py script.

Verify the installation:

After installing torchaudio, verify that it’s working correctly by running:

python -c "import torchaudio; print(torchaudio.__version__)"

This should output the version of torchaudio you just installed.

Comparison with other installation methods:

You mentioned trying to install torchaudio from jp6cu126 index. This is likely a custom repository or index, which might not be compatible with your PyTorch installation. The method I provided above uses the official PyTorch wheel repository, which ensures compatibility with your PyTorch version.

In summary, to install torchaudio on your Jetson Orin AGX dev kit, use the pip installation method with the --extra-index-url flag, specifying the PyTorch wheel repository and CUDA version compatible with your JetPack 6.2 installation.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi,

Please refer to below download center to get the latest torch and torchaudio

Thanks

I tried the fix provided here.

After installing the torch and torchaudio from the link,

I faced errors with libcudds and libnccl. The error with libcudds is fixed by installing.

File “/home/orin/miniconda3/envs/genai/lib/python3.10/site-packages/torch/init.py”, line 416, in
from torch._C import * # noqa: F403
ImportError: libnccl.so.2: cannot open shared object file: No such file or directory

Can someone help me fix the above error ?

sudo apt update
sudo apt install libnccl2 libnccl-dev

Or if you aren’t using nccl, edit this file and comment out the nccl line.

/home/orin/miniconda3/envs/genai/lib/python3.10/site-packages/torch/__init__.py
            #"nccl": "libnccl.so.*[0-9]",

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