Skip to content

Commit

Permalink
Add nvidia-l4t-base
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Nov 21, 2023
1 parent 3c580f8 commit 3f74237
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/nvidia-l4t-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: shellcheck

on:
push:
branches: [ main ]
paths:
- 'nvidia/l4t-base/**'
pull_request:
branches: [ main ]
paths:
- 'nvidia/l4t-base/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: nvidia/l4t-base
steps:
- uses: actions/checkout@v4

- name: Install QEMU static binaries
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}

- name: Build and push
uses: docker/bake-action@v4
with:
workdir: nvidia/l4t-base
push: ${{ github.event_name != 'pull_request' }}

- name: Get the image description
if: github.event_name != 'pull_request'
id: image_description
run: |
echo "image_description=$(docker buildx bake --print 2> /dev/null | jq -r '.target.nvidia-l4t-base-35-3-1.labels."org.opencontainers.image.description"')" >> $GITHUB_ENV
- name: Update Docker Hub Description
if: github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_DESCRIPTION_PASSWORD }}
repository: boxcutter/nvidia-l4t-base
short-description: ${{ env.image_description }}
readme-filepath: nvidia/l4t-base/README.md
79 changes: 79 additions & 0 deletions nvidia/l4t-base/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
FROM docker.io/arm64v8/ubuntu:20.04 as nvidia-l4t-base

