Merge branch 'fix-cdi-enable-docker' into 'main'

Fix --cdi.enabled for Docker

See merge request nvidia/container-toolkit/container-toolkit!541

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2024-01-23 20:16:12 +00:00 committed by Evan Lezar
parent 888fe458ae
commit 9d9260db8c
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,8 @@
# NVIDIA Container Toolkit Changelog # NVIDIA Container Toolkit Changelog
## v1.14.5 ## v1.14.5
* Fix `nvidia-ctk runtime configure --cdi.enabled` for Docker. This was incorrectly setting `experimental = true` instead
of setting `features.cdi = true`.
## v1.14.4 ## v1.14.4
* Include `nvidia/nvoptix.bin` in list of graphics mounts. * Include `nvidia/nvoptix.bin` in list of graphics mounts.

View File

@ -149,6 +149,7 @@ func (m command) build() *cli.Command {
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "cdi.enabled", Name: "cdi.enabled",
Aliases: []string{"cdi.enable"},
Usage: "Enable CDI in the configured runtime", Usage: "Enable CDI in the configured runtime",
Destination: &config.cdi.enabled, Destination: &config.cdi.enabled,
}, },
@ -310,7 +311,7 @@ func enableCDI(config *config, cfg engine.Interface) error {
case "containerd": case "containerd":
return cfg.Set("enable_cdi", true) return cfg.Set("enable_cdi", true)
case "docker": case "docker":
return cfg.Set("experimental", true) return cfg.Set("features", map[string]bool{"cdi": true})
} }
return fmt.Errorf("enabling CDI in %s is not supported", config.runtime) return fmt.Errorf("enabling CDI in %s is not supported", config.runtime)
} }