*** 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:
- 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.
- 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.
- 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
.
- 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:
- Add NVIDIA repository: Run the command
sudo apt-add-repository universe
to add the NVIDIA repository.
- Update package list: Run the command
sudo apt update
to update the package list.
- 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. ***