amdsmi_cli: Fix issues for CPU related API's for DIMM
- Fix interface issues for dimm temperature, dimm refresh rate and dimm power consumption Change-Id: I998209c8314e4d78a842187c5a0b127aea7dbef2
This commit is contained in:
committed by
Galantsev, Dmitrii
parent
7dcd5a3fd6
commit
4971466c22
@@ -1838,7 +1838,7 @@ class AMDSMICommands():
|
||||
args.cpu_lclk_dpm_level[0][0])
|
||||
static_dict["socket_dpm"]["dpml_level_range"] = dpm_val
|
||||
except amdsmi_exception.AmdSmiLibraryException as e:
|
||||
static_dict["socket_dpm"]["dpml_level_range"] = dpm_val
|
||||
static_dict["socket_dpm"]["dpml_level_range"] = "N/A"
|
||||
logging.debug("Failed to get socket dpm level range for cpu %s | %s", cpu_id, e.get_error_info())
|
||||
|
||||
if (args.cpu_pwr_svi_telemtry_rails):
|
||||
@@ -1893,7 +1893,7 @@ class AMDSMICommands():
|
||||
amdsmi_interface.amdsmi_set_cpu_socket_power_cap(args.cpu, args.set_cpu_pow_limit[0][0])
|
||||
static_dict["set_pow_limit"]["Response"] = "Set Operation successful"
|
||||
except amdsmi_exception.AmdSmiLibraryException as e:
|
||||
static_dict["set_pow_limit"]["Response"] = "Set Operation successful"
|
||||
static_dict["set_pow_limit"]["Response"] = "N/A"
|
||||
logging.debug("Failed to set power limit for cpu %s | %s", cpu_id, e.get_error_info())
|
||||
|
||||
if (args.set_cpu_xgmi_link_width):
|
||||
|
||||
@@ -654,9 +654,12 @@ core limit value"
|
||||
set_group.add_argument('--set_cpu_pwr_eff_mode', action='append', required=False, type=int, nargs=1, metavar=("MODE"), help=set_cpu_pwr_eff_mode_help)
|
||||
cpu_group.add_argument('--cpu_ddr_bandwidth', action='store_true', required=False, help=cpu_ddr_bandwidth_help)
|
||||
cpu_group.add_argument('--cpu_temp', action='store_true', required=False, help=cpu_temp_help)
|
||||
cpu_group.add_argument('--cpu_dimm_temp_range_rate', action='append', required=False, type=int, nargs=1, metavar=("DIMM_ADDR"), help=cpu_dimm_temp_range_rate_help)
|
||||
cpu_group.add_argument('--cpu_dimm_pow_conumption', action='append', required=False, type=int, nargs=1, metavar=("DIMM_ADDR"), help=cpu_dimm_pow_conumption_help)
|
||||
cpu_group.add_argument('--cpu_dimm_thermal_sensor', action='append', required=False, type=int, nargs=1, metavar=("DIMM_ADDR"), help=cpu_dimm_thermal_sensor_help)
|
||||
cpu_group.add_argument('--cpu_dimm_temp_range_rate', action='append', required=False, type=lambda x: int(x, 0),
|
||||
nargs=1, metavar=("DIMM_ADDR"), help=cpu_dimm_temp_range_rate_help)
|
||||
cpu_group.add_argument('--cpu_dimm_pow_conumption', action='append', required=False, type=lambda x: int(x, 0),
|
||||
nargs=1, metavar=("DIMM_ADDR"), help=cpu_dimm_pow_conumption_help)
|
||||
cpu_group.add_argument('--cpu_dimm_thermal_sensor', action='append', required=False, type=lambda x: int(x, 0),
|
||||
nargs=1, metavar=("DIMM_ADDR"), help=cpu_dimm_thermal_sensor_help)
|
||||
set_group.add_argument('--set_cpu_gmi3_link_width', action='append', required=False, type=int, nargs=2, metavar=("MIN_LW", "MAX_LW"), help=set_cpu_gmi3_link_width_help)
|
||||
set_group.add_argument('--set_cpu_pcie_lnk_rate', action='append', required=False, type=int, nargs=1, metavar=("LINK_RATE"), help=set_cpu_pcie_lnk_rate_help)
|
||||
set_group.add_argument('--set_cpu_df_pstate_range', action='append', required=False, type=int, nargs=2, metavar=("MAX_PSTATE", "MIN_PSTATE"), help=set_cpu_df_pstate_range_help)
|
||||
|
||||
@@ -1088,9 +1088,12 @@ def amdsmi_get_cpu_dimm_temp_range_and_refresh_rate(
|
||||
if not isinstance(dimm_addr, int):
|
||||
raise AmdSmiParameterException(dimm_addr, int)
|
||||
|
||||
dimm_addr = ctypes.c_uint8(dimm_addr)
|
||||
dimm = amdsmi_wrapper.amdsmi_temp_range_refresh_rate_t()
|
||||
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_dimm_temp_range_and_refresh_rate(processor_handle, dimm))
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_dimm_temp_range_and_refresh_rate(processor_handle,
|
||||
dimm_addr,
|
||||
ctypes.byref(dimm)))
|
||||
|
||||
return {
|
||||
"dimm_temperature_range": dimm.range,
|
||||
@@ -1107,9 +1110,12 @@ def amdsmi_get_cpu_dimm_power_consumption(
|
||||
if not isinstance(dimm_addr, int):
|
||||
raise AmdSmiParameterException(dimm_addr, int)
|
||||
|
||||
dimm_addr = ctypes.c_uint8(dimm_addr)
|
||||
dimm = amdsmi_wrapper.amdsmi_dimm_power_t()
|
||||
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_dimm_power_consumption(processor_handle, dimm))
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_dimm_power_consumption(processor_handle,
|
||||
dimm_addr,
|
||||
ctypes.byref(dimm)))
|
||||
|
||||
return {
|
||||
"dimm_power_consumed": f"{dimm.power} mW",
|
||||
@@ -1127,9 +1133,12 @@ def amdsmi_get_cpu_dimm_thermal_sensor(
|
||||
if not isinstance(dimm_addr, int):
|
||||
raise AmdSmiParameterException(dimm_addr, int)
|
||||
|
||||
dimm_addr = ctypes.c_uint8(dimm_addr)
|
||||
dimm_thermal = amdsmi_wrapper.amdsmi_dimm_thermal_t()
|
||||
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_dimm_thermal_sensor(processor_handle, dimm_thermal))
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_dimm_thermal_sensor(processor_handle,
|
||||
dimm_addr,
|
||||
ctypes.byref(dimm_thermal)))
|
||||
|
||||
return {
|
||||
"dimm_thermal_sensor_value": dimm_thermal.sensor,
|
||||
|
||||
Reference in New Issue
Block a user