tree: 18f3809bda0c53be16e37dcdb02b49375c84cda8 [path history] [tgz]
  1. nvidia-toolkit/
  2. operator/
  3. runtime/
  4. toolkit/
  5. container.go
  6. README.md
tools/container/README.md

Introduction

This repository contains tools that allow docker, containerd, or cri-o to be configured to use the NVIDIA Container Toolkit.

Note: These were copied from the container-config repository are being migrated to commands installed with the NVIDIA Container Toolkit.

These will be migrated into an upcoming nvidia-ctk CLI as required.

Docker

After building the docker binary, run:

docker setup \
    --runtime-name NAME \
        /run/nvidia/toolkit

Configure the nvidia-container-runtime as a docker runtime named NAME. If the --runtime-name flag is not specified, this runtime would be called nvidia.

Since --set-as-default is enabled by default, the specified runtime name will also be set as the default docker runtime. This can be disabled by explicityly specifying --set-as-default=false.

The following table describes the behaviour for different --runtime-name and --set-as-default flag combinations.

FlagsInstalled RuntimesDefault Runtime
NONE SPECIFIEDnvidianvidia
--runtime-name nvidianvidianvidia
--runtime-name NAMENAMENAME
--set-as-defaultnvidianvidia
--set-as-default --runtime-name nvidianvidianvidia
--set-as-default --runtime-name NAMENAMENAME
--set-as-default=falsenvidiaNOT SET
--set-as-default=false --runtime-name NAMENAMENOT SET
--set-as-default=false --runtime-name nvidianvidiaNOT SET

These combinations also hold for the environment variables that map to the command line flags: DOCKER_RUNTIME_NAME, DOCKER_SET_AS_DEFAULT.

Containerd

After running the containerd binary, run:

containerd setup \
    --runtime-class NAME \
        /run/nvidia/toolkit

Configure the nvidia-container-runtime as a runtime class named NAME. If the --runtime-class flag is not specified, this runtime would be called nvidia.

Adding the --set-as-default flag as follows:

containerd setup \
    --runtime-class NAME \
    --set-as-default \
        /run/nvidia/toolkit

will set the runtime class NAME (or nvidia if not specified) as the default runtime class.

The following table describes the behaviour for different --runtime-class and --set-as-default flag combinations.

FlagsInstalled Runtime ClassesDefault Runtime Class
NONE SPECIFIEDnvidiaNOT SET
--runtime-class NAMENAMENOT SET
--runtime-class nvidianvidiaNOT SET
--set-as-defaultnvidianvidia
--set-as-default --runtime-class NAMENAMENAME
--set-as-default --runtime-class nvidianvidianvidia

These combinations also hold for the environment variables that map to the command line flags.