Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/device-plugin/nvidiadevice/nvinternal/plugin/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,18 @@ func (plugin *NvidiaDevicePlugin) getAPIDevices() *[]*util.DeviceInfo {
if err != nil {
klog.ErrorS(err, "failed to get numa information", "idx", idx)
}
if !strings.HasPrefix(Model, "NVIDIA") {
// If the model name does not start with "NVIDIA ", we assume it is a virtual GPU or a non-NVIDIA device.
// This is to handle cases where the model name might not be in the expected format.
Model = fmt.Sprintf("NVIDIA-%s", Model)
}
res = append(res, &util.DeviceInfo{
ID: UUID,
Index: uint(idx),
Count: int32(plugin.schedulerConfig.DeviceSplitCount),
Devmem: registeredmem,
Devcore: int32(plugin.schedulerConfig.DeviceCoreScaling * 100),
Type: fmt.Sprintf("%v-%v", "NVIDIA", Model),
Type: Model,
Numa: numa,
Mode: plugin.operatingMode,
Health: health,
Expand Down