ARG RELEASE=r35.4
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -qq -y --no-install-recommends \
bc \
bzip2 \
can-utils \
ca-certificates \
freeglut3-dev \
gnupg2 \
gstreamer1.0-alsa \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-tools \
i2c-tools \
iw \
kbd \
kmod \
language-pack-en-base \
libapt-pkg-dev \
libcanberra-gtk3-module \
libgles2 \
libglu1-mesa-dev \
libglvnd-dev \
libgtk-3-0 \
libpython2.7 \
libudev1 \
libvulkan1 \
libzmq5 \
mtd-utils \
parted \
pciutils \
python \
python-pexpect \
python3-distutils \
python3-numpy \
sox \
udev \
vulkan-utils \
wget \
wireless-tools wpasupplicant && \
rm -rf /var/lib/apt/lists/* && apt-get clean

COPY jetson-ota-public.key /etc/jetson-ota-public.key
RUN apt-key add /etc/jetson-ota-public.key
RUN echo "deb https://repo.download.nvidia.com/jetson/common $RELEASE main" >> /etc/apt/sources.list

RUN echo "/usr/lib/aarch64-linux-gnu/tegra" >> /etc/ld.so.conf.d/nvidia-tegra.conf && \
echo "/usr/lib/aarch64-linux-gnu/tegra-egl" >> /etc/ld.so.conf.d/nvidia-tegra.conf

RUN rm /usr/share/glvnd/egl_vendor.d/50_mesa.json
RUN mkdir -p /usr/share/glvnd/egl_vendor.d/ && echo '\
{\
"file_format_version" : "1.0.0",\
"ICD" : {\
"library_path" : "libEGL_nvidia.so.0"\
}\
}' > /usr/share/glvnd/egl_vendor.d/10_nvidia.json

RUN mkdir -p /usr/share/egl/egl_external_platform.d/ && echo '\
{\
"file_format_version" : "1.0.0",\
"ICD" : {\
"library_path" : "libnvidia-egl-wayland.so.1"\
}\
}' > /usr/share/egl/egl_external_platform.d/nvidia_wayland.json

RUN ldconfig

ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES all

CMD ["/bin/bash"]
118 changes: 118 additions & 0 deletions nvidia/l4t-base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# l4t-base

Linux for Tegra (L4T) base image. Tegra is a system on a chip (SoC) series
developed by NVIDIA.

Based on:
- https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-base
- https://gitlab.com/nvidia/container-images/l4t-base

## What is L4T?

NVIDIA Linux4Tegra (L4T) package provides the bootloader, kernel, necessary
firmwares, NVIDIA drivers for various accelerators present on Jetson modules,
flashing utilities and a sample filesystem to be used on Jetson systems. The
software packages contained in L4T provide the functionality necessary to run
Linux on Jetson modules. For a detailed software overview please refer
documentation provided here: (https://docs.nvidia.com/jetson/l4t/index.html)

## Overview of the l4t-base container

l4t-base docker image enables applications to be run in a container using the
Nvidia Container Runtime on Jetson. It has a subset of packages from the l4t
rootfs included within (Multimedia, Gstreamer, Camera, Core, 3D Core, Vulkan,
Weston). The platform specific libraries providing hardware dependencies and
select device nodes for a particular device are mounted by the NVIDIA container
runtime into the l4t-base container from the underlying host, thereby providing
necessary dependencies for l4t applications to execute within the container.
This approach enables the l4t-base container to be shared between various
Jetson devices.

The image is tagged with the version corresponding to the release version of
the associated l4t release. Based on this, the l4t-base:r34.1 container is
intended to be run on devices executing the l4t r34.1 release.

Starting with the r32.4.3 release, the Dockerfile for the l4t-base docker image
is also being provided. This can be accessed at this [link](https://gitlab.com/nvidia/container-images/l4t-base). Users can use this to modify the contents to
suit their needs.

**Starting with the r34.1 release (JetPack 5.0 Developer Preview), the l4t-base
will not bring CUDA, CuDNN and TensorRT from the host file system.** The
l4t-base is meant to be used as the base container for containerizing
applications for Jetson. Users can apt install Jetson packages and other
software of their choice to extend the l4t-base dockerfile (see above) while
building application containers. All JetPack components are hosted in the
Debian Package Management server [here](https://repo.download.nvidia.com/jetson/).

For CUDA and TensorRT applications, users can use the L4T CUDA and TensorRT
runtime containers which have CUDA and CUDA/CuDNN/TensorRT respectively in the
container itself. They can be used as base containers to containerize [CUDA](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-cuda)
and [TensorRT](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-tensorrt) applications on Jetson.

## Running l4t-base container

### Prerequisites

Ensure these prerequisites are available on your system:

1. [NVIDIA Container Runtime on Jetson](https://github.com/nvidia/nvidia-docker/wiki#platform-support) Note that NVIDIA Container Runtime is available for install as part of [Nvidia JetPack](https://developer.nvidia.com/embedded/jetpack) in version 4.3 or newer

### Pull the container

Before running the l4t-base container, use Docker pull to ensure an up-to-date image is installed. Once the pull is complete, you can run the container image.

Procedure

1. In the Pull column, click the icon to copy the Docker pull command for the l4t-base container.

1. Open a command prompt and paste the pull command. Docker will initiate a pull of the container from the NGC registry. Ensure the pull completes successfully before proceeding to the next step.

### Run the container

To run the container:

1. Allow external applications to connect to the host's X display:

xhost *

1. Run the docker container using the docker command

sudo docker run -it --rm \
--net=host \
--runtime nvidia \
--env DISPLAY=$DISPLAY \
--mount type=bind,source=/tmp/.X11-unix/,target=/tmp/.X11-unix \
docker.io/polymathrobotics/nvidia-l4t-base:r35.4.1

### Exposing additional GPU features

By default a limited set of device nodes and associated functionality is
exposed within the l4t-base containers using the [mount plugin](https://github.com/NVIDIA/nvidia-docker/wiki/NVIDIA-Container-Runtime-on-Jetson#mount-plugins)
capability. The list is documented [here](https://github.com/NVIDIA/nvidia-docker/wiki/NVIDIA-Container-Runtime-on-Jetson#supported-devices).

User can expose additional devices using the [--device](https://docs.docker.com/engine/reference/commandline/run/#add-host-device-to-container---device)
command option provided by docker. Directories and files can be bind mounted
using the [-v](https://docs.docker.com/storage/bind-mounts/) option.

Note that usage of some devices might need associated libraries to be available inside the container.

### Creating Containers for Jetson

The following L4T containers can be readily leveraged as base containers to
create application containers: [CUDA](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-cuda), [TensorRT](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-tensorrt), [Deepstream](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/deepstream-l4t), [TensorFlow](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-tensorflow), [PyTorch](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch), [ML](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-ml).
The [NVIDIA Container RUntime on Jetson](https://github.com/nvidia/nvidia-docker/wiki#platform-support) documentation has a FAQ on container usage.

Refer to [this](https://gitlab.com/nvidia/container-images/l4t-jetpack)
git repo for sample dockerfile. The JetPack dockerfile in that repo uses L4T
container as base and creates a development container by installing CUDA,
cuDNN, TensorRT, VPI and OpenCV inside the container.

### License

The l4t-base container includes various software packages with their respective licenses included within the container.

### Suggested Reading

For more information about l4t refer [Jetson Download Center](https://developer.nvidia.com/embedded/downloads).

If you have questions, please refer to the [Jetson Forums](https://devtalk.nvidia.com/default/board/139/embedded-systems/1).
32 changes: 32 additions & 0 deletions nvidia/l4t-base/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
variable "CONTAINER_REGISTRY" {
default = "docker.io/boxcutter"
}

variable "IMAGE_NAME" {
default = "nvidia-l4t-base"
}

target "default" {
name = "${IMAGE_NAME}-${replace(item.version, ".", "-")}"
target = "nvidia-l4t-base"
args = {
RELEASE = item.release
}
tags = [
"${CONTAINER_REGISTRY}/${IMAGE_NAME}:${item.version}"
]
dockerfile = "Containerfile"
platforms = ["linux/arm64/v8"]
labels = {
"org.opencontainers.image.created" = timestamp()
"org.opencontainers.image.description" = "Linux for Tegra (L4T) base image for the NVIDIA Jetson embedded computing platform."
"org.opencontainers.image.licenses" = "Apache-2.0"
"org.opencontainers.image.source" = "https://github.com/boxcutter/oci"
}
matrix = {
item = [
{ version = "35.3.1", release = "r35.3" },
{ version = "35.4.1", release = "r35.4" },
]
}
}
86 changes: 86 additions & 0 deletions nvidia/l4t-base/jetson-ota-public.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFzTm9UBEADEvhgIxJx4PR3wFeqsxQYEe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8zmEgNMZTCiric0GQxI7YKygQdgz/1FeNsk
4cjOAPFxOX+D07Ia5bBx9zj+SXFUKKFIi1ZD67zGmwUkViwcs8Q25qUmxULhxdBw
2wmCGs/hPzfNzztUmgYb93sG1cpFC/DuFaKX/8WTQFDxT5aQe54Piya0EVrghCh3
aVI48ateq7Azn4r1n9YwscCrpd4so3q7NUzn37/mygn/CTsgJJF3JPxo5x0o/lQc
KaSplEhyykqJ4rkos+J983j/TA5clYoXrITGaN5ewJtdcJXiTuI6+pSjVMOWH7p5
MzOWYiDnr7g21AB/D/9MVeS6vivDDvtgtnQZah+a9enFj4YdcTTUI7FLEkE+NqKd
nfnlXzOMT1VkfPz3oetCBUOYuX5TL75REav51dCqPV/yIDFXPsgYe/SfGYS8sk49
aEGzYouyFnXnyiD7OvEKWsWIqY9e5yZrSw3kT21CFJheNi4+AJGblbjsppKULobk
rTHTtNr/s8+PHjqAKQVa0Chz+NdIz2AwN3XcjnzxvY20cODh0KJOTDhrYismdj3j
BMG7I+65FO3XuQpsbUZwpD9M2lm80r/ZIogpBVUqRT59aFNUgaoqGhAt08RfOpOK
6f2Tsea16pXbIDGop8PomXECxoPX2xZgtLwrd+9fbPaRqSHIjv14wCW1V/E8uqph
KJ44xaCIzgSBvS8AXTSUuvxOArO1j/b3191u34ulzw4fA22jINhu5uw1DxDrlMOZ
u++xchnFWYwbmSXYOeohCkehkVZBx0YnF4ffpc/NeuztqQDsgDI8a2dtPsFlyVmm
s3OX4MPOcLa3wXJGMpkt3PPqzGNpegV74xe0Q+TlFDK/qcX8b7wqcIkYHElvncmL
6WzI/3pW7xMLrPXqpQhXlffjDLw5QGZ8GG/2zKF9bfA1kHRYHa3j216l60fttQ0q
06EKS7bwCEfL/I176IRemVLUvT3+NvTB4l1NaqNQ8S/TzyDKI7/JuEwDHhG4EQ==
=/w3m
-----END PGP PUBLIC KEY BLOCK-----

0 comments on commit 3f74237

Please sign in to comment.