Merge amd-dev into amd-master 20240118
Signed-off-by: guanyu12 <guanyu12@amd.com> Change-Id: I77fea29caae9c0f6755a6903c2501ebfdfad60e7
This commit is contained in:
+772
-169
File diff suppressed because it is too large
Load Diff
@@ -119,7 +119,7 @@ class AmdSmiDeviceNotFoundException(AmdSmiException):
|
||||
self.command = command
|
||||
self.output_format = outputformat
|
||||
|
||||
common_message = f"Can not find a GPU with the corresponding identifier: '{self.command}'"
|
||||
common_message = f"Can not find a device with the corresponding identifier: '{self.command}'"
|
||||
|
||||
self.json_message["error"] = common_message
|
||||
self.json_message["code"] = self.value
|
||||
|
||||
@@ -736,6 +736,10 @@ class AMDSMICommands():
|
||||
else:
|
||||
logging.info("No CPU devices present")
|
||||
|
||||
if (cpu_options and (len(self.cpu_handles) == 0)):
|
||||
logging.error("No CPU devices present")
|
||||
sys.exit(-1)
|
||||
|
||||
if (len(self.device_handles) and ((((not gpus) and (not cpus)) or gpus)
|
||||
and not cpu_options)):
|
||||
self.logger.clear_multiple_devices_ouput()
|
||||
@@ -746,6 +750,10 @@ class AMDSMICommands():
|
||||
else:
|
||||
logging.info("No GPU devices present")
|
||||
|
||||
if (gpu_options and (len(self.device_handles) == 0)):
|
||||
logging.error("No GPU devices present")
|
||||
sys.exit(-1)
|
||||
|
||||
if (len(self.cpu_handles) == 0 and len(self.device_handles) == 0):
|
||||
logging.error("No CPU and GPU devices present")
|
||||
sys.exit(-1)
|
||||
@@ -1122,14 +1130,11 @@ class AMDSMICommands():
|
||||
if args.usage:
|
||||
try:
|
||||
engine_usage = amdsmi_interface.amdsmi_get_gpu_activity(args.gpu)
|
||||
engine_usage['gfx_usage'] = engine_usage.pop('gfx_activity')
|
||||
engine_usage['mem_usage'] = engine_usage.pop('umc_activity')
|
||||
engine_usage['mm_ip_usage'] = engine_usage.pop('mm_activity')
|
||||
engine_usage['vcn_activities'] = gpu_metric_output.pop('vcn_activity')
|
||||
engine_usage['jpeg_activities[AID0]'] = gpu_metric_output.pop('jpeg_activities[AID0]')
|
||||
engine_usage['jpeg_activities[AID1]'] = gpu_metric_output.pop('jpeg_activities[AID1]')
|
||||
engine_usage['jpeg_activities[AID2]'] = gpu_metric_output.pop('jpeg_activities[AID2]')
|
||||
engine_usage['jpeg_activities[AID3]'] = gpu_metric_output.pop('jpeg_activities[AID3]')
|
||||
engine_usage['gfx_activity'] = engine_usage.pop('gfx_activity')
|
||||
engine_usage['umc_activity'] = engine_usage.pop('umc_activity')
|
||||
engine_usage['mm_activity'] = engine_usage.pop('mm_activity')
|
||||
engine_usage['vcn_activity'] = gpu_metric_output.pop('vcn_activity')
|
||||
engine_usage['jpeg_activity'] = gpu_metric_output.pop('jpeg_activity')
|
||||
for key, value in engine_usage.items():
|
||||
if not isinstance(value, list) and value > 100:
|
||||
engine_usage[key] = "N/A"
|
||||
@@ -1655,7 +1660,32 @@ class AMDSMICommands():
|
||||
args (Namespace): Namespace containing the parsed CLI args
|
||||
multiple_devices (bool, optional): True if checking for multiple devices. Defaults to False.
|
||||
cpu (cpu_handle, optional): device_handle for target device. Defaults to None.
|
||||
|
||||
cpu_power_metrics (bool, optional): Value override for args.cpu_power_metrics. Defaults to None
|
||||
prochot (bool, optional): Value override for args.prochot. Defaults to None.
|
||||
freq_metrics (bool, optional): Value override for args.freq_metrics. Defaults to None.
|
||||
c0_res (bool, optional): Value override for args.c0_res. Defaults to None
|
||||
lclk_dpm_level (list, optional): Value override for args.lclk_dpm_level. Defaults to None
|
||||
pwr_svi_telemtry_rails (list, optional): value override for args.pwr_svi_telemtry_rails. Defaults to None
|
||||
io_bandwidth (list, optional): value override for args.io_bandwidth. Defaults to None
|
||||
xgmi_bandwidth (list, optional): value override for args.xgmi_bandwidth. Defaults to None
|
||||
enable_apb (bool, optional): Value override for args.enable_apb. Defaults to None
|
||||
disable_apb (bool, optional): Value override for args.disable_apb. Defaults to None
|
||||
set_pow_limit (int, optional): Value override for args.cpu_set_pow_limit. Defaults to None
|
||||
set_xgmi_link_width (list, optional): Value override for args.set_cpu_xgmi_link_width. Defaults to None
|
||||
set_lclk_dpm_level (list, optional): Value override for args.set_cpu_lclk_dpm_level. Defaults to None
|
||||
set_soc_boost_limit (list, optional): Value override for args.set_soc_boost_limit. Defaults to None
|
||||
metrics_ver (bool, optional): Value override for args.cpu_metrics_ver. Defaults to None
|
||||
metrics_table (bool, optional): Value override for args.cpu_metrics_table. Defaults to None
|
||||
socket_energy (bool, optional): Value override for args.socket_energy. Defaults to None
|
||||
set_pwr_eff_mode (list, optional): Value override for args.set_cpu_pwr_eff_mode. Defaults to None
|
||||
ddr_bandwidth (bool, optional): Value override for args.ddr_bandwidth. Defaults to None
|
||||
cpu_temp (bool, optional): Value override for args.cpu_temp. Defaults to None
|
||||
dimm_temp_range_rate (list, optional): Dimm address.Value override for args.cpu_dimm_temp_range_rate. Defaults to None
|
||||
dimm_pow_conumption (list, optional): Dimm address. Value override for args.cpu_dimm_pow_conumption. Defaults to None
|
||||
dimm_thermal_sensor (list, optional): Dimm address. Value override for args.cpu_dimm_thermal_sensor. Defaults to None
|
||||
set_gmi3_link_width (list, optional): Min and Max link wdiths.Value override for args.set_cpu_gmi3_link_width. Defaults to None
|
||||
set_pcie_lnk_rate (list, optional): Link rate.Value override for args.set_cpu_pcie_lnk_rate. Defaults to None
|
||||
set_df_pstate_range (list, optional): Max and Min pstates.Value override for args.set_cpu_df_pstate_range. Defaults to None
|
||||
Returns:
|
||||
None: Print output via AMDSMILogger to destination
|
||||
"""
|
||||
@@ -1725,7 +1755,7 @@ class AMDSMICommands():
|
||||
"socket_energy", "set_cpu_pwr_eff_mode", "cpu_ddr_bandwidth",
|
||||
"cpu_temp", "cpu_dimm_temp_range_rate", "cpu_dimm_pow_conumption",
|
||||
"cpu_dimm_thermal_sensor", "set_cpu_gmi3_link_width", "set_cpu_pcie_lnk_rate",
|
||||
"set_cpu_df_pstate_range"]
|
||||
"set_cpu_df_pstate_range", "cpu_enable_apb"]
|
||||
curr_platform_cpu_values = [args.cpu_power_metrics, args.cpu_prochot, args.cpu_freq_metrics,
|
||||
args.cpu_c0_res, args.cpu_lclk_dpm_level, args.cpu_pwr_svi_telemtry_rails,
|
||||
args.cpu_io_bandwidth, args.cpu_xgmi_bandwidth, args.cpu_disable_apb,
|
||||
@@ -1734,7 +1764,7 @@ class AMDSMICommands():
|
||||
args.socket_energy, args.set_cpu_pwr_eff_mode, args.cpu_ddr_bandwidth,
|
||||
args.cpu_temp, args.cpu_dimm_temp_range_rate, args.cpu_dimm_pow_conumption,
|
||||
args.cpu_dimm_thermal_sensor, args.set_cpu_gmi3_link_width, args.set_cpu_pcie_lnk_rate,
|
||||
args.set_cpu_df_pstate_range]
|
||||
args.set_cpu_df_pstate_range, args.cpu_enable_apb]
|
||||
|
||||
|
||||
# Handle No CPU passed
|
||||
@@ -1747,7 +1777,8 @@ class AMDSMICommands():
|
||||
"set_cpu_pow_limit", "set_cpu_xgmi_link_width", "set_cpu_lclk_dpm_level",
|
||||
"set_soc_boost_limit", "set_cpu_pwr_eff_mode", "cpu_dimm_temp_range_rate",
|
||||
"cpu_dimm_temp_range_rate", "cpu_dimm_pow_conumption", "cpu_dimm_thermal_sensor",
|
||||
"set_cpu_gmi3_link_width", "set_cpu_pcie_lnk_rate", "set_cpu_df_pstate_range"):
|
||||
"set_cpu_gmi3_link_width", "set_cpu_pcie_lnk_rate", "set_cpu_df_pstate_range",
|
||||
"cpu_enable_apb"):
|
||||
setattr(args, arg, True)
|
||||
|
||||
if (len(self.cpu_handles)):
|
||||
@@ -1840,7 +1871,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):
|
||||
@@ -1895,7 +1926,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):
|
||||
@@ -1938,15 +1969,12 @@ class AMDSMICommands():
|
||||
|
||||
if (args.cpu_metrics_table):
|
||||
static_dict["metrics_table"] = {}
|
||||
static_dict["metrics_table"]["response"] = "N/A"
|
||||
# Note:- amdsmi_get_metrics_table has been disabled as there is fix needed in the library API and will be
|
||||
# in next version
|
||||
"""try:
|
||||
try:
|
||||
metrics_table = amdsmi_interface.amdsmi_get_metrics_table(args.cpu)
|
||||
static_dict["metrics_table"]["response"] = metrics_table
|
||||
except amdsmi_exception.AmdSmiLibraryException as e:
|
||||
static_dict["metrics_table"]["response"] = "N/A"
|
||||
logging.debug("Failed to get metrics table for cpu %s | %s", cpu_id, e.get_error_info())"""
|
||||
logging.debug("Failed to get metrics table for cpu %s | %s", cpu_id, e.get_error_info())
|
||||
|
||||
if (args.socket_energy):
|
||||
static_dict["socket_energy"] = {}
|
||||
@@ -2056,7 +2084,10 @@ class AMDSMICommands():
|
||||
args (Namespace): Namespace containing the parsed CLI args
|
||||
multiple_devices (bool, optional): True if checking for multiple devices. Defaults to False.
|
||||
core (device_handle, optional): device_handle for target device. Defaults to None.
|
||||
|
||||
boost_limit (bool, optional): Value override for args.boostlimit. Defaults to None
|
||||
curr_active_freq_core_limit (bool, optional): Value override for args.boostlimit. Defaults to None
|
||||
set_core_boost_limit(list, optional): boost limit value.Value override for args.set_core_boost_limit. Defaults to None
|
||||
core_energy (bool, optional): Value override for args.core_energy. Defaults to None
|
||||
Returns:
|
||||
None: Print output via AMDSMILogger to destination
|
||||
"""
|
||||
@@ -2189,6 +2220,7 @@ class AMDSMICommands():
|
||||
guest_data (bool, optional): Value override for args.guest_data. Defaults to None.
|
||||
fb_usage (bool, optional): Value override for args.fb_usage. Defaults to None.
|
||||
xgmi (bool, optional): Value override for args.xgmi. Defaults to None.
|
||||
cpu (device_handle, optional): cpu index. Defaults to None
|
||||
cpu_power_metrics (bool, optional): Value override for args.cpu_power_metrics. Defaults to None
|
||||
prochot (bool, optional): Value override for args.prochot. Defaults to None.
|
||||
freq_metrics (bool, optional): Value override for args.freq_metrics. Defaults to None.
|
||||
@@ -2199,10 +2231,9 @@ class AMDSMICommands():
|
||||
xgmi_bandwidth (list, optional): value override for args.xgmi_bandwidth. Defaults to None
|
||||
enable_apb (bool, optional): Value override for args.enable_apb. Defaults to None
|
||||
disable_apb (bool, optional): Value override for args.disable_apb. Defaults to None
|
||||
set_pow_limit (bool, optional): Value override for args.cpu_set_pow_limit. Defaults to None
|
||||
set_pow_limit (int, optional): Value override for args.cpu_set_pow_limit. Defaults to None
|
||||
set_xgmi_link_width (list, optional): Value override for args.set_cpu_xgmi_link_width. Defaults to None
|
||||
set_lclk_dpm_level (bool, optional): Value override for args.set_cpu_lclk_dpm_level. Defaults to None
|
||||
boost_limit (bool, optional): Value override for args.boost_limit. Defaults to None
|
||||
set_lclk_dpm_level (list, optional): Value override for args.set_cpu_lclk_dpm_level. Defaults to None
|
||||
set_soc_boost_limit (list, optional): Value override for args.set_soc_boost_limit. Defaults to None
|
||||
metrics_ver (bool, optional): Value override for args.cpu_metrics_ver. Defaults to None
|
||||
metrics_table (bool, optional): Value override for args.cpu_metrics_table. Defaults to None
|
||||
@@ -2210,12 +2241,17 @@ class AMDSMICommands():
|
||||
set_pwr_eff_mode (list, optional): Value override for args.set_cpu_pwr_eff_mode. Defaults to None
|
||||
ddr_bandwidth (bool, optional): Value override for args.ddr_bandwidth. Defaults to None
|
||||
cpu_temp (bool, optional): Value override for args.cpu_temp. Defaults to None
|
||||
dimm_temp_range_rate (bool, optional): Value override for args.cpu_dimm_temp_range_rate. Defaults to None
|
||||
dimm_pow_conumption (bool, optional): Value override for args.cpu_dimm_pow_conumption. Defaults to None
|
||||
dimm_thermal_sensor (bool, optional): Value override for args.cpu_dimm_thermal_sensor. Defaults to None
|
||||
set_gmi3_link_width (list, optional): Value override for args.set_cpu_gmi3_link_width. Defaults to None
|
||||
set_pcie_lnk_rate (list, optional): Value override for args.set_cpu_pcie_lnk_rate. Defaults to None
|
||||
set_df_pstate_range (list, optional): Value override for args.set_cpu_df_pstate_range. Defaults to None
|
||||
dimm_temp_range_rate (list, optional): Dimm address.Value override for args.cpu_dimm_temp_range_rate. Defaults to None
|
||||
dimm_pow_conumption (list, optional): Dimm address. Value override for args.cpu_dimm_pow_conumption. Defaults to None
|
||||
dimm_thermal_sensor (list, optional): Dimm address. Value override for args.cpu_dimm_thermal_sensor. Defaults to None
|
||||
set_gmi3_link_width (list, optional): Min and Max link wdiths.Value override for args.set_cpu_gmi3_link_width. Defaults to None
|
||||
set_pcie_lnk_rate (list, optional): Link rate.Value override for args.set_cpu_pcie_lnk_rate. Defaults to None
|
||||
set_df_pstate_range (list, optional): Max and Min pstates.Value override for args.set_cpu_df_pstate_range. Defaults to None
|
||||
core (int, optional): core index. Value override for args.core.Defaults to None
|
||||
boost_limit (bool, optional): Value override for args.boostlimit. Defaults to None
|
||||
curr_active_freq_core_limit (bool, optional): Value override for args.boostlimit. Defaults to None
|
||||
set_core_boost_limit(list, optional): boost limit value.Value override for args.set_core_boost_limit. Defaults to None
|
||||
|
||||
|
||||
Raises:
|
||||
IndexError: Index error if gpu list is empty
|
||||
@@ -2252,6 +2288,10 @@ class AMDSMICommands():
|
||||
xgmi_err, energy, mem_usage, schedule,
|
||||
guard, guest_data, fb_usage, xgmi)
|
||||
|
||||
if (gpu_options and (len(self.device_handles) == 0)):
|
||||
logging.error("No GPU devices present")
|
||||
sys.exit(-1)
|
||||
|
||||
if ((len(self.cpu_handles) and ((((not gpus) and (not cpus) and (not cores)) or cpus)
|
||||
and not gpu_options and not core_options))):
|
||||
self.logger.clear_multiple_devices_ouput()
|
||||
@@ -2264,6 +2304,9 @@ class AMDSMICommands():
|
||||
dimm_pow_conumption,dimm_thermal_sensor, set_gmi3_link_width,
|
||||
set_pcie_lnk_rate, set_df_pstate_range)
|
||||
|
||||
if (cpu_options and (len(self.cpu_handles) == 0)):
|
||||
logging.error("No CPU devices present")
|
||||
sys.exit(-1)
|
||||
|
||||
if ((len(self.core_handles) and ((((not gpus) and (not cpus) and (not cores)) or cores)
|
||||
and not gpu_options and not cpu_options))):
|
||||
@@ -2272,6 +2315,10 @@ class AMDSMICommands():
|
||||
curr_active_freq_core_limit, set_core_boost_limit,
|
||||
core_energy)
|
||||
|
||||
if (core_options and (len(self.cpu_handles) == 0)):
|
||||
logging.error("No Core devices present")
|
||||
sys.exit(-1)
|
||||
|
||||
if (len(self.cpu_handles) == 0 and len(self.device_handles) == 0 and
|
||||
len(self.core_handles) == 0):
|
||||
logging.error("No CPU and GPU devices present")
|
||||
|
||||
@@ -385,7 +385,7 @@ class AMDSMIHelpers():
|
||||
|
||||
selected_device_handles = []
|
||||
for core_selection in core_selections:
|
||||
valid_cpu_choice = False
|
||||
valid_core_choice = False
|
||||
for core_id, core_info in core_choices.items():
|
||||
device_handle = core_info['Device Handle']
|
||||
|
||||
|
||||
+59
-22
@@ -323,6 +323,23 @@ class AMDSMIParser(argparse.ArgumentParser):
|
||||
type=self._positive_int, required=False, help=iterations_help)
|
||||
|
||||
|
||||
def _validate_cpu_core(self, value):
|
||||
if (int(value) < 0):
|
||||
outputformat = self.helpers.get_output_format()
|
||||
raise amdsmi_cli_exceptions.AmdSmiInvalidParameterValueException(value, outputformat)
|
||||
|
||||
return value
|
||||
|
||||
|
||||
def _validate_positive(self, value):
|
||||
i_value = int(value)
|
||||
if (i_value < 0):
|
||||
outputformat = self.helpers.get_output_format()
|
||||
raise amdsmi_cli_exceptions.AmdSmiInvalidParameterValueException(i_value, outputformat)
|
||||
|
||||
return i_value
|
||||
|
||||
|
||||
def _add_device_arguments(self, subcommand_parser, required=False):
|
||||
# Device arguments help text
|
||||
gpu_help = f"Select a GPU ID, BDF, or UUID from the possible choices:\n{self.gpu_choices_str}"
|
||||
@@ -336,9 +353,11 @@ class AMDSMIParser(argparse.ArgumentParser):
|
||||
device_args = subcommand_parser.add_mutually_exclusive_group(required=required)
|
||||
device_args.add_argument('-g', '--gpu', action=self._gpu_select(self.gpu_choices),
|
||||
nargs='+', help=gpu_help)
|
||||
device_args.add_argument('-U', '--cpu', action=self._cpu_select(self.cpu_choices),
|
||||
device_args.add_argument('-U', '--cpu', type=self._validate_cpu_core,
|
||||
action=self._cpu_select(self.cpu_choices),
|
||||
nargs='+', help=cpu_help)
|
||||
device_args.add_argument('-O', '--core', action=self._core_select(self.core_choices),
|
||||
device_args.add_argument('-O', '--core', type=self._validate_cpu_core,
|
||||
action=self._core_select(self.core_choices),
|
||||
nargs='+', help=core_help)
|
||||
|
||||
if self.helpers.is_hypervisor():
|
||||
@@ -556,7 +575,7 @@ class AMDSMIParser(argparse.ArgumentParser):
|
||||
\n input parameters are bandwidth type(1,2,4) and link ID encodings\
|
||||
\n i.e. P2, P3, G0 - G7"
|
||||
cpu_enable_apb_help = "Enables the DF p-state performance boost algorithm"
|
||||
cpu_disable_apb_help = "Disables the DF p-state performance boost alogorithm."
|
||||
cpu_disable_apb_help = "Disables the DF p-state performance boost algorithm."
|
||||
"Input parameter is DFPstate (0 -3 )"
|
||||
set_cpu_pow_limit_help = "Set power limit for the given socket. Input parameter is \
|
||||
power limit value."
|
||||
@@ -578,7 +597,7 @@ core limit value"
|
||||
cpu_ddr_bandwidth_help = "Displays per socket max ddr bw, current utilized bw and current utilized ddr bw in percentage"
|
||||
cpu_temp_help = "Displays cpu socket temperature"
|
||||
cpu_dimm_temp_range_rate_help = "Displays dimm temperature range and refresh rate"
|
||||
cpu_dimm_pow_conumption_help = "Displays dimm power conumption"
|
||||
cpu_dimm_pow_conumption_help = "Displays dimm power consumption"
|
||||
cpu_dimm_thermal_sensor_help = "Displays dimm thermal sensor"
|
||||
set_cpu_gmi3_link_width_help = "Sets max and min gmi3 link width range"
|
||||
set_cpu_pcie_lnk_rate_help = "Sets pcie link rate"
|
||||
@@ -634,32 +653,50 @@ core limit value"
|
||||
cpu_group.add_argument('--cpu_prochot', action='store_true', required=False, help=cpu_proc_help)
|
||||
cpu_group.add_argument('--cpu_freq_metrics', action='store_true', required=False, help=cpu_freq_help)
|
||||
cpu_group.add_argument('--cpu_c0_res', action='store_true', required=False, help=cpu_c0_res_help)
|
||||
cpu_group.add_argument('--cpu_lclk_dpm_level', action='append', required=False, type=int, nargs=1, metavar=("NBIOID"), help=cpu_lclk_dpm_help)
|
||||
cpu_group.add_argument('--cpu_pwr_svi_telemtry_rails', action='store_true', required=False, help=cpu_pwr_svi_telemtry_rails_help)
|
||||
cpu_group.add_argument('--cpu_io_bandwidth', action='append', required=False, nargs=2, metavar=("IO_BW","LINKID_NAME"), help=cpu_io_bandwidth_help)
|
||||
cpu_group.add_argument('--cpu_xgmi_bandwidth', action='append', required=False, nargs=2, metavar=("XGMI_BW","LINKID_NAME"), help=cpu_xgmi_bandwidth_help)
|
||||
cpu_group.add_argument('--cpu_lclk_dpm_level', action='append', required=False, type=self._validate_positive,
|
||||
nargs=1, metavar=("NBIOID"), help=cpu_lclk_dpm_help)
|
||||
cpu_group.add_argument('--cpu_pwr_svi_telemtry_rails', action='store_true', required=False,
|
||||
help=cpu_pwr_svi_telemtry_rails_help)
|
||||
cpu_group.add_argument('--cpu_io_bandwidth', action='append', required=False, nargs=2,
|
||||
metavar=("IO_BW","LINKID_NAME"), help=cpu_io_bandwidth_help)
|
||||
cpu_group.add_argument('--cpu_xgmi_bandwidth', action='append', required=False, nargs=2,
|
||||
metavar=("XGMI_BW","LINKID_NAME"), help=cpu_xgmi_bandwidth_help)
|
||||
cpu_group.add_argument('--cpu_enable_apb', action='store_true', required=False, help=cpu_enable_apb_help)
|
||||
cpu_group.add_argument('--cpu_disable_apb', action='append', required=False, type=int, nargs=1, metavar=("DF_PSTATE"), help=cpu_disable_apb_help)
|
||||
set_group.add_argument('--set_cpu_pow_limit', action='append', required=False, type=int, nargs=1, metavar=("POW_LIMIT"),help=set_cpu_pow_limit_help)
|
||||
set_group.add_argument('--set_cpu_xgmi_link_width', action='append', required=False, type=int, nargs=2, metavar=("MIN_WIDTH", "MAX_WIDTH"), help=set_cpu_xgmi_link_width_help)
|
||||
set_group.add_argument('--set_cpu_lclk_dpm_level', action='append', required=False, type=int, nargs=3, metavar=("NBIOID", "MIN_DPM", "MAX_DPM"),help=set_cpu_lclk_dpm_level_help)
|
||||
cpu_group.add_argument('--cpu_disable_apb', action='append', required=False, type=self._validate_positive,
|
||||
nargs=1, metavar=("DF_PSTATE"), help=cpu_disable_apb_help)
|
||||
set_group.add_argument('--set_cpu_pow_limit', action='append', required=False, type=self._validate_positive,
|
||||
nargs=1, metavar=("POW_LIMIT"),help=set_cpu_pow_limit_help)
|
||||
set_group.add_argument('--set_cpu_xgmi_link_width', action='append', required=False, type=self._validate_positive,
|
||||
nargs=2, metavar=("MIN_WIDTH", "MAX_WIDTH"), help=set_cpu_xgmi_link_width_help)
|
||||
set_group.add_argument('--set_cpu_lclk_dpm_level', action='append', required=False, type=self._validate_positive,
|
||||
nargs=3, metavar=("NBIOID", "MIN_DPM", "MAX_DPM"),help=set_cpu_lclk_dpm_level_help)
|
||||
cpu_group.add_argument('--core_boost_limit', action='store_true', required=False, help=core_boost_limit_help)
|
||||
cpu_group.add_argument('--core_curr_active_freq_core_limit', action='store_true', required=False, help=core_curr_active_freq_core_limit_help)
|
||||
set_group.add_argument('--set_soc_boost_limit', action='append', required=False, type=int, nargs=1, metavar=("BOOST_LIMIT"), help=set_soc_boost_limit_help)
|
||||
set_group.add_argument('--set_core_boost_limit', action='append', required=False, type=int, nargs=1, metavar=("BOOST_LIMIT"), help=set_core_boost_limit_help)
|
||||
cpu_group.add_argument('--core_curr_active_freq_core_limit', action='store_true', required=False,
|
||||
help=core_curr_active_freq_core_limit_help)
|
||||
set_group.add_argument('--set_soc_boost_limit', action='append', required=False, type=self._validate_positive,
|
||||
nargs=1, metavar=("BOOST_LIMIT"), help=set_soc_boost_limit_help)
|
||||
set_group.add_argument('--set_core_boost_limit', action='append', required=False, type=self._validate_positive,
|
||||
nargs=1, metavar=("BOOST_LIMIT"), help=set_core_boost_limit_help)
|
||||
cpu_group.add_argument('--cpu_metrics_ver', action='store_true', required=False, help=cpu_metrics_ver_help)
|
||||
cpu_group.add_argument('--cpu_metrics_table', action='store_true', required=False, help=cpu_metrics_table_help)
|
||||
cpu_group.add_argument('--core_energy', action='store_true', required=False, help=core_energy_help)
|
||||
cpu_group.add_argument('--socket_energy', action='store_true', required=False, help=socket_energy_help)
|
||||
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)
|
||||
set_group.add_argument('--set_cpu_pwr_eff_mode', action='append', required=False, type=self._validate_positive,
|
||||
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)
|
||||
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)
|
||||
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=self._validate_positive,
|
||||
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=self._validate_positive,
|
||||
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=self._validate_positive,
|
||||
nargs=2, metavar=("MAX_PSTATE", "MIN_PSTATE"), help=set_cpu_df_pstate_range_help)
|
||||
|
||||
def _add_process_parser(self, subparsers, func):
|
||||
if self.helpers.is_hypervisor():
|
||||
|
||||
@@ -58,11 +58,11 @@
|
||||
{ \
|
||||
if (RET != AMDSMI_STATUS_SUCCESS) { \
|
||||
const char *err_str; \
|
||||
const char **status_str; \
|
||||
cout << "AMDSMI call returned " << RET << " at line " \
|
||||
<< __LINE__ << endl; \
|
||||
status_str = amdsmi_get_esmi_err_msg(RET, &err_str); \
|
||||
cout << *status_str << endl; \
|
||||
amdsmi_status_t status; \
|
||||
status = amdsmi_get_esmi_err_msg(RET, &err_str); \
|
||||
std::cout << "AMDSMI call returned " << status << " at line " \
|
||||
<< __LINE__ << std::endl; \
|
||||
std::cout << err_str << std::endl; \
|
||||
return RET; \
|
||||
} \
|
||||
}
|
||||
@@ -86,52 +86,60 @@ int main(int argc, char **argv) {
|
||||
// Get all sockets
|
||||
uint32_t socket_count = 0;
|
||||
|
||||
/*ret = amdsmi_get_cpusocket_handles(&socket_count, nullptr);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
// Allocate the memory for the sockets
|
||||
vector<amdsmi_cpusocket_handle> sockets(socket_count);
|
||||
|
||||
// Get the sockets of the system
|
||||
ret = amdsmi_get_cpusocket_handles(&socket_count, &sockets[0]);
|
||||
CHK_AMDSMI_RET(ret)*/
|
||||
ret = amdsmi_get_socket_handles(&socket_count, nullptr);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
// Allocate the memory for the sockets
|
||||
vector<amdsmi_socket_handle> sockets(socket_count);
|
||||
|
||||
// Get the sockets of the system
|
||||
ret = amdsmi_get_socket_handles(&socket_count, &sockets[0]);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
cout << "Total Socket: " << socket_count << endl;
|
||||
// For each socket, get identifier and cores
|
||||
for (uint8_t i = 0; i < socket_count; i++) {
|
||||
|
||||
// For each socket, get cpus and cores
|
||||
for (uint32_t i = 0; i < socket_count; i++) {
|
||||
cout << endl << "Socket " << i << endl;
|
||||
uint32_t cpu_count = 0;
|
||||
uint32_t core_count = 0;
|
||||
|
||||
// Set processor type as AMD_CPU
|
||||
processor_type_t processor_type = AMD_CPU;
|
||||
ret = amdsmi_get_processor_handles_by_type(sockets[i], processor_type, nullptr, &cpu_count);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
// Allocate the memory for the cpus
|
||||
vector<amdsmi_processor_handle> plist(cpu_count);
|
||||
|
||||
// Get the cpus for each socket
|
||||
ret = amdsmi_get_processor_handles_by_type(sockets[i], processor_type, &plist[0], &cpu_count);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
cout << endl;
|
||||
// Read core count for each sockets
|
||||
|
||||
// Set processor type as AMD_CPU_CORE
|
||||
processor_type = AMD_CPU_CORE;
|
||||
ret = amdsmi_get_processor_handles_by_type(sockets[i], processor_type, nullptr, &core_count);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
// Allocate the memory for the cpu cores
|
||||
vector<amdsmi_processor_handle> core_list(core_count);
|
||||
|
||||
// Get the cpu cores for each socket
|
||||
ret = amdsmi_get_processor_handles_by_type(sockets[i], processor_type, &core_list[0], &core_count);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
for (int index = 0; index < plist.size(); index++) {
|
||||
socket_count = plist.size();
|
||||
ret = amdsmi_get_cpu_hsmp_proto_ver(plist[i], &proto_ver);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
for (uint32_t index = 0; index < plist.size(); index++) {
|
||||
ret = amdsmi_get_cpu_hsmp_proto_ver(plist[index], &proto_ver);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get hsmp proto version"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
cout<<"\n------------------------------------------";
|
||||
cout<<"\n| HSMP Proto Version | "<< proto_ver <<"\t\t |"<< endl;
|
||||
cout<<"------------------------------------------\n";
|
||||
|
||||
ret = amdsmi_get_cpu_smu_fw_version(plist[i], &smu_fw);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
ret = amdsmi_get_cpu_smu_fw_version(plist[index], &smu_fw);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get smu fw version"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
cout<<"\n------------------------------------------";
|
||||
cout<<"\n| SMU FW Version | "
|
||||
@@ -144,15 +152,14 @@ int main(int argc, char **argv) {
|
||||
uint32_t err_bits = 0;
|
||||
|
||||
uint32_t prochot;
|
||||
cout<<"\n-------------------------------------------------";
|
||||
cout<<"\n| Sensor Name\t\t\t |";
|
||||
for (uint32_t i = 0; i < socket_count; i++) {
|
||||
cout<<setprecision(3)<<" Socket "<<i<<"\t|";
|
||||
}
|
||||
cout<<setprecision(3)<<" CPU "<<index<<"\t|";
|
||||
cout<<"\n-------------------------------------------------";
|
||||
cout<<"\n| ProchotStatus:\t\t |";
|
||||
ret = amdsmi_get_cpu_prochot_status(plist[i], &prochot);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
ret = amdsmi_get_cpu_prochot_status(plist[index], &prochot);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get prochot status"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if (!ret) {
|
||||
cout<<setprecision(7)<< (prochot ? "active" : "inactive")<<"\t|";
|
||||
} else {
|
||||
@@ -164,11 +171,7 @@ int main(int argc, char **argv) {
|
||||
size_t len;
|
||||
char str[SHOWLINESZ] = {};
|
||||
int retVal = 0;
|
||||
cout<<"\n-------------------------------------------------";
|
||||
cout<<"\n| Sensor Name\t\t\t |";
|
||||
for (uint32_t i = 0; i < socket_count; i++) {
|
||||
cout<<setprecision(3)<<" Socket "<<i<<"\t|";
|
||||
}
|
||||
cout<<setprecision(3)<<" CPU "<<index<<"\t|";
|
||||
cout<<"\n-------------------------------------------------";
|
||||
cout<<"\n| fclk (Mhz)\t\t\t |";
|
||||
retVal = snprintf(str, SHOWLINESZ, "\n| mclk (Mhz)\t\t\t |");
|
||||
@@ -176,8 +179,11 @@ int main(int argc, char **argv) {
|
||||
len = strlen(str);
|
||||
uint32_t fclk, mclk, cclk;
|
||||
err_bits = 0;
|
||||
ret = amdsmi_get_cpu_fclk_mclk(plist[i], &fclk, &mclk);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
ret = amdsmi_get_cpu_fclk_mclk(plist[index], &fclk, &mclk);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get cpu fclk mclk"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if (!ret) {
|
||||
cout<<setprecision(7)<<" "<<fclk<<"\t\t|";
|
||||
retVal = snprintf(str + len, SHOWLINESZ - len, " %d\t\t|", mclk);
|
||||
@@ -194,16 +200,13 @@ int main(int argc, char **argv) {
|
||||
cout<<"\n-------------------------------------------------\n";
|
||||
|
||||
uint32_t socket_power;
|
||||
cout<<"\n-------------------------------------------------";
|
||||
cout<<"\n| Sensor Name\t\t\t |";
|
||||
for (uint32_t i = 0; i < socket_count; i++) {
|
||||
cout<<setprecision(3)<<" Socket "<<i<<"\t|";
|
||||
}
|
||||
cout<<setprecision(3)<<" CPU "<<index<<"\t|";
|
||||
cout<<"\n-------------------------------------------------";
|
||||
cout<<"\n| Power (Watts)\t\t\t | ";
|
||||
|
||||
ret = amdsmi_get_cpu_socket_power(plist[i], &socket_power);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
ret = amdsmi_get_cpu_socket_power(plist[index], &socket_power);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get cpu socket power"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if (!ret) {
|
||||
cout<<fixed<<setprecision(3)<<static_cast<double>(socket_power)/1000<<"\t|";
|
||||
@@ -212,11 +215,12 @@ int main(int argc, char **argv) {
|
||||
cout<<" NA (Err:" <<ret<<" |";
|
||||
}
|
||||
|
||||
uint32_t power_limit;
|
||||
uint32_t power_limit = 0;
|
||||
cout<<"\n| PowerLimit (Watts)\t\t | ";
|
||||
|
||||
ret = amdsmi_get_cpu_socket_power_cap(plist[i], &power_limit);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
ret = amdsmi_get_cpu_socket_power_cap(plist[index], &power_limit);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get cpu socket power cap"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if (!ret) {
|
||||
cout<<fixed<<setprecision(3)<<static_cast<double>(power_limit)/1000<<"\t|";
|
||||
@@ -225,11 +229,12 @@ int main(int argc, char **argv) {
|
||||
cout<<" NA (Err:" <<ret<<" |";
|
||||
}
|
||||
|
||||
uint32_t power_max;
|
||||
uint32_t power_max = 0;
|
||||
cout<<"\n| PowerLimitMax (Watts)\t\t | ";
|
||||
|
||||
ret = amdsmi_get_cpu_socket_power_cap_max(plist[i], &power_max);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
ret = amdsmi_get_cpu_socket_power_cap_max(plist[index], &power_max);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get cpu socket power cap max"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if (!ret) {
|
||||
cout<<fixed<<setprecision(3)<<static_cast<double>(power_max)/1000<<"\t|";
|
||||
@@ -243,20 +248,72 @@ int main(int argc, char **argv) {
|
||||
power_max = 0;
|
||||
cout<<"\nEnter the max power to be set:\n";
|
||||
cin>>input_power;
|
||||
ret = amdsmi_get_cpu_socket_power_cap_max(plist[i], &power_max);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
ret = amdsmi_get_cpu_socket_power_cap_max(plist[index], &power_max);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get cpu socket power cap max"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if ((ret == AMDSMI_STATUS_SUCCESS) && (input_power > power_max)) {
|
||||
cout<<"Input power is more than max power limit,"
|
||||
" limiting to "<<static_cast<double>(power_max)/1000<<"Watts\n";
|
||||
input_power = power_max;
|
||||
}
|
||||
ret = amdsmi_set_cpu_socket_power_cap(plist[i], input_power);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
|
||||
ret = amdsmi_set_cpu_socket_power_cap(plist[index], input_power);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to set cpu socket power cap"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if (!ret) {
|
||||
cout<<"Socket["<<i<<"] power_limit set to "
|
||||
cout<<"CPU ["<<index<<"] power_limit set to "
|
||||
<<fixed<<setprecision(3)<<static_cast<double>(input_power)/1000<<" Watts successfully\n";
|
||||
}
|
||||
|
||||
power_limit = 0;
|
||||
cout<<"\n| PowerLimit (Watts) \t\t | ";
|
||||
|
||||
ret = amdsmi_get_cpu_socket_power_cap(plist[index], &power_limit);
|
||||
if(ret != AMDSMI_STATUS_SUCCESS)
|
||||
cout<<"Failed to get cpu socket power cap"<<"["<<index<<"] , Err["<<ret<<"] "<< endl;
|
||||
|
||||
if (!ret) {
|
||||
cout<<fixed<<setprecision(3)<<static_cast<double>(power_limit)/1000<<"\t|";
|
||||
} else {
|
||||
err_bits |= 1 << ret;
|
||||
cout<<" NA (Err:" <<ret<<" |";
|
||||
}
|
||||
cout<<"\n-------------------------------------------------\n";
|
||||
|
||||
double fraction_q10 = 1/pow(2,10);
|
||||
double fraction_uq10 = fraction_q10;
|
||||
const char* err_str1;
|
||||
|
||||
amdsmi_hsmp_metric_table_t mtbl = {};
|
||||
ret = amdsmi_get_metrics_table(plist[index], &mtbl);
|
||||
|
||||
if (ret != AMDSMI_STATUS_SUCCESS) {
|
||||
cout<<"Failed to get Metrics Table for CPU["<<index<<"], Err["<<ret<<"]" << endl;
|
||||
} else {
|
||||
cout<<"\n| METRICS TABLE \t\t\t\t |\n";
|
||||
|
||||
cout<<"\n| ACCUMULATOR COUNTER | "<<mtbl.accumulation_counter<<"\t\t|";
|
||||
cout<<"\n| SOCKET POWER LIMIT | "<<(mtbl.socket_power_limit * fraction_uq10)<<" W\t\t|";
|
||||
cout<<"\n| MAX SOCKET POWER LIMIT | "<<(mtbl.max_socket_power_limit * fraction_uq10)<<" W\t\t|";
|
||||
cout<<"\n| SOCKET POWER | "<<(mtbl.socket_power * fraction_uq10)<<" W\t\t|\n";
|
||||
|
||||
cout<<"\n| Effective frequency per AID: \t\t\t\t\t\t|";
|
||||
cout<<"\n-------------------------------------------------------------------------";
|
||||
cout<<"\n| AID | SOCCLK \t\t| VCLK \t\t| DCLK \t\t| LCLK \t\t|";
|
||||
cout<<"\n-------------------------------------------------------------------------";
|
||||
for(uint32_t j = 0; j < 4 ; j++){
|
||||
cout<<fixed<<setprecision(3)<<"\n| ["<<j<<"] | "
|
||||
<<(mtbl.socclk_frequency[j] * fraction_uq10)<<"MHz\t| "
|
||||
<<(mtbl.vclk_frequency[j] * fraction_uq10)<<"MHz\t| "
|
||||
<<(mtbl.dclk_frequency[j] * fraction_uq10)<<"MHz\t| "
|
||||
<<(mtbl.lclk_frequency[j] * fraction_uq10)<<"MHz\t| ";
|
||||
}
|
||||
cout<<"\n-------------------------------------------------------------------------\n";
|
||||
cout<<"\n-------------------------------------------------------------------------\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Clean up resources allocated at amdsmi_init
|
||||
|
||||
@@ -1503,6 +1503,88 @@ typedef struct {
|
||||
uint8_t min_dpm_level; //!< Min LCLK DPM level[7:0](8 bit data)
|
||||
} amdsmi_dpm_level_t;
|
||||
|
||||
/**
|
||||
* @brief Metrics table (supported only with hsmp proto version 6).
|
||||
*/
|
||||
typedef struct __attribute__((__packed__)){
|
||||
uint32_t accumulation_counter;
|
||||
|
||||
/* TEMPERATURE */
|
||||
uint32_t max_socket_temperature;
|
||||
uint32_t max_vr_temperature;
|
||||
uint32_t max_hbm_temperature;
|
||||
uint64_t max_socket_temperature_acc;
|
||||
uint64_t max_vr_temperature_acc;
|
||||
uint64_t max_hbm_temperature_acc;
|
||||
|
||||
/* POWER */
|
||||
uint32_t socket_power_limit;
|
||||
uint32_t max_socket_power_limit;
|
||||
uint32_t socket_power;
|
||||
|
||||
/* ENERGY */
|
||||
uint64_t timestamp;
|
||||
uint64_t socket_energy_acc;
|
||||
uint64_t ccd_energy_acc;
|
||||
uint64_t xcd_energy_acc;
|
||||
uint64_t aid_energy_acc;
|
||||
uint64_t hbm_energy_acc;
|
||||
|
||||
/* FREQUENCY */
|
||||
uint32_t cclk_frequency_limit;
|
||||
uint32_t gfxclk_frequency_limit;
|
||||
uint32_t fclk_frequency;
|
||||
uint32_t uclk_frequency;
|
||||
uint32_t socclk_frequency[4];
|
||||
uint32_t vclk_frequency[4];
|
||||
uint32_t dclk_frequency[4];
|
||||
uint32_t lclk_frequency[4];
|
||||
uint64_t gfxclk_frequency_acc[8];
|
||||
uint64_t cclk_frequency_acc[96];
|
||||
|
||||
/* FREQUENCY RANGE */
|
||||
uint32_t max_cclk_frequency;
|
||||
uint32_t min_cclk_frequency;
|
||||
uint32_t max_gfxclk_frequency;
|
||||
uint32_t min_gfxclk_frequency;
|
||||
uint32_t fclk_frequency_table[4];
|
||||
uint32_t uclk_frequency_table[4];
|
||||
uint32_t socclk_frequency_table[4];
|
||||
uint32_t vclk_frequency_table[4];
|
||||
uint32_t dclk_frequency_table[4];
|
||||
uint32_t lclk_frequency_table[4];
|
||||
uint32_t max_lclk_dpm_range;
|
||||
uint32_t min_lclk_dpm_range;
|
||||
|
||||
/* XGMI */
|
||||
uint32_t xgmi_width;
|
||||
uint32_t xgmi_bitrate;
|
||||
uint64_t xgmi_read_bandwidth_acc[8];
|
||||
uint64_t xgmi_write_bandwidth_acc[8];
|
||||
|
||||
/* ACTIVITY */
|
||||
uint32_t socket_c0_residency;
|
||||
uint32_t socket_gfx_busy;
|
||||
uint32_t dram_bandwidth_utilization;
|
||||
uint64_t socket_c0_residency_acc;
|
||||
uint64_t socket_gfx_busy_acc;
|
||||
uint64_t dram_bandwidth_acc;
|
||||
uint32_t max_dram_bandwidth;
|
||||
uint64_t dram_bandwidth_utilization_acc;
|
||||
uint64_t pcie_bandwidth_acc[4];
|
||||
|
||||
/* THROTTLERS */
|
||||
uint32_t prochot_residency_acc;
|
||||
uint32_t ppt_residency_acc;
|
||||
uint32_t socket_thm_residency_acc;
|
||||
uint32_t vr_thm_residency_acc;
|
||||
uint32_t hbm_thm_residency_acc;
|
||||
uint32_t spare;
|
||||
|
||||
/* New items at the end to maintain driver compatibility */
|
||||
uint32_t gfxclk_frequency[8];
|
||||
} amdsmi_hsmp_metric_table_t;
|
||||
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -5892,7 +5974,7 @@ amdsmi_status_t amdsmi_get_metrics_table_version(amdsmi_processor_handle process
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t amdsmi_get_metrics_table(amdsmi_processor_handle processor_handle,
|
||||
struct hsmp_metric_table *metrics_table);
|
||||
amdsmi_hsmp_metric_table_t *metrics_table);
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -5924,9 +6006,9 @@ amdsmi_status_t amdsmi_first_online_core_on_cpu_socket(amdsmi_processor_handle p
|
||||
* @param[in,out] status_string - A pointer to a const char * which will be made
|
||||
* to point to a description of the provided error code
|
||||
*
|
||||
* @return const char** returned on success
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
const char** amdsmi_get_esmi_err_msg(amdsmi_status_t status, const char **status_string);
|
||||
amdsmi_status_t amdsmi_get_esmi_err_msg(amdsmi_status_t status, const char **status_string);
|
||||
#endif
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -63,7 +63,6 @@ class AMDSmiGPUDevice: public AMDSmiProcessor {
|
||||
if (check_if_drm_is_supported()) this->get_drm_data();
|
||||
}
|
||||
~AMDSmiGPUDevice() {
|
||||
if (check_if_drm_is_supported()) shared_mutex_close(mutex_);
|
||||
}
|
||||
|
||||
amdsmi_status_t get_drm_data();
|
||||
@@ -91,7 +90,6 @@ class AMDSmiGPUDevice: public AMDSmiProcessor {
|
||||
amdsmi_bdf_t bdf_;
|
||||
uint32_t vendor_id_;
|
||||
AMDSmiDrm& drm_;
|
||||
shared_mutex_t mutex_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -2126,8 +2126,8 @@ Output: Dictionary with fields
|
||||
`temperature_vrsoc` | vrsoc temperature value | Celsius (C)
|
||||
`temperature_vrmem` | vrmem temperature value | Celsius (C)
|
||||
`average_gfx_activity` | Average gfx activity | %
|
||||
`average_umc_activity` | Average umc activity | %
|
||||
`average_mm_activity` | Average mm activity | %
|
||||
`average_umc_activity` | Average umc (Universal Memory Controller) activity | %
|
||||
`average_mm_activity` | Average mm (multimedia) engine activity | %
|
||||
`average_socket_power` | Average socket power | W
|
||||
`energy_accumulator` | Energy accumulated with a 15.3 uJ resolution over 1ns | uJ
|
||||
`system_clock_counter` | System clock counter | ns
|
||||
@@ -2178,7 +2178,7 @@ Output: Dictionary with fields
|
||||
`mem_max_bandwidth` | Maximum memory bandwidth usage accumulated | GB/s
|
||||
`pcie_nak_sent_count_acc` | PCIe NAC sent count accumulated |
|
||||
`pcie_nak_rcvd_count_acc` | PCIe NAC received count accumulated |
|
||||
`jpeg_activitys[AID<X>]` | List of JPEG engine activity for each AID (X=0-3) | %
|
||||
`jpeg_activity` | List of JPEG engine activity | %
|
||||
|
||||
Exceptions that can be thrown by `amdsmi_get_gpu_metrics_info` function:
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ from collections.abc import Iterable
|
||||
|
||||
from . import amdsmi_wrapper
|
||||
from .amdsmi_exception import *
|
||||
import sys
|
||||
import math
|
||||
|
||||
MAX_NUM_PROCESSES = 1024
|
||||
|
||||
@@ -741,7 +743,7 @@ def amdsmi_get_cpu_core_energy(
|
||||
)
|
||||
)
|
||||
|
||||
return f"{penergy.value} J"
|
||||
return f"{float(penergy.value * pow(10, -6))} J"
|
||||
|
||||
def amdsmi_get_cpu_socket_energy(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
|
||||
@@ -758,7 +760,7 @@ def amdsmi_get_cpu_socket_energy(
|
||||
)
|
||||
)
|
||||
|
||||
return f"{penergy.value} J"
|
||||
return f"{float(penergy.value * pow(10, -6))} J"
|
||||
|
||||
def amdsmi_get_cpu_prochot_status(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
|
||||
@@ -817,7 +819,7 @@ def amdsmi_get_cpu_cclk_limit(
|
||||
|
||||
def amdsmi_get_cpu_socket_current_active_freq_limit(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
|
||||
) -> int:
|
||||
):
|
||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||
raise AmdSmiParameterException(
|
||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||
@@ -825,13 +827,17 @@ def amdsmi_get_cpu_socket_current_active_freq_limit(
|
||||
|
||||
freq = ctypes.c_uint16()
|
||||
src_type = ctypes.pointer(ctypes.pointer(ctypes.c_char()))
|
||||
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_get_cpu_socket_current_active_freq_limit(
|
||||
processor_handle, ctypes.byref(freq), src_type
|
||||
)
|
||||
)
|
||||
|
||||
return f"{freq.value} MHz"
|
||||
return {
|
||||
"freq": f"{freq.value} MHz",
|
||||
"freq_src": f"{amdsmi_wrapper.string_cast(src_type.contents)}"
|
||||
}
|
||||
|
||||
def amdsmi_get_cpu_socket_freq_range(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
|
||||
@@ -1082,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,
|
||||
@@ -1101,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",
|
||||
@@ -1121,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,
|
||||
@@ -1244,8 +1259,8 @@ def amdsmi_get_cpu_socket_lclk_dpm_level(
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_socket_lclk_dpm_level(processor_handle, nbio_id, dpm_level))
|
||||
|
||||
return {
|
||||
"nbio_max_dpm_level": nbio.max_dpm_level,
|
||||
"nbio_min_dpm_level": nbio.min_dpm_level
|
||||
"nbio_max_dpm_level": dpm_level.max_dpm_level,
|
||||
"nbio_min_dpm_level": dpm_level.min_dpm_level
|
||||
}
|
||||
|
||||
def amdsmi_set_cpu_pcie_link_rate(
|
||||
@@ -1348,6 +1363,33 @@ def amdsmi_get_metrics_table_version(
|
||||
|
||||
return metric_tbl_version.value
|
||||
|
||||
|
||||
NO_OF_32BITS = (sys.getsizeof(ctypes.c_uint32) * 8)
|
||||
NO_OF_64BITS = (sys.getsizeof(ctypes.c_uint64) * 8)
|
||||
KILO = math.pow(10, 3)
|
||||
|
||||
# Get 2's complement of 32 bit unsigned integer
|
||||
def check_msb_32(num):
|
||||
msb = 1 << (NO_OF_32BITS - 1)
|
||||
|
||||
'''If msb = 1 , then take 2's complement of the number'''
|
||||
if num & msb:
|
||||
num = ~num + 1
|
||||
return num
|
||||
else:
|
||||
return num
|
||||
|
||||
# Get 2's complement of 64 bit unsigned integer
|
||||
def check_msb_64(num):
|
||||
msb = 1 << (NO_OF_64BITS - 1)
|
||||
|
||||
'''If msb = 1 , then take 2's complement of the number'''
|
||||
if num & msb:
|
||||
num = ~num + 1
|
||||
return num
|
||||
else:
|
||||
return num
|
||||
|
||||
def amdsmi_get_metrics_table(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
|
||||
):
|
||||
@@ -1356,63 +1398,72 @@ def amdsmi_get_metrics_table(
|
||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||
)
|
||||
|
||||
mtbl = amdsmi_wrapper.struct_hsmp_metric_table()
|
||||
mtbl = amdsmi_wrapper.amdsmi_hsmp_metric_table_t()
|
||||
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_metrics_table(processor_handle, mtbl))
|
||||
'''Encodings for the metric table defined for hsmp'''
|
||||
fraction_q10 = 1 / math.pow(2, 10)
|
||||
fraction_uq10 = fraction_q10
|
||||
fraction_uq16 = 1 / math.pow(2, 16)
|
||||
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_get_metrics_table(
|
||||
processor_handle, mtbl
|
||||
)
|
||||
)
|
||||
|
||||
return {
|
||||
"mtbl_accumulation_counter": mtbl.accumulation_counter,
|
||||
"mtbl_max_socket_temperature": mtbl.max_socket_temperature,
|
||||
"mtbl_max_vr_temperature": mtbl.max_vr_temperature,
|
||||
"mtbl_max_hbm_temperature": mtbl.max_hbm_temperature,
|
||||
"mtbl_max_socket_temperature_acc": mtbl.max_socket_temperature_acc,
|
||||
"mtbl_max_vr_temperature_acc": mtbl.max_vr_temperature_acc,
|
||||
"mtbl_max_hbm_temperature_acc": mtbl.max_hbm_temperature_acc,
|
||||
"mtbl_socket_power_limit": mtbl.socket_power_limit,
|
||||
"mtbl_max_socket_power_limit": mtbl.max_socket_power_limit,
|
||||
"mtbl_socket_power": mtbl.socket_power,
|
||||
"mtbl_timestamp": mtbl.timestamp,
|
||||
"mtbl_socket_energy_acc": mtbl.socket_energy_acc,
|
||||
"mtbl_ccd_energy_acc": mtbl.ccd_energy_acc,
|
||||
"mtbl_xcd_energy_acc": mtbl.xcd_energy_acc,
|
||||
"mtbl_aid_energy_acc": mtbl.aid_energy_acc,
|
||||
"mtbl_hbm_energy_acc": mtbl.hbm_energy_acc,
|
||||
"mtbl_cclk_frequency_limit": mtbl.cclk_frequency_limit,
|
||||
"mtbl_gfxclk_frequency_limit": mtbl.gfxclk_frequency_limit,
|
||||
"mtbl_fclk_frequency": mtbl.fclk_frequency,
|
||||
"mtbl_uclk_frequency": mtbl.uclk_frequency,
|
||||
"mtbl_socclk_frequency": mtbl.socclk_frequency,
|
||||
"mtbl_vclk_frequency": mtbl.vclk_frequency,
|
||||
"mtbl_dclk_frequency": mtbl.dclk_frequency,
|
||||
"mtbl_lclk_frequency": mtbl.lclk_frequency,
|
||||
"mtbl_fclk_frequency_table": mtbl.fclk_frequency_table,
|
||||
"mtbl_uclk_frequency_table": mtbl.uclk_frequency_table,
|
||||
"mtbl_socclk_frequency_table": mtbl.socclk_frequency_table,
|
||||
"mtbl_vclk_frequency_table": mtbl.vclk_frequency_table,
|
||||
"mtbl_dclk_frequency_table": mtbl.dclk_frequency_table,
|
||||
"mtbl_lclk_frequency_table": mtbl.lclk_frequency_table,
|
||||
"mtbl_cclk_frequency_acc": mtbl.cclk_frequency_acc,
|
||||
"mtbl_gfxclk_frequency_acc": mtbl.gfxclk_frequency_acc,
|
||||
"mtbl_gfxclk_frequency": mtbl.gfxclk_frequency,
|
||||
"mtbl_max_cclk_frequency": mtbl.max_cclk_frequency,
|
||||
"mtbl_min_cclk_frequency": mtbl.min_cclk_frequency,
|
||||
"mtbl_max_gfxclk_frequency": mtbl.max_gfxclk_frequency,
|
||||
"mtbl_min_gfxclk_frequency": mtbl.min_gfxclk_frequency,
|
||||
"mtbl_max_socket_temperature": f"{round(check_msb_32(mtbl.max_socket_temperature) * fraction_q10 ,3)} °C",
|
||||
"mtbl_max_vr_temperature": f"{round(check_msb_32(mtbl.max_vr_temperature) * fraction_q10 ,3)} °C",
|
||||
"mtbl_max_hbm_temperature": f"{round(check_msb_32(mtbl.max_hbm_temperature) * fraction_q10 ,3)} °C",
|
||||
"mtbl_max_socket_temperature_acc": f"{round(check_msb_64(mtbl.max_socket_temperature_acc) * fraction_q10 ,3)} °C",
|
||||
"mtbl_max_vr_temperature_acc": f"{round(check_msb_64(mtbl.max_vr_temperature_acc) * fraction_q10 ,3)} °C",
|
||||
"mtbl_max_hbm_temperature_acc": f"{round(check_msb_64(mtbl.max_hbm_temperature_acc) * fraction_q10 ,3)} °C",
|
||||
"mtbl_socket_power_limit": f"{round(mtbl.socket_power_limit * fraction_uq10 ,3)} W",
|
||||
"mtbl_max_socket_power_limit": f"{round(mtbl.max_socket_power_limit * fraction_uq10 ,3)} W",
|
||||
"mtbl_socket_power": f"{round(mtbl.socket_power * fraction_uq10 ,3)} W",
|
||||
"mtbl_timestamp_raw": mtbl.timestamp,
|
||||
"mtbl_socket_energy_acc": f"{round((mtbl.socket_energy_acc * fraction_uq16)/KILO ,3)} kJ",
|
||||
"mtbl_ccd_energy_acc": f"{round((mtbl.ccd_energy_acc * fraction_uq16)/KILO ,3)} kJ",
|
||||
"mtbl_xcd_energy_acc": f"{round((mtbl.xcd_energy_acc * fraction_uq16)/KILO ,3)} kJ",
|
||||
"mtbl_aid_energy_acc": f"{round((mtbl.aid_energy_acc * fraction_uq16)/KILO ,3)} kJ",
|
||||
"mtbl_hbm_energy_acc": f"{round((mtbl.hbm_energy_acc * fraction_uq16)/KILO ,3)} kJ",
|
||||
"mtbl_cclk_frequency_limit": f"{round(mtbl.cclk_frequency_limit * fraction_uq10 ,3)} GHz",
|
||||
"mtbl_gfxclk_frequency_limit": f"{round(mtbl.gfxclk_frequency_limit * fraction_uq10 ,3)} MHz",
|
||||
"mtbl_fclk_frequency": f"{round(mtbl.fclk_frequency * fraction_uq10 ,3)} MHz",
|
||||
"mtbl_uclk_frequency": f"{round(mtbl.uclk_frequency * fraction_uq10 ,3)} MHz",
|
||||
"mtbl_socclk_frequency": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.socclk_frequency)]} MHz",
|
||||
"mtbl_vclk_frequency": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.vclk_frequency)]} MHz",
|
||||
"mtbl_dclk_frequency": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.dclk_frequency)]} MHz",
|
||||
"mtbl_lclk_frequency": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.lclk_frequency)]} MHz",
|
||||
"mtbl_fclk_frequency_table": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.fclk_frequency_table)]} MHz",
|
||||
"mtbl_uclk_frequency_table": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.uclk_frequency_table)]} MHz",
|
||||
"mtbl_socclk_frequency_table": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.socclk_frequency_table)]} MHz",
|
||||
"mtbl_vclk_frequency_table": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.vclk_frequency_table)]} MHz",
|
||||
"mtbl_dclk_frequency_table": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.dclk_frequency_table)]} MHz",
|
||||
"mtbl_lclk_frequency_table": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.lclk_frequency_table)]} MHz",
|
||||
"mtbl_cclk_frequency_acc": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.cclk_frequency_acc)]} GHz",
|
||||
"mtbl_gfxclk_frequency_acc": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.gfxclk_frequency_acc)]} MHz",
|
||||
"mtbl_gfxclk_frequency": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.gfxclk_frequency)]} MHz",
|
||||
"mtbl_max_cclk_frequency": f"{round(mtbl.max_cclk_frequency * fraction_uq10 ,3)} GHz",
|
||||
"mtbl_min_cclk_frequency": f"{round(mtbl.min_cclk_frequency * fraction_uq10 ,3)} GHz",
|
||||
"mtbl_max_gfxclk_frequency": f"{round(mtbl.max_gfxclk_frequency * fraction_uq10 ,3)} MHz",
|
||||
"mtbl_min_gfxclk_frequency": f"{round(mtbl.min_gfxclk_frequency * fraction_uq10 ,3)} MHz",
|
||||
"mtbl_max_lclk_dpm_range": mtbl.max_lclk_dpm_range,
|
||||
"mtbl_min_lclk_dpm_range": mtbl.min_lclk_dpm_range,
|
||||
"mtbl_xgmi_width": mtbl.xgmi_width,
|
||||
"mtbl_xgmi_bitrate": mtbl.xgmi_bitrate,
|
||||
"mtbl_xgmi_read_bandwidth_acc": mtbl.xgmi_read_bandwidth_acc,
|
||||
"mtbl_xgmi_write_bandwidth_acc": mtbl.xgmi_write_bandwidth_acc,
|
||||
"mtbl_socket_c0_residency": mtbl.socket_c0_residency,
|
||||
"mtbl_socket_gfx_busy": mtbl.socket_gfx_busy,
|
||||
"mtbl_dram_bandwidth_utilization": mtbl.dram_bandwidth_utilization,
|
||||
"mtbl_socket_c0_residency_acc": mtbl.socket_c0_residency_acc,
|
||||
"mtbl_socket_gfx_busy_acc": mtbl.socket_gfx_busy_acc,
|
||||
"mtbl_dram_bandwidth_acc": mtbl.dram_bandwidth_acc,
|
||||
"mtbl_max_dram_bandwidth": mtbl.max_dram_bandwidth,
|
||||
"mtbl_dram_bandwidth_utilization_acc": mtbl.dram_bandwidth_utilization_acc,
|
||||
"mtbl_pcie_bandwidth_acc": mtbl.pcie_bandwidth_acc,
|
||||
"mtbl_xgmi_width": round(mtbl.xgmi_width * fraction_uq10 ,3),
|
||||
"mtbl_xgmi_bitrate": f"{round(mtbl.xgmi_bitrate * fraction_uq10 ,3)} Gbps",
|
||||
"mtbl_xgmi_read_bandwidth_acc": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.xgmi_read_bandwidth_acc)]} Gbps",
|
||||
"mtbl_xgmi_write_bandwidth_acc": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.xgmi_write_bandwidth_acc)]} Gbps",
|
||||
"mtbl_socket_c0_residency": f"{round(mtbl.socket_c0_residency * fraction_uq10 ,3)} %",
|
||||
"mtbl_socket_gfx_busy": f"{round(mtbl.socket_gfx_busy * fraction_uq10 ,3)} %",
|
||||
"mtbl_dram_bandwidth_utilization": f"{round(mtbl.dram_bandwidth_utilization * fraction_uq10 ,3)} %",
|
||||
"mtbl_socket_c0_residency_acc": round(mtbl.socket_c0_residency_acc * fraction_uq10 ,3),
|
||||
"mtbl_socket_gfx_busy_acc": round(mtbl.socket_gfx_busy_acc * fraction_uq10 ,3),
|
||||
"mtbl_dram_bandwidth_acc": f"{round(mtbl.dram_bandwidth_acc * fraction_uq10 ,3)} Gbps",
|
||||
"mtbl_max_dram_bandwidth": f"{round(mtbl.max_dram_bandwidth * fraction_uq10 ,3)} Gbps",
|
||||
"mtbl_dram_bandwidth_utilization_acc": round(mtbl.dram_bandwidth_utilization_acc * fraction_uq10 ,3),
|
||||
"mtbl_pcie_bandwidth_acc": f"{[round(x*fraction_uq10 ,3) for x in list(mtbl.pcie_bandwidth_acc)]} Gbps",
|
||||
"mtbl_prochot_residency_acc": mtbl.prochot_residency_acc,
|
||||
"mtbl_ppt_residency_acc": mtbl.ppt_residency_acc,
|
||||
"mtbl_socket_thm_residency_acc": mtbl.socket_thm_residency_acc,
|
||||
@@ -3242,10 +3293,7 @@ def amdsmi_get_gpu_metrics_info(
|
||||
"mem_max_bandwidth": gpu_metrics.mem_max_bandwidth,
|
||||
"pcie_nak_sent_count_acc": gpu_metrics.pcie_nak_sent_count_acc,
|
||||
"pcie_nak_rcvd_count_acc": gpu_metrics.pcie_nak_rcvd_count_acc,
|
||||
"jpeg_activities[AID0]": list(gpu_metrics.jpeg_activities)[:8],
|
||||
"jpeg_activities[AID1]": list(gpu_metrics.jpeg_activities)[8:16],
|
||||
"jpeg_activities[AID2]": list(gpu_metrics.jpeg_activities)[16:24],
|
||||
"jpeg_activities[AID3]": list(gpu_metrics.jpeg_activities)[24:32],
|
||||
"jpeg_activity": list(gpu_metrics.jpeg_activity),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -906,7 +906,6 @@ amdsmi_clk_info_t = struct_amdsmi_clk_info_t
|
||||
class struct_amdsmi_engine_usage_t(Structure):
|
||||
pass
|
||||
|
||||
|
||||
struct_amdsmi_engine_usage_t._pack_ = 1 # source:False
|
||||
struct_amdsmi_engine_usage_t._fields_ = [
|
||||
('gfx_activity', ctypes.c_uint32),
|
||||
@@ -920,6 +919,16 @@ amdsmi_process_handle_t = ctypes.c_uint32
|
||||
class struct_amdsmi_proc_info_t(Structure):
|
||||
pass
|
||||
|
||||
class struct_engine_usage_(Structure):
|
||||
pass
|
||||
|
||||
struct_engine_usage_._pack_ = 1 # source:False
|
||||
struct_engine_usage_._fields_ = [
|
||||
('gfx', ctypes.c_uint64),
|
||||
('enc', ctypes.c_uint64),
|
||||
('reserved', ctypes.c_uint32 * 12),
|
||||
]
|
||||
|
||||
class struct_memory_usage_(Structure):
|
||||
pass
|
||||
|
||||
@@ -931,16 +940,6 @@ struct_memory_usage_._fields_ = [
|
||||
('reserved', ctypes.c_uint32 * 10),
|
||||
]
|
||||
|
||||
class struct_engine_usage_(Structure):
|
||||
pass
|
||||
|
||||
struct_engine_usage_._pack_ = 1 # source:False
|
||||
struct_engine_usage_._fields_ = [
|
||||
('gfx', ctypes.c_uint64),
|
||||
('enc', ctypes.c_uint64),
|
||||
('reserved', ctypes.c_uint32 * 12),
|
||||
]
|
||||
|
||||
struct_amdsmi_proc_info_t._pack_ = 1 # source:False
|
||||
struct_amdsmi_proc_info_t._fields_ = [
|
||||
('name', ctypes.c_char * 32),
|
||||
@@ -1527,11 +1526,12 @@ struct_amdsmi_gpu_metrics_t._fields_ = [
|
||||
('current_socclks', ctypes.c_uint16 * 4),
|
||||
('current_vclk0s', ctypes.c_uint16 * 4),
|
||||
('current_dclk0s', ctypes.c_uint16 * 4),
|
||||
('jpeg_activity', ctypes.c_uint16 * 32),
|
||||
('mem_bandwidth_acc', ctypes.c_uint64),
|
||||
('mem_max_bandwidth', ctypes.c_uint32),
|
||||
('pcie_nak_sent_count_acc', ctypes.c_uint32),
|
||||
('pcie_nak_rcvd_count_acc', ctypes.c_uint32),
|
||||
('jpeg_activities', ctypes.c_uint16 * 32),
|
||||
('PADDING_4', ctypes.c_ubyte * 4),
|
||||
]
|
||||
|
||||
amdsmi_gpu_metrics_t = struct_amdsmi_gpu_metrics_t
|
||||
@@ -1717,6 +1717,72 @@ struct_amdsmi_dpm_level_t._fields_ = [
|
||||
]
|
||||
|
||||
amdsmi_dpm_level_t = struct_amdsmi_dpm_level_t
|
||||
class struct_amdsmi_hsmp_metric_table_t(Structure):
|
||||
pass
|
||||
|
||||
struct_amdsmi_hsmp_metric_table_t._pack_ = 1 # source:True
|
||||
struct_amdsmi_hsmp_metric_table_t._fields_ = [
|
||||
('accumulation_counter', ctypes.c_uint32),
|
||||
('max_socket_temperature', ctypes.c_uint32),
|
||||
('max_vr_temperature', ctypes.c_uint32),
|
||||
('max_hbm_temperature', ctypes.c_uint32),
|
||||
('max_socket_temperature_acc', ctypes.c_uint64),
|
||||
('max_vr_temperature_acc', ctypes.c_uint64),
|
||||
('max_hbm_temperature_acc', ctypes.c_uint64),
|
||||
('socket_power_limit', ctypes.c_uint32),
|
||||
('max_socket_power_limit', ctypes.c_uint32),
|
||||
('socket_power', ctypes.c_uint32),
|
||||
('timestamp', ctypes.c_uint64),
|
||||
('socket_energy_acc', ctypes.c_uint64),
|
||||
('ccd_energy_acc', ctypes.c_uint64),
|
||||
('xcd_energy_acc', ctypes.c_uint64),
|
||||
('aid_energy_acc', ctypes.c_uint64),
|
||||
('hbm_energy_acc', ctypes.c_uint64),
|
||||
('cclk_frequency_limit', ctypes.c_uint32),
|
||||
('gfxclk_frequency_limit', ctypes.c_uint32),
|
||||
('fclk_frequency', ctypes.c_uint32),
|
||||
('uclk_frequency', ctypes.c_uint32),
|
||||
('socclk_frequency', ctypes.c_uint32 * 4),
|
||||
('vclk_frequency', ctypes.c_uint32 * 4),
|
||||
('dclk_frequency', ctypes.c_uint32 * 4),
|
||||
('lclk_frequency', ctypes.c_uint32 * 4),
|
||||
('gfxclk_frequency_acc', ctypes.c_uint64 * 8),
|
||||
('cclk_frequency_acc', ctypes.c_uint64 * 96),
|
||||
('max_cclk_frequency', ctypes.c_uint32),
|
||||
('min_cclk_frequency', ctypes.c_uint32),
|
||||
('max_gfxclk_frequency', ctypes.c_uint32),
|
||||
('min_gfxclk_frequency', ctypes.c_uint32),
|
||||
('fclk_frequency_table', ctypes.c_uint32 * 4),
|
||||
('uclk_frequency_table', ctypes.c_uint32 * 4),
|
||||
('socclk_frequency_table', ctypes.c_uint32 * 4),
|
||||
('vclk_frequency_table', ctypes.c_uint32 * 4),
|
||||
('dclk_frequency_table', ctypes.c_uint32 * 4),
|
||||
('lclk_frequency_table', ctypes.c_uint32 * 4),
|
||||
('max_lclk_dpm_range', ctypes.c_uint32),
|
||||
('min_lclk_dpm_range', ctypes.c_uint32),
|
||||
('xgmi_width', ctypes.c_uint32),
|
||||
('xgmi_bitrate', ctypes.c_uint32),
|
||||
('xgmi_read_bandwidth_acc', ctypes.c_uint64 * 8),
|
||||
('xgmi_write_bandwidth_acc', ctypes.c_uint64 * 8),
|
||||
('socket_c0_residency', ctypes.c_uint32),
|
||||
('socket_gfx_busy', ctypes.c_uint32),
|
||||
('dram_bandwidth_utilization', ctypes.c_uint32),
|
||||
('socket_c0_residency_acc', ctypes.c_uint64),
|
||||
('socket_gfx_busy_acc', ctypes.c_uint64),
|
||||
('dram_bandwidth_acc', ctypes.c_uint64),
|
||||
('max_dram_bandwidth', ctypes.c_uint32),
|
||||
('dram_bandwidth_utilization_acc', ctypes.c_uint64),
|
||||
('pcie_bandwidth_acc', ctypes.c_uint64 * 4),
|
||||
('prochot_residency_acc', ctypes.c_uint32),
|
||||
('ppt_residency_acc', ctypes.c_uint32),
|
||||
('socket_thm_residency_acc', ctypes.c_uint32),
|
||||
('vr_thm_residency_acc', ctypes.c_uint32),
|
||||
('hbm_thm_residency_acc', ctypes.c_uint32),
|
||||
('spare', ctypes.c_uint32),
|
||||
('gfxclk_frequency', ctypes.c_uint32 * 8),
|
||||
]
|
||||
|
||||
amdsmi_hsmp_metric_table_t = struct_amdsmi_hsmp_metric_table_t
|
||||
uint64_t = ctypes.c_uint64
|
||||
amdsmi_init = _libraries['libamd_smi.so'].amdsmi_init
|
||||
amdsmi_init.restype = amdsmi_status_t
|
||||
@@ -2326,17 +2392,14 @@ amdsmi_get_cpu_current_xgmi_bw.argtypes = [amdsmi_processor_handle, amdsmi_link_
|
||||
amdsmi_get_metrics_table_version = _libraries['libamd_smi.so'].amdsmi_get_metrics_table_version
|
||||
amdsmi_get_metrics_table_version.restype = amdsmi_status_t
|
||||
amdsmi_get_metrics_table_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)]
|
||||
class struct_hsmp_metric_table(Structure):
|
||||
pass
|
||||
|
||||
amdsmi_get_metrics_table = _libraries['libamd_smi.so'].amdsmi_get_metrics_table
|
||||
amdsmi_get_metrics_table.restype = amdsmi_status_t
|
||||
amdsmi_get_metrics_table.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_hsmp_metric_table)]
|
||||
amdsmi_get_metrics_table.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_amdsmi_hsmp_metric_table_t)]
|
||||
amdsmi_first_online_core_on_cpu_socket = _libraries['libamd_smi.so'].amdsmi_first_online_core_on_cpu_socket
|
||||
amdsmi_first_online_core_on_cpu_socket.restype = amdsmi_status_t
|
||||
amdsmi_first_online_core_on_cpu_socket.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)]
|
||||
amdsmi_get_esmi_err_msg = _libraries['libamd_smi.so'].amdsmi_get_esmi_err_msg
|
||||
amdsmi_get_esmi_err_msg.restype = ctypes.POINTER(ctypes.POINTER(ctypes.c_char))
|
||||
amdsmi_get_esmi_err_msg.restype = amdsmi_status_t
|
||||
amdsmi_get_esmi_err_msg.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))]
|
||||
__all__ = \
|
||||
['AGG_BW0', 'AMDSMI_ARG_PTR_NULL', 'AMDSMI_AVERAGE_POWER',
|
||||
@@ -2646,9 +2709,10 @@ __all__ = \
|
||||
'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter',
|
||||
'amdsmi_gpu_destroy_counter', 'amdsmi_gpu_metrics_t',
|
||||
'amdsmi_gpu_read_counter', 'amdsmi_gpu_xgmi_error_status',
|
||||
'amdsmi_init', 'amdsmi_init_flags_t',
|
||||
'amdsmi_init_gpu_event_notification', 'amdsmi_io_bw_encoding_t',
|
||||
'amdsmi_io_link_type_t', 'amdsmi_is_P2P_accessible',
|
||||
'amdsmi_hsmp_metric_table_t', 'amdsmi_init',
|
||||
'amdsmi_init_flags_t', 'amdsmi_init_gpu_event_notification',
|
||||
'amdsmi_io_bw_encoding_t', 'amdsmi_io_link_type_t',
|
||||
'amdsmi_is_P2P_accessible',
|
||||
'amdsmi_is_gpu_power_management_enabled',
|
||||
'amdsmi_link_id_bw_type_t', 'amdsmi_memory_page_status_t',
|
||||
'amdsmi_memory_partition_type_t', 'amdsmi_memory_type_t',
|
||||
@@ -2708,6 +2772,7 @@ __all__ = \
|
||||
'struct_amdsmi_freq_volt_region_t', 'struct_amdsmi_frequencies_t',
|
||||
'struct_amdsmi_frequency_range_t', 'struct_amdsmi_fw_info_t',
|
||||
'struct_amdsmi_gpu_cache_info_t', 'struct_amdsmi_gpu_metrics_t',
|
||||
'struct_amdsmi_hsmp_metric_table_t',
|
||||
'struct_amdsmi_link_id_bw_type_t', 'struct_amdsmi_name_value_t',
|
||||
'struct_amdsmi_od_vddc_point_t', 'struct_amdsmi_od_volt_curve_t',
|
||||
'struct_amdsmi_od_volt_freq_data_t',
|
||||
@@ -2724,5 +2789,5 @@ __all__ = \
|
||||
'struct_amdsmi_vram_info_t', 'struct_amdsmi_vram_usage_t',
|
||||
'struct_amdsmi_xgmi_info_t', 'struct_cache_',
|
||||
'struct_engine_usage_', 'struct_fields_', 'struct_fw_info_list_',
|
||||
'struct_hsmp_metric_table', 'struct_memory_usage_', 'uint32_t',
|
||||
'uint64_t', 'uint8_t', 'union_amdsmi_bdf_t']
|
||||
'struct_memory_usage_', 'uint32_t', 'uint64_t', 'uint8_t',
|
||||
'union_amdsmi_bdf_t']
|
||||
|
||||
@@ -1413,7 +1413,7 @@ AMGpuMetricsPublicLatestTupl_t GpuMetricsBase_v13_t::copy_internal_to_external_m
|
||||
metrics_public_init.average_mm_activity = m_gpu_metrics_tbl.m_average_mm_activity;
|
||||
|
||||
// Power/Energy
|
||||
// metrics_public_init.average_socket_power = m_gpu_metrics_tbl.m_average_socket_power; // 1.3 and 1.4 have the same value
|
||||
metrics_public_init.average_socket_power = m_gpu_metrics_tbl.m_average_socket_power; // 1.3 and 1.4 have the same value
|
||||
metrics_public_init.energy_accumulator = m_gpu_metrics_tbl.m_energy_accumulator;
|
||||
|
||||
// Driver attached timestamp (in ns)
|
||||
|
||||
+89
-79
@@ -2707,6 +2707,15 @@ amdsmi_get_gpu_metrics_log(amdsmi_processor_handle processor_handle)
|
||||
|
||||
|
||||
#ifdef ENABLE_ESMI_LIB
|
||||
static amdsmi_status_t amdsmi_errno_to_esmi_status(amdsmi_status_t status)
|
||||
{
|
||||
for (auto& iter : amd::smi::esmi_status_map) {
|
||||
if (iter.first == static_cast<esmi_status_t>(status))
|
||||
return iter.second;
|
||||
}
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_get_cpu_hsmp_proto_ver(amdsmi_processor_handle processor_handle,
|
||||
uint32_t *proto_ver)
|
||||
{
|
||||
@@ -2719,10 +2728,10 @@ amdsmi_status_t amdsmi_get_cpu_hsmp_proto_ver(amdsmi_processor_handle processor_
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_hsmp_proto_ver_get(&hsmp_proto_ver));
|
||||
*proto_ver = hsmp_proto_ver;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*proto_ver = hsmp_proto_ver;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2739,14 +2748,13 @@ amdsmi_status_t amdsmi_get_cpu_smu_fw_version(amdsmi_processor_handle processor_
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_smu_fw_version_get(&smu_fw));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
amdsmi_smu_fw->major = smu_fw.major;
|
||||
amdsmi_smu_fw->minor = smu_fw.minor;
|
||||
amdsmi_smu_fw->debug = smu_fw.debug;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2769,10 +2777,10 @@ amdsmi_status_t amdsmi_get_cpu_core_energy(amdsmi_processor_handle processor_han
|
||||
core_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_core_energy_get(core_ind, &core_input));
|
||||
*penergy = core_input;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*penergy = core_input;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
|
||||
@@ -2797,10 +2805,10 @@ amdsmi_status_t amdsmi_get_cpu_socket_energy(amdsmi_processor_handle processor_h
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_energy_get(sock_ind, &pkg_input));
|
||||
*penergy = pkg_input;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*penergy = pkg_input;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2824,10 +2832,10 @@ amdsmi_status_t amdsmi_get_cpu_prochot_status(amdsmi_processor_handle processor_
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_prochot_status_get(sock_ind, &phot));
|
||||
*prochot = phot;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*prochot = phot;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2851,12 +2859,12 @@ amdsmi_status_t amdsmi_get_cpu_fclk_mclk(amdsmi_processor_handle processor_handl
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_fclk_mclk_get(sock_ind, &f_clk, &m_clk));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*fclk = f_clk;
|
||||
*mclk = m_clk;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2879,10 +2887,10 @@ amdsmi_status_t amdsmi_get_cpu_cclk_limit(amdsmi_processor_handle processor_hand
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_cclk_limit_get(sock_ind, &c_clk));
|
||||
*cclk = c_clk;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*cclk = c_clk;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2906,10 +2914,10 @@ amdsmi_status_t amdsmi_get_cpu_socket_current_active_freq_limit(amdsmi_processor
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_current_active_freq_limit_get(sock_ind, &limit, src_type));
|
||||
*freq = limit;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*freq = limit;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2934,12 +2942,12 @@ amdsmi_status_t amdsmi_get_cpu_socket_freq_range(amdsmi_processor_handle process
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_freq_range_get(sock_ind, &f_max, &f_min));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*fmax = f_max;
|
||||
*fmin = f_min;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2962,10 +2970,10 @@ amdsmi_status_t amdsmi_get_cpu_core_current_freq_limit(amdsmi_processor_handle p
|
||||
core_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_current_freq_limit_core_get(core_ind, &c_clk));
|
||||
*freq = c_clk;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*freq = c_clk;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
|
||||
@@ -2990,10 +2998,10 @@ amdsmi_status_t amdsmi_get_cpu_socket_power(amdsmi_processor_handle processor_ha
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_power_get(sock_ind, &avg_power));
|
||||
*ppower = avg_power;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*ppower = avg_power;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3017,10 +3025,10 @@ amdsmi_status_t amdsmi_get_cpu_socket_power_cap(amdsmi_processor_handle processo
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_power_cap_get(sock_ind, &p_cap));
|
||||
*pcap = p_cap;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*pcap = p_cap;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3044,10 +3052,10 @@ amdsmi_status_t amdsmi_get_cpu_socket_power_cap_max(amdsmi_processor_handle proc
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_power_cap_max_get(sock_ind, &p_max));
|
||||
*pmax = p_max;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*pmax = p_max;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3071,10 +3079,10 @@ amdsmi_status_t amdsmi_get_cpu_pwr_svi_telemetry_all_rails(amdsmi_processor_hand
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_pwr_svi_telemetry_all_rails_get(sock_ind, &pow));
|
||||
*power = pow;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*power = pow;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3099,7 +3107,7 @@ amdsmi_status_t amdsmi_set_cpu_socket_power_cap(amdsmi_processor_handle processo
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_power_cap_set(sock_ind, pcap));
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3124,7 +3132,7 @@ amdsmi_status_t amdsmi_set_cpu_pwr_efficiency_mode(amdsmi_processor_handle proce
|
||||
status = static_cast<amdsmi_status_t>(esmi_pwr_efficiency_mode_set(sock_ind, mode));
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3148,10 +3156,10 @@ amdsmi_status_t amdsmi_get_cpu_core_boostlimit(amdsmi_processor_handle processor
|
||||
core_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_core_boostlimit_get(core_ind, &boostlimit));
|
||||
*pboostlimit = boostlimit;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*pboostlimit = boostlimit;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3175,10 +3183,10 @@ amdsmi_status_t amdsmi_get_cpu_socket_c0_residency(amdsmi_processor_handle proce
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_c0_residency_get(sock_ind, &res));
|
||||
*pc0_residency = res;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*pc0_residency = res;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3201,9 +3209,8 @@ amdsmi_status_t amdsmi_set_cpu_core_boostlimit(amdsmi_processor_handle processor
|
||||
core_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_core_boostlimit_set(core_ind, boostlimit));
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3228,7 +3235,7 @@ amdsmi_status_t amdsmi_set_cpu_socket_boostlimit(amdsmi_processor_handle process
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_boostlimit_set(sock_ind, boostlimit));
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3246,7 +3253,7 @@ amdsmi_status_t amdsmi_get_cpu_ddr_bw(amdsmi_processor_handle processor_handle,
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_ddr_bw_get(&ddr));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
ddr_bw->max_bw = ddr.max_bw;
|
||||
ddr_bw->utilized_bw = ddr.utilized_bw;
|
||||
@@ -3275,7 +3282,7 @@ amdsmi_status_t amdsmi_get_cpu_socket_temperature(amdsmi_processor_handle proces
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_temperature_get(sock_ind, &tmon));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*ptmon = tmon;
|
||||
|
||||
@@ -3305,7 +3312,7 @@ amdsmi_status_t amdsmi_get_cpu_dimm_temp_range_and_refresh_rate(
|
||||
status = static_cast<amdsmi_status_t>(esmi_dimm_temp_range_and_refresh_rate_get(
|
||||
sock_ind, dimm_addr, &dimm_rate));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
rate->range = dimm_rate.range;
|
||||
rate->ref_rate = dimm_rate.ref_rate;
|
||||
@@ -3334,7 +3341,7 @@ amdsmi_status_t amdsmi_get_cpu_dimm_power_consumption(amdsmi_processor_handle pr
|
||||
status = static_cast<amdsmi_status_t>(esmi_dimm_power_consumption_get(sock_ind,
|
||||
dimm_addr, &d_power));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
dimm_pow->power = d_power.power;
|
||||
dimm_pow->update_rate = d_power.update_rate;
|
||||
@@ -3364,7 +3371,7 @@ amdsmi_status_t amdsmi_get_cpu_dimm_thermal_sensor(amdsmi_processor_handle proce
|
||||
status = static_cast<amdsmi_status_t>(esmi_dimm_thermal_sensor_get(sock_ind,
|
||||
dimm_addr, &d_sensor));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
dimm_temp->temp = d_sensor.temp;
|
||||
dimm_temp->update_rate = d_sensor.update_rate;
|
||||
@@ -3385,7 +3392,7 @@ amdsmi_status_t amdsmi_set_cpu_xgmi_width(amdsmi_processor_handle processor_hand
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_xgmi_width_set(min, max));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3410,7 +3417,7 @@ amdsmi_status_t amdsmi_set_cpu_gmi3_link_width_range(amdsmi_processor_handle pro
|
||||
status = static_cast<amdsmi_status_t>(esmi_gmi3_link_width_range_set(sock_ind,
|
||||
min_link_width, max_link_width));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3433,7 +3440,7 @@ amdsmi_status_t amdsmi_cpu_apb_enable(amdsmi_processor_handle processor_handle)
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_apb_enable(sock_ind));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3457,7 +3464,7 @@ amdsmi_status_t amdsmi_cpu_apb_disable(amdsmi_processor_handle processor_handle,
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_apb_disable(sock_ind, pstate));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3481,7 +3488,7 @@ amdsmi_status_t amdsmi_set_cpu_socket_lclk_dpm_level(amdsmi_processor_handle pro
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_lclk_dpm_level_set(sock_ind, nbio_id, min, max));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3507,7 +3514,7 @@ amdsmi_status_t amdsmi_get_cpu_socket_lclk_dpm_level(amdsmi_processor_handle pro
|
||||
status = static_cast<amdsmi_status_t>(esmi_socket_lclk_dpm_level_get(sock_ind,
|
||||
nbio_id, &nb));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
nbio->min_dpm_level = nb.min_dpm_level;
|
||||
nbio->max_dpm_level = nb.max_dpm_level;
|
||||
@@ -3535,7 +3542,7 @@ amdsmi_status_t amdsmi_set_cpu_pcie_link_rate(amdsmi_processor_handle processor_
|
||||
status = static_cast<amdsmi_status_t>(esmi_pcie_link_rate_set(sock_ind,
|
||||
rate_ctrl, prev_mode));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3560,7 +3567,7 @@ amdsmi_status_t amdsmi_set_cpu_df_pstate_range(amdsmi_processor_handle processor
|
||||
status = static_cast<amdsmi_status_t>(esmi_df_pstate_range_set(sock_ind,
|
||||
max_pstate, min_pstate));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3590,7 +3597,7 @@ amdsmi_status_t amdsmi_get_cpu_current_io_bandwidth(amdsmi_processor_handle proc
|
||||
status = static_cast<amdsmi_status_t>(esmi_current_io_bandwidth_get(sock_ind,
|
||||
io_link, &bw));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*io_bw = bw;
|
||||
|
||||
@@ -3614,7 +3621,7 @@ amdsmi_status_t amdsmi_get_cpu_current_xgmi_bw(amdsmi_processor_handle processor
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_current_xgmi_bw_get(io_link, &bw));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*xgmi_bw = bw;
|
||||
|
||||
@@ -3633,16 +3640,16 @@ amdsmi_status_t amdsmi_get_metrics_table_version(amdsmi_processor_handle process
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_metrics_table_version_get(&metrics_tbl_ver));
|
||||
*metrics_version = metrics_tbl_ver;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*metrics_version = metrics_tbl_ver;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_get_metrics_table(amdsmi_processor_handle processor_handle,
|
||||
struct hsmp_metric_table *metrics_table)
|
||||
amdsmi_hsmp_metric_table_t *metrics_table)
|
||||
{
|
||||
amdsmi_status_t status;
|
||||
struct hsmp_metric_table metrics_tbl;
|
||||
@@ -3653,6 +3660,9 @@ amdsmi_status_t amdsmi_get_metrics_table(amdsmi_processor_handle processor_handl
|
||||
if (processor_handle == nullptr)
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
if(sizeof(amdsmi_hsmp_metric_table_t) != sizeof(struct hsmp_metric_table))
|
||||
return AMDSMI_STATUS_UNEXPECTED_SIZE;
|
||||
|
||||
amdsmi_status_t r = amdsmi_get_processor_info(processor_handle, SIZE, proc_id);
|
||||
if (r != AMDSMI_STATUS_SUCCESS)
|
||||
return r;
|
||||
@@ -3660,10 +3670,10 @@ amdsmi_status_t amdsmi_get_metrics_table(amdsmi_processor_handle processor_handl
|
||||
sock_ind = (uint8_t)std::stoi(proc_id, NULL, 0);
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_metrics_table_get(sock_ind, &metrics_tbl));
|
||||
*metrics_table = metrics_tbl;
|
||||
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
std::memcpy(metrics_table, &metrics_tbl, sizeof(amdsmi_hsmp_metric_table_t));
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3688,21 +3698,21 @@ amdsmi_status_t amdsmi_first_online_core_on_cpu_socket(amdsmi_processor_handle p
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_first_online_core_on_socket(sock_ind, &online_core));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
return amdsmi_errno_to_esmi_status(status);
|
||||
|
||||
*pcore_ind = online_core;
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
const char** amdsmi_get_esmi_err_msg(amdsmi_status_t status, const char **status_string)
|
||||
amdsmi_status_t amdsmi_get_esmi_err_msg(amdsmi_status_t status, const char **status_string)
|
||||
{
|
||||
for (auto& iter : amd::smi::esmi_status_map) {
|
||||
if (iter.first == status) {
|
||||
*status_string = esmi_get_err_msg(static_cast<esmi_status_t>(iter.first));
|
||||
break;
|
||||
return iter.second;
|
||||
}
|
||||
}
|
||||
return status_string;
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -131,6 +131,7 @@ amdsmi_status_t AMDSmiDrm::init() {
|
||||
amd::smi::RocmSMI& smi = amd::smi::RocmSMI::getInstance();
|
||||
auto devices = smi.devices();
|
||||
|
||||
bool has_valid_fds = false;
|
||||
for (uint32_t i=0; i < devices.size(); i++) {
|
||||
auto rocm_smi_device = devices[i];
|
||||
std::string render_file_name;
|
||||
@@ -171,6 +172,7 @@ amdsmi_status_t AMDSmiDrm::init() {
|
||||
continue;
|
||||
}
|
||||
|
||||
has_valid_fds = true;
|
||||
bdf.fields.function_number = device->businfo.pci->func;
|
||||
bdf.fields.device_number = device->businfo.pci->dev;
|
||||
bdf.fields.bus_number = device->businfo.pci->bus;
|
||||
@@ -182,6 +184,12 @@ amdsmi_status_t AMDSmiDrm::init() {
|
||||
drm_free_device(&device);
|
||||
}
|
||||
|
||||
// cannot find any valid fds.
|
||||
if (!has_valid_fds) {
|
||||
drm_bdfs_.clear();
|
||||
return AMDSMI_STATUS_INIT_ERROR;
|
||||
}
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -315,7 +323,7 @@ std::vector<std::string>& AMDSmiDrm::get_drm_paths() {
|
||||
}
|
||||
|
||||
bool AMDSmiDrm::check_if_drm_is_supported() {
|
||||
return drm_cmd_write_ != NULL ? true : false;
|
||||
return (drm_cmd_write_ != NULL && drm_bdfs_.size() >0) ? true : false;
|
||||
}
|
||||
|
||||
std::vector<amdsmi_bdf_t> AMDSmiDrm::get_bdfs() {
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
#include <functional>
|
||||
#include "amd_smi/impl/amd_smi_gpu_device.h"
|
||||
#include "rocm_smi/rocm_smi_utils.h"
|
||||
|
||||
|
||||
namespace amd {
|
||||
@@ -80,11 +81,6 @@ amdsmi_status_t AMDSmiGPUDevice::get_drm_data() {
|
||||
ret = drm_.get_bdf_by_index(gpu_id_, &bdf);
|
||||
if (ret != AMDSMI_STATUS_SUCCESS) return AMDSMI_STATUS_NOT_SUPPORTED;
|
||||
|
||||
mutex_ = shared_mutex_init(path.c_str(), 0777);
|
||||
if (mutex_.ptr == nullptr) {
|
||||
printf("Failed to create shared mem. mutex.");
|
||||
return AMDSMI_STATUS_INIT_ERROR;
|
||||
}
|
||||
bdf_ = bdf, path_ = path, fd_ = fd;
|
||||
vendor_id_ = drm_.get_vendor_id();
|
||||
|
||||
@@ -92,7 +88,7 @@ amdsmi_status_t AMDSmiGPUDevice::get_drm_data() {
|
||||
}
|
||||
|
||||
pthread_mutex_t* AMDSmiGPUDevice::get_mutex() {
|
||||
return mutex_.ptr;
|
||||
return amd::smi::GetMutex(gpu_id_);
|
||||
}
|
||||
|
||||
amdsmi_status_t AMDSmiGPUDevice::amdgpu_query_info(unsigned info_id,
|
||||
|
||||
@@ -50,7 +50,7 @@ set(TEST "amdsmitst")
|
||||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} tstSources)
|
||||
|
||||
# Header file include path
|
||||
include_directories(${TEST} ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
include_directories(${TEST} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${ROCM_INC_DIR}/..)
|
||||
|
||||
# Build rules
|
||||
add_executable(${TEST} ${tstSources} ${functionalSources})
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "rocm_smi/rocm_smi_utils.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include "test_common.h"
|
||||
#include "test_base.h"
|
||||
@@ -159,10 +160,12 @@ TEST(amdsmitstReadOnly, TestVoltCurvRead) {
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadOnly, TestPerfLevelRead) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestPerfLevelRead tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadWrite, TestPerfLevelReadWrite) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestPerfLevelReadWrite tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
@@ -183,10 +186,12 @@ TEST(amdsmitstReadWrite, TestFrequenciesReadWrite) {
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadWrite, TestPciReadWrite) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestPciReadWrite tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadOnly, TestSysInfoRead) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestSysInfoRead tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
@@ -195,14 +200,17 @@ TEST(amdsmitstReadOnly, TestGPUBusyRead) {
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadOnly, TestPowerRead) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestPowerRead tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadWrite, TestPowerReadWrite) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestPowerReadWrite tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadWrite, TestPowerCapReadWrite) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestPowerCapReadWrite tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
@@ -215,6 +223,7 @@ TEST(amdsmitstReadOnly, TestMemUtilRead) {
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
TEST(amdsmitstReadOnly, TestIdInfoRead) {
|
||||
if (amd::smi::is_vm_guest()) GTEST_SKIP();
|
||||
TestIdInfoRead tst;
|
||||
RunGenericTest(&tst);
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ if ! does_image_exist; then
|
||||
# docker pull dmitriigalantsev/amdsmi_wrapper_updater
|
||||
echo "No docker image found! Generating one"
|
||||
# set to 0 because it's compatible with more systems
|
||||
DOCKER_BUILDKIT="${DOCKER_BUILDKIT:0}" docker build "$DIR/py-interface" -t "$DOCKER_NAME":latest
|
||||
DOCKER_BUILDKIT="${DOCKER_BUILDKIT:=0}" docker build "$DIR/py-interface" -t "$DOCKER_NAME":latest
|
||||
fi
|
||||
|
||||
ENABLE_ESMI_LIB=""
|
||||
|
||||
Reference in New Issue
Block a user