File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
pkg/device-plugin/nvidiadevice/nvinternal/plugin Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -165,13 +165,18 @@ func (plugin *NvidiaDevicePlugin) getAPIDevices() *[]*util.DeviceInfo {
165
165
if err != nil {
166
166
klog .ErrorS (err , "failed to get numa information" , "idx" , idx )
167
167
}
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
+ }
168
173
res = append (res , & util.DeviceInfo {
169
174
ID : UUID ,
170
175
Index : uint (idx ),
171
176
Count : int32 (plugin .schedulerConfig .DeviceSplitCount ),
172
177
Devmem : registeredmem ,
173
178
Devcore : int32 (plugin .schedulerConfig .DeviceCoreScaling * 100 ),
174
- Type : fmt . Sprintf ( "%v-%v" , "NVIDIA" , Model ) ,
179
+ Type : Model ,
175
180
Numa : numa ,
176
181
Mode : plugin .operatingMode ,
177
182
Health : health ,
You can’t perform that action at this time.
0 commit comments