Skip to content

Commit 0c440fb

Browse files
committed
Use cdi-cri device-list-strategy by default when CDI is enabled
Signed-off-by: Christopher Desiniotis <[email protected]>
1 parent 78007bc commit 0c440fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

controllers/object_controls.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,9 +1380,9 @@ func transformDevicePluginForCDI(obj *appsv1.DaemonSet, config *gpuv1.ClusterPol
13801380
}
13811381

13821382
// When the container runtime supports CDI, we leverage native CDI support in container / cri-o
1383-
// to inject GPUs into workloads. In this case, we use the standard CDI annotation prefix 'cdi.k8s.io/'
1384-
// instead of a custom annotation prefix that the 'nvidia' container runtime is configured to look for.
1385-
deviceListStrategy := "cdi-annotations"
1383+
// to inject GPUs into workloads. If native CDI is not supported, we leverage CDI support in
1384+
// NVIDIA Container Toolkit.
1385+
deviceListStrategy := "cdi-cri"
13861386
cdiAnnotationPrefix := "cdi.k8s.io/"
13871387
if !n.runtimeSupportsCDI {
13881388
deviceListStrategy = "envvar,cdi-annotations"

controllers/transforms_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ func TestTransformDevicePluginForCDI(t *testing.T) {
12771277
Name: "main-ctr",
12781278
Env: []corev1.EnvVar{
12791279
{Name: CDIEnabledEnvName, Value: "true"},
1280-
{Name: DeviceListStrategyEnvName, Value: "cdi-annotations"},
1280+
{Name: DeviceListStrategyEnvName, Value: "cdi-cri"},
12811281
{Name: CDIAnnotationPrefixEnvName, Value: "cdi.k8s.io/"},
12821282
},
12831283
}),
@@ -1327,7 +1327,7 @@ func TestTransformDevicePluginForCDI(t *testing.T) {
13271327
Env: []corev1.EnvVar{
13281328
{Name: CDIEnabledEnvName, Value: "true"},
13291329
{Name: NvidiaCDIHookPathEnvName, Value: "/path/to/install/toolkit/nvidia-cdi-hook"},
1330-
{Name: DeviceListStrategyEnvName, Value: "cdi-annotations"},
1330+
{Name: DeviceListStrategyEnvName, Value: "cdi-cri"},
13311331
{Name: CDIAnnotationPrefixEnvName, Value: "cdi.k8s.io/"},
13321332
},
13331333
}),

0 commit comments

Comments
 (0)