From ab598f004db7ea3e08abf38ad0687c1119a9c640 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 23 Jan 2024 14:56:01 +0100 Subject: [PATCH 1/2] Fix --cdi.enabled for Docker Instead of relying only on Experimental mode, the docker daemon config requires that CDI is an opt-in feature. Signed-off-by: Evan Lezar --- CHANGELOG.md | 1 + cmd/nvidia-ctk/runtime/configure/configure.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb819582..b796cd38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * Fix bug in determining default nvidia-container-runtime.user config value on SUSE-based systems. * Add `crun` to the list of configured low-level runtimes. * Added support for `--ldconfig-path` to `nvidia-ctk cdi generate` command. +* Fix `nvidia-ctk runtime configure --cdi.enabled` for Docker. * [toolkit-container] Bump CUDA base image version to 12.3.1. diff --git a/cmd/nvidia-ctk/runtime/configure/configure.go b/cmd/nvidia-ctk/runtime/configure/configure.go index a3da3e76..d1583ed1 100644 --- a/cmd/nvidia-ctk/runtime/configure/configure.go +++ b/cmd/nvidia-ctk/runtime/configure/configure.go @@ -310,7 +310,7 @@ func enableCDI(config *config, cfg engine.Interface) error { case "containerd": cfg.Set("enable_cdi", true) case "docker": - cfg.Set("experimental", true) + cfg.Set("features", map[string]bool{"cdi": true}) default: return fmt.Errorf("enabling CDI in %s is not supported", config.runtime) } From f936f4c0bcb1f71aa4d2f5ee70b7b39a28c768e5 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 23 Jan 2024 14:57:15 +0100 Subject: [PATCH 2/2] Add --cdi.enable as alias for --cdi.enabled Signed-off-by: Evan Lezar --- cmd/nvidia-ctk/runtime/configure/configure.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/nvidia-ctk/runtime/configure/configure.go b/cmd/nvidia-ctk/runtime/configure/configure.go index d1583ed1..b4b53ed3 100644 --- a/cmd/nvidia-ctk/runtime/configure/configure.go +++ b/cmd/nvidia-ctk/runtime/configure/configure.go @@ -149,6 +149,7 @@ func (m command) build() *cli.Command { }, &cli.BoolFlag{ Name: "cdi.enabled", + Aliases: []string{"cdi.enable"}, Usage: "Enable CDI in the configured runtime", Destination: &config.cdi.enabled, },