Docker Container: nvidia:l4t-ml wont run

I did a clean Jetpack 4.4 install on my Xavier NT ,works great.

went to:

Using the instructions in the link above i installed the container

sudo docker pull

“Then to start an interactive session in the container, run the following command:”

sudo docker run -it --rm --runtime nvidia --network host

“You should then be able to start a Python3 interpreter and import the packages above.”

I get this error:

docker: Error response from daemon: Unknown runtime specified nvidia

Please help.

It doesn’t seem like you have the nvidia-container-runtime installed, and perhaps other JetPack components aren’t installed. Did you flash using SDK Manager, or the SD card image?

What does it show if you run the following command?

$ dpkg -s nvidia-container-runtime
Package: nvidia-container-runtime
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 1894
Architecture: arm64
Version: 3.1.0-1
Depends: nvidia-container-toolkit (>= 1.0.1), nvidia-container-toolkit (<< 2.0.0), libseccomp2
Description: NVIDIA container runtime
 Provides a modified version of runc allowing users to run GPU enabled

thanks for the reply.

  1. i flashed my xavier nt with the latest sd card image.

  2. when i $sudo docker images i get: r32.4.3-py3 cb5bd2c84e7d 5 weeks ago 4.4GB
    so it seems to have installed the image ok.

  3. when i run the command you gave, I get exactly what you showed: installed ok etc.

For grins, i tried it without --runtime nvidia :
sudo docker run -it --rm --network host
and the container worked, i was able to see the Jupyter notebook at http://localhost:8888/

what is runtime nvidia, and why do i need it.
also, i can run python3, import numpy, pandas etc, but cant import cv2. How do i get access to cv2 when im running the container?

The --runtime nvidia option allows access to the GPU and CUDA from within the containers.

If you run sudo docker info, do you see Runtimes: nvidia runc in the output?

You would need to install the OpenCV packages into the container (i.e. via apt), as OpenCV isn’t in the l4t-ml base image.

$ sudo docker info
Debug Mode: false

Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 1
Server Version: 19.03.11
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version:
init version: fec3683
Security Options:
Profile: default
Kernel Version: 4.9.140-tegra
Operating System: Ubuntu Core 16
OSType: linux
Architecture: aarch64
CPUs: 6
Total Memory: 7.582GiB
Name: rick-desktop
Docker Root Dir: /var/snap/docker/common/var-lib-docker
Debug Mode: false
Experimental: false
Insecure Registries:
Live Restore Enabled: false

Hmm for some reason the NVIDIA runtime is either not properly installed or loading on your system. Let us know if you run into any further issues regarding this.

How can i install the NVIDIA runtime?

Well, what I am confused about is that dpkg shows nvidia-runtime is already installed for you, but it isn’t loading nvidia-runtime.

If you cat /etc/docker/daemon.json , does it include an entry like this:

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

Also, are you able to run the following command?

$ nvidia-container-runtime --version
runc version spec: 1.0.1-dev

Both commands give me exactly the same results that you show

try installing nvidia docker environment with sdkmanager
sdkmanager headless
with reflashing OS or without reflashing OS

Thanks for the help, but i dont understand sdkmanager headless.

So i found

looked there and saw:

Ubuntu distributions

  1. Install the repository for your distribution by following the instructions here.
  2. Install the nvidia-container-runtime package:
sudo apt-get install nvidia-container-runtime

so i did a $sudo apt-get remove nvidia-container-runtime

then autoremove

then reboot

then $sudo apt-get install nvidia-container-runtime

now everything works as it should.

1 Like

Hi @rick.minicucci, thanks for sharing your solution that re-installing nvidia-container-runtime fixed the issue for you.

1 Like