Skip to content

Machine Learning Containers for NVIDIA Jetson and JetPack-L4T

License

Notifications You must be signed in to change notification settings

Tjayojo/jetson-containers

 
 

Repository files navigation

Machine Learning Containers for Jetson and JetPack

NVIDIA Docker PyTorch TensorFlow Jupyter Notebook ROS

This project provides Dockerfiles, build scripts, and container images for machine learning on NVIDIA Jetson:

The following ROS containers are also available, which can be pulled from DockerHub or built from source:

Distro Base Desktop PyTorch
ROS Melodic ros-base X X
ROS Noetic ros-base X PyTorch
ROS2 Foxy ros-base desktop PyTorch
ROS2 Galactic ros-base desktop PyTorch
ROS2 Humble ros-base desktop PyTorch
ROS2 Iron ros-base desktop PyTorch

The PyTorch-based ROS containers also have the jetson-inference and ros_deep_learning packages installed.

Pre-Built Container Images

The following images can be pulled from NGC or DockerHub without needing to build the containers yourself:

l4t-ml (nvcr.io/nvidia/l4t-ml:r35.2.1-py3)
L4T Version Container Tag
l4t-ml R35.2.1 nvcr.io/nvidia/l4t-ml:r35.2.1-py3
R35.1.0 nvcr.io/nvidia/l4t-ml:r35.1.0-py3
R34.1.1 nvcr.io/nvidia/l4t-ml:r34.1.1-py3
R34.1.0 nvcr.io/nvidia/l4t-ml:r34.1.0-py3
R32.7.1 nvcr.io/nvidia/l4t-ml:r32.7.1-py3
R32.6.1 nvcr.io/nvidia/l4t-ml:r32.6.1-py3
R32.5.0* nvcr.io/nvidia/l4t-ml:r32.5.0-py3
R32.4.4 nvcr.io/nvidia/l4t-ml:r32.4.4-py3
R32.4.3 nvcr.io/nvidia/l4t-ml:r32.4.3-py3
l4t-pytorch (nvcr.io/nvidia/l4t-pytorch:r35.2.1-pth2.0-py3)
L4T Version Container Tag
l4t-pytorch R35.2.1 nvcr.io/nvidia/l4t-pytorch:r35.2.1-pth2.0-py3
R35.1.0 nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.13-py3
R35.1.0 nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.12-py3
R35.1.0 nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.11-py3
R34.1.1 nvcr.io/nvidia/l4t-pytorch:r34.1.1-pth1.12-py3
R34.1.1 nvcr.io/nvidia/l4t-pytorch:r34.1.1-pth1.11-py3
R34.1.0 nvcr.io/nvidia/l4t-pytorch:r34.1.0-pth1.12-py3
R32.7.1 nvcr.io/nvidia/l4t-pytorch:r32.7.1-pth1.10-py3
R32.7.1 nvcr.io/nvidia/l4t-pytorch:r32.7.1-pth1.9-py3
R32.6.1 nvcr.io/nvidia/l4t-pytorch:r32.6.1-pth1.9-py3
R32.6.1 nvcr.io/nvidia/l4t-pytorch:r32.6.1-pth1.8-py3
R32.5.0* nvcr.io/nvidia/l4t-pytorch:r32.5.0-pth1.7-py3
R32.5.0* nvcr.io/nvidia/l4t-pytorch:r32.5.0-pth1.6-py3
R32.4.4 nvcr.io/nvidia/l4t-pytorch:r32.4.4-pth1.6-py3
R32.4.3 nvcr.io/nvidia/l4t-pytorch:r32.4.3-pth1.6-py3
l4t-tensorflow (nvcr.io/nvidia/l4t-tensorflow:r35.2.1-tf2.11-py3)
L4T Version Container Tag
l4t-tensorflow R35.2.1 nvcr.io/nvidia/l4t-tensorflow:r35.2.1-tf2.11-py3
R35.1.0 nvcr.io/nvidia/l4t-tensorflow:r35.1.0-tf1.15-py3
R35.1.0 nvcr.io/nvidia/l4t-tensorflow:r35.1.0-tf2.9-py3
R34.1.1 nvcr.io/nvidia/l4t-tensorflow:r34.1.1-tf1.15-py3
R34.1.1 nvcr.io/nvidia/l4t-tensorflow:r34.1.1-tf2.8-py3
R34.1.0 nvcr.io/nvidia/l4t-tensorflow:r34.1.0-tf1.15-py3
R34.1.0 nvcr.io/nvidia/l4t-tensorflow:r34.1.0-tf2.8-py3
R32.7.1 nvcr.io/nvidia/l4t-tensorflow:r32.7.1-tf1.15-py3
R32.7.1 nvcr.io/nvidia/l4t-tensorflow:r32.7.1-tf2.7-py3
R32.6.1 nvcr.io/nvidia/l4t-tensorflow:r32.6.1-tf1.15-py3
R32.6.1 nvcr.io/nvidia/l4t-tensorflow:r32.6.1-tf2.5-py3
R32.5.0* nvcr.io/nvidia/l4t-tensorflow:r32.5.0-tf1.15-py3
R32.5.0* nvcr.io/nvidia/l4t-tensorflow:r32.5.0-tf2.3-py3
R32.4.4 nvcr.io/nvidia/l4t-tensorflow:r32.4.4-tf1.15-py3
R32.4.4 nvcr.io/nvidia/l4t-tensorflow:r32.4.4-tf2.3-py3
R32.4.3 nvcr.io/nvidia/l4t-tensorflow:r32.4.3-tf1.15-py3
R32.4.3 nvcr.io/nvidia/l4t-tensorflow:r32.4.3-tf2.2-py3

