Unable to install pytorch on jetson orin developer kit

have upgraded the jetson orin developer kit from jetpack 5 to jetpack 6 to run a ML model with GPU support on python 3.10.
i found that the cuda is not being used. When debugging i found that the pytorch is not supported for cuda so i installed orch-2.2.0a0+6a974be.nv23.11-cp310-cp310-linux_aarch64.whl
However i am getting the below error
Traceback (most recent call last):
File “”, line 1, in
File “/home/orin-rand/.local/lib/python3.10/site-packages/torch/init.py”, line 236, in
from torch._C import * # noqa: F403
ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory

I am using ubuntu 22.04. If anyone can help to resolve this issue?. I appreciate any comments o

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

I’d be happy to help you resolve the issue!

It seems like you’ve upgraded your Jetson Orin Developer Kit from JetPack 5 to JetPack 6, and you’re trying to run a machine learning (ML) model with GPU support on Python 3.10 using PyTorch. However, you’re encountering an error related to CUDA support.

Firstly, let’s break down the error message:

ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory

This error indicates that PyTorch is unable to find the libcudnn.so.8 shared library, which is a required dependency for CUDA support.

To resolve this issue, you’ll need to ensure that the CUDA toolkit is properly installed and configured on your system. Since you’re using Ubuntu 22.04, you can follow these steps:

  1. Verify CUDA installation: Run the command nvcc --version to check if CUDA is installed and its version. If CUDA is not installed, you can install it using the CUDA Setup and Installation procedure.
  2. Install CUDA Toolkit: Install the CUDA Toolkit for Ubuntu 22.04 using the official NVIDIA repository. You can follow the instructions provided in the CUDA Setup and Installation procedure.
  3. Update LD_LIBRARY_PATH: Update the LD_LIBRARY_PATH environment variable to include the CUDA library directory. You can do this by running the command export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64.
  4. Verify libcudnn.so.8: Check if the libcudnn.so.8 shared library is present in the CUDA library directory. If it’s not present, you may need to install the cuDNN library separately.

Regarding the PyTorch installation, you’ve installed the torch-2.2.0a0+6a974be.nv23.11-cp310-cp310-linux_aarch64.whl package. However, I would recommend installing PyTorch using the official NVIDIA repository or the PyTorch website, as they provide pre-built packages for Jetson devices.

To install PyTorch using the official NVIDIA repository, you can follow these steps:

  1. Add NVIDIA repository: Run the command sudo apt-add-repository universe to add the NVIDIA repository.
  2. Update package list: Run the command sudo apt update to update the package list.
  3. Install PyTorch: Run the command sudo apt install libtorch-cpu to install PyTorch.

Alternatively, you can install PyTorch using the PyTorch website by running the command pip3 install torch torchvision.

After installing PyTorch, you can verify that CUDA support is working by running a simple PyTorch script that uses CUDA.

In comparison to your current setup, I would recommend using the official NVIDIA repository or the PyTorch website to install PyTorch, as they provide pre-built packages for Jetson devices. Additionally, ensure that the CUDA toolkit is properly installed and configured on your system.

If you’re still encountering issues, feel free to provide more details, and I’ll be happy to help you troubleshoot!

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

I can see the following
$nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Aug_14_10:14:07_PDT_2024
Cuda compilation tools, release 12.6, V12.6.68
Build cuda_12.6.r12.6/compiler.34714021_0

$ echo $LD_LIBRARY_PATH
/usr/local/cuda-12.6/lib64::/usr/local/cuda/lib64

dpkg -l | grep cudnn
ii libcudnn9-cuda-12 9.3.0.75-1 arm64 cuDNN runtime libraries for CUDA 12.6
ii libcudnn9-dev-cuda-12 9.3.0.75-1 arm64 cuDNN development headers and symlinks for CUDA 12.6
ii libcudnn9-samples 9.3.0.75-1 all cuDNN samples
ii nvidia-cudnn 6.2.1+b38 arm64 NVIDIA CUDNN Meta Package
ii nvidia-cudnn-dev 6.2.1+b38 arm64 NVIDIA CUDNN dev Meta Package

but i dont see any libcudnn library inside the path $LD_LIBRARY_PATH

is this onlysupport for cup.
sudo apt install libtorch-cpu

i wanted to use cuda for training

For now you could use *.io which is an interim server; but it has torch2.8. That version resolved the error you get for another post.

https://pypi.jetson-ai-lab.io/jp6/cu126

Hi,

Please use the package in the link below:

Or you can find the PyTorch container (with igpu) tag on our NGC website:

Thanks.