Skip to content
Merged
Show file tree
Hide file tree
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: 4 additions & 3 deletions cmd/gpu_plugin/gpu_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func (dp *devicePlugin) healthStatusForCard(cardPath string) string {
return health
}

dt, err := dp.levelzeroService.GetDeviceTemperature(bdfAddr)
deviceTemps, err := dp.levelzeroService.GetDeviceTemperature(bdfAddr)
// In case of any errors, return the current health status
if err != nil {
klog.Warningf("Device temperature retrieval failed: %v", err)
Expand All @@ -407,9 +407,10 @@ func (dp *devicePlugin) healthStatusForCard(cardPath string) string {
limit := float64(dp.options.temperatureLimit)

// Temperatures for different areas
klog.V(4).Infof("Temperatures: Memory=%.1fC, GPU=%.1fC, Global=%.1fC", dh.MemoryTemperature, dh.GPUTemperature, dh.GlobalTemperature)
klog.V(4).Infof("Temperatures: Memory=%.1fC, GPU=%.1fC, Global=%.1fC",
deviceTemps.Memory, deviceTemps.GPU, deviceTemps.Global)

if dt.GPU > limit || dt.Global > limit || dt.Memory > limit {
if deviceTemps.GPU > limit || deviceTemps.Global > limit || deviceTemps.Memory > limit {
health = pluginapi.Unhealthy
}

Expand Down
9 changes: 3 additions & 6 deletions cmd/gpu_plugin/levelzeroservice/levelzero_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ type LevelzeroService interface {
}

type DeviceHealth struct {
Memory bool
Bus bool
SoC bool
GlobalTemperature float64
GPUTemperature float64
MemoryTemperature float64
Memory bool
Bus bool
SoC bool
}

type DeviceTemperature struct {
Expand Down