ROS

ROS Melodic (dustynv/ros:melodic-ros-base-l4t-r32.7.1)
L4T Version Container Tag
ROS Melodic (ros-base) R32.7.1 dustynv/ros:melodic-ros-base-l4t-r32.7.1
R32.6.1 dustynv/ros:melodic-ros-base-l4t-r32.6.1
R32.5.0* dustynv/ros:melodic-ros-base-l4t-r32.5.0
R32.4.4 dustynv/ros:melodic-ros-base-l4t-r32.4.4
ROS Noetic (dustynv/ros:noetic-ros-base-l4t-r35.3.1)
L4T Version Container Tag
ROS Noetic (ros-base) R35.3.1 dustynv/ros:noetic-ros-base-l4t-r35.3.1
R35.2.1 dustynv/ros:noetic-ros-base-l4t-r35.2.1
R35.1.0 dustynv/ros:noetic-ros-base-l4t-r35.1.0
R34.1.1 dustynv/ros:noetic-ros-base-l4t-r34.1.1
R34.1.0 dustynv/ros:noetic-ros-base-l4t-r34.1.0
R32.7.1 dustynv/ros:noetic-ros-base-l4t-r32.7.1
R32.6.1 dustynv/ros:noetic-ros-base-l4t-r32.6.1
R32.5.0* dustynv/ros:noetic-ros-base-l4t-r32.5.0
R32.4.4 dustynv/ros:noetic-ros-base-l4t-r32.4.4
ROS Noetic (PyTorch) R35.3.1 dustynv/ros:noetic-pytorch-l4t-r35.3.1
R35.2.1 dustynv/ros:noetic-pytorch-l4t-r35.2.1
R35.1.0 dustynv/ros:noetic-pytorch-l4t-r35.1.0
R34.1.1 dustynv/ros:noetic-pytorch-l4t-r34.1.1
R34.1.0 dustynv/ros:noetic-pytorch-l4t-r34.1.0
R32.7.1 dustynv/ros:noetic-pytorch-l4t-r32.7.1
R32.6.1 dustynv/ros:noetic-pytorch-l4t-r32.6.1
R32.5.0* dustynv/ros:noetic-pytorch-l4t-r32.5.0
R32.4.4 dustynv/ros:noetic-pytorch-l4t-r32.4.4

