amdsmi: Adding Support to get hsmp Driver version
* amdsmi: Adding Support to get hsmp Driver version Adding Support to fetch hsmp driver version from ESmi Interfaces. Adding Support to fetch memory bandwidth per socket. Signed-off-by: muthusamy <muthusamy.ramalingam@amd.com>
Αυτή η υποβολή περιλαμβάνεται σε:
υποβλήθηκε από
GitHub
γονέας
21841f44a5
υποβολή
ced110dbb6
@@ -39,6 +39,8 @@ try:
|
||||
from .amdsmi_interface import amdsmi_get_cpu_smu_fw_version
|
||||
from .amdsmi_interface import amdsmi_get_cpu_core_energy
|
||||
from .amdsmi_interface import amdsmi_get_cpu_socket_energy
|
||||
from .amdsmi_interface import amdsmi_get_threads_per_core
|
||||
from .amdsmi_interface import amdsmi_get_cpu_hsmp_driver_version
|
||||
from .amdsmi_interface import amdsmi_get_cpu_prochot_status
|
||||
from .amdsmi_interface import amdsmi_get_cpu_fclk_mclk
|
||||
from .amdsmi_interface import amdsmi_get_cpu_cclk_limit
|
||||
|
||||
@@ -826,6 +826,21 @@ def amdsmi_get_cpu_smu_fw_version(processor_handle: amdsmi_wrapper.amdsmi_proces
|
||||
"smu_fw_major_ver_num": smu_fw.major
|
||||
}
|
||||
|
||||
def amdsmi_get_cpu_hsmp_driver_version(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
|
||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||
raise AmdSmiParameterException(
|
||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||
)
|
||||
|
||||
hsmp_driver_version = amdsmi_wrapper.amdsmi_hsmp_driver_version_t()
|
||||
|
||||
_check_res(amdsmi_wrapper.amdsmi_get_cpu_hsmp_driver_version(processor_handle, hsmp_driver_version))
|
||||
|
||||
return {
|
||||
"hsmp_driver_major_ver_num": hsmp_driver_version.major,
|
||||
"hsmp_driver_minor_ver_num": hsmp_driver_version.minor,
|
||||
}
|
||||
|
||||
def amdsmi_get_cpu_core_energy(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
|
||||
) -> int:
|
||||
@@ -860,6 +875,16 @@ def amdsmi_get_cpu_socket_energy(
|
||||
|
||||
return f"{float(penergy.value * pow(10, -6))} J"
|
||||
|
||||
def amdsmi_get_threads_per_core():
|
||||
threads_per_core = ctypes.c_uint32()
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_get_threads_per_core(
|
||||
ctypes.byref(threads_per_core)
|
||||
)
|
||||
)
|
||||
|
||||
return threads_per_core.value
|
||||
|
||||
def amdsmi_get_cpu_prochot_status(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
|
||||
) -> int:
|
||||
|
||||
@@ -1989,6 +1989,16 @@ struct_amdsmi_topology_nearest_t._fields_ = [
|
||||
]
|
||||
|
||||
amdsmi_topology_nearest_t = struct_amdsmi_topology_nearest_t
|
||||
class struct_amdsmi_hsmp_driver_version_t(Structure):
|
||||
pass
|
||||
|
||||
struct_amdsmi_hsmp_driver_version_t._pack_ = 1 # source:False
|
||||
struct_amdsmi_hsmp_driver_version_t._fields_ = [
|
||||
('major', ctypes.c_ubyte),
|
||||
('minor', ctypes.c_ubyte),
|
||||
]
|
||||
|
||||
amdsmi_hsmp_driver_version_t = struct_amdsmi_hsmp_driver_version_t
|
||||
class struct_amdsmi_smu_fw_version_t(Structure):
|
||||
pass
|
||||
|
||||
@@ -2553,6 +2563,9 @@ amdsmi_get_cpu_socket_energy.argtypes = [amdsmi_processor_handle, ctypes.POINTER
|
||||
amdsmi_get_threads_per_core = _libraries['libamd_smi.so'].amdsmi_get_threads_per_core
|
||||
amdsmi_get_threads_per_core.restype = amdsmi_status_t
|
||||
amdsmi_get_threads_per_core.argtypes = [ctypes.POINTER(ctypes.c_uint32)]
|
||||
amdsmi_get_cpu_hsmp_driver_version = _libraries['libamd_smi.so'].amdsmi_get_cpu_hsmp_driver_version
|
||||
amdsmi_get_cpu_hsmp_driver_version.restype = amdsmi_status_t
|
||||
amdsmi_get_cpu_hsmp_driver_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_amdsmi_hsmp_driver_version_t)]
|
||||
amdsmi_get_cpu_smu_fw_version = _libraries['libamd_smi.so'].amdsmi_get_cpu_smu_fw_version
|
||||
amdsmi_get_cpu_smu_fw_version.restype = amdsmi_status_t
|
||||
amdsmi_get_cpu_smu_fw_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_amdsmi_smu_fw_version_t)]
|
||||
@@ -2922,6 +2935,7 @@ __all__ = \
|
||||
'amdsmi_get_cpu_dimm_temp_range_and_refresh_rate',
|
||||
'amdsmi_get_cpu_dimm_thermal_sensor', 'amdsmi_get_cpu_family',
|
||||
'amdsmi_get_cpu_fclk_mclk', 'amdsmi_get_cpu_handles',
|
||||
'amdsmi_get_cpu_hsmp_driver_version',
|
||||
'amdsmi_get_cpu_hsmp_proto_ver', 'amdsmi_get_cpu_model',
|
||||
'amdsmi_get_cpu_prochot_status',
|
||||
'amdsmi_get_cpu_pwr_svi_telemetry_all_rails',
|
||||
@@ -2996,8 +3010,9 @@ __all__ = \
|
||||
'amdsmi_gpu_cache_info_t', 'amdsmi_gpu_control_counter',
|
||||
'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter',
|
||||
'amdsmi_gpu_destroy_counter', 'amdsmi_gpu_metrics_t',
|
||||
'amdsmi_gpu_read_counter', 'amdsmi_gpu_validate_ras_eeprom',
|
||||
'amdsmi_gpu_xcp_metrics_t', 'amdsmi_gpu_xgmi_error_status',
|
||||
'amdsmi_gpu_read_counter', 'amdsmi_gpu_xcp_metrics_t',
|
||||
'amdsmi_gpu_xgmi_error_status', 'amdsmi_hsmp_driver_version_t',
|
||||
'amdsmi_gpu_validate_ras_eeprom',
|
||||
'amdsmi_hsmp_freqlimit_src_names', 'amdsmi_hsmp_metrics_table_t',
|
||||
'amdsmi_init', 'amdsmi_init_flags_t',
|
||||
'amdsmi_init_gpu_event_notification', 'amdsmi_io_bw_encoding_t',
|
||||
@@ -3070,6 +3085,7 @@ __all__ = \
|
||||
'struct_amdsmi_frequency_range_t', 'struct_amdsmi_fw_info_t',
|
||||
'struct_amdsmi_gpu_cache_info_t', 'struct_amdsmi_gpu_metrics_t',
|
||||
'struct_amdsmi_gpu_xcp_metrics_t',
|
||||
'struct_amdsmi_hsmp_driver_version_t',
|
||||
'struct_amdsmi_hsmp_metrics_table_t', 'struct_amdsmi_kfd_info_t',
|
||||
'struct_amdsmi_link_id_bw_type_t', 'struct_amdsmi_link_metrics_t',
|
||||
'struct_amdsmi_memory_partition_config_t',
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user