How to reproduce exactly L4T 32.5.1 / Jetpack 4.5.1 / Ubuntu 18.04 inside a docker container

Hello to everyone.

I’ve got an idea that I want to discuss with you. I would like to upgrade ubuntu 18.04 that I have on the jetson nano to version 21.04 and at the same time I want to install the L4T 32.5.1 and the jetpack 4.5.1 with ubuntu 18.04 inside a docker container. In other words,inside the docker container there should be a system like this :

NVIDIA Jetson Nano (Developer Kit Version)
L4T 32.5.1 [ JetPack 4.5.1 ]
Ubuntu 18.04.5 LTS
Kernel Version: 4.9.201+
Xlib: extension “NV-GLX” missing on display “localhost:10.0”.
Xlib: extension “NV-GLX” missing on display “localhost:10.0”.
Xlib: extension “NV-GLX” missing on display “localhost:10.0”.
CUDA 11.0.207
CUDA Architecture: 5.3
OpenCV version: 4.1.1
OpenCV Cuda: NO
Vision Works:
VPI: ii libnvvpi1 1.0.15 arm64 NVIDIA Vision Programming Interface library
Vulcan: 1.2.70

it’s the same system that everyday I use as main system on my jetson nano. As primary OS I want to have the most updated ubuntu version,that at the moment is the 21.04. What do u think about this idea ? Do u have some good suggestion and tutorial that I can learn ?

I made an experiment. I created a dockerfile like this one :

FROM ubuntu:18.04