ROS2

ROS2 Foxy (dustynv/ros:foxy-ros-base-l4t-r35.3.1)
L4T Version Container Tag
ROS2 Foxy (ros-base) R35.3.1 dustynv/ros:foxy-ros-base-l4t-r35.3.1
R35.2.1 dustynv/ros:foxy-ros-base-l4t-r35.2.1
R35.1.0 dustynv/ros:foxy-ros-base-l4t-r35.1.0
R34.1.1 dustynv/ros:foxy-ros-base-l4t-r34.1.1
R34.1.0 dustynv/ros:foxy-ros-base-l4t-r34.1.0
R32.7.1 dustynv/ros:foxy-ros-base-l4t-r32.7.1
R32.6.1 dustynv/ros:foxy-ros-base-l4t-r32.6.1
R32.5.0* dustynv/ros:foxy-ros-base-l4t-r32.5.0
R32.4.4 dustynv/ros:foxy-ros-base-l4t-r32.4.4
ROS2 Foxy (desktop) R35.3.1 dustynv/ros:foxy-desktop-l4t-r35.3.1
R35.1.0 dustynv/ros:foxy-desktop-l4t-r35.2.1
R35.1.0 dustynv/ros:foxy-desktop-l4t-r35.1.0
R34.1.1 dustynv/ros:foxy-desktop-l4t-r34.1.1
ROS2 Foxy (PyTorch) R35.3.1 dustynv/ros:foxy-pytorch-l4t-r35.3.1
R35.2.1 dustynv/ros:foxy-pytorch-l4t-r35.2.1
R35.1.0 dustynv/ros:foxy-pytorch-l4t-r35.1.0
R34.1.1 dustynv/ros:foxy-pytorch-l4t-r34.1.1
R34.1.0 dustynv/ros:foxy-pytorch-l4t-r34.1.0
R32.7.1 dustynv/ros:foxy-pytorch-l4t-r32.7.1
R32.6.1 dustynv/ros:foxy-pytorch-l4t-r32.6.1
R32.5.0* dustynv/ros:foxy-pytorch-l4t-r32.5.0
R32.4.4 dustynv/ros:foxy-pytorch-l4t-r32.4.4
ROS2 Galactic (dustynv/ros:galactic-ros-base-l4t-r35.3.1)
L4T Version Container Tag
ROS2 Galactic (ros-base) R35.3.1 dustynv/ros:galactic-ros-base-l4t-r35.3.1
R35.2.1 dustynv/ros:galactic-ros-base-l4t-r35.2.1
R35.1.0 dustynv/ros:galactic-ros-base-l4t-r35.1.0
R34.1.1 dustynv/ros:galactic-ros-base-l4t-r34.1.1
R34.1.0 dustynv/ros:galactic-ros-base-l4t-r34.1.0
R32.7.1 dustynv/ros:galactic-ros-base-l4t-r32.7.1
R32.6.1 dustynv/ros:galactic-ros-base-l4t-r32.6.1
R32.5.0* dustynv/ros:galactic-ros-base-l4t-r32.5.0
R32.4.4 dustynv/ros:galactic-ros-base-l4t-r32.4.4
ROS2 Galactic (desktop) R35.3.1 dustynv/ros:galactic-desktop-l4t-r35.3.1
R35.2.1 dustynv/ros:galactic-desktop-l4t-r35.2.1
R35.1.0 dustynv/ros:galactic-desktop-l4t-r35.1.0
R34.1.1 dustynv/ros:galactic-desktop-l4t-r34.1.1
ROS2 Galactic (PyTorch) R35.3.1 dustynv/ros:galactic-pytorch-l4t-r35.3.1
R35.2.1 dustynv/ros:galactic-pytorch-l4t-r35.2.1
R35.1.0 dustynv/ros:galactic-pytorch-l4t-r35.1.0
R34.1.1 dustynv/ros:galactic-pytorch-l4t-r34.1.1
R34.1.0 dustynv/ros:galactic-pytorch-l4t-r34.1.0
R32.7.1 dustynv/ros:galactic-pytorch-l4t-r32.7.1
R32.6.1 dustynv/ros:galactic-pytorch-l4t-r32.6.1
R32.5.0* dustynv/ros:galactic-pytorch-l4t-r32.5.0
R32.4.4 dustynv/ros:galactic-pytorch-l4t-r32.4.4
ROS2 Humble (dustynv/ros:humble-ros-base-l4t-r35.3.1)
L4T Version Container Tag
ROS2 Humble (ros-base) R35.3.1 dustynv/ros:humble-ros-base-l4t-r35.3.1
R35.2.1 dustynv/ros:humble-ros-base-l4t-r35.2.1
R35.1.0 dustynv/ros:humble-ros-base-l4t-r35.1.0
R34.1.1 dustynv/ros:humble-ros-base-l4t-r34.1.1
R34.1.0 dustynv/ros:humble-ros-base-l4t-r34.1.0
R32.7.1 dustynv/ros:humble-ros-base-l4t-r32.7.1
ROS2 Humble (desktop) R35.3.1 dustynv/ros:humble-desktop-l4t-r35.3.1
R35.2.1 dustynv/ros:humble-desktop-l4t-r35.2.1
R35.1.0 dustynv/ros:humble-desktop-l4t-r35.1.0
R34.1.1 dustynv/ros:humble-desktop-l4t-r34.1.1
R32.7.1 dustynv/ros:humble-desktop-l4t-r32.7.1
ROS2 Humble (PyTorch) R35.3.1 dustynv/ros:humble-pytorch-l4t-r35.3.1
R35.2.1 dustynv/ros:humble-pytorch-l4t-r35.2.1
R35.1.0 dustynv/ros:humble-pytorch-l4t-r35.1.0
R34.1.1 dustynv/ros:humble-pytorch-l4t-r34.1.1
R34.1.0 dustynv/ros:humble-pytorch-l4t-r34.1.0
R32.7.1 dustynv/ros:humble-pytorch-l4t-r32.7.1
ROS2 Iron (dustynv/ros:iron-ros-base-l4t-r35.3.1)
L4T Version Container Tag
ROS2 Iron (ros-base) R35.3.1 dustynv/ros:iron-ros-base-l4t-r35.3.1
R35.2.1 dustynv/ros:iron-ros-base-l4t-r35.2.1
R35.1.0 dustynv/ros:iron-ros-base-l4t-r35.1.0
R32.7.1 dustynv/ros:iron-ros-base-l4t-r32.7.1
ROS2 Iron (desktop) R35.3.1 dustynv/ros:iron-desktop-l4t-r35.3.1
R35.2.1 dustynv/ros:iron-desktop-l4t-r35.2.1
R35.1.0 dustynv/ros:iron-desktop-l4t-r35.1.0
R32.7.1 dustynv/ros:iron-desktop-l4t-r32.7.1
ROS2 Iron (PyTorch) R35.3.1 dustynv/ros:iron-pytorch-l4t-r35.3.1
R35.2.1 dustynv/ros:iron-pytorch-l4t-r35.2.1
R35.1.0 dustynv/ros:iron-pytorch-l4t-r35.1.0
R32.7.1 dustynv/ros:iron-pytorch-l4t-r32.7.1

