diff --git a/pkg/sensors/accelerator/device/sources/dcgm.go b/pkg/sensors/accelerator/device/sources/dcgm.go index af2943c0cf..9fbba5fdcb 100644 --- a/pkg/sensors/accelerator/device/sources/dcgm.go +++ b/pkg/sensors/accelerator/device/sources/dcgm.go @@ -307,7 +307,7 @@ func (d *GPUDcgm) AbsEnergyFromDevice() []uint32 { } // since Kepler collects metrics at intervals of SamplePeriodSec, which is greater than 1 second, it is // necessary to calculate the energy consumption for the entire waiting period - energy := uint32(uint64(power) * config.SamplePeriodSec) + energy := uint32(uint64(power) * config.SamplePeriodSec()) gpuEnergy = append(gpuEnergy, energy) } return gpuEnergy diff --git a/pkg/sensors/accelerator/device/sources/habana.go b/pkg/sensors/accelerator/device/sources/habana.go index a1abbe84a4..7cfefb3ce6 100644 --- a/pkg/sensors/accelerator/device/sources/habana.go +++ b/pkg/sensors/accelerator/device/sources/habana.go @@ -108,7 +108,7 @@ func (g *GPUHabana) AbsEnergyFromDevice() []uint32 { klog.Errorf("failed to get power usage on device %v: %v\n", dev, ret) continue } - energy := uint32(uint64(power) * config.SamplePeriodSec) + energy := uint32(uint64(power) * config.SamplePeriodSec()) gpuEnergy = append(gpuEnergy, energy) dname, _ := dev.(device.GPUDevice).DeviceHandler.(hlml.Device).Name() diff --git a/pkg/sensors/accelerator/device/sources/nvml.go b/pkg/sensors/accelerator/device/sources/nvml.go index 0db0e5570d..04b9931c75 100644 --- a/pkg/sensors/accelerator/device/sources/nvml.go +++ b/pkg/sensors/accelerator/device/sources/nvml.go @@ -184,7 +184,7 @@ func (n *GPUNvml) AbsEnergyFromDevice() []uint32 { } // since Kepler collects metrics at intervals of SamplePeriodSec, which is greater than 1 second, it is // necessary to calculate the energy consumption for the entire waiting period - energy := uint32(uint64(power) * config.SamplePeriodSec) + energy := uint32(uint64(power) * config.SamplePeriodSec()) gpuEnergy = append(gpuEnergy, energy) } return gpuEnergy