RUN apt-get update && apt-get install -y --no-install-recommends \
    gnupg2 curl ca-certificates && \
    curl -fsSL | apt-key add - && \
    echo "deb /" > /etc/apt/sources.list.d/cuda.list && \
    apt-get purge --autoremove -y curl \
    && rm -rf /var/lib/apt/lists/*


# For libraries in the cuda-compat-* package:
RUN apt-get update && apt-get install -y --no-install-recommends \
    cuda-cudart-11-3=11.3.109-1 \
    && ln -s cuda-11.3 /usr/local/cuda && \
    rm -rf /var/lib/apt/lists/*

# Required for nvidia-docker v1
RUN echo "/usr/local/nvidia/lib" >> /etc/ \
    && echo "/usr/local/nvidia/lib64" >> /etc/

ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64


# nvidia-container-runtime

but it didn’t work. It gave this error :

root@zi-desktop:~/Desktop/zi/Work/I9/Virt/dockers/arm64/nvidia-docker# ./

docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: exec command: [/usr/bin/nvidia-container-cli --load-kmods configure --ldconfig=@/sbin/ldconfig.real --device=all --compute --utility --require=cuda>=11.2 --pid=19186 /var/lib/docker/overlay2/bbd6118701a9488d09f9a48b431bd2458772721f04ac7ebcc199cf30775429d1/merged]
nvidia-container-cli: requirement error: unsatisfied condition: cuda >= 11.2: unknown.

what’s the reason of this error ? because on the main OS I’m using > CUDA 11.0.207 and I can’t use CUDA 11.3 inside docker ?


Do you want to build a Jetson docker on the host?
If yes, please follow the guidelines below:

You will need to install the host CUDA library from JetPack for compatibility.


@AastaLLL would jetson GPU cuda samples run from such containers on x86? is GPU virtualization supported?

root@Z390-AORUS-PRO:/home/ziomario/Scrivania/Virt/dockers/docker-build# docker build -t docker://zi/devicequer
y .

invalid argument “docker://zi/devicequery” for “-t, --tag” flag: invalid reference format
See ‘docker build --help’.

root@Z390-AORUS-PRO:/home/ziomario/Scrivania/Virt/dockers/docker-build# docker build .

Sending build context to Docker daemon 2.048kB
Step 1/6 : FROM
r32.3.1: Pulling from nvidia/l4t-base
8aaa03d29a6e: Pull complete
e73d3a974854: Pull complete
2c14cdba18f5: Pull complete
23dd63c7659b: Pull complete
3bd414bd9504: Pull complete
cafd526eb263: Pull complete
483b0873e636: Pull complete
2568c5428ff2: Pull complete
6bcd9356d42f: Pull complete
c7f6d0180a4e: Pull complete
beddc9b83fb0: Pull complete
656f2307c79e: Pull complete
fe2e73a571b7: Pull complete
f5decba41c07: Pull complete
f0b6e413c48c: Pull complete
Digest: sha256:e8987d52ddb9496948e02656fc62d46561abce25bfe83203f4bc24c67e094578
Status: Downloaded newer image for
—> aaaa63e7b12d
Step 2/6 : RUN apt-get update && apt-get install -y --no-install-recommends make g++

—> Running in 7f898c4a516a
Get:1 bionic InRelease [242 kB]
Get:2 bionic-updates InRelease [88.7 kB]
Get:3 bionic-backports InRelease [74.6 kB]
Get:4 bionic-security InRelease [88.7 kB]
Get:5 bionic/main arm64 Packages [975 kB]
Get:6 bionic/main Translation-en [516 kB]
Get:7 bionic/restricted arm64 Packages [664 B]
Get:8 bionic/restricted Translation-en [3584 B]
Get:9 bionic/universe arm64 Packages [8316 kB]
Get:10 bionic/universe Translation-en [4941 kB]
Get:11 bionic/multiverse arm64 Packages [126 kB]
Get:12 bionic/multiverse Translation-en [108 kB]
Get:13 bionic-updates/main arm64 Packages [1294 kB]
Get:14 bionic-updates/main Translation-en [421 kB]
Get:15 bionic-updates/restricted arm64 Packages [3404 B]
Get:16 bionic-updates/restricted Translation-en [52.6 kB]
Get:17 bionic-updates/universe arm64 Packages [1536 kB]
Get:18 bionic-updates/universe Translation-en [371 kB]
Get:19 bionic-updates/multiverse arm64 Packages [4920 B]
Get:20 bionic-updates/multiverse Translation-en [6792 B]
Get:21 bionic-backports/main arm64 Packages [9992 B]
Get:22 bionic-backports/main Translation-en [4764 B]
Get:23 bionic-backports/universe arm64 Packages [9932 B]
Get:24 bionic-backports/universe Translation-en [4588 B]
Get:25 bionic-security/main arm64 Packages [996 kB]
Get:26 bionic-security/main Translation-en [329 kB]
Get:27 bionic-security/restricted arm64 Packages [2852 B]
Get:28 bionic-security/restricted Translation-en [48.9 kB]
Get:29 bionic-security/universe arm64 Packages [994 kB]
Get:30 bionic-security/universe Translation-en [256 kB]
Get:31 bionic-security/multiverse arm64 Packages [2732 B]
Get:32 bionic-security/multiverse Translation-en [4412 B]
Fetched 21.8 MB in 12s (1853 kB/s)

Reading package lists…
Reading package lists…
Building dependency tree…
Reading state information…

The following additional packages will be installed:
binutils binutils-aarch64-linux-gnu binutils-common cpp cpp-7 g+±7 gcc
gcc-7 gcc-7-base gcc-8-base libasan4 libatomic1 libbinutils libc-dev-bin
libc6 libc6-dev libcc1-0 libgcc-7-dev libgcc1 libgomp1 libitm1 liblsan0
libstdc+±7-dev libstdc++6 libtsan0 libubsan0 linux-libc-dev

Suggested packages:
binutils-doc cpp-doc gcc-7-locales gcc-7-doc libstdc++6-7-dbg gcc-multilib
manpages-dev autoconf automake libtool flex bison gdb gcc-doc libgcc1-dbg
libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg
libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg
glibc-doc libstdc+±7-doc make-doc
Recommended packages:
manpages manpages-dev

The following NEW packages will be installed:
binutils binutils-aarch64-linux-gnu binutils-common g++ g+±7 gcc gcc-7
libasan4 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libgcc-7-dev
libitm1 liblsan0 libstdc+±7-dev libtsan0 libubsan0 linux-libc-dev make
The following packages will be upgraded:
cpp cpp-7 gcc-7-base gcc-8-base libc6 libgcc1 libgomp1 libstdc++6
8 upgraded, 21 newly installed, 0 to remove and 284 not upgraded.
Need to get 34.9 MB of archives.
After this operation, 112 MB of additional disk space will be used.
Get:1 bionic-updates/main arm64 libgomp1 arm64 8.4.0-1ubuntu1~18.04 [69.7
Get:2 bionic-updates/main arm64 gcc-8-base arm64 8.4.0-1ubuntu1~18.04 [18
.8 kB]
Get:3 bionic-updates/main arm64 libstdc++6 arm64 8.4.0-1ubuntu1~18.04 [37
2 kB]
Get:4 bionic-updates/main arm64 libgcc1 arm64 1:8.4.0-1ubuntu1~18.04 [34.
4 kB]
Get:5 bionic-updates/main arm64 libc6 arm64 2.27-3ubuntu1.4 [2275 kB]
Get:6 bionic-updates/main arm64 binutils-common arm64 2.30-21ubuntu1~18.0
4.5 [197 kB]
Get:7 bionic-updates/main arm64 libbinutils arm64 2.30-21ubuntu1~18.04.5
[418 kB]
Get:8 bionic-updates/main arm64 binutils-aarch64-linux-gnu arm64 2.30-21u
buntu1~18.04.5 [2168 kB]
Get:9 bionic-updates/main arm64 binutils arm64 2.30-21ubuntu1~18.04.5 [33
76 B]
Get:10 bionic-updates/main arm64 cpp-7 arm64 7.5.0-3ubuntu1~18.04 [7046 k
Get:11 bionic-updates/main arm64 gcc-7-base arm64 7.5.0-3ubuntu1~18.04 [1
8.3 kB]
Get:12 bionic-updates/main arm64 cpp arm64 4:7.4.0-1ubuntu2.3 [27.7 kB]
Get:13 bionic-updates/main arm64 libcc1-0 arm64 8.4.0-1ubuntu1~18.04 [36.
5 kB]
Get:14 bionic-updates/main arm64 libitm1 arm64 8.4.0-1ubuntu1~18.04 [24.3
Get:15 bionic-updates/main arm64 libatomic1 arm64 8.4.0-1ubuntu1~18.04 [9
176 B]
Get:16 bionic-updates/main arm64 libasan4 arm64 7.5.0-3ubuntu1~18.04 [335
Get:17 bionic-updates/main arm64 liblsan0 arm64 8.4.0-1ubuntu1~18.04 [121
Get:18 bionic-updates/main arm64 libtsan0 arm64 8.4.0-1ubuntu1~18.04 [269
Get:19 bionic-updates/main arm64 libubsan0 arm64 7.5.0-3ubuntu1~18.04 [11
7 kB]
Get:20 bionic-updates/main arm64 libgcc-7-dev arm64 7.5.0-3ubuntu1~18.04
[833 kB]
Get:21 bionic-updates/main arm64 gcc-7 arm64 7.5.0-3ubuntu1~18.04 [7772 k
Get:22 bionic-updates/main arm64 gcc arm64 4:7.4.0-1ubuntu2.3 [5208 B]
Get:23 bionic-updates/main arm64 libc-dev-bin arm64 2.27-3ubuntu1.4 [58.7
Get:24 bionic-updates/main arm64 linux-libc-dev arm64 4.15.0-147.151 [968
Get:25 bionic-updates/main arm64 libc6-dev arm64 2.27-3ubuntu1.4 [2046 kB
Get:26 bionic-updates/main arm64 libstdc+±7-dev arm64 7.5.0-3ubuntu1~18.
04 [1471 kB]
Get:27 bionic-updates/main arm64 g+±7 arm64 7.5.0-3ubuntu1~18.04 [8077 k
Get:28 bionic-updates/main arm64 g++ arm64 4:7.4.0-1ubuntu2.3 [1552 B]
Get:29 bionic/main arm64 make arm64 4.1-9.1ubuntu1 [139 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 34.9 MB in 5s (7408 kB/s)
(Reading database … 40762 files and directories currently installed.)
Preparing to unpack …/libgomp1_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking libgomp1:arm64 (8.4.0-1ubuntu1~18.04) over (8.3.0-6ubuntu1~18.04.1) …
Preparing to unpack …/gcc-8-base_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking gcc-8-base:arm64 (8.4.0-1ubuntu1~18.04) over (8.3.0-6ubuntu1~18.04.1) …
Setting up gcc-8-base:arm64 (8.4.0-1ubuntu1~18.04) …
(Reading database … 40762 files and directories currently installed.)
Preparing to unpack …/libstdc++6_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking libstdc++6:arm64 (8.4.0-1ubuntu1~18.04) over (8.3.0-6ubuntu1~18.04.1) …
Setting up libstdc++6:arm64 (8.4.0-1ubuntu1~18.04) …
(Reading database … 40762 files and directories currently installed.)
Preparing to unpack …/libgcc1_1%3a8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking libgcc1:arm64 (1:8.4.0-1ubuntu1~18.04) over (1:8.3.0-6ubuntu1~18.04.1) …
Setting up libgcc1:arm64 (1:8.4.0-1ubuntu1~18.04) …
(Reading database … 40762 files and directories currently installed.)
Preparing to unpack …/libc6_2.27-3ubuntu1.4_arm64.deb …
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Unpacking libc6:arm64 (2.27-3ubuntu1.4) over (2.27-3ubuntu1) …
Setting up libc6:arm64 (2.27-3ubuntu1.4) …
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Selecting previously unselected package binutils-common:arm64.
(Reading database … 40762 files and directories currently installed.)
Preparing to unpack …/00-binutils-common_2.30-21ubuntu1~18.04.5_arm64.deb …
Unpacking binutils-common:arm64 (2.30-21ubuntu1~18.04.5) …
Selecting previously unselected package libbinutils:arm64.
Preparing to unpack …/01-libbinutils_2.30-21ubuntu1~18.04.5_arm64.deb …
Unpacking libbinutils:arm64 (2.30-21ubuntu1~18.04.5) …
Selecting previously unselected package binutils-aarch64-linux-gnu.
Preparing to unpack …/02-binutils-aarch64-linux-gnu_2.30-21ubuntu1~18.04.5_arm64.deb …
Unpacking binutils-aarch64-linux-gnu (2.30-21ubuntu1~18.04.5) …
Selecting previously unselected package binutils.
Preparing to unpack …/03-binutils_2.30-21ubuntu1~18.04.5_arm64.deb …
Unpacking binutils (2.30-21ubuntu1~18.04.5) …
Preparing to unpack …/04-cpp-7_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking cpp-7 (7.5.0-3ubuntu1~18.04) over (7.4.0-1ubuntu1~18.04.1) …
Preparing to unpack …/05-gcc-7-base_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking gcc-7-base:arm64 (7.5.0-3ubuntu1~18.04) over (7.4.0-1ubuntu1~18.04.1) …
Preparing to unpack …/06-cpp_4%3a7.4.0-1ubuntu2.3_arm64.deb …
Unpacking cpp (4:7.4.0-1ubuntu2.3) over (4:7.3.0-3ubuntu2) …
Selecting previously unselected package libcc1-0:arm64.
Preparing to unpack …/07-libcc1-0_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking libcc1-0:arm64 (8.4.0-1ubuntu1~18.04) …
Selecting previously unselected package libitm1:arm64.
Preparing to unpack …/08-libitm1_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking libitm1:arm64 (8.4.0-1ubuntu1~18.04) …
Selecting previously unselected package libatomic1:arm64.
Preparing to unpack …/09-libatomic1_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking libatomic1:arm64 (8.4.0-1ubuntu1~18.04) …
Selecting previously unselected package libasan4:arm64.
Preparing to unpack …/10-libasan4_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking libasan4:arm64 (7.5.0-3ubuntu1~18.04) …
Selecting previously unselected package liblsan0:arm64.
Preparing to unpack …/11-liblsan0_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking liblsan0:arm64 (8.4.0-1ubuntu1~18.04) …
Selecting previously unselected package libtsan0:arm64.
Preparing to unpack …/12-libtsan0_8.4.0-1ubuntu1~18.04_arm64.deb …
Unpacking libtsan0:arm64 (8.4.0-1ubuntu1~18.04) …
Selecting previously unselected package libubsan0:arm64.
Preparing to unpack …/13-libubsan0_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking libubsan0:arm64 (7.5.0-3ubuntu1~18.04) …
Selecting previously unselected package libgcc-7-dev:arm64.
Preparing to unpack …/14-libgcc-7-dev_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking libgcc-7-dev:arm64 (7.5.0-3ubuntu1~18.04) …
Selecting previously unselected package gcc-7.
Preparing to unpack …/15-gcc-7_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking gcc-7 (7.5.0-3ubuntu1~18.04) …
Selecting previously unselected package gcc.
Preparing to unpack …/16-gcc_4%3a7.4.0-1ubuntu2.3_arm64.deb …
Unpacking gcc (4:7.4.0-1ubuntu2.3) …
Selecting previously unselected package libc-dev-bin.
Preparing to unpack …/17-libc-dev-bin_2.27-3ubuntu1.4_arm64.deb …
Unpacking libc-dev-bin (2.27-3ubuntu1.4) …
Selecting previously unselected package linux-libc-dev:arm64.
Preparing to unpack …/18-linux-libc-dev_4.15.0-147.151_arm64.deb …
Unpacking linux-libc-dev:arm64 (4.15.0-147.151) …
Selecting previously unselected package libc6-dev:arm64.
Preparing to unpack …/19-libc6-dev_2.27-3ubuntu1.4_arm64.deb …
Unpacking libc6-dev:arm64 (2.27-3ubuntu1.4) …
Selecting previously unselected package libstdc+±7-dev:arm64.
Preparing to unpack …/20-libstdc+±7-dev_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking libstdc+±7-dev:arm64 (7.5.0-3ubuntu1~18.04) …
Selecting previously unselected package g+±7.
Preparing to unpack …/21-g+±7_7.5.0-3ubuntu1~18.04_arm64.deb …
Unpacking g+±7 (7.5.0-3ubuntu1~18.04) …
Selecting previously unselected package g++.
Preparing to unpack …/22-g++_4%3a7.4.0-1ubuntu2.3_arm64.deb …
Unpacking g++ (4:7.4.0-1ubuntu2.3) …
Selecting previously unselected package make.
Preparing to unpack …/23-make_4.1-9.1ubuntu1_arm64.deb …
Unpacking make (4.1-9.1ubuntu1) …
Setting up libgomp1:arm64 (8.4.0-1ubuntu1~18.04) …
Setting up libatomic1:arm64 (8.4.0-1ubuntu1~18.04) …
Setting up libcc1-0:arm64 (8.4.0-1ubuntu1~18.04) …
Setting up make (4.1-9.1ubuntu1) …
Setting up libtsan0:arm64 (8.4.0-1ubuntu1~18.04) …
Setting up linux-libc-dev:arm64 (4.15.0-147.151) …
Setting up liblsan0:arm64 (8.4.0-1ubuntu1~18.04) …
Setting up gcc-7-base:arm64 (7.5.0-3ubuntu1~18.04) …
Setting up binutils-common:arm64 (2.30-21ubuntu1~18.04.5) …
Processing triggers for libc-bin (2.27-3ubuntu1) …
Setting up libc-dev-bin (2.27-3ubuntu1.4) …
Setting up libc6-dev:arm64 (2.27-3ubuntu1.4) …
Setting up libitm1:arm64 (8.4.0-1ubuntu1~18.04) …
Setting up libasan4:arm64 (7.5.0-3ubuntu1~18.04) …
Setting up libbinutils:arm64 (2.30-21ubuntu1~18.04.5) …
Setting up libubsan0:arm64 (7.5.0-3ubuntu1~18.04) …
Setting up libgcc-7-dev:arm64 (7.5.0-3ubuntu1~18.04) …
Setting up cpp-7 (7.5.0-3ubuntu1~18.04) …
Setting up libstdc+±7-dev:arm64 (7.5.0-3ubuntu1~18.04) …
Setting up binutils-aarch64-linux-gnu (2.30-21ubuntu1~18.04.5) …
Setting up binutils (2.30-21ubuntu1~18.04.5) …
Setting up cpp (4:7.4.0-1ubuntu2.3) …
Setting up gcc-7 (7.5.0-3ubuntu1~18.04) …
Setting up g+±7 (7.5.0-3ubuntu1~18.04) …
Setting up gcc (4:7.4.0-1ubuntu2.3) …
Setting up g++ (4:7.4.0-1ubuntu2.3) …
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode

update-alternatives: warning: skip creation of /usr/share/man/man1/c++.1.gz because associated file /usr/share
/man/man1/g++.1.gz (of link group c++) doesn’t exist

Processing triggers for libc-bin (2.27-3ubuntu1) …
Removing intermediate container 7f898c4a516a
—> 7e59a3532a1c
Step 3/6 : COPY ./samples /tmp/samples

COPY failed: file not found in build context or excluded by .dockerignore: stat samples: file does not exist

root@Z390-AORUS-PRO:/home/ziomario/Scrivania/Virt/dockers/docker-build# docker images

none none 7e59a3532a1c 19 seconds ago 1.42GB


CUDA-based sample should work.
But some hardware related example, like VIC, is not supported virtually within the x86 container.



Step 3/6 : COPY ./samples /tmp/samples

COPY failed: file not found in build context or excluded by .dockerignore: stat samples: file does not exist

The error indicates the ./samples folder doesn’t exist.
Please remember to copy it from the CUDA folder into the docker workspace first.

$ cp -r /usr/local/cuda/samples /tmp


but it won’t be x86, container, it would be arm aarch64 container, right?

On PC,it uses qemu x86 to emulate aarch64,so it’s 50 % and 50% :)

Hi, marietto2008

Do you fix the issue after copying the example into the workspace?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.