note: L4T R32.x containers can run on other versions of R32.x (e.g. R32.7.1 containers can run on R32.7.2)
          L4T R35 containers can run on other versions of R35 (e.g. R35.1.0 containers can run on R35.2.1)

To download and run one of these images, you can use the included run script from the repo:

# L4T version in the container tag should match your L4T version
$ scripts/docker_run.sh -c nvcr.io/nvidia/l4t-pytorch:r32.5.0-pth1.7-py3

For other configurations, below are the instructions to build and test the containers using the included Dockerfiles.

Building the Containers

To rebuild the containers from a Jetson device running JetPack 4.4 or newer, first clone this repo:

$ git clone https://github.com/dusty-nv/jetson-containers
$ cd jetson-containers

Before proceeding, make sure you have set your Docker Default Runtime to nvidia as shown below:

Docker Default Runtime

To enable access to the CUDA compiler (nvcc) during docker build operations, add "default-runtime": "nvidia" to your /etc/docker/daemon.json configuration file before attempting to build the containers:

{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },

    "default-runtime": "nvidia"
}

You will then want to restart the Docker service or reboot your system before proceeding.

ML Containers

To build the ML containers (l4t-pytorch, l4t-tensorflow, l4t-ml), use scripts/docker_build_ml.sh - along with an optional argument of which container(s) to build:

