Skip to content

Commit 0879e2a

Browse files
committed
nvidia model duplicate NVIDIA prefix
Signed-off-by: rongfu.leng <[email protected]>
1 parent a90081d commit 0879e2a

File tree

1 file changed

+6
-1
lines changed
  • pkg/device-plugin/nvidiadevice/nvinternal/plugin

1 file changed

+6
-1
lines changed

pkg/device-plugin/nvidiadevice/nvinternal/plugin/register.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,18 @@ func (plugin *NvidiaDevicePlugin) getAPIDevices() *[]*util.DeviceInfo {
165165
if err != nil {
166166
klog.ErrorS(err, "failed to get numa information", "idx", idx)
167167
}
168+
if !strings.HasPrefix(Model, "NVIDIA ") {
169+
// If the model name does not start with "NVIDIA ", we assume it is a virtual GPU or a non-NVIDIA device.
170+
// This is to handle cases where the model name might not be in the expected format.
171+
Model = fmt.Sprintf("NVIDIA-%s", Model)
172+
}
168173
res = append(res, &util.DeviceInfo{
169174
ID: UUID,
170175
Index: uint(idx),
171176
Count: int32(plugin.schedulerConfig.DeviceSplitCount),
172177
Devmem: registeredmem,
173178
Devcore: int32(plugin.schedulerConfig.DeviceCoreScaling * 100),
174-
Type: fmt.Sprintf("%v-%v", "NVIDIA", Model),
179+
Type: Model,
175180
Numa: numa,
176181
Mode: plugin.operatingMode,
177182
Health: health,

0 commit comments

Comments
 (0)