Skip to content

How to install on Jetson

Asankhaya Sharma edited this page Jan 23, 2025 · 1 revision

Tested on Ubuntu 20.04 Jetpack 5.02 CUDA 11.4 cuDNN 8.2.4.15 Torch 1.13 Torchvision 0.14.1

After booting in the device for the first time:

Clone the HUB from https://github.com/securade/hub

Install python3 venv

sudo apt install python3.8-venv

Install python3 dev

sudo apt install python3-dev

Install lapack/blas

sudo apt-get install gfortran libopenblas-dev liblapack-dev

Install ffmpeg

sudo apt-get install ffmpeg

Install CUDA Toolkit 11.4 for torch 1.13

sudo apt-get install cuda-11-4

Install cuDNN (see https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html). You will need to sign in with your Nvidia account to download.

The cuDNN version and CUDA version is specific to your Jetpack SDK

(e.g. https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.4/11.4_20210831/Ubuntu20_04-aarch64sbsa/libcudnn8_8.2.4.15-1+cuda11.4_arm64.deb)

Install the Pytorch version for the Jetpack on the device (see https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html).

(e.g. https://developer.download.nvidia.com/compute/redist/jp/v502/pytorch/torch-1.13.0a0+410ce96a.nv22.12-cp38-cp38-linux_aarch64.whl)

Torchvision will need to be built from source, clone https://github.com/pytorch/vision

And run python setup.py install

This should create a wheel that you can use (e.g. torchvision-0.14.1a0+5e8e2f1-cp38-cp38-linux_aarch64.whl).

Install openCV with CUDA support from source (see https://github.com/opencv/opencv-python#manual-builds).

sudo apt-get install libgtk2.0-dev and pkg-config

(see https://serverfault.com/questions/993576/debian-apt-install-build-essential-fails-because-of-unmet-dependencies if build fails)

Now, install the HUB in a virtual environment as usual.

Setup a virtual environment

python3 -m venv .venv

Activate the environment

source .venv/bin/activate

Update pip, wheel and setuptools if needed

pip install --upgrade pip wheel setuptools

Run pip install with requirements.txt

pip install -r requirements.txt

Clone this wiki locally