diff --git a/include/amd_smi/amdsmi.h b/include/amd_smi/amdsmi.h index e42aeda8ef..dcd36ae585 100644 --- a/include/amd_smi/amdsmi.h +++ b/include/amd_smi/amdsmi.h @@ -1647,7 +1647,7 @@ amdsmi_status_t amdsmi_set_gpu_pci_bandwidth(amdsmi_processor_handle processor_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *power); +amdsmi_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *power); /** * @brief Get the energy accumulator counter of the device with provided @@ -1657,7 +1657,7 @@ amdsmi_dev_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sens * @p power, and a pointer to a uint64_t @p timestamp, this function will write * amount of energy consumed to the uint64_t pointed to by @p power, * and the timestamp to the uint64_t pointed to by @p timestamp. - * The amdsmi_dev_get_power_ave() is an average of a short time. This function + * The amdsmi_get_power_ave() is an average of a short time. This function * accumulates all energy consumed. * * @param[in] processor_handle a device handle diff --git a/py-interface/README.md b/py-interface/README.md index d11dfbb0a3..5e9bf52792 100644 --- a/py-interface/README.md +++ b/py-interface/README.md @@ -1490,7 +1490,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_power_ave +## amdsmi_get_power_ave Description: Get the average power consumption of the device @@ -1502,7 +1502,7 @@ If a device has more than one sensor, it could be greater than 0. Output: the average power consumption -Exceptions that can be thrown by `amdsmi_dev_get_power_ave` function: +Exceptions that can be thrown by `amdsmi_get_power_ave` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1515,7 +1515,7 @@ try: print("No GPUs on machine") else: for device in devices: - power = amdsmi_dev_get_power_ave(device) + power = amdsmi_get_power_ave(device) print(power) except AmdSmiException as e: print(e) diff --git a/py-interface/__init__.py b/py-interface/__init__.py index 73ae3b2075..3c3e2bd2e5 100644 --- a/py-interface/__init__.py +++ b/py-interface/__init__.py @@ -144,7 +144,7 @@ from .amdsmi_interface import amdsmi_get_gpu_pci_replay_counter from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity # # Power information -from .amdsmi_interface import amdsmi_dev_get_power_ave +from .amdsmi_interface import amdsmi_get_power_ave from .amdsmi_interface import amdsmi_dev_get_energy_count # # Memory information diff --git a/py-interface/amdsmi_interface.py b/py-interface/amdsmi_interface.py index 393c552a8d..cebb56292d 100644 --- a/py-interface/amdsmi_interface.py +++ b/py-interface/amdsmi_interface.py @@ -1838,7 +1838,7 @@ def amdsmi_dev_set_power_cap( ) -def amdsmi_dev_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32): +def amdsmi_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( processor_handle, amdsmi_wrapper.amdsmi_processor_handle @@ -1847,7 +1847,7 @@ def amdsmi_dev_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_h power = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_power_ave( + amdsmi_wrapper.amdsmi_get_power_ave( processor_handle, sensor_id, ctypes.byref(power)) ) diff --git a/py-interface/amdsmi_wrapper.py b/py-interface/amdsmi_wrapper.py index 6727177884..1474a3d326 100644 --- a/py-interface/amdsmi_wrapper.py +++ b/py-interface/amdsmi_wrapper.py @@ -1457,9 +1457,9 @@ amdsmi_get_gpu_pci_replay_counter.argtypes = [amdsmi_processor_handle, ctypes.PO amdsmi_set_gpu_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_set_gpu_pci_bandwidth amdsmi_set_gpu_pci_bandwidth.restype = amdsmi_status_t amdsmi_set_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, uint64_t] -amdsmi_dev_get_power_ave = _libraries['libamd_smi.so'].amdsmi_dev_get_power_ave -amdsmi_dev_get_power_ave.restype = amdsmi_status_t -amdsmi_dev_get_power_ave.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_power_ave = _libraries['libamd_smi.so'].amdsmi_get_power_ave +amdsmi_get_power_ave.restype = amdsmi_status_t +amdsmi_get_power_ave.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_energy_count = _libraries['libamd_smi.so'].amdsmi_dev_get_energy_count amdsmi_dev_get_energy_count.restype = amdsmi_status_t amdsmi_dev_get_energy_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_uint64)] @@ -1865,7 +1865,7 @@ __all__ = \ 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', 'amdsmi_get_gpu_pci_replay_counter', 'amdsmi_get_gpu_pci_throughput', 'amdsmi_dev_get_perf_level', - 'amdsmi_dev_get_power_ave', + 'amdsmi_get_power_ave', 'amdsmi_dev_get_power_profile_presets', 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', 'amdsmi_dev_get_temp_metric', 'amdsmi_get_gpu_vendor_name', diff --git a/py-interface/rocm_smi_tool.py b/py-interface/rocm_smi_tool.py index 30a5dd0a72..e2bf4fab3c 100644 --- a/py-interface/rocm_smi_tool.py +++ b/py-interface/rocm_smi_tool.py @@ -298,7 +298,7 @@ class Formatter: | """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_get_gpu_pci_throughput ") + """ | | """ + self.style.text("10 Get device pci replay counter. Api: amdsmi_get_gpu_pci_replay_counter ") + """ | | """ + self.style.text("11 Get topo numa affinity. Api: amdsmi_get_gpu_topo_numa_affinity ") + """ | - | """ + self.style.text("12 Get device power ave. Api: amdsmi_dev_get_power_ave ") + """ | + | """ + self.style.text("12 Get device power ave. Api: amdsmi_get_power_ave ") + """ | | """ + self.style.text("13 Get device energy count. Api: amdsmi_dev_get_energy_count ") + """ | | """ + self.style.text("14 Get device memory total. Api: amdsmi_dev_get_memory_total ") + """ | | """ + self.style.text("15 Get device memory usage. Api: amdsmi_dev_get_memory_usage ") + """ | @@ -377,7 +377,7 @@ class Formatter: ############################################## def amdsmi_tool_dev_power_ave_get(dev, dic): sensor_id = dic["sensor_id"] - return smi_api.amdsmi_dev_get_power_ave(dev, ctypes.c_uint32(sensor_id)) + return smi_api.amdsmi_get_power_ave(dev, ctypes.c_uint32(sensor_id)) def amdsmi_tool_dev_memory_total_get(dev): result = {} diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index 8fe38255af..ae9ad5204c 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -938,7 +938,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"}, {"rsmi_dev_ecc_count_get", " amdsmi_dev_get_ecc_count"}, {"rsmi_counter_available_counters_get", " amdsmi_counter_get_available_counters"}, - {"rsmi_dev_power_ave_get", "amdsmi_dev_get_power_ave"}, + {"rsmi_dev_power_ave_get", "amdsmi_get_power_ave"}, {"rsmi_dev_power_cap_get", "amdsmi_get_power_cap_info"}, {"rsmi_dev_power_cap_default_get", "amdsmi_get_power_cap_info"}, {"rsmi_dev_power_cap_range_get", "amdsmi_get_power_cap_info"}, @@ -1131,7 +1131,7 @@ amdsmi_status_t } amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_processor_handle processor_handle, +amdsmi_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *power) { AMDSMI_CHECK_INIT(); diff --git a/tests/amd_smi_test/functional/mutual_exclusion.cc b/tests/amd_smi_test/functional/mutual_exclusion.cc index ecea990b48..53cb2b34b3 100755 --- a/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -283,7 +283,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_get_gpu_metrics_info amdsmi_dev_get_od_volt_curve_regions amdsmi_dev_power_max_get - amdsmi_dev_get_power_ave + amdsmi_get_power_ave amdsmi_dev_power_cap_get amdsmi_dev_power_cap_range_get amdsmi_dev_set_power_cap diff --git a/tests/amd_smi_test/functional/power_read.cc b/tests/amd_smi_test/functional/power_read.cc index bad4ab6f1f..3246025939 100755 --- a/tests/amd_smi_test/functional/power_read.cc +++ b/tests/amd_smi_test/functional/power_read.cc @@ -112,7 +112,7 @@ void TestPowerRead::Run(void) { info.max_power_cap << " uW" << std::endl; } - err = amdsmi_dev_get_power_ave(processor_handles_[i], 0, &val_ui64); + err = amdsmi_get_power_ave(processor_handles_[i], 0, &val_ui64); IF_VERB(STANDARD) { std::cout << "\t**Averge Power Usage: "; CHK_AMDSMI_PERM_ERR(err) @@ -120,7 +120,7 @@ void TestPowerRead::Run(void) { std::cout << static_cast(val_ui64)/1000 << " mW" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_power_ave(processor_handles_[i], 0, nullptr); + err = amdsmi_get_power_ave(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } }