diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index dcd36ae585..b5e69e69a1 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1677,7 +1677,7 @@ amdsmi_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_i * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power, +amdsmi_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp); /** @} End PowerQuer */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 5e9bf52792..c35d77fe8c 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1522,7 +1522,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_get_energy_count +## amdsmi_get_energy_count Description: Get the energy accumulator counter of the device. @@ -1538,7 +1538,7 @@ Field | Content `counter_resolution` | counter resolution `timestamp` | timestamp -Exceptions that can be thrown by `amdsmi_dev_get_energy_count` function: +Exceptions that can be thrown by `amdsmi_get_energy_count` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1551,7 +1551,7 @@ try: print("No GPUs on machine") else: for device in devices: - power = amdsmi_dev_get_energy_count(device) + power = amdsmi_get_energy_count(device) print(power) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 3c3e2bd2e5..a600c50e80 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -145,7 +145,7 @@ from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity # # Power information from .amdsmi_interface import amdsmi_get_power_ave -from .amdsmi_interface import amdsmi_dev_get_energy_count +from .amdsmi_interface import amdsmi_get_energy_count # # Memory information from .amdsmi_interface import amdsmi_dev_get_memory_total diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index cebb56292d..7ed7b88e9c 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1877,7 +1877,7 @@ def amdsmi_dev_set_power_profile( ) -def amdsmi_dev_get_energy_count(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_energy_count(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 @@ -1888,7 +1888,7 @@ def amdsmi_dev_get_energy_count(processor_handle: amdsmi_wrapper.amdsmi_processo timestamp = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_energy_count(processor_handle, ctypes.byref( + amdsmi_wrapper.amdsmi_get_energy_count(processor_handle, ctypes.byref( power), ctypes.byref(counter_resolution), ctypes.byref(timestamp)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 1474a3d326..aad9c29fa6 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1460,9 +1460,9 @@ amdsmi_set_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, uint64_t] 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)] +amdsmi_get_energy_count = _libraries['libamd_smi.so'].amdsmi_get_energy_count +amdsmi_get_energy_count.restype = amdsmi_status_t +amdsmi_get_energy_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_set_power_cap = _libraries['libamd_smi.so'].amdsmi_dev_set_power_cap amdsmi_dev_set_power_cap.restype = amdsmi_status_t amdsmi_dev_set_power_cap.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] @@ -1854,7 +1854,7 @@ __all__ = \ 'amdsmi_dev_destroy_counter', 'amdsmi_dev_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_ecc_count', 'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status', - 'amdsmi_dev_get_energy_count', 'amdsmi_dev_get_fan_rpms', + 'amdsmi_get_energy_count', 'amdsmi_dev_get_fan_rpms', 'amdsmi_dev_get_fan_speed', 'amdsmi_dev_get_fan_speed_max', 'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info', 'amdsmi_get_gpu_id', 'amdsmi_dev_get_memory_busy_percent', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index e2bf4fab3c..2e976eb059 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -299,7 +299,7 @@ class Formatter: | """ + 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_get_power_ave ") + """ | - | """ + self.style.text("13 Get device energy count. Api: amdsmi_dev_get_energy_count ") + """ | + | """ + self.style.text("13 Get device energy count. Api: amdsmi_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 ") + """ | | """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_dev_get_memory_busy_percent ") + """ | @@ -759,7 +759,7 @@ commands = { "device_identifier1": [None, True], "sensor_id": [int, True] }], - 13: [smi_api.amdsmi_dev_get_energy_count, { + 13: [smi_api.amdsmi_get_energy_count, { "device_identifier1": [None, True] }], 14: [amdsmi_tool_dev_memory_total_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index ae9ad5204c..dfae1cb993 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1373,7 +1373,7 @@ amdsmi_status_t amdsmi_dev_get_memory_busy_percent( busy_percent); } -amdsmi_status_t amdsmi_dev_get_energy_count(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp) { return rsmi_wrapper(rsmi_dev_energy_count_get, processor_handle, power, counter_resolution, timestamp); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/metrics_counter_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/metrics_counter_read.cc index 657bb30137..2c24576fba 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/metrics_counter_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/metrics_counter_read.cc @@ -106,7 +106,7 @@ void TestMetricsCounterRead::Run(void) { uint64_t power; uint64_t timestamp; float counter_resolution; - err = amdsmi_dev_get_energy_count(processor_handles_[i], &power, &counter_resolution, ×tamp); + err = amdsmi_get_energy_count(processor_handles_[i], &power, &counter_resolution, ×tamp); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -128,7 +128,7 @@ void TestMetricsCounterRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_energy_count(processor_handles_[i], nullptr, nullptr, nullptr); + err = amdsmi_get_energy_count(processor_handles_[i], nullptr, nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); // Coarse Grain counters