Building on Jetson

1. Install JetPack

JetPack includes the collection of CUDA-related libraries that is required to run PyTorch with CUDA.

Please refer to for the up-to-date instruction.

sudo bash -c 'echo "deb r34.1 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list'
sudo bash -c 'echo "deb r34.1 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list'

sudo apt update
sudo apt dist-upgrade


sudo apt install nvidia-jetpack

Checking the versions

To check the version installed you can use the following commands;

# JetPack
$ apt list --installed | grep nvidia-jetpack

nvidia-jetpack-dev/stable,now 5.0.1-b118 arm64 [installed,automatic]
nvidia-jetpack-runtime/stable,now 5.0.1-b118 arm64 [installed,automatic]
nvidia-jetpack/stable,now 5.0.1-b118 arm64 [installed]

$ apt list --installed | grep cuda-toolkit

cuda-toolkit-11-4-config-common/stable,now 11.4.243-1 all [installed,automatic]
cuda-toolkit-11-4/stable,now 11.4.14-1 arm64 [installed,automatic]
cuda-toolkit-11-config-common/stable,now 11.4.243-1 all [installed,automatic]
cuda-toolkit-config-common/stable,now 11.4.243-1 all [installed,automatic]

# cuDNN
$ apt list --installed | grep cudnn

libcudnn8-dev/stable,now arm64 [installed,automatic]
libcudnn8-samples/stable,now arm64 [installed,automatic]
libcudnn8/stable,now arm64 [installed,automatic]
nvidia-cudnn8-dev/stable,now 5.0.1-b118 arm64 [installed,automatic]
nvidia-cudnn8-runtime/stable,now 5.0.1-b118 arm64 [installed,automatic]

2. [Optional] Install jtop

Since Tegra GPUs are not supported by nvidia-smi command, it is recommended to isntall jtop.

Only super-use can install jtop. So make sure to add -U, so that running jtop won’t require super-user priviledge.

3. Install pip in user env

By default, pip / pip3 commands use the ones from system directory /usr/bin/, and its site-packages directory is protected and cannot be modified without sudo.

One way to workaround this is to install pip in user directory.

python --user

After this verify that pip command is pointing the one in user directory.

$ which pip

4. Install PyTorch

As of PyTorch 1.13 and torchaudio 0.13, there is no official pre-built binaries for Linux ARM64. Nidia provides custom pre-built binaries for PyTorch, which works with specific JetPack.

Please refer to for up-to-date instruction on how to install PyTorch.

$ package=torch-1.13.0a0+340c4120.nv22.06-cp38-cp38-linux_aarch64.whl
$ wget "${package}"
$ pip install --no-cache "${package}"

Verify the installation by checking the version and CUDA device accessibility.

$ python -c '

import torch
print(torch.empty((1, 2), device=torch.device("cuda")))
tensor([[0., 0.]], device='cuda:0')

5. Build TorchAudio

1. Install build tools

pip install cmake ninja

2. Install dependencies

sudo apt install ffmpeg libavformat-dev libavcodec-dev libavutil-dev libavdevice-dev libavfilter-dev

3. Build TorchAudio

git clone
cd audio
USE_CUDA=1 pip install -v -e . --no-use-pep517

4. Check the installation

import torchaudio


--prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources