Docker Container: nvidia:l4t-ml wont run

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

went to:
https://ngc.nvidia.com/catalog/containers/nvidia:l4t-ml

Using the instructions in the link above i installed the container

sudo docker pull nvcr.io/nvidia/l4t-ml:r32.4.3-py3

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

sudo docker run -it --rm --runtime nvidia --network host nvcr.io/nvidia/l4t-ml:r32.4.3-py3

“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
Maintainer: NVIDIA CORPORATION <cudatools@nvidia.com>
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
 containers.
Homepage: https://github.com/NVIDIA/nvidia-container-runtime/wiki

thanks for the reply.

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

  2. when i $sudo docker images i get:
    nvcr.io/nvidia/l4t-ml 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 nvcr.io/nvidia/l4t-ml:r32.4.3-py3
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
Client:
Debug Mode: false

Server:
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
Plugins:
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:
seccomp
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
ID: 4IXH:LPV6:DEDM:3UVQ:ZGOM:NTXU:DJFN:SNXT:YE7N:UOY7:HRRQ:OU5C
Docker Root Dir: /var/snap/docker/common/var-lib-docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
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 https://github.com/NVIDIA/nvidia-container-runtime

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