mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-11 16:06:02 +08:00
fix: Add gpu monitoring support for some machines (#10133)
Refs #9504 #8397
This commit is contained in:
parent
b2b578a5f0
commit
c752ea4959
3 changed files with 7 additions and 9 deletions
|
@ -59,11 +59,5 @@ func (n NvidiaSMI) LoadGpuInfo() (*common.GpuInfo, error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if version == "v12" || version == "v11" {
|
return schema.Parse(data, version)
|
||||||
return schema.Parse(data, version)
|
|
||||||
} else {
|
|
||||||
global.LOG.Errorf("don't support such schema version %s", version)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &common.GpuInfo{}, nil
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,12 @@ func Parse(buf []byte, version string) (*common.GpuInfo, error) {
|
||||||
|
|
||||||
gpuItem.Temperature = s.Gpu[i].Temperature.GpuTemp
|
gpuItem.Temperature = s.Gpu[i].Temperature.GpuTemp
|
||||||
gpuItem.PerformanceState = s.Gpu[i].PerformanceState
|
gpuItem.PerformanceState = s.Gpu[i].PerformanceState
|
||||||
if version == "v12" {
|
if version == "v12" || version == "v13" {
|
||||||
gpuItem.PowerDraw = s.Gpu[i].GpuPowerReadings.PowerDraw
|
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 {
|
} else {
|
||||||
gpuItem.PowerDraw = s.Gpu[i].PowerReadings.PowerDraw
|
gpuItem.PowerDraw = s.Gpu[i].PowerReadings.PowerDraw
|
||||||
gpuItem.MaxPowerLimit = s.Gpu[i].PowerReadings.MaxPowerLimit
|
gpuItem.MaxPowerLimit = s.Gpu[i].PowerReadings.MaxPowerLimit
|
||||||
|
|
|
@ -108,6 +108,7 @@ type smi struct {
|
||||||
} `xml:"gpu_operation_mode"`
|
} `xml:"gpu_operation_mode"`
|
||||||
GpuPartNumber string `xml:"gpu_part_number"`
|
GpuPartNumber string `xml:"gpu_part_number"`
|
||||||
GpuPowerReadings struct {
|
GpuPowerReadings struct {
|
||||||
|
InstantPowerDraw string `xml:"instant_power_draw"`
|
||||||
CurrentPowerLimit string `xml:"current_power_limit"`
|
CurrentPowerLimit string `xml:"current_power_limit"`
|
||||||
DefaultPowerLimit string `xml:"default_power_limit"`
|
DefaultPowerLimit string `xml:"default_power_limit"`
|
||||||
MaxPowerLimit string `xml:"max_power_limit"`
|
MaxPowerLimit string `xml:"max_power_limit"`
|
||||||
|
|
Loading…
Add table
Reference in a new issue