"Hello. I want to install torchaudio with PyTorch 2.0.0."

Package: nvidia-jetpack
Version: 5.0.2-b231

import torch
print(torch.version)
2.0.0+nv23.05
print(torch.cuda.is_available())
True

I’ve tried updating the version of CMake, but the installation is still not successful. When it does get installed, there are errors when importing. Can someone please help me?

Hi @suhyun01150, you can follow along with this script of how I build torchaudio in container, or you could try existing l4t-pytorch container for JetPack 5 that already has torchaudio installed.

If you still encounter errors, please post the terminal logs so we can take a deeper look - thanks!

I installed it successfully using the method you provided, and import torchaudio was also successful. However, when importing the library that torchaudio includes as a dependency, an error occurs because of cudnn.

from df.enhance import enhance, init_df, load_audio, save_audio
df_model, df_state, _ = init_df()
2024-07-26 16:34:12 | INFO | DF | Running on torch 2.0.0+nv23.05
2024-07-26 16:34:12 | INFO | DF | Running on host nvidia-desktop
fatal: not a git repository (or any of the parent directories): .git
2024-07-26 16:34:12 | INFO | DF | Loading model settings of DeepFilterNet3
2024-07-26 16:34:12 | INFO | DF | Using DeepFilterNet3 model at /home/nvidia/.cache/DeepFilterNet/DeepFilterNet3
2024-07-26 16:34:12 | INFO | DF | Initializing model deepfilternet3
Traceback (most recent call last):
File “”, line 1, in
File “/home/nvidia/.local/lib/python3.8/site-packages/df/enhance.py”, line 174, in init_df
model, epoch = load_model_cp(checkpoint_dir, df_state, epoch=epoch, mask_only=mask_only)
File “/home/nvidia/.local/lib/python3.8/site-packages/df/checkpoint.py”, line 32, in load_model
model = init_model(df_state, run_df=mask_only is False, train_mask=train_df_only is False)
File “/home/nvidia/.local/lib/python3.8/site-packages/df/model.py”, line 22, in init_model
model = getattr(import_module(“df.” + model), “init_model”)(*args, **kwargs)
File “/home/nvidia/.local/lib/python3.8/site-packages/df/deepfilternet3.py”, line 87, in init_model
return model.to(device=get_device())
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1145, in to
return self._apply(convert)
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 797, in _apply
module._apply(fn)
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 797, in _apply
module._apply(fn)
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 797, in _apply
module._apply(fn)
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/nn/modules/rnn.py”, line 202, in _apply
self._init_flat_weights()
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/nn/modules/rnn.py”, line 139, in _init_flat_weights
self.flatten_parameters()
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/nn/modules/rnn.py”, line 169, in flatten_parameters
not torch.backends.cudnn.is_acceptable(fw.data)):
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/backends/cudnn/init.py”, line 97, in is_acceptable
if not _init():
File “/home/nvidia/.local/lib/python3.8/site-packages/torch/backends/cudnn/init.py”, line 52, in _init
raise RuntimeError(f’{base_error_msg}’
RuntimeError: cuDNN version incompatibility: PyTorch was compiled against (8, 6, 0) but found runtime version (8, 4, 1). PyTorch already comes bundled with cuDNN. One option to resolving this error is to ensure PyTorch can find the bundled cuDNN.Looks like your LD_LIBRARY_PATH contains incompatible version of cudnnPlease either remove it from the path or install cudnn (8, 6, 0)

please help me…

Ah ok - JetPack 5.0.2 predates support of the PyTorch 2.0 wheels (which were built against JetPack 5.1 and cuDNN 8.6). I would recommend downgrading to an older version of PyTorch (v1.13 was the last for JP 5.0 from this thread), or to upgrade your version of JetPack to something more recent.

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