$ ./scripts/docker_build_ml.sh all        # build all: l4t-pytorch, l4t-tensorflow, and l4t-ml
$ ./scripts/docker_build_ml.sh pytorch    # build only l4t-pytorch
$ ./scripts/docker_build_ml.sh tensorflow # build only l4t-tensorflow

You have to build l4t-pytorch and l4t-tensorflow to build l4t-ml, because it uses those base containers in the multi-stage build.

Note that the TensorFlow and PyTorch pip wheel installers for aarch64 are automatically downloaded in the Dockerfiles from the Jetson Zoo.

ROS Containers

To build the ROS containers, use scripts/docker_build_ros.sh with the --distro option to specify the name of the ROS distro to build and --package to specify the ROS package to build (the default package is ros_base):

$ ./scripts/docker_build_ros.sh --distro all     # build all ROS distros (default)
$ ./scripts/docker_build_ros.sh --distro humble  # build only humble (ros_base)
$ ./scripts/docker_build_ros.sh --distro humble --package desktop  # build humble desktop

The package options are: ros_base, ros_core, and desktop - you can also specify --with-pytorch to build variants with support for PyTorch, jetson-inference and ros_deep_learning.

Run the Containers

To run ROS container, first you should get the container name , type the command which built container, if container has been built successfully, it will give your container name like bellow.

$ ./scripts/docker_build_ros.s --distro humble
 ... 
Successfully built ebc1d71f00f3
Successfully tagged ros:humble-ros-base-l4t-r35.1.0 # ros:humble-ros-base-l4t-r35.1.0 is the container name

Then, type

$ ./scripts/docker_run.sh -c ros:humble-ros-base-l4t-r35.1.0

to run the container.

Testing the Containers

To run a series of automated tests on the packages installed in the containers, run the following from your jetson-containers directory:

$ ./scripts/docker_test_ml.sh all        # test all: l4t-pytorch, l4t-tensorflow, and l4t-ml
$ ./scripts/docker_test_ml.sh pytorch    # test only l4t-pytorch
$ ./scripts/docker_test_ml.sh tensorflow # test only l4t-tensorflow

To test ROS:

$ ./scripts/docker_test_ros.sh all       # test if the build of ROS all was successful: 'melodic', 'noetic', 'eloquent', 'foxy'
$ ./scripts/docker_test_ros.sh melodic   # test if the build of 'ROS melodic' was successful
$ ./scripts/docker_test_ros.sh noetic    # test if the build of 'ROS noetic' was successful
$ ./scripts/docker_test_ros.sh eloquent  # test if the build of 'ROS eloquent' was successful
$ ./scripts/docker_test_ros.sh foxy      # test if the build of 'ROS foxy' was successful

About

Machine Learning Containers for NVIDIA Jetson and JetPack-L4T

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 57.3%
  • Python 35.0%
  • OCaml 7.7%