nvidia-container-toolkit/cmd/nvidia-container-runtime
Evan Lezar c77e86137e Add version output to CLIs
This change adds version output to the nvidia-continer-runtime,
nvidia-container-toolkit, and nvidia-ctk CLIs. The same version
is used in all cases and includes a version string and a git
revision if set.

The construction of the version string mirrors what is done in runc.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2022-05-13 07:31:11 +02:00
..
modifier Replace experimental and discover-mode 2022-05-12 10:53:50 +02:00
logger.go Call logger.Reset() to ensure errors are captured 2022-05-12 15:42:42 +02:00
main_test.go Add nvidia-container-runtime.runtimes config option 2022-05-09 09:38:12 +02:00
main.go Add version output to CLIs 2022-05-13 07:31:11 +02:00
README.md Add csv discovery mode to experimental runtime 2022-04-07 10:45:19 +02:00
runtime_factory_test.go Replace experimental and discover-mode 2022-05-12 10:53:50 +02:00
runtime_factory.go Replace experimental and discover-mode 2022-05-12 10:53:50 +02:00

The NVIDIA Container Runtime

The NVIDIA Container Runtime is a shim for OCI-compliant low-level runtimes such as runc. When a create command is detected, the incoming OCI runtime specification is modified in place and the command is forwarded to the low-level runtime.

Standard Mode

In the standard mode configuration, the NVIDIA Container Runtime adds a prestart hook to the incomming OCI specification that invokes the NVIDIA Container Runtime Hook for all containers created. This hook checks whether NVIDIA devices are requested and ensures GPU access is configured using the nvidia-container-cli from project libnvidia-container.

Experimental Mode

The NVIDIA Container Runtime can be configured in an experimental mode by setting the following options in the runtime's config.toml file:

[nvidia-container-runtime]
experimental = true

When this setting is enabled, the modifications made to the OCI specification are controlled by the nvidia-container-runtime.discover-mode option, with the following mode supported:

  • "legacy": This mode mirrors the behaviour of the standard mode, inserting the NVIDIA Container Runtime Hook as a prestart hook into the container's OCI specification.
  • "csv": This mode uses CSV files at /etc/nvidia-container-runtime/host-files-for-container.d to define the devices and mounts that are to be injected into a container when it is created.

Notes on using the docker CLI

The docker CLI supports the --gpus flag to select GPUs for inclusion in a container. Since specifying this flag inserts the same NVIDIA Container Runtime Hook into the OCI runtime specification. When experimental mode is activated, the NVIDIA Container Runtime detects the presence of the hook and raises an error. This requirement will be relaxed in the near future.