Skip to content

Commit

Permalink
accelerator: ignore gpu error of process not found (#829)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcelo Amaral <[email protected]>
  • Loading branch information
marceloamaral authored Jul 26, 2023
1 parent 36209ab commit 88451ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/power/accelerator/source/gpu_nvml.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ func (n *GPUNvml) GetProcessResourceUtilizationPerDevice(device interface{}, sin

processUtilizationSample, ret := device.(nvml.Device).GetProcessUtilization(lastUtilizationTimestamp)
if ret != nvml.SUCCESS {
if ret == nvml.ERROR_NOT_FOUND {
// ignore the error if there is no process running in the GPU
return nil, nil
}
return nil, fmt.Errorf("failed to get processes' utilization on device %v: %v", device, nvml.ErrorString(ret))
}

Expand Down

0 comments on commit 88451ac

Please sign in to comment.