Skip to content

Commit a8b1140

Browse files
authored
Merge pull request #2155 from tkatila/gpu-levelzero-use-correct-struct
gpu: levelzero: use correct struct for temp printing
2 parents e0d9e10 + 5c20516 commit a8b1140

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

cmd/gpu_plugin/gpu_plugin.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ func (dp *devicePlugin) healthStatusForCard(cardPath string) string {
396396
return health
397397
}
398398

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

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

412-
if dt.GPU > limit || dt.Global > limit || dt.Memory > limit {
413+
if deviceTemps.GPU > limit || deviceTemps.Global > limit || deviceTemps.Memory > limit {
413414
health = pluginapi.Unhealthy
414415
}
415416

cmd/gpu_plugin/levelzeroservice/levelzero_service.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@ type LevelzeroService interface {
3333
}
3434

3535
type DeviceHealth struct {
36-
Memory bool
37-
Bus bool
38-
SoC bool
39-
GlobalTemperature float64
40-
GPUTemperature float64
41-
MemoryTemperature float64
36+
Memory bool
37+
Bus bool
38+
SoC bool
4239
}
4340

4441
type DeviceTemperature struct {

0 commit comments

Comments
 (0)