From f768bb5783795aa4d6d9fca5313ac3429adfe250 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 30 Jan 2023 13:36:11 +0100 Subject: [PATCH] Use device index as CDI device names by default This change uses the `index` mode for the --device-name-strategy when generating CDI specifications by default. This generates device names such as nvidia.com/gpu=0 or nvidia.com/gpu=1:0 by default. Note that this requires a CDI spec version of 0.5.0 and for consumers (e.g. podman) that are only compatible with older versions one of the other stragegies (`type-index` or `uuid`) should be used instead to generate a v0.3.0 or v0.4.0 specification. Signed-off-by: Evan Lezar --- cmd/nvidia-ctk/cdi/generate/generate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go index aeee4967..93334eb3 100644 --- a/cmd/nvidia-ctk/cdi/generate/generate.go +++ b/cmd/nvidia-ctk/cdi/generate/generate.go @@ -89,8 +89,8 @@ func (m command) build() *cli.Command { }, &cli.StringFlag{ Name: "device-name-strategy", - Usage: "Specify the strategy for generating device names. One of [type-index | index | uuid]", - Value: deviceNameStrategyTypeIndex, + Usage: "Specify the strategy for generating device names. One of [index | uuid | type-index]", + Value: deviceNameStrategyIndex, Destination: &cfg.deviceNameStrategy, }, &cli.StringFlag{