Skip to content

Commit bf52a8e

Browse files
committed
nvidia-k8s-device-plugin: add patch to enable allDeviceName
Signed-off-by: Jingwei Wang <[email protected]>
1 parent 7ace475 commit bf52a8e

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From ae5521585da70ff06ae66c9b02613cf85b5c3c0a Mon Sep 17 00:00:00 2001
2+
From: Jingwei Wang <[email protected]>
3+
Date: Tue, 18 Mar 2025 23:23:40 +0000
4+
Subject: [PATCH] k8s-device-plugin all device patch
5+
6+
Signed-off-by: Jingwei Wang <[email protected]>
7+
---
8+
internal/cdi/cdi.go | 5 +++++
9+
1 file changed, 5 insertions(+)
10+
11+
diff --git a/internal/cdi/cdi.go b/internal/cdi/cdi.go
12+
index fae421ba..c53ee730 100644
13+
--- a/internal/cdi/cdi.go
14+
+++ b/internal/cdi/cdi.go
15+
@@ -38,6 +38,7 @@ import (
16+
17+
const (
18+
cdiRoot = "/var/run/cdi"
19+
+ allDeviceName = "all"
20+
)
21+
22+
// cdiHandler creates CDI specs for devices assocatied with the device plugin
23+
@@ -124,6 +125,10 @@ func New(infolib info.Interface, nvmllib nvml.Interface, devicelib device.Interf
24+
nvcdi.WithDeviceNamers(deviceNamer),
25+
nvcdi.WithVendor(c.vendor),
26+
nvcdi.WithClass("gpu"),
27+
+ nvcdi.WithMergedDeviceOptions(
28+
+ transform.WithName(allDeviceName),
29+
+ transform.WithSkipIfExists(true),
30+
+ ),
31+
)
32+
if err != nil {
33+
return nil, fmt.Errorf("failed to create nvcdi library: %v", err)
34+
--
35+
2.47.0
36+

packages/nvidia-k8s-device-plugin/nvidia-k8s-device-plugin.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Source2: nvidia-k8s-device-plugin-conf
1818
Source3: nvidia-k8s-device-plugin-exec-start-conf
1919
Source4: nvidia-k8s-device-plugin-mig-conf
2020

21+
Patch1100: 1100-k8s-device-plugin-all-device-patch.patch
2122

2223
BuildRequires: %{_cross_os}glibc-devel
2324
Requires: %{name}(binaries)

0 commit comments

Comments
 (0)