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
24 changes: 16 additions & 8 deletions internal/rm/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,39 @@ func (r *nvmlResourceManager) checkHealth(stop <-chan any, devices Devices, unhe
deviceIDToGiMap[d.ID] = gi
deviceIDToCiMap[d.ID] = ci
placedDevices = append(placedDevices, placedDevice{parentUUID: uuid, device: d})
}
parentToDeviceMap := groupByParent(placedDevices)

gpu, ret := r.nvml.DeviceGetHandleByUUID(uuid)
for parentUUID, d := range parentToDeviceMap {
gpu, ret := r.nvml.DeviceGetHandleByUUID(parentUUID)
if ret != nvml.SUCCESS {
klog.Infof("unable to get device handle from UUID: %v; marking it as unhealthy", ret)
unhealthy <- d
for _, d := range d {
unhealthy <- d
}
continue
}

supportedEvents, ret := gpu.GetSupportedEventTypes()
if ret != nvml.SUCCESS {
klog.Infof("unable to determine the supported events for %v: %v; marking it as unhealthy", d.ID, ret)
unhealthy <- d
klog.Infof("unable to determine the supported events for %v: %v; marking it as unhealthy", parentUUID, ret)
for _, d := range d {
unhealthy <- d
}
continue
}

ret = gpu.RegisterEvents(eventMask&supportedEvents, eventSet)
switch {
case ret == nvml.ERROR_NOT_SUPPORTED:
klog.Warningf("Device %v is too old to support healthchecking.", d.ID)
klog.Warningf("Device %v is too old to support healthchecking.", parentUUID)
case ret != nvml.SUCCESS:
klog.Infof("Marking device %v as unhealthy: %v", d.ID, ret)
unhealthy <- d
klog.Infof("Marking device %v as unhealthy: %v", parentUUID, ret)
for _, d := range d {
unhealthy <- d
}
}
}
parentToDeviceMap := groupByParent(placedDevices)

for {
select {
Expand Down
Loading