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
8 changes: 1 addition & 7 deletions agent/utils/ai_tools/gpu/gpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,5 @@ func (n NvidiaSMI) LoadGpuInfo() (*common.GpuInfo, error) {
break
}

if version == "v12" || version == "v11" {
return schema.Parse(data, version)
} else {
global.LOG.Errorf("don't support such schema version %s", version)
}

return &common.GpuInfo{}, nil
return schema.Parse(data, version)
}
7 changes: 5 additions & 2 deletions agent/utils/ai_tools/gpu/schema/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ func Parse(buf []byte, version string) (*common.GpuInfo, error) {

gpuItem.Temperature = s.Gpu[i].Temperature.GpuTemp
gpuItem.PerformanceState = s.Gpu[i].PerformanceState
if version == "v12" {
if version == "v12" || version == "v13" {
gpuItem.PowerDraw = s.Gpu[i].GpuPowerReadings.PowerDraw
gpuItem.MaxPowerLimit = s.Gpu[i].GpuPowerReadings.MaxPowerLimit
if len(gpuItem.PowerDraw) == 0 {
gpuItem.PowerDraw = s.Gpu[i].GpuPowerReadings.InstantPowerDraw
}
gpuItem.MaxPowerLimit = s.Gpu[i].GpuPowerReadings.CurrentPowerLimit
} else {
gpuItem.PowerDraw = s.Gpu[i].PowerReadings.PowerDraw
gpuItem.MaxPowerLimit = s.Gpu[i].PowerReadings.MaxPowerLimit
Expand Down
1 change: 1 addition & 0 deletions agent/utils/ai_tools/gpu/schema/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type smi struct {
} `xml:"gpu_operation_mode"`
GpuPartNumber string `xml:"gpu_part_number"`
GpuPowerReadings struct {
InstantPowerDraw string `xml:"instant_power_draw"`
CurrentPowerLimit string `xml:"current_power_limit"`
DefaultPowerLimit string `xml:"default_power_limit"`
MaxPowerLimit string `xml:"max_power_limit"`
Expand Down
Loading