From 135971e3bf75a7523e01b46251b5f01e2d2dd5f1 Mon Sep 17 00:00:00 2001 From: "Galantsev, Dmitrii" Date: Wed, 5 Apr 2023 20:18:43 -0500 Subject: [PATCH 01/95] CMake: Install amdsmitst.exclude Change-Id: I166cbd265cf9074e17cad39fddac77988e2fd686 Signed-off-by: Galantsev, Dmitrii [ROCm/amdsmi commit: 3d00ae124086eb6a1f3d73897865cc49202e7d21] --- projects/amdsmi/tests/amd_smi_test/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/amdsmi/tests/amd_smi_test/CMakeLists.txt b/projects/amdsmi/tests/amd_smi_test/CMakeLists.txt index 93c2bbab04..122adcf29f 100644 --- a/projects/amdsmi/tests/amd_smi_test/CMakeLists.txt +++ b/projects/amdsmi/tests/amd_smi_test/CMakeLists.txt @@ -70,3 +70,8 @@ install( TARGETS ${TEST} gtest gtest_main DESTINATION ${SHARE_INSTALL_PREFIX}/tests COMPONENT tests) + +install( + FILES amdsmitst.exclude + DESTINATION ${SHARE_INSTALL_PREFIX}/tests + COMPONENT tests) From dbd6fe5768666bf701bbcaeaffd0909e19367ffc Mon Sep 17 00:00:00 2001 From: Dalibor Stanisavljevic Date: Tue, 25 Apr 2023 15:52:31 +0200 Subject: [PATCH 02/95] SWDEV-397055 - Remove mm_ip_list from caps Change-Id: Ia4f337d24744fc545e8336705fe7a2b2d9b5f8db Signed-off-by: Dalibor Stanisavljevic [ROCm/amdsmi commit: b36f040bf98bba821e001757f536c6873e308881] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index bfc3ca80a6..cdf51d688d 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -354,6 +354,8 @@ class AMDSMICommands(): if args.caps: try: caps_info = amdsmi_interface.amdsmi_get_caps_info(args.gpu) + caps_info.pop('mm_ip_list') + caps_info.pop('ras_supported') if self.logger.is_human_readable_format(): for capability_name, capability_value in caps_info.items(): @@ -362,11 +364,6 @@ class AMDSMICommands(): if isinstance(capability_value, bool): caps_info[capability_name] = f"{bool(capability_value)}" - if self.logger.is_csv_format() and self.logger.is_gpuvsmi_compatibility(): - if 'mm_ip_list' in caps_info: - if caps_info['mm_ip_list']: # Don't index if it's not populated - caps_info['mm_ip_list'] = caps_info['mm_ip_list'][0] - static_dict['caps'] = caps_info except amdsmi_exception.AmdSmiLibraryException as e: static_dict['caps'] = e.get_error_info() From 77728c48f39deaf83cae8197b90503ff12f6447d Mon Sep 17 00:00:00 2001 From: Dalibor Stanisavljevic Date: Thu, 27 Apr 2023 09:36:43 +0200 Subject: [PATCH 03/95] SWDEV-397054 - Added ecc info (accummulated number of ECC errors) Change-Id: I75f6fc402d8c62046c4ccd581347360343aea0e4 Signed-off-by: Dalibor Stanisavljevic [ROCm/amdsmi commit: 6cce103fba7c69724899a5bf1c4253a4bae3819a] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 49 +++++++++++++------ projects/amdsmi/amdsmi_cli/amdsmi_parser.py | 3 ++ 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index cdf51d688d..be12192cdd 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -342,13 +342,12 @@ class AMDSMICommands(): if (self.helpers.is_linux() and self.helpers.is_baremetal()): if args.ras: try: - if self.helpers.has_ras_support(args.gpu): - static_dict['ras'] = amdsmi_interface.amdsmi_get_ras_block_features_enabled(args.gpu) - else: - static_dict['ras'] = 'N/A' - + static_dict['ras'] = amdsmi_interface.amdsmi_get_ras_block_features_enabled(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: - static_dict['ras'] = e.get_error_info() + if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NOT_SUPPORTED: + static_dict['ras'] = 'N/A' + else: + static_dict['ras'] = e.get_error_info() if not self.all_arguments: raise e if args.caps: @@ -399,7 +398,7 @@ class AMDSMICommands(): for ras_dict in ras_dicts: for key, value in ras_dict.items(): self.logger.store_output(args.gpu, key, value) - self.logger.store_output(args.gpu, 'values', static_dict) + self.logger.store_output(args.gpu, 'values', static_dict) self.logger.store_multiple_device_output() else: # Store values if ras has an error @@ -628,8 +627,8 @@ class AMDSMICommands(): def metric(self, args, multiple_devices=False, watching_output=False, gpu=None, usage=None, watch=None, watch_time=None, iterations=None, fb_usage=None, power=None, - clock=None, temperature=None, ecc=None, pcie=None, voltage=None, fan=None, - voltage_curve=None, overdrive=None, mem_overdrive=None, perf_level=None, + clock=None, temperature=None, ecc=None, ecc_block=None, pcie=None, voltage=None, + fan=None, voltage_curve=None, overdrive=None, mem_overdrive=None, perf_level=None, replay_count=None, xgmi_err=None, energy=None, mem_usage=None): """Get Metric information for target gpu @@ -647,6 +646,7 @@ class AMDSMICommands(): clock (bool, optional): Value override for args.clock. Defaults to None. temperature (bool, optional): Value override for args.temperature. Defaults to None. ecc (bool, optional): Value override for args.ecc. Defaults to None. + ecc_block (bool, optional): Value override for args.ecc. Defaults to None. pcie (bool, optional): Value override for args.pcie. Defaults to None. voltage (bool, optional): Value override for args.voltage. Defaults to None. fan (bool, optional): Value override for args.fan. Defaults to None. @@ -692,6 +692,8 @@ class AMDSMICommands(): args.temperature = temperature if ecc: args.ecc = ecc + if ecc_block: + args.ecc_block = ecc_block if pcie: args.pcie = pcie if voltage: @@ -757,10 +759,10 @@ class AMDSMICommands(): args.fb_usage = args.replay_count = args.mem_usage = self.all_arguments = True if (self.helpers.is_linux() and self.helpers.is_baremetal()): - if not any([args.usage, args.fb_usage, args.power, args.clock, args.temperature, args.ecc, args.pcie, args.voltage, args.fan, + if not any([args.usage, args.fb_usage, args.power, args.clock, args.temperature, args.ecc, args.ecc_block, args.pcie, args.voltage, args.fan, args.voltage_curve, args.overdrive, args.mem_overdrive, args.perf_level, args.replay_count, args.xgmi_err, args.energy, args.mem_usage]): - args.usage = args.fb_usage = args.power = args.clock = args.temperature = args.ecc = args.pcie = args.voltage = args.fan = \ + args.usage = args.fb_usage = args.power = args.clock = args.temperature = args.ecc = args.ecc_block = args.pcie = args.voltage = args.fan = \ args.voltage_curve = args.overdrive = args.mem_overdrive = args.perf_level = \ args.replay_count = args.xgmi_err = args.energy = args.mem_usage = self.all_arguments = True @@ -896,6 +898,23 @@ class AMDSMICommands(): if not self.all_arguments: raise e if args.ecc: + try: + ecc_count = amdsmi_interface.amdsmi_get_ecc_error_count(args.gpu) + ecc_count['correctable'] = ecc_count.pop('correctable_count') + ecc_count['uncorrectable'] = ecc_count.pop('uncorrectable_count') + + values_dict['ecc'] = ecc_count + except amdsmi_exception.AmdSmiLibraryException as e: + if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NOT_SUPPORTED: + ecc_count['correctable'] = 'N/A' + ecc_count['uncorrectable'] = 'N/A' + values_dict['ecc'] = ecc_count + else: + values_dict['ecc'] = e.get_error_info() + if not self.all_arguments: + raise e + + if args.ecc_block: ecc_dict = {} try: if self.helpers.has_ras_support(args.gpu): @@ -907,12 +926,12 @@ class AMDSMICommands(): ecc_dict[state['block']] = {'correctable' : ecc_count['correctable_count'], 'uncorrectable': ecc_count['uncorrectable_count']} if not ecc_dict: - ecc_dict['correctable'] = 'N/A' - ecc_dict['uncorrectable'] = 'N/A' + ecc_dict['correctable_per_block'] = 'N/A' + ecc_dict['uncorrectable_per_block'] = 'N/A' - values_dict['ecc'] = ecc_dict + values_dict['ecc_block'] = ecc_dict except amdsmi_exception.AmdSmiLibraryException as e: - values_dict['ecc'] = e.get_error_info() + values_dict['ecc_block'] = e.get_error_info() if not self.all_arguments: raise e diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_parser.py b/projects/amdsmi/amdsmi_cli/amdsmi_parser.py index acc930dd5d..4c52a0e5d6 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_parser.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_parser.py @@ -415,6 +415,7 @@ class AMDSMIParser(argparse.ArgumentParser): clock_help = "Average, max, and current clock frequencies" temperature_help = "Current temperatures" ecc_help = "Number of ECC errors" + ecc_block_help = "Number of ECC errors per block" pcie_help = "Current PCIe speed and width" voltage_help = "Current GPU voltages" @@ -459,6 +460,8 @@ class AMDSMIParser(argparse.ArgumentParser): metric_parser.add_argument('-c', '--clock', action='store_true', required=False, help=clock_help) metric_parser.add_argument('-t', '--temperature', action='store_true', required=False, help=temperature_help) metric_parser.add_argument('-e', '--ecc', action='store_true', required=False, help=ecc_help) + metric_parser.add_argument('-k', '--ecc-block', action='store_true', required=False, help=ecc_block_help) + metric_parser.add_argument('-P', '--pcie', action='store_true', required=False, help=pcie_help) metric_parser.add_argument('-V', '--voltage', action='store_true', required=False, help=voltage_help) metric_parser.add_argument('-u', '--usage', action='store_true', required=False, help=usage_help) From 86a4cc3d117ca9560806801045aa87c831999b57 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sat, 25 Feb 2023 05:24:03 -0500 Subject: [PATCH 04/95] Change AMDSmiDevice to AMDSmiProcessor grep -rli 'AMDSmiDevice' * | xargs -i@ sed -i 's/AMDSmiDevice/AMDSmiProcessor/g' @ Change-Id: Ib71e11d7122699cc62df3c4e9711ce3fc51e6fdf [ROCm/amdsmi commit: c4aa7d2c03179535dc66417b43d1b052d617104d] --- .../amdsmi/include/amd_smi/impl/amd_smi_device.h | 12 ++++++------ .../amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h | 6 +++--- .../amdsmi/include/amd_smi/impl/amd_smi_socket.h | 6 +++--- .../amdsmi/include/amd_smi/impl/amd_smi_system.h | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 10 +++++----- projects/amdsmi/src/amd_smi/amd_smi_system.cc | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h index 86a7623d2d..be1bfb9cd9 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h @@ -41,18 +41,18 @@ * */ -#ifndef AMD_SMI_INCLUDE_AMD_SMI_DEVICE_H_ -#define AMD_SMI_INCLUDE_AMD_SMI_DEVICE_H_ +#ifndef AMD_SMI_INCLUDE_AMD_SMI_PROCESSOR_H_ +#define AMD_SMI_INCLUDE_AMD_SMI_PROCESSOR_H_ #include "amd_smi/amdsmi.h" namespace amd { namespace smi { -class AMDSmiDevice { +class AMDSmiProcessor { public: - explicit AMDSmiDevice(device_type_t device) : device_type_(device) {} - virtual ~AMDSmiDevice() {} + explicit AMDSmiProcessor(device_type_t device) : device_type_(device) {} + virtual ~AMDSmiProcessor() {} device_type_t get_device_type() const { return device_type_;} private: device_type_t device_type_; @@ -62,4 +62,4 @@ class AMDSmiDevice { } // namespace smi } // namespace amd -#endif // AMD_SMI_INCLUDE_AMD_SMI_DEVICE_H_ +#endif // AMD_SMI_INCLUDE_AMD_SMI_PROCESSOR_H_ diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h index 9e17b05ca3..0d66d939de 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h @@ -52,13 +52,13 @@ namespace amd { namespace smi { -class AMDSmiGPUDevice: public AMDSmiDevice { +class AMDSmiGPUDevice: public AMDSmiProcessor { public: AMDSmiGPUDevice(uint32_t gpu_id, uint32_t fd, std::string path, amdsmi_bdf_t bdf, AMDSmiDrm& drm): - AMDSmiDevice(AMD_GPU), gpu_id_(gpu_id), fd_(fd), path_(path), bdf_(bdf), drm_(drm) {} + AMDSmiProcessor(AMD_GPU), gpu_id_(gpu_id), fd_(fd), path_(path), bdf_(bdf), drm_(drm) {} AMDSmiGPUDevice(uint32_t gpu_id, AMDSmiDrm& drm): - AMDSmiDevice(AMD_GPU), gpu_id_(gpu_id), drm_(drm) { + AMDSmiProcessor(AMD_GPU), gpu_id_(gpu_id), drm_(drm) { if (check_if_drm_is_supported()) this->get_drm_data(); } ~AMDSmiGPUDevice() { diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h index 5f114bdc4b..a6d91e156e 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h @@ -58,12 +58,12 @@ class AMDSmiSocket { explicit AMDSmiSocket(const std::string& id) : socket_identifier_(id) {} ~AMDSmiSocket(); const std::string& get_socket_id() const { return socket_identifier_;} - void add_device(AMDSmiDevice* device) { devices_.push_back(device); } - std::vector& get_devices() { return devices_;} + void add_device(AMDSmiProcessor* device) { devices_.push_back(device); } + std::vector& get_devices() { return devices_;} amdsmi_status_t get_device_count(uint32_t* device_count) const; private: std::string socket_identifier_; - std::vector devices_; + std::vector devices_; }; } // namespace smi diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h index c83a86eb3c..58eb004197 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h @@ -70,7 +70,7 @@ class AMDSmiSystem { AMDSmiSocket** socket); amdsmi_status_t handle_to_device(amdsmi_device_handle device_handle, - AMDSmiDevice** device); + AMDSmiProcessor** device); amdsmi_status_t gpu_index_to_handle(uint32_t gpu_index, amdsmi_device_handle* device_handle); @@ -82,7 +82,7 @@ class AMDSmiSystem { uint64_t init_flag_; AMDSmiDrm drm_; std::vector sockets_; - std::set devices_; // Track valid devices + std::set devices_; // Track valid devices }; diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 1b0790b93f..9cdffd582b 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -84,7 +84,7 @@ static amdsmi_status_t get_gpu_device_from_handle(amdsmi_device_handle device_ha if (device_handle == nullptr || gpudevice == nullptr) return AMDSMI_STATUS_INVAL; - amd::smi::AMDSmiDevice* device = nullptr; + amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() .handle_to_device(device_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -230,7 +230,7 @@ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, if (r != AMDSMI_STATUS_SUCCESS) return r; - std::vector& devices = socket->get_devices(); + std::vector& devices = socket->get_devices(); uint32_t device_size = static_cast(devices.size()); // Get the device count only if (device_handles == nullptr) { @@ -257,7 +257,7 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle , if (device_type == nullptr) { return AMDSMI_STATUS_INVAL; } - amd::smi::AMDSmiDevice* device = nullptr; + amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() .handle_to_device(device_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -355,7 +355,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_device_handle device_handle, return AMDSMI_STATUS_INVAL; } - amd::smi::AMDSmiDevice* device = nullptr; + amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() .handle_to_device(device_handle, &device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; @@ -397,7 +397,7 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_device_handle device_handle, return AMDSMI_STATUS_INVAL; } - amd::smi::AMDSmiDevice* amd_device = nullptr; + amd::smi::AMDSmiProcessor* amd_device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() .handle_to_device(device_handle, &amd_device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; diff --git a/projects/amdsmi/src/amd_smi/amd_smi_system.cc b/projects/amdsmi/src/amd_smi/amd_smi_system.cc index b104294a06..8f52dd2bb5 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_system.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_system.cc @@ -104,7 +104,7 @@ amdsmi_status_t AMDSmiSystem::populate_amd_gpu_devices() { sockets_.push_back(socket); } - AMDSmiDevice* device = new AMDSmiGPUDevice(i, drm_); + AMDSmiProcessor* device = new AMDSmiGPUDevice(i, drm_); socket->add_device(device); devices_.insert(device); } @@ -166,11 +166,11 @@ amdsmi_status_t AMDSmiSystem::handle_to_socket( amdsmi_status_t AMDSmiSystem::handle_to_device( amdsmi_device_handle device_handle, - AMDSmiDevice** device) { + AMDSmiProcessor** device) { if (device_handle == nullptr || device == nullptr) { return AMDSMI_STATUS_INVAL; } - *device = static_cast(device_handle); + *device = static_cast(device_handle); // double check handlers is here if (std::find(devices_.begin(), devices_.end(), *device) From ea0c860a1a2fed7ae12f6e624471aa956d5f4ca0 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sat, 25 Feb 2023 05:26:14 -0500 Subject: [PATCH 05/95] Change amdsmi_device_handle to amdsmi_processor_handle grep -rli 'amdsmi_device_handle' * | xargs -i@ sed -i 's/amdsmi_device_handle/amdsmi_processor_handle/g' @ Change-Id: Ie25c51933dcc31e5b34c8070d0d5ba0e8cd05cc1 [ROCm/amdsmi commit: 3963036a05e6337e202c06959a9077d81beb7ac1] --- projects/amdsmi/README.md | 2 +- .../amdsmi/example/amd_smi_drm_example.cc | 4 +- .../amdsmi/example/amd_smi_nodrm_example.cc | 2 +- projects/amdsmi/include/amd_smi/amdsmi.h | 188 +++--- .../include/amd_smi/impl/amd_smi_system.h | 4 +- projects/amdsmi/py-interface/README.md | 2 +- .../amdsmi/py-interface/amdsmi_interface.py | 586 ++++++++++-------- .../amdsmi/py-interface/amdsmi_wrapper.py | 176 +++--- projects/amdsmi/py-interface/rocm_smi_tool.py | 2 +- projects/amdsmi/src/amd_smi/amd_smi.cc | 186 +++--- projects/amdsmi/src/amd_smi/amd_smi_system.cc | 4 +- .../functional/hw_topology_read.cc | 2 +- .../functional/perf_cntr_read_write.cc | 8 +- .../functional/perf_cntr_read_write.h | 6 +- .../amdsmi/tests/amd_smi_test/test_base.cc | 4 +- .../amdsmi/tests/amd_smi_test/test_base.h | 4 +- 16 files changed, 609 insertions(+), 571 deletions(-) diff --git a/projects/amdsmi/README.md b/projects/amdsmi/README.md index ac7ec316c3..8e7dad3d24 100755 --- a/projects/amdsmi/README.md +++ b/projects/amdsmi/README.md @@ -119,7 +119,7 @@ int main() { ret = amdsmi_get_device_handles(sockets[i], &device_count, nullptr); // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector device_handles(device_count); // Get all devices of the socket ret = amdsmi_get_device_handles(sockets[i], &device_count, &device_handles[0]); diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index d878b6e4b6..69d8945d8e 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -248,7 +248,7 @@ int main() { CHK_AMDSMI_RET(ret) // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector device_handles(device_count); // Get all devices of the socket ret = amdsmi_get_device_handles(sockets[i], &device_count, &device_handles[0]); @@ -276,7 +276,7 @@ int main() { bdf.function_number); // Get handle from BDF - amdsmi_device_handle dev_handle; + amdsmi_processor_handle dev_handle; ret = amdsmi_get_device_handle_from_bdf(bdf, &dev_handle); CHK_AMDSMI_RET(ret) diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 43c01594ff..950ff16e65 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -100,7 +100,7 @@ int main() { CHK_AMDSMI_RET(ret) // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector device_handles(device_count); // Get all devices of the socket ret = amdsmi_get_device_handles(sockets[i], &device_count, &device_handles[0]); diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index ed8716935f..0e87262ec9 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -120,7 +120,7 @@ typedef enum { } amdsmi_container_types_t; //! opaque handler point to underlying implementation -typedef void *amdsmi_device_handle; +typedef void *amdsmi_processor_handle; typedef void *amdsmi_socket_handle; /** @@ -609,7 +609,7 @@ typedef enum { * Event notification data returned from event notification API */ typedef struct { - amdsmi_device_handle device_handle; //!< Handler of device that corresponds to the event + amdsmi_processor_handle device_handle; //!< Handler of device that corresponds to the event amdsmi_evt_notification_type_t event; //!< Event type char message[MAX_EVENT_NOTIFICATION_MSG_SIZE]; //!< Event message } amdsmi_evt_notification_data_t; @@ -1235,7 +1235,7 @@ amdsmi_status_t amdsmi_get_socket_info( * @param[in] socket_handle The socket to query * * @param[in,out] device_count As input, the value passed - * through this parameter is the number of ::amdsmi_device_handle's that + * through this parameter is the number of ::amdsmi_processor_handle's that * may be safely written to the memory pointed to by @p device_handles. This is the * limit on how many device handles will be written to @p device_handles. On return, @p * device_count will contain the number of device handles written to @p device_handles, @@ -1245,7 +1245,7 @@ amdsmi_status_t amdsmi_get_socket_info( * how many devices are available to read for the socket. * * @param[in,out] device_handles A pointer to a block of memory to which the - * ::amdsmi_device_handle values will be written. This value may be NULL. + * ::amdsmi_processor_handle values will be written. This value may be NULL. * In this case, this function can be used to query how many devices are * available to read. * @@ -1253,7 +1253,7 @@ amdsmi_status_t amdsmi_get_socket_info( */ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, uint32_t *device_count, - amdsmi_device_handle* device_handles); + amdsmi_processor_handle* device_handles); /** * @brief Get the device type of the device_handle @@ -1269,7 +1269,7 @@ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle, device_type_t* device_type); /** @@ -1284,7 +1284,7 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_device_handle* device_handle); +amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle* device_handle); /** @} End DiscQueries */ @@ -1317,7 +1317,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_devic * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_id(amdsmi_device_handle device_handle, uint16_t *id); +amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_t *id); /** * @brief Get the name string for a give vendor ID @@ -1350,7 +1350,7 @@ amdsmi_status_t amdsmi_dev_get_id(amdsmi_device_handle device_handle, uint16_t * * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_device_handle device_handle, char *name, +amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle device_handle, char *name, size_t len); /** @@ -1375,7 +1375,7 @@ amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_device_handle device_handle, c * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_device_handle device_handle, char *brand, +amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle, char *brand, uint32_t len); /** @@ -1397,7 +1397,7 @@ amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_device_handle device_handle, c * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_device_handle device_handle, uint16_t *id); +amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handle, uint16_t *id); /** * @brief Get the name string for the device subsytem @@ -1431,7 +1431,7 @@ amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_device_handle device_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_subsystem_name(amdsmi_device_handle device_handle, char *name, size_t len); +amdsmi_dev_get_subsystem_name(amdsmi_processor_handle device_handle, char *name, size_t len); /** * @brief Get the drm minor number associated with this device @@ -1447,7 +1447,7 @@ amdsmi_dev_get_subsystem_name(amdsmi_device_handle device_handle, char *name, si * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_drm_render_minor(amdsmi_device_handle device_handle, uint32_t *minor); +amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle device_handle, uint32_t *minor); /** @} End IDQuer */ @@ -1474,7 +1474,7 @@ amdsmi_dev_get_drm_render_minor(amdsmi_device_handle device_handle, uint32_t *mi * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_pci_bandwidth(amdsmi_device_handle device_handle, amdsmi_pcie_bandwidth_t *bandwidth); +amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_bandwidth_t *bandwidth); /** * @brief Get the unique PCI device identifier associated for a device @@ -1508,7 +1508,7 @@ amdsmi_dev_get_pci_bandwidth(amdsmi_device_handle device_handle, amdsmi_pcie_ban * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_device_handle device_handle, uint64_t *bdfid); +amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle device_handle, uint64_t *bdfid); /** * @brief Get the NUMA node associated with a device @@ -1529,7 +1529,7 @@ amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_device_handle device_handle, uint64 * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_device_handle device_handle, uint32_t *numa_node); +amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle device_handle, uint32_t *numa_node); /** * @brief Get PCIe traffic information @@ -1553,7 +1553,7 @@ amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_device_handle device_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_device_handle device_handle, uint64_t *sent, +amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle device_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz); /** @@ -1575,7 +1575,7 @@ amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_device_handle device_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle device_handle, uint64_t *counter); /** @} End PCIeQuer */ @@ -1615,7 +1615,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_device_handle device_h * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_device_handle device_handle, uint64_t bw_bitmask); +amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_handle, uint64_t bw_bitmask); /** @} End PCIeCont */ @@ -1647,7 +1647,7 @@ amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_device_handle device_handle * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t *power); +amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t *power); /** * @brief Get the energy accumulator counter of the device with provided @@ -1677,7 +1677,7 @@ amdsmi_dev_get_power_ave(amdsmi_device_handle device_handle, uint32_t sensor_ind * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_energy_count(amdsmi_device_handle device_handle, uint64_t *power, +amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp); /** @} End PowerQuer */ @@ -1705,7 +1705,7 @@ amdsmi_dev_get_energy_count(amdsmi_device_handle device_handle, uint64_t *power, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t cap); + amdsmi_dev_set_power_cap(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t cap); /** * @brief Set the power performance profile @@ -1725,7 +1725,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_device_handle device_handle, uint32_t reserved, + amdsmi_dev_set_power_profile(amdsmi_processor_handle device_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile); /** @} End PowerCont*/ @@ -1758,7 +1758,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_total(amdsmi_device_handle device_handle, amdsmi_memory_type_t mem_type, +amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, uint64_t *total); /** @@ -1782,7 +1782,7 @@ amdsmi_dev_get_memory_total(amdsmi_device_handle device_handle, amdsmi_memory_ty * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_usage(amdsmi_device_handle device_handle, amdsmi_memory_type_t mem_type, +amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, uint64_t *used); /** @@ -1800,7 +1800,7 @@ amdsmi_dev_get_memory_usage(amdsmi_device_handle device_handle, amdsmi_memory_ty * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_device_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); +amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); /** * @brief Returns if RAS features are enabled or disabled for given block @@ -1823,7 +1823,7 @@ amdsmi_get_bad_page_info(amdsmi_device_handle device_handle, uint32_t *num_pages * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_device_handle device_handle, amdsmi_gpu_block_t block, +amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** @@ -1845,7 +1845,7 @@ amdsmi_get_ras_block_features_enabled(amdsmi_device_handle device_handle, amdsmi * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_busy_percent(amdsmi_device_handle device_handle, uint32_t *busy_percent); +amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle device_handle, uint32_t *busy_percent); /** * @brief Get information about reserved ("retired") memory pages @@ -1878,7 +1878,7 @@ amdsmi_dev_get_memory_busy_percent(amdsmi_device_handle device_handle, uint32_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_device_handle device_handle, uint32_t *num_pages, +amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records); /** @} End MemQuer */ @@ -1911,7 +1911,7 @@ amdsmi_dev_get_memory_reserved_pages(amdsmi_device_handle device_handle, uint32_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_device_handle device_handle, uint32_t sensor_ind, +amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, uint32_t sensor_ind, int64_t *speed); /** @@ -1937,7 +1937,7 @@ amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_device_handle device_handle, uint * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, uint32_t sensor_ind, int64_t *speed); /** @@ -1961,7 +1961,7 @@ amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t *max_speed); /** @@ -1990,7 +1990,7 @@ amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature); @@ -2020,7 +2020,7 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage); @@ -2044,7 +2044,7 @@ amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_device_handle device_handle, uint32_t sensor_ind); +amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, uint32_t sensor_ind); /** * @brief Set the fan speed for the specified device with the provided speed, @@ -2066,7 +2066,7 @@ amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_device_handle device_handle, uint32_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t speed); /** @} End PhysCont */ @@ -2098,7 +2098,7 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_device_handle device_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_device_handle device_handle, uint32_t *busy_percent); +amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, uint32_t *busy_percent); /** * @brief Get coarse grain utilization counter of the specified device @@ -2125,7 +2125,7 @@ amdsmi_dev_get_busy_percent(amdsmi_device_handle device_handle, uint32_t *busy_p * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_utilization_count(amdsmi_device_handle device_handle, +amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, amdsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp); @@ -2142,7 +2142,7 @@ amdsmi_get_utilization_count(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info); +amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info); /** * @brief Get max PCIe capabilities of the device with provided device handle. @@ -2156,7 +2156,7 @@ amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info); +amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info); /** * @brief Get the performance level of the device @@ -2176,7 +2176,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle device_handle, am * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t *perf); /** @@ -2197,7 +2197,7 @@ amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_device_handle device_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_set_perf_determinism_mode(amdsmi_device_handle device_handle, uint64_t clkvalue); +amdsmi_set_perf_determinism_mode(amdsmi_processor_handle device_handle, uint64_t clkvalue); /** * @brief Get the overdrive percent associated with the device with provided @@ -2219,7 +2219,7 @@ amdsmi_set_perf_determinism_mode(amdsmi_device_handle device_handle, uint64_t cl * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_device_handle device_handle, uint32_t *od); +amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle device_handle, uint32_t *od); /** * @brief Get the list of possible system clock speeds of device for a @@ -2240,7 +2240,7 @@ amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_device_handle device_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f); /** @@ -2252,7 +2252,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_device_handle device_handle); +amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle); /** * @brief This function retrieves the voltage/frequency curve information @@ -2271,7 +2271,7 @@ amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_device_handle device_handle); * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_handle, amdsmi_od_volt_freq_data_t *odv); /** @@ -2291,7 +2291,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle device_handle, amdsmi_gpu_metrics_t *pgpu_metrics); /** @@ -2313,7 +2313,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_device_handle device_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_device_handle device_handle, uint64_t minclkvalue, +amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType); @@ -2336,7 +2336,7 @@ amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_device_handle device_handle, uin * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_device_handle device_handle, amdsmi_freq_ind_t level, +amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType); @@ -2358,7 +2358,7 @@ amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_device_handle device_handle, uint32_t vpoint, +amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue); /** @@ -2396,7 +2396,7 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle device_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer); /** @@ -2431,7 +2431,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_device_handle devic * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_device_handle device_handle, uint32_t sensor_ind, + amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle device_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status); /** @} End PerfQuer */ @@ -2463,7 +2463,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_device_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_dev_set_perf_level(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the PowerPlay performance level associated with the device with @@ -2482,7 +2482,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_device_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the overdrive percent associated with the device with provided @@ -2523,7 +2523,7 @@ amdsmi_status_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_device_handle device_handle, uint32_t od); +amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle device_handle, uint32_t od); /** * @brief Set the overdrive percent associated with the device with provided @@ -2562,7 +2562,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_device_handle device_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_device_handle device_handle, uint32_t od); +amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle device_handle, uint32_t od); /** * @brief Control the set of allowed frequencies that can be used for the @@ -2596,7 +2596,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_device_handle device_h * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask); /** @} End PerfCont */ @@ -2679,7 +2679,7 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec); /** @@ -2706,7 +2706,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handle, uint64_t *enabled_blocks); /** @@ -2730,7 +2730,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_device_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_device_handle device_handle, amdsmi_gpu_block_t block, +amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** @@ -2868,7 +2868,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_counter_group_supported(amdsmi_device_handle device_handle, amdsmi_event_group_t group); +amdsmi_dev_counter_group_supported(amdsmi_processor_handle device_handle, amdsmi_event_group_t group); /** * @brief Create a performance counter object @@ -2895,7 +2895,7 @@ amdsmi_dev_counter_group_supported(amdsmi_device_handle device_handle, amdsmi_ev * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_create_counter(amdsmi_device_handle device_handle, amdsmi_event_type_t type, +amdsmi_dev_create_counter(amdsmi_processor_handle device_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle); /** @@ -2971,7 +2971,7 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_device_handle device_handle, + amdsmi_counter_get_available_counters(amdsmi_processor_handle device_handle, amdsmi_event_group_t grp, uint32_t *available); /** @} End PerfCntr */ @@ -3093,7 +3093,7 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_device_handle device_handle, amdsmi_xgmi_status_t *status); +amdsmi_dev_xgmi_error_status(amdsmi_processor_handle device_handle, amdsmi_xgmi_status_t *status); /** * @brief Reset the XGMI error status for a device @@ -3107,7 +3107,7 @@ amdsmi_dev_xgmi_error_status(amdsmi_device_handle device_handle, amdsmi_xgmi_sta * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_device_handle device_handle); +amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle); /** @} End SysInfo */ @@ -3133,7 +3133,7 @@ amdsmi_dev_reset_xgmi_error(amdsmi_device_handle device_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_numa_node_number(amdsmi_device_handle device_handle, uint32_t *numa_node); +amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t *numa_node); /** * @brief Retrieve the weight for a connection between 2 GPUs @@ -3154,7 +3154,7 @@ amdsmi_topo_get_numa_node_number(amdsmi_device_handle device_handle, uint32_t *n * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_link_weight(amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, +amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, uint64_t *weight); /** @@ -3179,7 +3179,7 @@ amdsmi_topo_get_link_weight(amdsmi_device_handle device_handle_src, amdsmi_devic * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_get_minmax_bandwidth(amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, + amdsmi_get_minmax_bandwidth(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth); /** @@ -3205,8 +3205,8 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_link_type(amdsmi_device_handle device_handle_src, - amdsmi_device_handle device_handle_dst, +amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, + amdsmi_processor_handle device_handle_dst, uint64_t *hops, AMDSMI_IO_LINK_TYPE *type); /** @@ -3228,7 +3228,7 @@ amdsmi_topo_get_link_type(amdsmi_device_handle device_handle_src, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_is_P2P_accessible(amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, +amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, bool *accessible); /** @} End HWTopo */ @@ -3277,7 +3277,7 @@ amdsmi_is_P2P_accessible(amdsmi_device_handle device_handle_src, amdsmi_device_h * amdsmi_func_id_iter_handle_t iter_handle, var_iter, sub_var_iter; * amdsmi_func_id_value_t value; * amdsmi_status_t err; - * amdsmi_device_handle device; + * amdsmi_processor_handle device; * * // Get the device handle via amdsmi_get_device_handles() * // ... ... @@ -3366,7 +3366,7 @@ amdsmi_is_P2P_accessible(amdsmi_device_handle device_handle_src, amdsmi_device_h * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_device_handle device_handle, +amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle device_handle, amdsmi_func_id_iter_handle_t *handle); /** @@ -3471,7 +3471,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_init_event_notification(amdsmi_device_handle device_handle); +amdsmi_init_event_notification(amdsmi_processor_handle device_handle); /** * @brief Specify which events to collect for a device @@ -3500,7 +3500,7 @@ amdsmi_init_event_notification(amdsmi_device_handle device_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_device_handle device_handle, uint64_t mask); + amdsmi_set_event_notification_mask(amdsmi_processor_handle device_handle, uint64_t mask); /** * @brief Collect event notifications, waiting a specified amount of time @@ -3555,7 +3555,7 @@ amdsmi_status_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_stop_event_notification(amdsmi_device_handle device_handle); +amdsmi_status_t amdsmi_stop_event_notification(amdsmi_processor_handle device_handle); /** @} End EvntNotif */ @@ -3569,7 +3569,7 @@ amdsmi_status_t amdsmi_stop_event_notification(amdsmi_device_handle device_handl * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_device_handle device_handle, amdsmi_bdf_t *bdf); +amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf); /** * @brief Returns the UUID of the device @@ -3586,7 +3586,7 @@ amdsmi_get_device_bdf(amdsmi_device_handle device_handle, amdsmi_bdf_t *bdf); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_length, char *uuid); +amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid_length, char *uuid); /*****************************************************************************/ /** @defgroup swversion SW Version Information @@ -3608,7 +3608,7 @@ amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_le * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char *version); +amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, char *version); /** @} End swversion */ @@ -3632,7 +3632,7 @@ amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_asic_info(amdsmi_device_handle device_handle, amdsmi_asic_info_t *info); +amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t *info); /** * @brief Returns the board part number and board information for the requested device @@ -3645,7 +3645,7 @@ amdsmi_get_asic_info(amdsmi_device_handle device_handle, amdsmi_asic_info_t *inf * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_board_info(amdsmi_device_handle device_handle, amdsmi_board_info_t *info); +amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t *info); /** * @brief Returns the power caps as currently configured in the @@ -3660,7 +3660,7 @@ amdsmi_get_board_info(amdsmi_device_handle device_handle, amdsmi_board_info_t *i * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_power_cap_info(amdsmi_device_handle device_handle, uint32_t sensor_ind, +amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info); /** @@ -3675,7 +3675,7 @@ amdsmi_get_power_cap_info(amdsmi_device_handle device_handle, uint32_t sensor_in * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_xgmi_info(amdsmi_device_handle device_handle, amdsmi_xgmi_info_t *info); +amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t *info); /** * @brief Returns the device capabilities as currently configured in @@ -3689,7 +3689,7 @@ amdsmi_get_xgmi_info(amdsmi_device_handle device_handle, amdsmi_xgmi_info_t *inf * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_caps_info(amdsmi_device_handle device_handle, amdsmi_gpu_caps_t *info); +amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amdsmi_gpu_caps_t *info); /** @} End asicinfo */ @@ -3708,7 +3708,7 @@ amdsmi_get_caps_info(amdsmi_device_handle device_handle, amdsmi_gpu_caps_t *info * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_fw_info(amdsmi_device_handle device_handle, amdsmi_fw_info_t *info); +amdsmi_get_fw_info(amdsmi_processor_handle device_handle, amdsmi_fw_info_t *info); /** * @brief Returns the static information for the vBIOS on the device. @@ -3721,7 +3721,7 @@ amdsmi_get_fw_info(amdsmi_device_handle device_handle, amdsmi_fw_info_t *info); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_device_handle device_handle, amdsmi_vbios_info_t *info); +amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t *info); /** @} End fwinfo */ @@ -3741,7 +3741,7 @@ amdsmi_get_vbios_info(amdsmi_device_handle device_handle, amdsmi_vbios_info_t *i * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_gpu_activity(amdsmi_device_handle device_handle, amdsmi_engine_usage_t *info); +amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usage_t *info); /** * @brief Returns the current power and voltage of the GPU. @@ -3754,7 +3754,7 @@ amdsmi_get_gpu_activity(amdsmi_device_handle device_handle, amdsmi_engine_usage_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_power_measure(amdsmi_device_handle device_handle, amdsmi_power_measure_t *info); +amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_measure_t *info); /** * @brief Returns the measurements of the clocks in the GPU @@ -3771,7 +3771,7 @@ amdsmi_get_power_measure(amdsmi_device_handle device_handle, amdsmi_power_measur * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info); +amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info); /** * @brief Returns the VRAM usage (both total and used memory) @@ -3786,7 +3786,7 @@ amdsmi_get_clock_measure(amdsmi_device_handle device_handle, amdsmi_clk_type_t c * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vram_usage(amdsmi_device_handle device_handle, amdsmi_vram_info_t *info); +amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t *info); /** @} End gpumon */ @@ -3810,7 +3810,7 @@ amdsmi_get_vram_usage(amdsmi_device_handle device_handle, amdsmi_vram_info_t *in * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); +amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); /** @} End powermon */ @@ -3841,7 +3841,7 @@ amdsmi_get_target_frequency_range(amdsmi_device_handle device_handle, amdsmi_clk * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_list(amdsmi_device_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes); +amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes); /** * @brief Returns the process information of a given process. @@ -3857,7 +3857,7 @@ amdsmi_get_process_list(amdsmi_device_handle device_handle, amdsmi_process_handl * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_info(amdsmi_device_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); +amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); /** @} End processinfo */ @@ -3878,7 +3878,7 @@ amdsmi_get_process_info(amdsmi_device_handle device_handle, amdsmi_process_handl * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_device_handle device_handle, amdsmi_error_count_t *ec); +amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_count_t *ec); /** @} End eccinfo */ diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h index 58eb004197..53fbf248d5 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h @@ -69,11 +69,11 @@ class AMDSmiSystem { amdsmi_status_t handle_to_socket(amdsmi_socket_handle socket_handle, AMDSmiSocket** socket); - amdsmi_status_t handle_to_device(amdsmi_device_handle device_handle, + amdsmi_status_t handle_to_device(amdsmi_processor_handle device_handle, AMDSmiProcessor** device); amdsmi_status_t gpu_index_to_handle(uint32_t gpu_index, - amdsmi_device_handle* device_handle); + amdsmi_processor_handle* device_handle); private: AMDSmiSystem() : init_flag_(AMDSMI_INIT_AMD_GPUS) {} diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 5b20b46eff..75394dd900 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -105,7 +105,7 @@ except AmdSmiException as e: ## amdsmi_get_device_type Description: Checks the type of device with provided handle. -Input parameters: device handle as an instance of `amdsmi_device_handle` +Input parameters: device handle as an instance of `amdsmi_processor_handle` Output: Integer, type of gpu diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 0e93d31111..29a8c8311f 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -293,11 +293,11 @@ class AmdSmiUtilizationCounterType(IntEnum): class AmdSmiEventReader: def __init__( - self, device_handle: amdsmi_wrapper.amdsmi_device_handle, *event_types + self, device_handle: amdsmi_wrapper.amdsmi_processor_handle, *event_types ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_types, Iterable): raise AmdSmiParameterException( @@ -508,12 +508,12 @@ def amdsmi_get_socket_info(socket_handle): return socket_info.value.decode() -def amdsmi_get_device_handles() -> List[amdsmi_wrapper.amdsmi_device_handle]: +def amdsmi_get_device_handles() -> List[amdsmi_wrapper.amdsmi_processor_handle]: socket_handles = amdsmi_get_socket_handles() devices = [] for socket in socket_handles: device_count = ctypes.c_uint32() - null_ptr = ctypes.POINTER(amdsmi_wrapper.amdsmi_device_handle)() + null_ptr = ctypes.POINTER(amdsmi_wrapper.amdsmi_processor_handle)() _check_res( amdsmi_wrapper.amdsmi_get_device_handles( socket, @@ -522,7 +522,7 @@ def amdsmi_get_device_handles() -> List[amdsmi_wrapper.amdsmi_device_handle]: ) ) device_handles = ( - amdsmi_wrapper.amdsmi_device_handle * device_count.value)() + amdsmi_wrapper.amdsmi_processor_handle * device_count.value)() _check_res( amdsmi_wrapper.amdsmi_get_device_handles( socket, @@ -532,7 +532,7 @@ def amdsmi_get_device_handles() -> List[amdsmi_wrapper.amdsmi_device_handle]: ) devices.extend( [ - amdsmi_wrapper.amdsmi_device_handle(device_handles[dev_idx]) + amdsmi_wrapper.amdsmi_processor_handle(device_handles[dev_idx]) for dev_idx in range(device_count.value) ] ) @@ -551,11 +551,11 @@ def amdsmi_shut_down(): def amdsmi_get_device_type( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> ctypes.c_uint32: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) dev_type = amdsmi_wrapper.device_type_t() @@ -566,10 +566,10 @@ def amdsmi_get_device_type( return dev_type.value -def amdsmi_get_device_bdf(device_handle: amdsmi_wrapper.amdsmi_device_handle) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_get_device_bdf(device_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) bdf_info = amdsmi_wrapper.amdsmi_bdf_t() @@ -582,11 +582,11 @@ def amdsmi_get_device_bdf(device_handle: amdsmi_wrapper.amdsmi_device_handle) -> def amdsmi_get_asic_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) asic_info = amdsmi_wrapper.amdsmi_asic_info_t() @@ -606,11 +606,11 @@ def amdsmi_get_asic_info( def amdsmi_get_power_cap_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) power_info = amdsmi_wrapper.amdsmi_power_cap_info_t() @@ -627,11 +627,11 @@ def amdsmi_get_power_cap_info( "max_power_cap": power_info.max_power_cap} def amdsmi_get_caps_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) gpu_caps = amdsmi_wrapper.amdsmi_gpu_caps_t() @@ -654,11 +654,11 @@ def amdsmi_get_caps_info( def amdsmi_get_vbios_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) vbios_info = amdsmi_wrapper.amdsmi_vbios_info_t() @@ -677,11 +677,11 @@ def amdsmi_get_vbios_info( def amdsmi_get_gpu_activity( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) engine_usage = amdsmi_wrapper.amdsmi_engine_usage_t() @@ -699,12 +699,12 @@ def amdsmi_get_gpu_activity( def amdsmi_get_clock_measure( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_type, AmdSmiClkType): raise AmdSmiParameterException(clock_type, AmdSmiClkType) @@ -727,11 +727,11 @@ def amdsmi_get_clock_measure( def amdsmi_get_bad_page_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) num_pages = ctypes.c_uint32() @@ -752,12 +752,12 @@ def amdsmi_get_bad_page_info( def amdsmi_get_target_frequency_range( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_type, AmdSmiClkType): raise AmdSmiParameterException(clock_type, AmdSmiClkType) @@ -780,11 +780,11 @@ def amdsmi_get_target_frequency_range( def amdsmi_get_ecc_error_count( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) error_count = amdsmi_wrapper.amdsmi_error_count_t() @@ -801,11 +801,11 @@ def amdsmi_get_ecc_error_count( def amdsmi_get_board_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) board_info = amdsmi_wrapper.amdsmi_board_info_t() @@ -822,11 +822,11 @@ def amdsmi_get_board_info( def amdsmi_get_ras_block_features_enabled( - device_handle: amdsmi_wrapper.amdsmi_device_handle, -) -> List[Dict[str, str]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + device_handle: amdsmi_wrapper.amdsmi_processor_handle, +) -> Dict[str, Any]: + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) ras_state = amdsmi_wrapper.amdsmi_ras_err_state_t() @@ -854,11 +854,11 @@ def amdsmi_get_ras_block_features_enabled( def amdsmi_get_process_list( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> List[amdsmi_wrapper.amdsmi_process_handle]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) max_processes = ctypes.c_uint32(0) @@ -882,12 +882,12 @@ def amdsmi_get_process_list( def amdsmi_get_process_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, process: amdsmi_wrapper.amdsmi_process_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(process, amdsmi_wrapper.amdsmi_process_handle): @@ -920,10 +920,10 @@ def amdsmi_get_process_info( } -def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_device_handle) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) uuid = ctypes.create_string_buffer(_AMDSMI_GPU_UUID_SIZE) @@ -941,11 +941,11 @@ def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_device_handle) - def amdsmi_get_driver_version( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_int() @@ -963,11 +963,11 @@ def amdsmi_get_driver_version( def amdsmi_get_power_measure( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) power_measure = amdsmi_wrapper.amdsmi_power_measure_t() @@ -986,11 +986,11 @@ def amdsmi_get_power_measure( def amdsmi_get_fw_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle + device_handle: amdsmi_wrapper.amdsmi_processor_handle ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle) + device_handle, amdsmi_wrapper.amdsmi_processor_handle) fw_info = amdsmi_wrapper.amdsmi_fw_info_t() _check_res(amdsmi_wrapper.amdsmi_get_fw_info( device_handle, ctypes.byref(fw_info))) @@ -1006,11 +1006,11 @@ def amdsmi_get_fw_info( def amdsmi_get_vram_usage( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) vram_info = amdsmi_wrapper.amdsmi_vram_info_t() @@ -1023,11 +1023,11 @@ def amdsmi_get_vram_usage( def amdsmi_get_pcie_link_status( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) pcie_info = amdsmi_wrapper.amdsmi_pcie_info_t() @@ -1041,11 +1041,11 @@ def amdsmi_get_pcie_link_status( def amdsmi_get_pcie_link_caps( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) pcie_info = amdsmi_wrapper.amdsmi_pcie_info_t() @@ -1062,18 +1062,18 @@ def amdsmi_get_device_handle_from_bdf(bdf): if bdf is None: raise AmdSmiBdfFormatException(bdf) amdsmi_bdf = _make_amdsmi_bdf_from_list(bdf) - device_handle = amdsmi_wrapper.amdsmi_device_handle() + device_handle = amdsmi_wrapper.amdsmi_processor_handle() _check_res(amdsmi_wrapper.amdsmi_get_device_handle_from_bdf( amdsmi_bdf, ctypes.byref(device_handle))) return device_handle def amdsmi_dev_get_vendor_name( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint64() @@ -1089,10 +1089,10 @@ def amdsmi_dev_get_vendor_name( return vendor_name.value.decode("utf-8") -def amdsmi_dev_get_id(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) id = ctypes.c_uint16() @@ -1102,10 +1102,10 @@ def amdsmi_dev_get_id(device_handle: amdsmi_wrapper.amdsmi_device_handle): return id.value -def amdsmi_dev_get_vram_vendor(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_vram_vendor(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint32() @@ -1121,10 +1121,10 @@ def amdsmi_dev_get_vram_vendor(device_handle: amdsmi_wrapper.amdsmi_device_handl return vram_vendor.value.decode("utf-8") -def amdsmi_dev_get_drm_render_minor(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_drm_render_minor(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) minor = ctypes.c_uint32() @@ -1137,10 +1137,10 @@ def amdsmi_dev_get_drm_render_minor(device_handle: amdsmi_wrapper.amdsmi_device_ return minor.value -def amdsmi_dev_get_subsystem_id(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_subsystem_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) id = ctypes.c_uint16() @@ -1152,10 +1152,10 @@ def amdsmi_dev_get_subsystem_id(device_handle: amdsmi_wrapper.amdsmi_device_hand return id.value -def amdsmi_dev_get_subsystem_name(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_subsystem_name(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint64() @@ -1200,11 +1200,11 @@ def amdsmi_get_version_str(sw_component: AmdSmiSwComponent): def amdsmi_topo_get_numa_node_number( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) numa_node_number = ctypes.c_uint32() @@ -1219,17 +1219,17 @@ def amdsmi_topo_get_numa_node_number( def amdsmi_topo_get_link_weight( - device_handle_src: amdsmi_wrapper.amdsmi_device_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_device_handle, + device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_device_handle + device_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_device_handle + device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) weight = ctypes.c_uint64() @@ -1244,17 +1244,17 @@ def amdsmi_topo_get_link_weight( def amdsmi_get_minmax_bandwidth( - device_handle_src: amdsmi_wrapper.amdsmi_device_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_device_handle, + device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_device_handle + device_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_device_handle + device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) min_bandwidth = ctypes.c_uint64() @@ -1273,17 +1273,17 @@ def amdsmi_get_minmax_bandwidth( def amdsmi_topo_get_link_type( - device_handle_src: amdsmi_wrapper.amdsmi_device_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_device_handle, + device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_device_handle + device_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_device_handle + device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) hops = ctypes.c_uint64() @@ -1302,17 +1302,17 @@ def amdsmi_topo_get_link_type( def amdsmi_is_P2P_accessible( - device_handle_src: amdsmi_wrapper.amdsmi_device_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_device_handle, + device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_device_handle + device_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_device_handle + device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) accessible = ctypes.c_bool() @@ -1326,10 +1326,10 @@ def amdsmi_is_P2P_accessible( return accessible.value -def amdsmi_get_xgmi_info(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_get_xgmi_info(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) xgmi_info = amdsmi_wrapper.amdsmi_xgmi_info_t() @@ -1345,12 +1345,12 @@ def amdsmi_get_xgmi_info(device_handle: amdsmi_wrapper.amdsmi_device_handle): def amdsmi_dev_counter_group_supported( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_group, AmdSmiEventGroup): raise AmdSmiParameterException(event_group, AmdSmiEventGroup) @@ -1362,12 +1362,12 @@ def amdsmi_dev_counter_group_supported( def amdsmi_dev_create_counter( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, event_type: AmdSmiEventType, ) -> amdsmi_wrapper.amdsmi_event_handle_t: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_type, AmdSmiEventType): raise AmdSmiParameterException(event_type, AmdSmiEventType) @@ -1432,12 +1432,12 @@ def amdsmi_read_counter( def amdsmi_counter_get_available_counters( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_group, AmdSmiEventGroup): raise AmdSmiParameterException(event_group, AmdSmiEventGroup) @@ -1453,12 +1453,12 @@ def amdsmi_counter_get_available_counters( def amdsmi_dev_set_perf_level( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_level: AmdSmiDevPerfLevel, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(perf_level, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_level, AmdSmiDevPerfLevel) @@ -1468,11 +1468,11 @@ def amdsmi_dev_set_perf_level( def amdsmi_dev_get_power_profile_presets( - device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_idx: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -1493,21 +1493,21 @@ def amdsmi_dev_get_power_profile_presets( } -def amdsmi_dev_reset_gpu(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_reset_gpu(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) _check_res(amdsmi_wrapper.amdsmi_dev_reset_gpu(device_handle)) def amdsmi_set_perf_determinism_mode( - device_handle: amdsmi_wrapper.amdsmi_device_handle, clock_value: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_value, int): raise AmdSmiParameterException(clock_value, int) @@ -1520,11 +1520,11 @@ def amdsmi_set_perf_determinism_mode( def amdsmi_dev_set_fan_speed( - device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_idx: int, fan_speed: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int, fan_speed: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -1540,11 +1540,11 @@ def amdsmi_dev_set_fan_speed( def amdsmi_dev_reset_fan( - device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_idx: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -1554,13 +1554,13 @@ def amdsmi_dev_reset_fan( def amdsmi_dev_set_clk_freq( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType, freq_bitmask: int, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clk_type, AmdSmiClkType): raise AmdSmiParameterException(clk_type, AmdSmiParameterException) @@ -1575,11 +1575,11 @@ def amdsmi_dev_set_clk_freq( def amdsmi_dev_set_overdrive_level_v1( - device_handle: amdsmi_wrapper.amdsmi_device_handle, overdrive_value: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(overdrive_value, int): raise AmdSmiParameterException(overdrive_value, int) @@ -1592,11 +1592,11 @@ def amdsmi_dev_set_overdrive_level_v1( def amdsmi_dev_set_overdrive_level( - device_handle: amdsmi_wrapper.amdsmi_device_handle, overdrive_value: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(overdrive_value, int): raise AmdSmiParameterException(overdrive_value, int) @@ -1609,11 +1609,11 @@ def amdsmi_dev_set_overdrive_level( def amdsmi_dev_open_supported_func_iterator( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> amdsmi_wrapper.amdsmi_func_id_iter_handle_t: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) obj_handle = amdsmi_wrapper.amdsmi_func_id_iter_handle_t() @@ -1626,10 +1626,10 @@ def amdsmi_dev_open_supported_func_iterator( return obj_handle -def amdsmi_dev_get_pci_id(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_pci_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) bdfid = ctypes.c_uint64() @@ -1717,11 +1717,11 @@ def amdsmi_get_func_iter_value( def amdsmi_dev_set_pci_bandwidth( - device_handle: amdsmi_wrapper.amdsmi_device_handle, bitmask: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, bitmask: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(bitmask, int): @@ -1742,10 +1742,10 @@ def _format_transfer_rate(transfer_rate): } -def amdsmi_dev_get_pci_bandwidth(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_pci_bandwidth(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) bandwidth = amdsmi_wrapper.amdsmi_pcie_bandwidth_t() @@ -1763,10 +1763,10 @@ def amdsmi_dev_get_pci_bandwidth(device_handle: amdsmi_wrapper.amdsmi_device_han } -def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) sent = ctypes.c_uint64() @@ -1785,10 +1785,10 @@ def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_device_ha } -def amdsmi_dev_get_pci_replay_counter(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_pci_replay_counter(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) counter = ctypes.c_uint64() @@ -1801,10 +1801,10 @@ def amdsmi_dev_get_pci_replay_counter(device_handle: amdsmi_wrapper.amdsmi_devic return counter.value -def amdsmi_topo_get_numa_affinity(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_topo_get_numa_affinity(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) numa_node = ctypes.c_uint32() @@ -1818,11 +1818,11 @@ def amdsmi_topo_get_numa_affinity(device_handle: amdsmi_wrapper.amdsmi_device_ha def amdsmi_dev_set_power_cap( - device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_ind: int, cap: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_ind: int, cap: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_ind, int): @@ -1838,10 +1838,10 @@ def amdsmi_dev_set_power_cap( ) -def amdsmi_dev_get_power_ave(device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_id: ctypes.c_uint32): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_power_ave(device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) power = ctypes.c_uint64() @@ -1855,13 +1855,13 @@ def amdsmi_dev_get_power_ave(device_handle: amdsmi_wrapper.amdsmi_device_handle, def amdsmi_dev_set_power_profile( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, reserved: int, profile: AmdSmiPowerProfilePresetMasks, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(reserved, int): @@ -1877,10 +1877,10 @@ def amdsmi_dev_set_power_profile( ) -def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) power = ctypes.c_uint64() @@ -1900,14 +1900,14 @@ def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_device_hand def amdsmi_dev_set_clk_range( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, min_clk_value: int, max_clk_value: int, clk_type: AmdSmiClkType, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(min_clk_value, int): @@ -1929,10 +1929,10 @@ def amdsmi_dev_set_clk_range( ) -def amdsmi_dev_get_memory_total(device_handle: amdsmi_wrapper.amdsmi_device_handle, mem_type: AmdSmiMemoryType): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_memory_total(device_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(mem_type, AmdSmiMemoryType): @@ -1951,14 +1951,14 @@ def amdsmi_dev_get_memory_total(device_handle: amdsmi_wrapper.amdsmi_device_hand def amdsmi_dev_set_od_clk_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, level: AmdSmiFreqInd, value: int, clk_type: AmdSmiClkType, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(level, AmdSmiFreqInd): @@ -1977,10 +1977,10 @@ def amdsmi_dev_set_od_clk_info( ) -def amdsmi_dev_get_memory_usage(device_handle: amdsmi_wrapper.amdsmi_device_handle, mem_type: AmdSmiMemoryType): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_memory_usage(device_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(mem_type, AmdSmiMemoryType): @@ -1999,14 +1999,14 @@ def amdsmi_dev_get_memory_usage(device_handle: amdsmi_wrapper.amdsmi_device_hand def amdsmi_dev_set_od_volt_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, vpoint: int, clk_value: int, volt_value: int, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(vpoint, int): @@ -2028,10 +2028,10 @@ def amdsmi_dev_set_od_volt_info( ) -def amdsmi_dev_get_memory_busy_percent(device_handle: amdsmi_wrapper.amdsmi_device_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_memory_busy_percent(device_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) busy_percent = ctypes.c_uint32() @@ -2045,12 +2045,12 @@ def amdsmi_dev_get_memory_busy_percent(device_handle: amdsmi_wrapper.amdsmi_devi def amdsmi_dev_set_perf_level_v1( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_lvl: AmdSmiDevPerfLevel, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(perf_lvl, AmdSmiDevPerfLevel): @@ -2061,11 +2061,11 @@ def amdsmi_dev_set_perf_level_v1( def amdsmi_dev_get_fan_rpms( - device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_idx: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -2080,11 +2080,11 @@ def amdsmi_dev_get_fan_rpms( def amdsmi_dev_get_fan_speed( - device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_idx: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -2099,11 +2099,11 @@ def amdsmi_dev_get_fan_speed( def amdsmi_dev_get_fan_speed_max( - device_handle: amdsmi_wrapper.amdsmi_device_handle, sensor_idx: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -2118,13 +2118,13 @@ def amdsmi_dev_get_fan_speed_max( def amdsmi_dev_get_temp_metric( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiTemperatureType, metric: AmdSmiTemperatureMetric, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_type, AmdSmiTemperatureType): raise AmdSmiParameterException(sensor_type, AmdSmiTemperatureType) @@ -2142,13 +2142,13 @@ def amdsmi_dev_get_temp_metric( def amdsmi_dev_get_volt_metric( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiVoltageType, metric: AmdSmiVoltageMetric, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_type, AmdSmiVoltageType): raise AmdSmiParameterException(sensor_type, AmdSmiVoltageType) @@ -2166,11 +2166,11 @@ def amdsmi_dev_get_volt_metric( def amdsmi_dev_get_busy_percent( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) busy_percent = ctypes.c_uint32() @@ -2184,12 +2184,12 @@ def amdsmi_dev_get_busy_percent( def amdsmi_get_utilization_count( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, *counter_types: Tuple[AmdSmiUtilizationCounterType] ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not len(counter_types): raise AmdSmiLibraryException(amdsmi_wrapper.AMDSMI_STATUS_INVAL) @@ -2230,11 +2230,11 @@ def amdsmi_get_utilization_count( def amdsmi_dev_get_perf_level( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) perf = amdsmi_wrapper.amdsmi_dev_perf_level_t() @@ -2253,12 +2253,26 @@ def amdsmi_dev_get_perf_level( return result -def amdsmi_dev_get_overdrive_level( - device_handle: amdsmi_wrapper.amdsmi_device_handle, -) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_set_perf_determinism_mode( + device_handle: amdsmi_wrapper.amdsmi_processor_handle, clkvalue: int +) -> None: + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle + ) + if not isinstance(clkvalue, int): + raise AmdSmiParameterException(clkvalue, int) + + _check_res(amdsmi_wrapper.amdsmi_set_perf_determinism_mode( + device_handle, clkvalue)) + + +def amdsmi_dev_get_overdrive_level( + device_handle: amdsmi_wrapper.amdsmi_processor_handle, +) -> int: + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + raise AmdSmiParameterException( + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) od_level = ctypes.c_uint32() @@ -2272,11 +2286,11 @@ def amdsmi_dev_get_overdrive_level( def amdsmi_dev_get_gpu_clk_freq( - device_handle: amdsmi_wrapper.amdsmi_device_handle, clk_type: AmdSmiClkType + device_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clk_type, AmdSmiClkType): raise AmdSmiParameterException(clk_type, AmdSmiClkType) @@ -2296,11 +2310,11 @@ def amdsmi_dev_get_gpu_clk_freq( def amdsmi_dev_get_od_volt_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) freq_data = amdsmi_wrapper.amdsmi_od_volt_freq_data_t() @@ -2333,11 +2347,11 @@ def amdsmi_dev_get_od_volt_info( def amdsmi_dev_get_gpu_metrics_info( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) gpu_metrics = amdsmi_wrapper.amdsmi_gpu_metrics_t() @@ -2386,11 +2400,11 @@ def amdsmi_dev_get_gpu_metrics_info( def amdsmi_dev_get_od_volt_curve_regions( - device_handle: amdsmi_wrapper.amdsmi_device_handle, num_regions: int + device_handle: amdsmi_wrapper.amdsmi_processor_handle, num_regions: int ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(num_regions, int): raise AmdSmiParameterException(num_regions, int) @@ -2424,12 +2438,36 @@ def amdsmi_dev_get_od_volt_curve_regions( return result -def amdsmi_dev_get_ecc_count( - device_handle: amdsmi_wrapper.amdsmi_device_handle, block: AmdSmiGpuBlock -) -> Dict[str, int]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): +def amdsmi_dev_get_power_profile_presets( + device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int +) -> Dict[str, Any]: + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle + ) + if not isinstance(sensor_idx, int): + raise AmdSmiParameterException(sensor_idx, int) + + status = amdsmi_wrapper.amdsmi_power_profile_status_t() + _check_res( + amdsmi_wrapper. amdsmi_dev_get_power_profile_presets( + device_handle, sensor_idx, ctypes.byref(status) + ) + ) + + return { + "available_profiles": status.available_profiles, + "current": status.current, + "num_profiles": status.num_profiles, + } + + +def amdsmi_dev_get_ecc_count( + device_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock +) -> Dict[str, int]: + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + raise AmdSmiParameterException( + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(block, AmdSmiGpuBlock): @@ -2448,11 +2486,11 @@ def amdsmi_dev_get_ecc_count( def amdsmi_dev_get_ecc_enabled( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) blocks = ctypes.c_uint64(0) @@ -2465,11 +2503,11 @@ def amdsmi_dev_get_ecc_enabled( def amdsmi_dev_get_ecc_status( - device_handle: amdsmi_wrapper.amdsmi_device_handle, block: AmdSmiGpuBlock + device_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> AmdSmiRasErrState: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(block, AmdSmiGpuBlock): @@ -2566,11 +2604,11 @@ def amdsmi_get_compute_process_gpus(pid: int) -> List[int]: def amdsmi_dev_xgmi_error_status( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> AmdSmiXgmiStatus: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) status = amdsmi_wrapper.amdsmi_xgmi_status_t() @@ -2583,22 +2621,22 @@ def amdsmi_dev_xgmi_error_status( def amdsmi_dev_reset_xgmi_error( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) _check_res(amdsmi_wrapper.amdsmi_dev_reset_xgmi_error(device_handle)) def amdsmi_dev_get_memory_reserved_pages( - device_handle: amdsmi_wrapper.amdsmi_device_handle, + device_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_device_handle): + if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_device_handle + device_handle, amdsmi_wrapper.amdsmi_processor_handle ) num_pages = ctypes.c_uint32() diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index fbb3b5de19..105c190480 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -229,7 +229,7 @@ CONTAINER_DOCKER = 1 c__EA_amdsmi_container_types_t = ctypes.c_uint32 # enum amdsmi_container_types_t = c__EA_amdsmi_container_types_t amdsmi_container_types_t__enumvalues = c__EA_amdsmi_container_types_t__enumvalues -amdsmi_device_handle = ctypes.POINTER(None) +amdsmi_processor_handle = ctypes.POINTER(None) amdsmi_socket_handle = ctypes.POINTER(None) # values for enumeration 'c__EA_device_type_t' @@ -1416,161 +1416,161 @@ amdsmi_get_device_handles.restype = amdsmi_status_t amdsmi_get_device_handles.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.POINTER(None))] amdsmi_get_device_type = _libraries['libamd_smi.so'].amdsmi_get_device_type amdsmi_get_device_type.restype = amdsmi_status_t -amdsmi_get_device_type.argtypes = [amdsmi_device_handle, ctypes.POINTER(c__EA_device_type_t)] +amdsmi_get_device_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_device_type_t)] amdsmi_get_device_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_device_handle_from_bdf amdsmi_get_device_handle_from_bdf.restype = amdsmi_status_t amdsmi_get_device_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))] amdsmi_dev_get_id = _libraries['libamd_smi.so'].amdsmi_dev_get_id amdsmi_dev_get_id.restype = amdsmi_status_t -amdsmi_dev_get_id.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint16)] +amdsmi_dev_get_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] amdsmi_dev_get_vendor_name = _libraries['libamd_smi.so'].amdsmi_dev_get_vendor_name amdsmi_dev_get_vendor_name.restype = amdsmi_status_t -amdsmi_dev_get_vendor_name.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_char), size_t] +amdsmi_dev_get_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] uint32_t = ctypes.c_uint32 amdsmi_dev_get_vram_vendor = _libraries['libamd_smi.so'].amdsmi_dev_get_vram_vendor amdsmi_dev_get_vram_vendor.restype = amdsmi_status_t -amdsmi_dev_get_vram_vendor.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_char), uint32_t] +amdsmi_dev_get_vram_vendor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), uint32_t] amdsmi_dev_get_subsystem_id = _libraries['libamd_smi.so'].amdsmi_dev_get_subsystem_id amdsmi_dev_get_subsystem_id.restype = amdsmi_status_t -amdsmi_dev_get_subsystem_id.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint16)] +amdsmi_dev_get_subsystem_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] amdsmi_dev_get_subsystem_name = _libraries['libamd_smi.so'].amdsmi_dev_get_subsystem_name amdsmi_dev_get_subsystem_name.restype = amdsmi_status_t -amdsmi_dev_get_subsystem_name.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_char), size_t] +amdsmi_dev_get_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] amdsmi_dev_get_drm_render_minor = _libraries['libamd_smi.so'].amdsmi_dev_get_drm_render_minor amdsmi_dev_get_drm_render_minor.restype = amdsmi_status_t -amdsmi_dev_get_drm_render_minor.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_dev_get_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_get_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_bandwidth amdsmi_dev_get_pci_bandwidth.restype = amdsmi_status_t -amdsmi_dev_get_pci_bandwidth.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)] +amdsmi_dev_get_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)] amdsmi_dev_get_pci_id = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_id amdsmi_dev_get_pci_id.restype = amdsmi_status_t -amdsmi_dev_get_pci_id.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_topo_get_numa_affinity = _libraries['libamd_smi.so'].amdsmi_topo_get_numa_affinity amdsmi_topo_get_numa_affinity.restype = amdsmi_status_t -amdsmi_topo_get_numa_affinity.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_topo_get_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_get_pci_throughput = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_throughput amdsmi_dev_get_pci_throughput.restype = amdsmi_status_t -amdsmi_dev_get_pci_throughput.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_pci_throughput.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_pci_replay_counter = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_replay_counter amdsmi_dev_get_pci_replay_counter.restype = amdsmi_status_t -amdsmi_dev_get_pci_replay_counter.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_pci_replay_counter.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_set_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_dev_set_pci_bandwidth amdsmi_dev_set_pci_bandwidth.restype = amdsmi_status_t -amdsmi_dev_set_pci_bandwidth.argtypes = [amdsmi_device_handle, uint64_t] +amdsmi_dev_set_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_device_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_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_device_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_uint64)] +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_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_device_handle, uint32_t, uint64_t] +amdsmi_dev_set_power_cap.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] amdsmi_dev_set_power_profile = _libraries['libamd_smi.so'].amdsmi_dev_set_power_profile amdsmi_dev_set_power_profile.restype = amdsmi_status_t -amdsmi_dev_set_power_profile.argtypes = [amdsmi_device_handle, uint32_t, amdsmi_power_profile_preset_masks_t] +amdsmi_dev_set_power_profile.argtypes = [amdsmi_processor_handle, uint32_t, amdsmi_power_profile_preset_masks_t] amdsmi_dev_get_memory_total = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_total amdsmi_dev_get_memory_total.restype = amdsmi_status_t -amdsmi_dev_get_memory_total.argtypes = [amdsmi_device_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_memory_usage = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_usage amdsmi_dev_get_memory_usage.restype = amdsmi_status_t -amdsmi_dev_get_memory_usage.argtypes = [amdsmi_device_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_memory_usage.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_get_bad_page_info = _libraries['libamd_smi.so'].amdsmi_get_bad_page_info amdsmi_get_bad_page_info.restype = amdsmi_status_t -amdsmi_get_bad_page_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] +amdsmi_get_bad_page_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] amdsmi_get_ras_block_features_enabled = _libraries['libamd_smi.so'].amdsmi_get_ras_block_features_enabled amdsmi_get_ras_block_features_enabled.restype = amdsmi_status_t -amdsmi_get_ras_block_features_enabled.argtypes = [amdsmi_device_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] +amdsmi_get_ras_block_features_enabled.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] amdsmi_dev_get_memory_busy_percent = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_busy_percent amdsmi_dev_get_memory_busy_percent.restype = amdsmi_status_t -amdsmi_dev_get_memory_busy_percent.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_dev_get_memory_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_get_memory_reserved_pages = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_reserved_pages amdsmi_dev_get_memory_reserved_pages.restype = amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] +amdsmi_dev_get_memory_reserved_pages.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] amdsmi_dev_get_fan_rpms = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_rpms amdsmi_dev_get_fan_rpms.restype = amdsmi_status_t -amdsmi_dev_get_fan_rpms.argtypes = [amdsmi_device_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_dev_get_fan_rpms.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] amdsmi_dev_get_fan_speed = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_speed amdsmi_dev_get_fan_speed.restype = amdsmi_status_t -amdsmi_dev_get_fan_speed.argtypes = [amdsmi_device_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_dev_get_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] amdsmi_dev_get_fan_speed_max = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_speed_max amdsmi_dev_get_fan_speed_max.restype = amdsmi_status_t -amdsmi_dev_get_fan_speed_max.argtypes = [amdsmi_device_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_fan_speed_max.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_temp_metric = _libraries['libamd_smi.so'].amdsmi_dev_get_temp_metric amdsmi_dev_get_temp_metric.restype = amdsmi_status_t -amdsmi_dev_get_temp_metric.argtypes = [amdsmi_device_handle, amdsmi_temperature_type_t, amdsmi_temperature_metric_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_dev_get_temp_metric.argtypes = [amdsmi_processor_handle, amdsmi_temperature_type_t, amdsmi_temperature_metric_t, ctypes.POINTER(ctypes.c_int64)] amdsmi_dev_get_volt_metric = _libraries['libamd_smi.so'].amdsmi_dev_get_volt_metric amdsmi_dev_get_volt_metric.restype = amdsmi_status_t -amdsmi_dev_get_volt_metric.argtypes = [amdsmi_device_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_dev_get_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)] amdsmi_dev_reset_fan = _libraries['libamd_smi.so'].amdsmi_dev_reset_fan amdsmi_dev_reset_fan.restype = amdsmi_status_t -amdsmi_dev_reset_fan.argtypes = [amdsmi_device_handle, uint32_t] +amdsmi_dev_reset_fan.argtypes = [amdsmi_processor_handle, uint32_t] amdsmi_dev_set_fan_speed = _libraries['libamd_smi.so'].amdsmi_dev_set_fan_speed amdsmi_dev_set_fan_speed.restype = amdsmi_status_t -amdsmi_dev_set_fan_speed.argtypes = [amdsmi_device_handle, uint32_t, uint64_t] +amdsmi_dev_set_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] amdsmi_dev_get_busy_percent = _libraries['libamd_smi.so'].amdsmi_dev_get_busy_percent amdsmi_dev_get_busy_percent.restype = amdsmi_status_t -amdsmi_dev_get_busy_percent.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_dev_get_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_get_utilization_count = _libraries['libamd_smi.so'].amdsmi_get_utilization_count amdsmi_get_utilization_count.restype = amdsmi_status_t -amdsmi_get_utilization_count.argtypes = [amdsmi_device_handle, struct_c__SA_amdsmi_utilization_counter_t * 0, uint32_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_utilization_count.argtypes = [amdsmi_processor_handle, struct_c__SA_amdsmi_utilization_counter_t * 0, uint32_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_get_pcie_link_status = _libraries['libamd_smi.so'].amdsmi_get_pcie_link_status amdsmi_get_pcie_link_status.restype = amdsmi_status_t -amdsmi_get_pcie_link_status.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_info_t)] +amdsmi_get_pcie_link_status.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_info_t)] amdsmi_get_pcie_link_caps = _libraries['libamd_smi.so'].amdsmi_get_pcie_link_caps amdsmi_get_pcie_link_caps.restype = amdsmi_status_t -amdsmi_get_pcie_link_caps.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_info_t)] +amdsmi_get_pcie_link_caps.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_info_t)] amdsmi_dev_get_perf_level = _libraries['libamd_smi.so'].amdsmi_dev_get_perf_level amdsmi_dev_get_perf_level.restype = amdsmi_status_t -amdsmi_dev_get_perf_level.argtypes = [amdsmi_device_handle, ctypes.POINTER(c__EA_amdsmi_dev_perf_level_t)] +amdsmi_dev_get_perf_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_dev_perf_level_t)] amdsmi_set_perf_determinism_mode = _libraries['libamd_smi.so'].amdsmi_set_perf_determinism_mode amdsmi_set_perf_determinism_mode.restype = amdsmi_status_t -amdsmi_set_perf_determinism_mode.argtypes = [amdsmi_device_handle, uint64_t] +amdsmi_set_perf_determinism_mode.argtypes = [amdsmi_processor_handle, uint64_t] amdsmi_dev_get_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_get_overdrive_level amdsmi_dev_get_overdrive_level.restype = amdsmi_status_t -amdsmi_dev_get_overdrive_level.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_dev_get_overdrive_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_get_gpu_clk_freq = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_clk_freq amdsmi_dev_get_gpu_clk_freq.restype = amdsmi_status_t -amdsmi_dev_get_gpu_clk_freq.argtypes = [amdsmi_device_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)] +amdsmi_dev_get_gpu_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)] amdsmi_dev_reset_gpu = _libraries['libamd_smi.so'].amdsmi_dev_reset_gpu amdsmi_dev_reset_gpu.restype = amdsmi_status_t -amdsmi_dev_reset_gpu.argtypes = [amdsmi_device_handle] +amdsmi_dev_reset_gpu.argtypes = [amdsmi_processor_handle] amdsmi_dev_get_od_volt_info = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_info amdsmi_dev_get_od_volt_info.restype = amdsmi_status_t -amdsmi_dev_get_od_volt_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_od_volt_freq_data_t)] +amdsmi_dev_get_od_volt_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_od_volt_freq_data_t)] amdsmi_dev_get_gpu_metrics_info = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_metrics_info amdsmi_dev_get_gpu_metrics_info.restype = amdsmi_status_t -amdsmi_dev_get_gpu_metrics_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_metrics_t)] +amdsmi_dev_get_gpu_metrics_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_metrics_t)] amdsmi_dev_set_clk_range = _libraries['libamd_smi.so'].amdsmi_dev_set_clk_range amdsmi_dev_set_clk_range.restype = amdsmi_status_t -amdsmi_dev_set_clk_range.argtypes = [amdsmi_device_handle, uint64_t, uint64_t, amdsmi_clk_type_t] +amdsmi_dev_set_clk_range.argtypes = [amdsmi_processor_handle, uint64_t, uint64_t, amdsmi_clk_type_t] amdsmi_dev_set_od_clk_info = _libraries['libamd_smi.so'].amdsmi_dev_set_od_clk_info amdsmi_dev_set_od_clk_info.restype = amdsmi_status_t -amdsmi_dev_set_od_clk_info.argtypes = [amdsmi_device_handle, amdsmi_freq_ind_t, uint64_t, amdsmi_clk_type_t] +amdsmi_dev_set_od_clk_info.argtypes = [amdsmi_processor_handle, amdsmi_freq_ind_t, uint64_t, amdsmi_clk_type_t] amdsmi_dev_set_od_volt_info = _libraries['libamd_smi.so'].amdsmi_dev_set_od_volt_info amdsmi_dev_set_od_volt_info.restype = amdsmi_status_t -amdsmi_dev_set_od_volt_info.argtypes = [amdsmi_device_handle, uint32_t, uint64_t, uint64_t] +amdsmi_dev_set_od_volt_info.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t, uint64_t] amdsmi_dev_get_od_volt_curve_regions = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_curve_regions amdsmi_dev_get_od_volt_curve_regions.restype = amdsmi_status_t -amdsmi_dev_get_od_volt_curve_regions.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_freq_volt_region_t)] +amdsmi_dev_get_od_volt_curve_regions.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_freq_volt_region_t)] amdsmi_dev_get_power_profile_presets = _libraries['libamd_smi.so'].amdsmi_dev_get_power_profile_presets amdsmi_dev_get_power_profile_presets.restype = amdsmi_status_t -amdsmi_dev_get_power_profile_presets.argtypes = [amdsmi_device_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_profile_status_t)] +amdsmi_dev_get_power_profile_presets.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_profile_status_t)] amdsmi_dev_set_perf_level = _libraries['libamd_smi.so'].amdsmi_dev_set_perf_level amdsmi_dev_set_perf_level.restype = amdsmi_status_t -amdsmi_dev_set_perf_level.argtypes = [amdsmi_device_handle, amdsmi_dev_perf_level_t] +amdsmi_dev_set_perf_level.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] amdsmi_dev_set_perf_level_v1 = _libraries['libamd_smi.so'].amdsmi_dev_set_perf_level_v1 amdsmi_dev_set_perf_level_v1.restype = amdsmi_status_t -amdsmi_dev_set_perf_level_v1.argtypes = [amdsmi_device_handle, amdsmi_dev_perf_level_t] +amdsmi_dev_set_perf_level_v1.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] amdsmi_dev_set_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_set_overdrive_level amdsmi_dev_set_overdrive_level.restype = amdsmi_status_t -amdsmi_dev_set_overdrive_level.argtypes = [amdsmi_device_handle, uint32_t] +amdsmi_dev_set_overdrive_level.argtypes = [amdsmi_processor_handle, uint32_t] amdsmi_dev_set_overdrive_level_v1 = _libraries['libamd_smi.so'].amdsmi_dev_set_overdrive_level_v1 amdsmi_dev_set_overdrive_level_v1.restype = amdsmi_status_t -amdsmi_dev_set_overdrive_level_v1.argtypes = [amdsmi_device_handle, uint32_t] +amdsmi_dev_set_overdrive_level_v1.argtypes = [amdsmi_processor_handle, uint32_t] amdsmi_dev_set_clk_freq = _libraries['libamd_smi.so'].amdsmi_dev_set_clk_freq amdsmi_dev_set_clk_freq.restype = amdsmi_status_t -amdsmi_dev_set_clk_freq.argtypes = [amdsmi_device_handle, amdsmi_clk_type_t, uint64_t] +amdsmi_dev_set_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, uint64_t] amdsmi_get_version = _libraries['libamd_smi.so'].amdsmi_get_version amdsmi_get_version.restype = amdsmi_status_t amdsmi_get_version.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_version_t)] @@ -1579,22 +1579,22 @@ amdsmi_get_version_str.restype = amdsmi_status_t amdsmi_get_version_str.argtypes = [amdsmi_sw_component_t, ctypes.POINTER(ctypes.c_char), uint32_t] amdsmi_dev_get_ecc_count = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_count amdsmi_dev_get_ecc_count.restype = amdsmi_status_t -amdsmi_dev_get_ecc_count.argtypes = [amdsmi_device_handle, amdsmi_gpu_block_t, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] +amdsmi_dev_get_ecc_count.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] amdsmi_dev_get_ecc_enabled = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_enabled amdsmi_dev_get_ecc_enabled.restype = amdsmi_status_t -amdsmi_dev_get_ecc_enabled.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_ecc_enabled.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_ecc_status = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_status amdsmi_dev_get_ecc_status.restype = amdsmi_status_t -amdsmi_dev_get_ecc_status.argtypes = [amdsmi_device_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] +amdsmi_dev_get_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] amdsmi_status_string = _libraries['libamd_smi.so'].amdsmi_status_string amdsmi_status_string.restype = amdsmi_status_t amdsmi_status_string.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] amdsmi_dev_counter_group_supported = _libraries['libamd_smi.so'].amdsmi_dev_counter_group_supported amdsmi_dev_counter_group_supported.restype = amdsmi_status_t -amdsmi_dev_counter_group_supported.argtypes = [amdsmi_device_handle, amdsmi_event_group_t] +amdsmi_dev_counter_group_supported.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t] amdsmi_dev_create_counter = _libraries['libamd_smi.so'].amdsmi_dev_create_counter amdsmi_dev_create_counter.restype = amdsmi_status_t -amdsmi_dev_create_counter.argtypes = [amdsmi_device_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_destroy_counter = _libraries['libamd_smi.so'].amdsmi_dev_destroy_counter amdsmi_dev_destroy_counter.restype = amdsmi_status_t amdsmi_dev_destroy_counter.argtypes = [amdsmi_event_handle_t] @@ -1606,7 +1606,7 @@ amdsmi_read_counter.restype = amdsmi_status_t amdsmi_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__SA_amdsmi_counter_value_t)] amdsmi_counter_get_available_counters = _libraries['libamd_smi.so'].amdsmi_counter_get_available_counters amdsmi_counter_get_available_counters.restype = amdsmi_status_t -amdsmi_counter_get_available_counters.argtypes = [amdsmi_device_handle, amdsmi_event_group_t, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_counter_get_available_counters.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t, ctypes.POINTER(ctypes.c_uint32)] amdsmi_get_compute_process_info = _libraries['libamd_smi.so'].amdsmi_get_compute_process_info amdsmi_get_compute_process_info.restype = amdsmi_status_t amdsmi_get_compute_process_info.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_process_info_t), ctypes.POINTER(ctypes.c_uint32)] @@ -1618,28 +1618,28 @@ amdsmi_get_compute_process_gpus.restype = amdsmi_status_t amdsmi_get_compute_process_gpus.argtypes = [uint32_t, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_xgmi_error_status = _libraries['libamd_smi.so'].amdsmi_dev_xgmi_error_status amdsmi_dev_xgmi_error_status.restype = amdsmi_status_t -amdsmi_dev_xgmi_error_status.argtypes = [amdsmi_device_handle, ctypes.POINTER(c__EA_amdsmi_xgmi_status_t)] +amdsmi_dev_xgmi_error_status.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_xgmi_status_t)] amdsmi_dev_reset_xgmi_error = _libraries['libamd_smi.so'].amdsmi_dev_reset_xgmi_error amdsmi_dev_reset_xgmi_error.restype = amdsmi_status_t -amdsmi_dev_reset_xgmi_error.argtypes = [amdsmi_device_handle] +amdsmi_dev_reset_xgmi_error.argtypes = [amdsmi_processor_handle] amdsmi_topo_get_numa_node_number = _libraries['libamd_smi.so'].amdsmi_topo_get_numa_node_number amdsmi_topo_get_numa_node_number.restype = amdsmi_status_t -amdsmi_topo_get_numa_node_number.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_topo_get_numa_node_number.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_topo_get_link_weight = _libraries['libamd_smi.so'].amdsmi_topo_get_link_weight amdsmi_topo_get_link_weight.restype = amdsmi_status_t -amdsmi_topo_get_link_weight.argtypes = [amdsmi_device_handle, amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_topo_get_link_weight.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_get_minmax_bandwidth = _libraries['libamd_smi.so'].amdsmi_get_minmax_bandwidth amdsmi_get_minmax_bandwidth.restype = amdsmi_status_t -amdsmi_get_minmax_bandwidth.argtypes = [amdsmi_device_handle, amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_minmax_bandwidth.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] amdsmi_topo_get_link_type = _libraries['libamd_smi.so'].amdsmi_topo_get_link_type amdsmi_topo_get_link_type.restype = amdsmi_status_t -amdsmi_topo_get_link_type.argtypes = [amdsmi_device_handle, amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(c__EA_AMDSMI_IO_LINK_TYPE)] +amdsmi_topo_get_link_type.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(c__EA_AMDSMI_IO_LINK_TYPE)] amdsmi_is_P2P_accessible = _libraries['libamd_smi.so'].amdsmi_is_P2P_accessible amdsmi_is_P2P_accessible.restype = amdsmi_status_t -amdsmi_is_P2P_accessible.argtypes = [amdsmi_device_handle, amdsmi_device_handle, ctypes.POINTER(ctypes.c_bool)] +amdsmi_is_P2P_accessible.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_bool)] amdsmi_dev_open_supported_func_iterator = _libraries['libamd_smi.so'].amdsmi_dev_open_supported_func_iterator amdsmi_dev_open_supported_func_iterator.restype = amdsmi_status_t -amdsmi_dev_open_supported_func_iterator.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] +amdsmi_dev_open_supported_func_iterator.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] amdsmi_dev_open_supported_variant_iterator = _libraries['libamd_smi.so'].amdsmi_dev_open_supported_variant_iterator amdsmi_dev_open_supported_variant_iterator.restype = amdsmi_status_t amdsmi_dev_open_supported_variant_iterator.argtypes = [amdsmi_func_id_iter_handle_t, ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] @@ -1654,70 +1654,70 @@ amdsmi_get_func_iter_value.restype = amdsmi_status_t amdsmi_get_func_iter_value.argtypes = [amdsmi_func_id_iter_handle_t, ctypes.POINTER(union_c__UA_amdsmi_func_id_value_t)] amdsmi_init_event_notification = _libraries['libamd_smi.so'].amdsmi_init_event_notification amdsmi_init_event_notification.restype = amdsmi_status_t -amdsmi_init_event_notification.argtypes = [amdsmi_device_handle] +amdsmi_init_event_notification.argtypes = [amdsmi_processor_handle] amdsmi_set_event_notification_mask = _libraries['libamd_smi.so'].amdsmi_set_event_notification_mask amdsmi_set_event_notification_mask.restype = amdsmi_status_t -amdsmi_set_event_notification_mask.argtypes = [amdsmi_device_handle, uint64_t] +amdsmi_set_event_notification_mask.argtypes = [amdsmi_processor_handle, uint64_t] amdsmi_get_event_notification = _libraries['libamd_smi.so'].amdsmi_get_event_notification amdsmi_get_event_notification.restype = amdsmi_status_t amdsmi_get_event_notification.argtypes = [ctypes.c_int32, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_evt_notification_data_t)] amdsmi_stop_event_notification = _libraries['libamd_smi.so'].amdsmi_stop_event_notification amdsmi_stop_event_notification.restype = amdsmi_status_t -amdsmi_stop_event_notification.argtypes = [amdsmi_device_handle] +amdsmi_stop_event_notification.argtypes = [amdsmi_processor_handle] amdsmi_get_device_bdf = _libraries['libamd_smi.so'].amdsmi_get_device_bdf amdsmi_get_device_bdf.restype = amdsmi_status_t -amdsmi_get_device_bdf.argtypes = [amdsmi_device_handle, ctypes.POINTER(union_c__UA_amdsmi_bdf_t)] +amdsmi_get_device_bdf.argtypes = [amdsmi_processor_handle, ctypes.POINTER(union_c__UA_amdsmi_bdf_t)] amdsmi_get_device_uuid = _libraries['libamd_smi.so'].amdsmi_get_device_uuid amdsmi_get_device_uuid.restype = amdsmi_status_t -amdsmi_get_device_uuid.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_char)] +amdsmi_get_device_uuid.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_char)] amdsmi_get_driver_version = _libraries['libamd_smi.so'].amdsmi_get_driver_version amdsmi_get_driver_version.restype = amdsmi_status_t -amdsmi_get_driver_version.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_char)] +amdsmi_get_driver_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_char)] amdsmi_get_asic_info = _libraries['libamd_smi.so'].amdsmi_get_asic_info amdsmi_get_asic_info.restype = amdsmi_status_t -amdsmi_get_asic_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_asic_info_t)] +amdsmi_get_asic_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_asic_info_t)] amdsmi_get_board_info = _libraries['libamd_smi.so'].amdsmi_get_board_info amdsmi_get_board_info.restype = amdsmi_status_t -amdsmi_get_board_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_board_info_t)] +amdsmi_get_board_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_board_info_t)] amdsmi_get_power_cap_info = _libraries['libamd_smi.so'].amdsmi_get_power_cap_info amdsmi_get_power_cap_info.restype = amdsmi_status_t -amdsmi_get_power_cap_info.argtypes = [amdsmi_device_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_cap_info_t)] +amdsmi_get_power_cap_info.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_cap_info_t)] amdsmi_get_xgmi_info = _libraries['libamd_smi.so'].amdsmi_get_xgmi_info amdsmi_get_xgmi_info.restype = amdsmi_status_t -amdsmi_get_xgmi_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_xgmi_info_t)] +amdsmi_get_xgmi_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_xgmi_info_t)] amdsmi_get_caps_info = _libraries['libamd_smi.so'].amdsmi_get_caps_info amdsmi_get_caps_info.restype = amdsmi_status_t -amdsmi_get_caps_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_caps_t)] +amdsmi_get_caps_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_caps_t)] amdsmi_get_fw_info = _libraries['libamd_smi.so'].amdsmi_get_fw_info amdsmi_get_fw_info.restype = amdsmi_status_t -amdsmi_get_fw_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_fw_info_t)] +amdsmi_get_fw_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_fw_info_t)] amdsmi_get_vbios_info = _libraries['libamd_smi.so'].amdsmi_get_vbios_info amdsmi_get_vbios_info.restype = amdsmi_status_t -amdsmi_get_vbios_info.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_vbios_info_t)] +amdsmi_get_vbios_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vbios_info_t)] amdsmi_get_gpu_activity = _libraries['libamd_smi.so'].amdsmi_get_gpu_activity amdsmi_get_gpu_activity.restype = amdsmi_status_t -amdsmi_get_gpu_activity.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_engine_usage_t)] +amdsmi_get_gpu_activity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_engine_usage_t)] amdsmi_get_power_measure = _libraries['libamd_smi.so'].amdsmi_get_power_measure amdsmi_get_power_measure.restype = amdsmi_status_t -amdsmi_get_power_measure.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_power_measure_t)] +amdsmi_get_power_measure.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_power_measure_t)] amdsmi_get_clock_measure = _libraries['libamd_smi.so'].amdsmi_get_clock_measure amdsmi_get_clock_measure.restype = amdsmi_status_t -amdsmi_get_clock_measure.argtypes = [amdsmi_device_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_clk_measure_t)] +amdsmi_get_clock_measure.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_clk_measure_t)] amdsmi_get_vram_usage = _libraries['libamd_smi.so'].amdsmi_get_vram_usage amdsmi_get_vram_usage.restype = amdsmi_status_t -amdsmi_get_vram_usage.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_vram_info_t)] +amdsmi_get_vram_usage.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vram_info_t)] amdsmi_get_target_frequency_range = _libraries['libamd_smi.so'].amdsmi_get_target_frequency_range amdsmi_get_target_frequency_range.restype = amdsmi_status_t -amdsmi_get_target_frequency_range.argtypes = [amdsmi_device_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequency_range_t)] +amdsmi_get_target_frequency_range.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequency_range_t)] amdsmi_get_process_list = _libraries['libamd_smi.so'].amdsmi_get_process_list amdsmi_get_process_list.restype = amdsmi_status_t -amdsmi_get_process_list.argtypes = [amdsmi_device_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_process_list.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] amdsmi_get_process_info = _libraries['libamd_smi.so'].amdsmi_get_process_info amdsmi_get_process_info.restype = amdsmi_status_t -amdsmi_get_process_info.argtypes = [amdsmi_device_handle, amdsmi_process_handle, ctypes.POINTER(struct_c__SA_amdsmi_proc_info_t)] +amdsmi_get_process_info.argtypes = [amdsmi_processor_handle, amdsmi_process_handle, ctypes.POINTER(struct_c__SA_amdsmi_proc_info_t)] amdsmi_get_ecc_error_count = _libraries['libamd_smi.so'].amdsmi_get_ecc_error_count amdsmi_get_ecc_error_count.restype = amdsmi_status_t -amdsmi_get_ecc_error_count.argtypes = [amdsmi_device_handle, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] +amdsmi_get_ecc_error_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] __all__ = \ ['AMDSMI_CNTR_CMD_START', 'AMDSMI_CNTR_CMD_STOP', 'AMDSMI_COARSE_GRAIN_GFX_ACTIVITY', @@ -1882,7 +1882,7 @@ __all__ = \ 'amdsmi_dev_set_pci_bandwidth', 'amdsmi_dev_set_perf_level', 'amdsmi_dev_set_perf_level_v1', 'amdsmi_dev_set_power_cap', 'amdsmi_dev_set_power_profile', 'amdsmi_dev_xgmi_error_status', - 'amdsmi_device_handle', 'amdsmi_engine_usage_t', + 'amdsmi_processor_handle', 'amdsmi_engine_usage_t', 'amdsmi_error_count_t', 'amdsmi_event_group_t', 'amdsmi_event_group_t__enumvalues', 'amdsmi_event_handle_t', 'amdsmi_event_type_t', 'amdsmi_event_type_t__enumvalues', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 9df8409ca0..93c973f3fd 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -234,7 +234,7 @@ class Formatter: self.print_dict(result) elif isinstance(result, list): self.print_list(result) - elif isinstance(result, smi_api.amdsmi_wrapper.amdsmi_device_handle): + elif isinstance(result, smi_api.amdsmi_wrapper.amdsmi_processor_handle): self.print_handle("\n" + result) else: print(result) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 9cdffd582b..ec9109c26e 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -76,7 +76,7 @@ static bool initialized_lib = false; } \ } while (0) -static amdsmi_status_t get_gpu_device_from_handle(amdsmi_device_handle device_handle, +static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle device_handle, amd::smi::AMDSmiGPUDevice** gpudevice) { AMDSMI_CHECK_INIT(); @@ -99,7 +99,7 @@ static amdsmi_status_t get_gpu_device_from_handle(amdsmi_device_handle device_ha template amdsmi_status_t rsmi_wrapper(F && f, - amdsmi_device_handle device_handle, Args &&... args) { + amdsmi_processor_handle device_handle, Args &&... args) { AMDSMI_CHECK_INIT(); @@ -216,7 +216,7 @@ amdsmi_status_t amdsmi_get_socket_info( amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, uint32_t* device_count, - amdsmi_device_handle* device_handles) { + amdsmi_processor_handle* device_handles) { AMDSMI_CHECK_INIT(); if (device_count == nullptr) { @@ -243,13 +243,13 @@ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, // Copy the device handles for (uint32_t i = 0; i < *device_count; i++) { - device_handles[i] = reinterpret_cast(devices[i]); + device_handles[i] = reinterpret_cast(devices[i]); } return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle , +amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle , device_type_t* device_type) { AMDSMI_CHECK_INIT(); @@ -267,7 +267,7 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle , } amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_device_handle device_handle, amdsmi_bdf_t *bdf) { +amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf) { AMDSMI_CHECK_INIT(); @@ -286,7 +286,7 @@ amdsmi_get_device_bdf(amdsmi_device_handle device_handle, amdsmi_bdf_t *bdf) { return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_board_info(amdsmi_device_handle device_handle, amdsmi_board_info_t *board_info) { +amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t *board_info) { AMDSMI_CHECK_INIT(); @@ -319,7 +319,7 @@ amdsmi_status_t amdsmi_get_board_info(amdsmi_device_handle device_handle, amdsmi return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature) { @@ -346,7 +346,7 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_device_handle device_handle, return amdsmi_status; } -amdsmi_status_t amdsmi_get_vram_usage(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t *vram_info) { AMDSMI_CHECK_INIT(); @@ -388,7 +388,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_device_handle device_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_caps_info(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amdsmi_gpu_caps_t *info) { AMDSMI_CHECK_INIT(); @@ -478,42 +478,42 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_device_handle device_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, uint32_t sensor_ind, int64_t *speed) { return rsmi_wrapper(rsmi_dev_fan_rpms_get, device_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, uint32_t sensor_ind, int64_t *speed) { return rsmi_wrapper(rsmi_dev_fan_speed_get, device_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t *max_speed) { return rsmi_wrapper(rsmi_dev_fan_speed_max_get, device_handle, sensor_ind, max_speed); } -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, uint32_t sensor_ind) { return rsmi_wrapper(rsmi_dev_fan_reset, device_handle, sensor_ind); } -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t speed) { return rsmi_wrapper(rsmi_dev_fan_speed_set, device_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_id(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_t *id) { return rsmi_wrapper(rsmi_dev_id_get, device_handle, id); } // TODO(bliu) : add fw info from libdrm -amdsmi_status_t amdsmi_get_fw_info(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle device_handle, amdsmi_fw_info_t *info) { const std::map fw_in_rsmi = { { FW_ID_ASD, RSMI_FW_BLOCK_ASD}, @@ -559,7 +559,7 @@ amdsmi_status_t amdsmi_get_fw_info(amdsmi_device_handle device_handle, } amdsmi_status_t -amdsmi_get_asic_info(amdsmi_device_handle device_handle, amdsmi_asic_info_t *info) { +amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t *info) { AMDSMI_CHECK_INIT(); @@ -622,34 +622,34 @@ amdsmi_get_asic_info(amdsmi_device_handle device_handle, amdsmi_asic_info_t *inf } -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handle, uint16_t *id) { return rsmi_wrapper(rsmi_dev_subsystem_id_get, device_handle, id); } amdsmi_status_t amdsmi_dev_get_subsystem_name( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, char *name, size_t len) { return rsmi_wrapper(rsmi_dev_subsystem_name_get, device_handle, name, len); } amdsmi_status_t amdsmi_dev_get_vendor_name( - amdsmi_device_handle device_handle, char *name, size_t len) { + amdsmi_processor_handle device_handle, char *name, size_t len) { return rsmi_wrapper(rsmi_dev_vendor_name_get, device_handle, name, len); } -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle, char *brand, uint32_t len) { return rsmi_wrapper(rsmi_dev_vram_vendor_get, device_handle, brand, len); } amdsmi_status_t -amdsmi_init_event_notification(amdsmi_device_handle device_handle) { +amdsmi_init_event_notification(amdsmi_processor_handle device_handle) { return rsmi_wrapper(rsmi_event_notification_init, device_handle); } amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_device_handle device_handle, + amdsmi_set_event_notification_mask(amdsmi_processor_handle device_handle, uint64_t mask) { return rsmi_wrapper(rsmi_event_notification_mask_set, device_handle, mask); } @@ -686,17 +686,17 @@ amdsmi_status_t } amdsmi_status_t amdsmi_stop_event_notification( - amdsmi_device_handle device_handle) { + amdsmi_processor_handle device_handle) { return rsmi_wrapper(rsmi_event_notification_stop, device_handle); } amdsmi_status_t amdsmi_dev_counter_group_supported( - amdsmi_device_handle device_handle, amdsmi_event_group_t group) { + amdsmi_processor_handle device_handle, amdsmi_event_group_t group) { return rsmi_wrapper(rsmi_dev_counter_group_supported, device_handle, static_cast(group)); } -amdsmi_status_t amdsmi_dev_create_counter(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_create_counter(amdsmi_processor_handle device_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle) { return rsmi_wrapper(rsmi_dev_counter_create, device_handle, static_cast(type), @@ -727,7 +727,7 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, } amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_device_handle device_handle, + amdsmi_counter_get_available_counters(amdsmi_processor_handle device_handle, amdsmi_event_group_t grp, uint32_t *available) { return rsmi_wrapper(rsmi_counter_available_counters_get, device_handle, static_cast(grp), @@ -735,12 +735,12 @@ amdsmi_status_t } amdsmi_status_t -amdsmi_topo_get_numa_node_number(amdsmi_device_handle device_handle, uint32_t *numa_node) { +amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t *numa_node) { return rsmi_wrapper(rsmi_topo_get_numa_node_number, device_handle, numa_node); } amdsmi_status_t -amdsmi_topo_get_link_weight(amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, +amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, uint64_t *weight) { AMDSMI_CHECK_INIT(); @@ -758,7 +758,7 @@ amdsmi_topo_get_link_weight(amdsmi_device_handle device_handle_src, amdsmi_devic } amdsmi_status_t - amdsmi_get_minmax_bandwidth(amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, + amdsmi_get_minmax_bandwidth(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth) { AMDSMI_CHECK_INIT(); @@ -776,7 +776,7 @@ amdsmi_status_t } amdsmi_status_t -amdsmi_topo_get_link_type(amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, +amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, uint64_t *hops, AMDSMI_IO_LINK_TYPE *type) { AMDSMI_CHECK_INIT(); @@ -794,8 +794,8 @@ amdsmi_topo_get_link_type(amdsmi_device_handle device_handle_src, amdsmi_device_ } amdsmi_status_t -amdsmi_is_P2P_accessible(amdsmi_device_handle device_handle_src, - amdsmi_device_handle device_handle_dst, +amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, + amdsmi_processor_handle device_handle_dst, bool *accessible) { AMDSMI_CHECK_INIT(); @@ -814,7 +814,7 @@ amdsmi_is_P2P_accessible(amdsmi_device_handle device_handle_src, // TODO(bliu) : other xgmi related information amdsmi_status_t -amdsmi_get_xgmi_info(amdsmi_device_handle device_handle, amdsmi_xgmi_info_t *info) { +amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) @@ -824,18 +824,18 @@ amdsmi_get_xgmi_info(amdsmi_device_handle device_handle, amdsmi_xgmi_info_t *inf } amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_device_handle device_handle, amdsmi_xgmi_status_t *status) { +amdsmi_dev_xgmi_error_status(amdsmi_processor_handle device_handle, amdsmi_xgmi_status_t *status) { return rsmi_wrapper(rsmi_dev_xgmi_error_status, device_handle, reinterpret_cast(status)); } amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_device_handle device_handle) { +amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle) { return rsmi_wrapper(rsmi_dev_xgmi_error_reset, device_handle); } amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_device_handle device_handle, +amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle device_handle, amdsmi_func_id_iter_handle_t *handle) { AMDSMI_CHECK_INIT(); @@ -1008,7 +1008,7 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, return amd::smi::rsmi_to_amdsmi_status(r); } -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); @@ -1018,7 +1018,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_device_handle device_handle, static_cast(block), reinterpret_cast(ec)); } -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handle, uint64_t *enabled_blocks) { AMDSMI_CHECK_INIT(); @@ -1027,7 +1027,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_device_handle device_handle, return rsmi_wrapper(rsmi_dev_ecc_enabled_get, device_handle, enabled_blocks); } -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); @@ -1040,7 +1040,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_device_handle device_handle, } amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_device_handle device_handle, +amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, uint32_t *busy_percent) { AMDSMI_CHECK_INIT(); @@ -1050,7 +1050,7 @@ amdsmi_dev_get_busy_percent(amdsmi_device_handle device_handle, busy_percent); } amdsmi_status_t amdsmi_dev_get_gpu_metrics_info( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, amdsmi_gpu_metrics_t *pgpu_metrics) { AMDSMI_CHECK_INIT(); @@ -1061,7 +1061,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_metrics_info( } amdsmi_status_t -amdsmi_get_power_cap_info(amdsmi_device_handle device_handle, +amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info) { AMDSMI_CHECK_INIT(); @@ -1120,14 +1120,14 @@ amdsmi_get_power_cap_info(amdsmi_device_handle device_handle, } amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_device_handle device_handle, + amdsmi_dev_set_power_cap(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t cap) { return rsmi_wrapper(rsmi_dev_power_cap_set, device_handle, sensor_ind, cap); } amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_device_handle device_handle, +amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t *power) { AMDSMI_CHECK_INIT(); @@ -1137,7 +1137,7 @@ amdsmi_dev_get_power_ave(amdsmi_device_handle device_handle, sensor_ind, power); } amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_device_handle device_handle, + amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle device_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status) { AMDSMI_CHECK_INIT(); @@ -1150,19 +1150,19 @@ amdsmi_status_t } amdsmi_status_t amdsmi_set_perf_determinism_mode( - amdsmi_device_handle device_handle, uint64_t clkvalue) { + amdsmi_processor_handle device_handle, uint64_t clkvalue) { return rsmi_wrapper(rsmi_perf_determinism_mode_set, device_handle, clkvalue); } amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_device_handle device_handle, + amdsmi_dev_set_power_profile(amdsmi_processor_handle device_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile) { return rsmi_wrapper(rsmi_dev_power_profile_set, device_handle, reserved, static_cast(profile)); } -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t *perf) { AMDSMI_CHECK_INIT(); @@ -1172,33 +1172,33 @@ amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_device_handle device_handle, reinterpret_cast(perf)); } amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_device_handle device_handle, + amdsmi_dev_set_perf_level(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl) { return rsmi_wrapper(rsmi_dev_perf_level_set, device_handle, static_cast(perf_lvl)); } amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_device_handle device_handle, + amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl) { return rsmi_wrapper(rsmi_dev_perf_level_set_v1, device_handle, static_cast(perf_lvl)); } -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_handle, uint64_t bw_bitmask) { return rsmi_wrapper(rsmi_dev_pci_bandwidth_set, device_handle, bw_bitmask); } -amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_bandwidth_t *bandwidth) { return rsmi_wrapper(rsmi_dev_pci_bandwidth_get, device_handle, reinterpret_cast(bandwidth)); } // TODO(bliu): other frequencies in amdsmi_clk_type_t -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f) { AMDSMI_CHECK_INIT(); @@ -1242,7 +1242,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_device_handle device_handle, reinterpret_cast(f)); } -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask) { AMDSMI_CHECK_INIT(); @@ -1258,60 +1258,60 @@ amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_device_handle device_handle, static_cast(clk_type), freq_bitmask); } amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_device_handle device_handle, +amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records) { return rsmi_wrapper(rsmi_dev_memory_reserved_pages_get, device_handle, num_pages, reinterpret_cast(records)); } -amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, uint64_t *total) { return rsmi_wrapper(rsmi_dev_memory_total_get, device_handle, static_cast(mem_type), total); } -amdsmi_status_t amdsmi_dev_get_memory_usage(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, uint64_t *used) { return rsmi_wrapper(rsmi_dev_memory_usage_get, device_handle, static_cast(mem_type), used); } amdsmi_status_t amdsmi_dev_get_overdrive_level( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, uint32_t *od) { return rsmi_wrapper(rsmi_dev_overdrive_level_get, device_handle, od); } amdsmi_status_t amdsmi_dev_set_overdrive_level( - amdsmi_device_handle device_handle, uint32_t od) { + amdsmi_processor_handle device_handle, uint32_t od) { return rsmi_wrapper(rsmi_dev_overdrive_level_set, device_handle, od); } amdsmi_status_t amdsmi_dev_get_pci_replay_counter( - amdsmi_device_handle device_handle, uint64_t *counter) { + amdsmi_processor_handle device_handle, uint64_t *counter) { return rsmi_wrapper(rsmi_dev_pci_replay_counter_get, device_handle, counter); } amdsmi_status_t amdsmi_dev_get_pci_throughput( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz) { return rsmi_wrapper(rsmi_dev_pci_throughput_get, device_handle, sent, received, max_pkt_sz); } -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_handle, amdsmi_od_volt_freq_data_t *odv) { return rsmi_wrapper(rsmi_dev_od_volt_info_get, device_handle, reinterpret_cast(odv)); } amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer) { return rsmi_wrapper(rsmi_dev_od_volt_curve_regions_get, device_handle, num_regions, reinterpret_cast(buffer)); } -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage) { return rsmi_wrapper(rsmi_dev_volt_metric_get, device_handle, @@ -1319,7 +1319,7 @@ amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_device_handle device_handle, static_cast(metric), voltage); } -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType) { @@ -1328,13 +1328,13 @@ amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_device_handle device_handle, static_cast(clkType)); } -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue) { return rsmi_wrapper(rsmi_dev_od_volt_info_set, device_handle, vpoint, clkvalue, voltvalue); } -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType) { @@ -1344,17 +1344,17 @@ amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_device_handle device_handle, } amdsmi_status_t amdsmi_dev_set_overdrive_level_v1( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, uint32_t od) { return rsmi_wrapper(rsmi_dev_overdrive_level_set_v1, device_handle, od); } -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_device_handle device_handle) { +amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle) { return rsmi_wrapper(rsmi_dev_gpu_reset, device_handle); } -amdsmi_status_t amdsmi_get_utilization_count(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, amdsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp) { @@ -1363,32 +1363,32 @@ amdsmi_status_t amdsmi_get_utilization_count(amdsmi_device_handle device_handle, count, timestamp); } amdsmi_status_t amdsmi_dev_get_memory_busy_percent( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, uint32_t *busy_percent) { return rsmi_wrapper(rsmi_dev_memory_busy_percent_get, device_handle, busy_percent); } -amdsmi_status_t amdsmi_dev_get_energy_count(amdsmi_device_handle device_handle, +amdsmi_status_t amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp) { return rsmi_wrapper(rsmi_dev_energy_count_get, device_handle, power, counter_resolution, timestamp); } amdsmi_status_t amdsmi_dev_get_drm_render_minor( - amdsmi_device_handle device_handle, uint32_t *minor) { + amdsmi_processor_handle device_handle, uint32_t *minor) { return rsmi_wrapper(rsmi_dev_drm_render_minor_get, device_handle, minor); } amdsmi_status_t amdsmi_dev_get_pci_id( - amdsmi_device_handle device_handle, uint64_t *bdfid) { + amdsmi_processor_handle device_handle, uint64_t *bdfid) { return rsmi_wrapper(rsmi_dev_pci_id_get, device_handle, bdfid); } amdsmi_status_t amdsmi_topo_get_numa_affinity( - amdsmi_device_handle device_handle, uint32_t *numa_node) { + amdsmi_processor_handle device_handle, uint32_t *numa_node) { return rsmi_wrapper(rsmi_topo_numa_affinity_get, device_handle, numa_node); } @@ -1418,7 +1418,7 @@ amdsmi_status_t amdsmi_get_version_str(amdsmi_sw_component_t component, } amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_device_handle device_handle, amdsmi_vbios_info_t *info) { +amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1463,7 +1463,7 @@ amdsmi_get_vbios_info(amdsmi_device_handle device_handle, amdsmi_vbios_info_t *i } amdsmi_status_t -amdsmi_get_gpu_activity(amdsmi_device_handle device_handle, amdsmi_engine_usage_t *info) { +amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usage_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1488,7 +1488,7 @@ amdsmi_get_gpu_activity(amdsmi_device_handle device_handle, amdsmi_engine_usage_ } amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) { +amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1543,7 +1543,7 @@ amdsmi_get_clock_measure(amdsmi_device_handle device_handle, amdsmi_clk_type_t c } amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_device_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { +amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); if (state == nullptr || block > AMDSMI_GPU_BLOCK_LAST) { @@ -1567,7 +1567,7 @@ amdsmi_get_ras_block_features_enabled(amdsmi_device_handle device_handle, amdsmi } amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_device_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { +amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { AMDSMI_CHECK_INIT(); if (num_pages == nullptr) { @@ -1594,7 +1594,7 @@ amdsmi_get_bad_page_info(amdsmi_device_handle device_handle, uint32_t *num_pages } amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_device_handle device_handle, amdsmi_error_count_t *ec) { +amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); if (ec == nullptr) { @@ -1621,7 +1621,7 @@ amdsmi_get_ecc_error_count(amdsmi_device_handle device_handle, amdsmi_error_coun } amdsmi_status_t -amdsmi_get_process_list(amdsmi_device_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes) { +amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes) { AMDSMI_CHECK_INIT(); if (max_processes == nullptr) { @@ -1669,7 +1669,7 @@ amdsmi_get_process_list(amdsmi_device_handle device_handle, amdsmi_process_handl } amdsmi_status_t -amdsmi_get_process_info(amdsmi_device_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { +amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1694,7 +1694,7 @@ amdsmi_get_process_info(amdsmi_device_handle device_handle, amdsmi_process_handl } amdsmi_status_t -amdsmi_get_power_measure(amdsmi_device_handle device_handle, amdsmi_power_measure_t *info) { +amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_measure_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1737,7 +1737,7 @@ amdsmi_get_power_measure(amdsmi_device_handle device_handle, amdsmi_power_measur } amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { +amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { AMDSMI_CHECK_INIT(); if (range == nullptr || clk_type > CLK_TYPE__MAX) { @@ -1788,7 +1788,7 @@ amdsmi_get_target_frequency_range(amdsmi_device_handle device_handle, amdsmi_clk } amdsmi_status_t -amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char *version) { +amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, char *version) { AMDSMI_CHECK_INIT(); if (length == nullptr || version == nullptr) { @@ -1806,7 +1806,7 @@ amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char } amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_length, char *uuid) { +amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid_length, char *uuid) { AMDSMI_CHECK_INIT(); if (uuid_length == nullptr || uuid == nullptr) { @@ -1854,7 +1854,7 @@ amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_le } amdsmi_status_t -amdsmi_get_pcie_link_status(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info){ +amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info){ AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1873,7 +1873,7 @@ amdsmi_get_pcie_link_status(amdsmi_device_handle device_handle, amdsmi_pcie_info return status; } -amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info) { +amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1932,13 +1932,13 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle device_handle, am } amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, - amdsmi_device_handle* device_handle) + amdsmi_processor_handle* device_handle) { amdsmi_status_t status; uint32_t socket_count = 0; uint32_t device_count = AMDSMI_MAX_DEVICES; - amdsmi_device_handle devs[AMDSMI_MAX_DEVICES]; + amdsmi_processor_handle devs[AMDSMI_MAX_DEVICES]; AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/src/amd_smi/amd_smi_system.cc b/projects/amdsmi/src/amd_smi/amd_smi_system.cc index 8f52dd2bb5..d81dfb0c00 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_system.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_system.cc @@ -165,7 +165,7 @@ amdsmi_status_t AMDSmiSystem::handle_to_socket( } amdsmi_status_t AMDSmiSystem::handle_to_device( - amdsmi_device_handle device_handle, + amdsmi_processor_handle device_handle, AMDSmiProcessor** device) { if (device_handle == nullptr || device == nullptr) { return AMDSMI_STATUS_INVAL; @@ -181,7 +181,7 @@ amdsmi_status_t AMDSmiSystem::handle_to_device( } amdsmi_status_t AMDSmiSystem::gpu_index_to_handle(uint32_t gpu_index, - amdsmi_device_handle* device_handle) { + amdsmi_processor_handle* device_handle) { if (device_handle == nullptr) return AMDSMI_STATUS_INVAL; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc index a7fdc9029d..f46c33627d 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc @@ -113,7 +113,7 @@ void TestHWTopologyRead::Run(void) { std::vector numa_numbers(num_devices); for (uint32_t dv_ind = 0; dv_ind < num_devices; ++dv_ind) { - amdsmi_device_handle dev_handle = device_handles_[dv_ind]; + amdsmi_processor_handle dev_handle = device_handles_[dv_ind]; err = amdsmi_topo_get_numa_node_number(dev_handle, &numa_numbers[dv_ind]); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index e223be4715..a37ff24027 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -110,7 +110,7 @@ void TestPerfCntrReadWrite::Close() { // Refactor this to handle different event groups once we have > 1 event group -void TestPerfCntrReadWrite::CountEvents(amdsmi_device_handle dv_ind, +void TestPerfCntrReadWrite::CountEvents(amdsmi_processor_handle dv_ind, amdsmi_event_type_t evnt, amdsmi_counter_value_t *val, int32_t sleep_sec) { amdsmi_event_handle_t evt_handle; amdsmi_status_t ret; @@ -157,7 +157,7 @@ static const uint64_t kVg20Level1Bandwidth = 23; // 23 GB/sec void -TestPerfCntrReadWrite::testEventsIndividually(amdsmi_device_handle dv_ind) { +TestPerfCntrReadWrite::testEventsIndividually(amdsmi_processor_handle dv_ind) { amdsmi_status_t ret; amdsmi_counter_value_t val; uint64_t throughput; @@ -231,7 +231,7 @@ TestPerfCntrReadWrite::testEventsIndividually(amdsmi_device_handle dv_ind) { } void -TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_device_handle dv_ind) { +TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) { amdsmi_status_t ret; amdsmi_counter_value_t val; uint32_t avail_counters; @@ -352,7 +352,7 @@ void TestPerfCntrReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - amdsmi_device_handle dev_handle = device_handles_[dv_ind]; + amdsmi_processor_handle dev_handle = device_handles_[dv_ind]; PrintDeviceHeader(dev_handle); try { testEventsIndividually(dev_handle); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.h b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.h index 96e29199dd..1aef41d396 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.h +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.h @@ -72,11 +72,11 @@ class TestPerfCntrReadWrite : public TestBase { virtual void DisplayTestInfo(void); private: - void CountEvents(amdsmi_device_handle dv_ind, + void CountEvents(amdsmi_processor_handle dv_ind, amdsmi_event_type_t evnt, amdsmi_counter_value_t *val, int32_t sleep_sec = 1); - void testEventsIndividually(amdsmi_device_handle dv_ind); - void testEventsSimultaneously(amdsmi_device_handle dv_ind); + void testEventsIndividually(amdsmi_processor_handle dv_ind); + void testEventsSimultaneously(amdsmi_processor_handle dv_ind); }; class PerfCntrEvtGrp { diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.cc b/projects/amdsmi/tests/amd_smi_test/test_base.cc index 2ae7662076..3b4d93c9fd 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.cc +++ b/projects/amdsmi/tests/amd_smi_test/test_base.cc @@ -131,7 +131,7 @@ void TestBase::SetUp(uint64_t init_flags) { } ASSERT_EQ(err, AMDSMI_STATUS_SUCCESS); - std::vector device_handles(device_count); + std::vector device_handles(device_count); err = amdsmi_get_device_handles(sockets_[i], &device_count, &device_handles[0]); if (err != AMDSMI_STATUS_SUCCESS) { @@ -159,7 +159,7 @@ void TestBase::SetUp(uint64_t init_flags) { return; } -void TestBase::PrintDeviceHeader(amdsmi_device_handle dv_ind) { +void TestBase::PrintDeviceHeader(amdsmi_processor_handle dv_ind) { amdsmi_status_t err; uint16_t val_ui16; amdsmi_asic_info_t info; diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.h b/projects/amdsmi/tests/amd_smi_test/test_base.h index 9d98ccb628..935e265239 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.h +++ b/projects/amdsmi/tests/amd_smi_test/test_base.h @@ -121,11 +121,11 @@ class TestBase { protected: void MakeHeaderStr(const char *inStr, std::string *outStr) const; - void PrintDeviceHeader(amdsmi_device_handle dv_ind); + void PrintDeviceHeader(amdsmi_processor_handle dv_ind); bool setup_failed_; ///< Record that setup failed to return ierr in Run uint32_t num_monitor_devs_; ///< Number of monitor devices found ///< device handles - amdsmi_device_handle device_handles_[MAX_MONITOR_DEVICES]; + amdsmi_processor_handle device_handles_[MAX_MONITOR_DEVICES]; uint32_t socket_count_; ///< socket count std::vector sockets_; ///< sockets From 94331a7a90252ecfbe1770ae5270e6d3c9435758 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sat, 25 Feb 2023 05:28:40 -0500 Subject: [PATCH 06/95] Change device_handle to processor_handle grep -rli 'device_handle' * | xargs -i@ sed -i 's/device_handle/processor_handle/g' @ Change-Id: Ifc8b7fa3b5488ce1fa8d8cf9eb3981a09450de11 [ROCm/amdsmi commit: 3f9e4d95d45e50fe99b6566d9f3ffe0ef15f92c1] --- projects/amdsmi/README.md | 16 +- .../amdsmi/example/amd_smi_drm_example.cc | 68 +- .../amdsmi/example/amd_smi_nodrm_example.cc | 38 +- projects/amdsmi/include/amd_smi/amdsmi.h | 560 ++++++------- .../include/amd_smi/impl/amd_smi_system.h | 4 +- projects/amdsmi/py-interface/README.md | 380 ++++----- projects/amdsmi/py-interface/__init__.py | 4 +- .../amdsmi/py-interface/amdsmi_interface.py | 750 +++++++++--------- .../amdsmi/py-interface/amdsmi_wrapper.py | 16 +- projects/amdsmi/py-interface/rocm_smi_tool.py | 58 +- projects/amdsmi/src/amd_smi/amd_smi.cc | 436 +++++----- projects/amdsmi/src/amd_smi/amd_smi_system.cc | 12 +- .../functional/api_support_read.cc | 4 +- .../amd_smi_test/functional/err_cnt_read.cc | 18 +- .../functional/evt_notif_read_write.cc | 10 +- .../tests/amd_smi_test/functional/fan_read.cc | 14 +- .../amd_smi_test/functional/fan_read_write.cc | 14 +- .../functional/frequencies_read.cc | 14 +- .../functional/frequencies_read_write.cc | 12 +- .../amd_smi_test/functional/gpu_busy_read.cc | 4 +- .../functional/gpu_metrics_read.cc | 6 +- .../functional/hw_topology_read.cc | 14 +- .../amd_smi_test/functional/id_info_read.cc | 48 +- .../functional/mem_page_info_read.cc | 10 +- .../amd_smi_test/functional/mem_util_read.cc | 6 +- .../functional/metrics_counter_read.cc | 10 +- .../functional/mutual_exclusion.cc | 52 +- .../amd_smi_test/functional/overdrive_read.cc | 6 +- .../functional/overdrive_read_write.cc | 12 +- .../amd_smi_test/functional/pci_read_write.cc | 24 +- .../functional/perf_cntr_read_write.cc | 2 +- .../functional/perf_determinism.cc | 12 +- .../functional/perf_level_read.cc | 6 +- .../functional/perf_level_read_write.cc | 12 +- .../functional/power_cap_read_write.cc | 14 +- .../amd_smi_test/functional/power_read.cc | 8 +- .../functional/power_read_write.cc | 18 +- .../amd_smi_test/functional/sys_info_read.cc | 26 +- .../amd_smi_test/functional/temp_read.cc | 8 +- .../functional/volt_freq_curv_read.cc | 10 +- .../amd_smi_test/functional/volt_read.cc | 8 +- .../functional/xgmi_read_write.cc | 2 +- .../amdsmi/tests/amd_smi_test/test_base.cc | 10 +- .../amdsmi/tests/amd_smi_test/test_base.h | 2 +- 44 files changed, 1381 insertions(+), 1377 deletions(-) diff --git a/projects/amdsmi/README.md b/projects/amdsmi/README.md index 8e7dad3d24..64bbab66aa 100755 --- a/projects/amdsmi/README.md +++ b/projects/amdsmi/README.md @@ -76,7 +76,7 @@ Many of the functions in the library take a "socket handle" or "device handle". GPU device and CPU device on the same socket. Moreover, for MI200, it may have multiple GCDs. To discover the sockets in the system, `amdsmi_get_socket_handles()` is called to get list of sockets -handles, which in turn can be used to query the devices in that socket using `amdsmi_get_device_handles()`. The device handler is used to distinguish the detected devices from one another. It is important to note that a device may end up with a different device handles after restart application, so a device handle should not be relied upon to be constant over process. +handles, which in turn can be used to query the devices in that socket using `amdsmi_get_processor_handles()`. The device handler is used to distinguish the detected devices from one another. It is important to note that a device may end up with a different device handles after restart application, so a device handle should not be relied upon to be constant over process. ## Hello AMD SMI @@ -116,20 +116,20 @@ int main() { // Get the device count for the socket. uint32_t device_count = 0; - ret = amdsmi_get_device_handles(sockets[i], &device_count, nullptr); + ret = amdsmi_get_processor_handles(sockets[i], &device_count, nullptr); // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector processor_handles(device_count); // Get all devices of the socket - ret = amdsmi_get_device_handles(sockets[i], - &device_count, &device_handles[0]); + ret = amdsmi_get_processor_handles(sockets[i], + &device_count, &processor_handles[0]); // For each device of the socket, get name and temperature. for (uint32_t j=0; j < device_count; j++) { // Get device type. Since the amdsmi is initialized with // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. device_type_t device_type; - ret = amdsmi_get_device_type(device_handles[j], &device_type); + ret = amdsmi_get_device_type(processor_handles[j], &device_type); if (device_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; return 1; @@ -137,13 +137,13 @@ int main() { // Get device name amdsmi_board_info_t board_info; - ret = amdsmi_get_board_info(device_handles[j], &board_info); + ret = amdsmi_get_board_info(processor_handles[j], &board_info); std::cout << "\tdevice " << j <<"\n\t\tName:" << board_info.product_name << std::endl; // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(device_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); std::cout << "\t\tTemperature: " << val_i64 << "C" << std::endl; } diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 69d8945d8e..b70e16cf75 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -244,14 +244,14 @@ int main() { // Get the device count available for the socket. uint32_t device_count = 0; - ret = amdsmi_get_device_handles(sockets[i], &device_count, nullptr); + ret = amdsmi_get_processor_handles(sockets[i], &device_count, nullptr); CHK_AMDSMI_RET(ret) // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector processor_handles(device_count); // Get all devices of the socket - ret = amdsmi_get_device_handles(sockets[i], - &device_count, &device_handles[0]); + ret = amdsmi_get_processor_handles(sockets[i], + &device_count, &processor_handles[0]); CHK_AMDSMI_RET(ret) // For each device of the socket, get name and temperature. @@ -259,7 +259,7 @@ int main() { // Get device type. Since the amdsmi is initialized with // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. device_type_t device_type = {}; - ret = amdsmi_get_device_type(device_handles[j], &device_type); + ret = amdsmi_get_device_type(processor_handles[j], &device_type); CHK_AMDSMI_RET(ret) if (device_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; @@ -268,7 +268,7 @@ int main() { // Get BDF info amdsmi_bdf_t bdf = {}; - ret = amdsmi_get_device_bdf(device_handles[j], &bdf); + ret = amdsmi_get_device_bdf(processor_handles[j], &bdf); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_device_bdf:\n"); printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i, @@ -277,12 +277,12 @@ int main() { // Get handle from BDF amdsmi_processor_handle dev_handle; - ret = amdsmi_get_device_handle_from_bdf(bdf, &dev_handle); + ret = amdsmi_get_processor_handle_from_bdf(bdf, &dev_handle); CHK_AMDSMI_RET(ret) // Get ASIC info amdsmi_asic_info_t asic_info = {}; - ret = amdsmi_get_asic_info(device_handles[j], &asic_info); + ret = amdsmi_get_asic_info(processor_handles[j], &asic_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); @@ -294,7 +294,7 @@ int main() { // Get VBIOS info amdsmi_vbios_info_t vbios_info = {}; - ret = amdsmi_get_vbios_info(device_handles[j], &vbios_info); + ret = amdsmi_get_vbios_info(processor_handles[j], &vbios_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vbios_info:\n"); printf("\tVBios Name: %s\n", vbios_info.name); @@ -306,7 +306,7 @@ int main() { // Get power measure amdsmi_power_measure_t power_measure = {}; - ret = amdsmi_get_power_measure(device_handles[j], &power_measure); + ret = amdsmi_get_power_measure(processor_handles[j], &power_measure); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_power_measure:\n"); printf("\tCurrent GFX Voltage: %d\n", @@ -320,7 +320,7 @@ int main() { // Get driver version char version[AMDSMI_MAX_DRIVER_VERSION_LENGTH]; int version_length = AMDSMI_MAX_DRIVER_VERSION_LENGTH; - ret = amdsmi_get_driver_version(device_handles[j], &version_length, version); + ret = amdsmi_get_driver_version(processor_handles[j], &version_length, version); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_driver_version:\n"); printf("\tDriver version: %s\n\n", version); @@ -328,14 +328,14 @@ int main() { // Get device uuid unsigned int uuid_length = AMDSMI_GPU_UUID_SIZE; char uuid[AMDSMI_GPU_UUID_SIZE]; - ret = amdsmi_get_device_uuid(device_handles[j], &uuid_length, uuid); + ret = amdsmi_get_device_uuid(processor_handles[j], &uuid_length, uuid); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_device_uuid:\n"); printf("\tDevice uuid: %s\n\n", uuid); // Get engine usage info amdsmi_engine_usage_t engine_usage = {}; - ret = amdsmi_get_gpu_activity(device_handles[j], &engine_usage); + ret = amdsmi_get_gpu_activity(processor_handles[j], &engine_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_gpu_activity:\n"); printf("\tAverage GFX Activity: %d\n", @@ -348,7 +348,7 @@ int main() { // Get firmware info amdsmi_fw_info_t fw_information = {}; char ucode_name[AMDSMI_MAX_STRING_LENGTH]; - ret = amdsmi_get_fw_info(device_handles[j], &fw_information); + ret = amdsmi_get_fw_info(processor_handles[j], &fw_information); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_fw_info:\n"); printf("Number of Microcodes: %d\n", fw_information.num_fw_info); @@ -359,7 +359,7 @@ int main() { // Get GFX clock measurements amdsmi_clk_measure_t gfx_clk_values = {}; - ret = amdsmi_get_clock_measure(device_handles[j], CLK_TYPE_GFX, + ret = amdsmi_get_clock_measure(processor_handles[j], CLK_TYPE_GFX, &gfx_clk_values); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_clock_measure:\n"); @@ -369,7 +369,7 @@ int main() { // Get MEM clock measurements amdsmi_clk_measure_t mem_clk_values = {}; - ret = amdsmi_get_clock_measure(device_handles[j], CLK_TYPE_MEM, + ret = amdsmi_get_clock_measure(processor_handles[j], CLK_TYPE_MEM, &mem_clk_values); CHK_AMDSMI_RET(ret) printf("\tGPU MEM Max Clock: %d\n", mem_clk_values.max_clk); @@ -378,7 +378,7 @@ int main() { // Get PCIe status amdsmi_pcie_info_t pcie_info = {}; - ret = amdsmi_get_pcie_link_status(device_handles[j], &pcie_info); + ret = amdsmi_get_pcie_link_status(processor_handles[j], &pcie_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_pcie_link_status:\n"); printf("\tPCIe lanes: %d\n", pcie_info.pcie_lanes); @@ -386,7 +386,7 @@ int main() { // Get PCIe caps amdsmi_pcie_info_t pcie_caps_info = {}; - ret = amdsmi_get_pcie_link_caps(device_handles[j], &pcie_caps_info); + ret = amdsmi_get_pcie_link_caps(processor_handles[j], &pcie_caps_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_pcie_link_caps:\n"); printf("\tPCIe max lanes: %d\n", pcie_caps_info.pcie_lanes); @@ -395,7 +395,7 @@ int main() { // Get VRAM temperature limit int64_t temperature = 0; ret = amdsmi_dev_get_temp_metric( - device_handles[j], TEMPERATURE_TYPE_VRAM, + processor_handles[j], TEMPERATURE_TYPE_VRAM, AMDSMI_TEMP_CRITICAL, &temperature); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_dev_get_temp_metric:\n"); @@ -403,7 +403,7 @@ int main() { // Get GFX temperature limit ret = amdsmi_dev_get_temp_metric( - device_handles[j], TEMPERATURE_TYPE_EDGE, + processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CRITICAL, &temperature); CHK_AMDSMI_RET(ret) printf("\tGPU GFX temp limit: %ld\n\n", temperature); @@ -417,7 +417,7 @@ int main() { TEMPERATURE_TYPE_VRAM, TEMPERATURE_TYPE_PLX}; for (const auto &temp_type : temp_types) { ret = amdsmi_dev_get_temp_metric( - device_handles[j], temp_type, + processor_handles[j], temp_type, AMDSMI_TEMP_CURRENT, &temp_measurements[(int)(temp_type)]); CHK_AMDSMI_RET(ret) @@ -446,7 +446,7 @@ int main() { for (auto block = AMDSMI_GPU_BLOCK_FIRST; block <= AMDSMI_GPU_BLOCK_LAST; block = (amdsmi_gpu_block_t)(block * 2)) { - ret = amdsmi_get_ras_block_features_enabled(device_handles[j], block, + ret = amdsmi_get_ras_block_features_enabled(processor_handles[j], block, &state); CHK_AMDSMI_RET(ret) printf("\tBlock: %s\n", block_names[index]); @@ -459,7 +459,7 @@ int main() { char bad_page_status_names[3][15] = {"RESERVED", "PENDING", "UNRESERVABLE"}; uint32_t num_pages = 0; - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, nullptr); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_bad_page_info:\n"); @@ -467,7 +467,7 @@ int main() { printf("\tNo bad pages found.\n"); } else { std::vector bad_page_info(num_pages); - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, bad_page_info.data()); CHK_AMDSMI_RET(ret) for (uint32_t page_it = 0; page_it < num_pages; page_it += 1) { @@ -484,7 +484,7 @@ int main() { // Get ECC error counts amdsmi_error_count_t err_cnt_info = {}; - ret = amdsmi_get_ecc_error_count(device_handles[j], &err_cnt_info); + ret = amdsmi_get_ecc_error_count(processor_handles[j], &err_cnt_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_ecc_error_count:\n"); printf("\tCorrectable errors: %lu\n", err_cnt_info.correctable_count); @@ -501,7 +501,7 @@ int main() { // Get frequency ranges amdsmi_frequency_range_t freq_ranges = {}; ret = amdsmi_get_target_frequency_range( - device_handles[j], CLK_TYPE_GFX, &freq_ranges); + processor_handles[j], CLK_TYPE_GFX, &freq_ranges); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_target_frequency_range:\n"); printf("\tSupported min freq: %lu\n", @@ -514,7 +514,7 @@ int main() { freq_ranges.current_freq_range.upper_bound); uint32_t num_process = 0; - ret = amdsmi_get_process_list(device_handles[j], nullptr, + ret = amdsmi_get_process_list(processor_handles[j], nullptr, &num_process); CHK_AMDSMI_RET(ret) if (!num_process) { @@ -529,14 +529,14 @@ int main() { sprintf(bdf_str, "%04lx:%02x:%02x.%d", bdf.domain_number, bdf.bus_number, bdf.device_number, bdf.function_number); int num = 0; - ret = amdsmi_get_process_list(device_handles[j], process_list, + ret = amdsmi_get_process_list(processor_handles[j], process_list, &num_process); CHK_AMDSMI_RET(ret) for (uint32_t it = 0; it < num_process; it += 1) { if (getpid() == process_list[it]) { continue; } - ret = amdsmi_get_process_info(device_handles[j], + ret = amdsmi_get_process_info(processor_handles[j], process_list[it], &process); if (ret != AMDSMI_STATUS_SUCCESS) { printf("amdsmi_get_process_info() failed for " @@ -623,7 +623,7 @@ int main() { // Get device name amdsmi_board_info_t board_info = {}; - ret = amdsmi_get_board_info(device_handles[j], &board_info); + ret = amdsmi_get_board_info(processor_handles[j], &board_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_board_info:\n"); std::cout << "\tdevice [" << j @@ -636,7 +636,7 @@ int main() { // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(device_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_dev_get_temp_metric:\n"); @@ -645,7 +645,7 @@ int main() { // Get frame buffer amdsmi_vram_info_t vram_usage = {}; - ret = amdsmi_get_vram_usage(device_handles[j], &vram_usage); + ret = amdsmi_get_vram_usage(processor_handles[j], &vram_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vram_usage:\n"); std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used @@ -653,7 +653,7 @@ int main() { // Get Cap info amdsmi_gpu_caps_t caps_info = {}; - ret = amdsmi_get_caps_info(device_handles[j], &caps_info); + ret = amdsmi_get_caps_info(processor_handles[j], &caps_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_caps_info:\n"); std::cout << "\t\tGFX IP Major: " << caps_info.gfx.gfxip_major @@ -668,7 +668,7 @@ int main() { << "\n\n"; amdsmi_power_cap_info_t cap_info = {}; - ret = amdsmi_get_power_cap_info(device_handles[j], 0, &cap_info); + ret = amdsmi_get_power_cap_info(processor_handles[j], 0, &cap_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_power_cap_info:\n"); std::cout << "\t\t Power Cap: " << cap_info.power_cap diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 950ff16e65..9a89699d51 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -96,14 +96,14 @@ int main() { // Get the device count available for the socket. uint32_t device_count = 0; - ret = amdsmi_get_device_handles(sockets[i], &device_count, nullptr); + ret = amdsmi_get_processor_handles(sockets[i], &device_count, nullptr); CHK_AMDSMI_RET(ret) // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector processor_handles(device_count); // Get all devices of the socket - ret = amdsmi_get_device_handles(sockets[i], - &device_count, &device_handles[0]); + ret = amdsmi_get_processor_handles(sockets[i], + &device_count, &processor_handles[0]); CHK_AMDSMI_RET(ret) // For each device of the socket, get name and temperature. @@ -111,7 +111,7 @@ int main() { // Get device type. Since the amdsmi is initialized with // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. device_type_t device_type = {}; - ret = amdsmi_get_device_type(device_handles[j], &device_type); + ret = amdsmi_get_device_type(processor_handles[j], &device_type); CHK_AMDSMI_RET(ret) if (device_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; @@ -119,7 +119,7 @@ int main() { } amdsmi_bdf_t bdf = {}; - ret = amdsmi_get_device_bdf(device_handles[j], &bdf); + ret = amdsmi_get_device_bdf(processor_handles[j], &bdf); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_device_bdf:\n"); printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i, @@ -127,7 +127,7 @@ int main() { bdf.function_number); amdsmi_asic_info_t asic_info = {}; - ret = amdsmi_get_asic_info(device_handles[j], &asic_info); + ret = amdsmi_get_asic_info(processor_handles[j], &asic_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); @@ -139,7 +139,7 @@ int main() { // Get VBIOS info amdsmi_vbios_info_t vbios_info = {}; - ret = amdsmi_get_vbios_info(device_handles[j], &vbios_info); + ret = amdsmi_get_vbios_info(processor_handles[j], &vbios_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vbios_info:\n"); printf("\tVBios Name: %s\n", vbios_info.name); @@ -151,7 +151,7 @@ int main() { // Get engine usage info amdsmi_engine_usage_t engine_usage = {}; - ret = amdsmi_get_gpu_activity(device_handles[j], &engine_usage); + ret = amdsmi_get_gpu_activity(processor_handles[j], &engine_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_gpu_activity:\n"); printf("\tAverage GFX Activity: %d\n", @@ -163,7 +163,7 @@ int main() { // Get firmware info amdsmi_fw_info_t fw_information = {}; - ret = amdsmi_get_fw_info(device_handles[j], &fw_information); + ret = amdsmi_get_fw_info(processor_handles[j], &fw_information); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_fw_info:\n"); printf("\tFirmware version: %d\n", fw_information.num_fw_info); @@ -227,7 +227,7 @@ int main() { TEMPERATURE_TYPE_VRAM, TEMPERATURE_TYPE_PLX}; for (const auto &temp_type : temp_types) { ret = amdsmi_dev_get_temp_metric( - device_handles[j], temp_type, + processor_handles[j], temp_type, AMDSMI_TEMP_CURRENT, &temp_measurements[(int)(temp_type)]); CHK_AMDSMI_RET(ret) @@ -246,7 +246,7 @@ int main() { char bad_page_status_names[3][15] = {"RESERVED", "PENDING", "UNRESERVABLE"}; uint32_t num_pages = 0; - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, nullptr); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_bad_page_info:\n"); @@ -254,7 +254,7 @@ int main() { printf("\tNo bad pages found.\n"); } else { std::vector bad_page_info(num_pages); - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, bad_page_info.data()); CHK_AMDSMI_RET(ret) for (uint32_t page_it = 0; page_it < num_pages; page_it += 1) { @@ -271,7 +271,7 @@ int main() { // Get ECC error counts amdsmi_error_count_t err_cnt_info = {}; - ret = amdsmi_get_ecc_error_count(device_handles[j], &err_cnt_info); + ret = amdsmi_get_ecc_error_count(processor_handles[j], &err_cnt_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_ecc_error_count:\n"); printf("\tCorrectable errors: %lu\n", err_cnt_info.correctable_count); @@ -287,7 +287,7 @@ int main() { // Get device name amdsmi_board_info_t board_info = {}; - ret = amdsmi_get_board_info(device_handles[j], &board_info); + ret = amdsmi_get_board_info(processor_handles[j], &board_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_board_info:\n"); std::cout << "\tdevice [" << j @@ -300,7 +300,7 @@ int main() { // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(device_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_dev_get_temp_metric:\n"); @@ -309,7 +309,7 @@ int main() { // Get frame buffer amdsmi_vram_info_t vram_usage = {}; - ret = amdsmi_get_vram_usage(device_handles[j], &vram_usage); + ret = amdsmi_get_vram_usage(processor_handles[j], &vram_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vram_usage:\n"); std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used @@ -317,7 +317,7 @@ int main() { // Get Cap info amdsmi_gpu_caps_t caps_info = {}; - ret = amdsmi_get_caps_info(device_handles[j], &caps_info); + ret = amdsmi_get_caps_info(processor_handles[j], &caps_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_caps_info:\n"); std::cout << "\t\tGFX IP Major: " << caps_info.gfx.gfxip_major @@ -332,7 +332,7 @@ int main() { << "\n\n"; amdsmi_power_cap_info_t cap_info = {}; - ret = amdsmi_get_power_cap_info(device_handles[j], 0, &cap_info); + ret = amdsmi_get_power_cap_info(processor_handles[j], 0, &cap_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_power_cap_info:\n"); std::cout << "\t\t Power Cap: " << cap_info.power_cap / 1000000 diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 0e87262ec9..4bc3216d00 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -609,7 +609,7 @@ typedef enum { * Event notification data returned from event notification API */ typedef struct { - amdsmi_processor_handle device_handle; //!< Handler of device that corresponds to the event + amdsmi_processor_handle processor_handle; //!< Handler of device that corresponds to the event amdsmi_evt_notification_type_t event; //!< Event type char message[MAX_EVENT_NOTIFICATION_MSG_SIZE]; //!< Event message } amdsmi_evt_notification_data_t; @@ -1229,39 +1229,39 @@ amdsmi_status_t amdsmi_get_socket_info( * Currently, only AMD GPUs are supported. * * The number of device count is returned through @p device_count - * if @p device_handles is NULL. Then the number of @p device_count can be pass - * as input to retrieval all devices on the socket to @p device_handles. + * if @p processor_handles is NULL. Then the number of @p device_count can be pass + * as input to retrieval all devices on the socket to @p processor_handles. * * @param[in] socket_handle The socket to query * * @param[in,out] device_count As input, the value passed * through this parameter is the number of ::amdsmi_processor_handle's that - * may be safely written to the memory pointed to by @p device_handles. This is the - * limit on how many device handles will be written to @p device_handles. On return, @p - * device_count will contain the number of device handles written to @p device_handles, + * may be safely written to the memory pointed to by @p processor_handles. This is the + * limit on how many device handles will be written to @p processor_handles. On return, @p + * device_count will contain the number of device handles written to @p processor_handles, * or the number of device handles that could have been written if enough memory had been * provided. - * If @p device_handles is NULL, as output, @p device_count will contain + * If @p processor_handles is NULL, as output, @p device_count will contain * how many devices are available to read for the socket. * - * @param[in,out] device_handles A pointer to a block of memory to which the + * @param[in,out] processor_handles A pointer to a block of memory to which the * ::amdsmi_processor_handle values will be written. This value may be NULL. * In this case, this function can be used to query how many devices are * available to read. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, +amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, uint32_t *device_count, - amdsmi_processor_handle* device_handles); + amdsmi_processor_handle* processor_handles); /** - * @brief Get the device type of the device_handle + * @brief Get the device type of the processor_handle * - * @details This function retrieves the device type. A device_handle must be provided + * @details This function retrieves the device type. A processor_handle must be provided * for that device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[out] device_type a pointer to device_type_t to which the device type * will be written. If this parameter is nullptr, this function will return @@ -1269,7 +1269,7 @@ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle processor_handle, device_type_t* device_type); /** @@ -1280,11 +1280,11 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle, * * @param[in] bdf The bdf to match with corresponding device handle. * - * @param[out] device_handle device handle with the matching bdf. + * @param[out] processor_handle device handle with the matching bdf. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle* device_handle); +amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle* processor_handle); /** @} End DiscQueries */ @@ -1298,7 +1298,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_proce * @brief Get the device id associated with the device with provided device * handler. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p id, + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p id, * this function will write the device id value to the uint64_t pointed to by * @p id. This ID is an identification of the type of device, so calling this * function for different devices will give the same value if they are kind @@ -1306,7 +1306,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_proce * one device from another. amdsmi_dev_get_pci_id() should be used to get a * unique identifier. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] id a pointer to uint64_t to which the device id will be * written @@ -1317,12 +1317,12 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_proce * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_t *id); +amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, uint16_t *id); /** * @brief Get the name string for a give vendor ID * - * @details Given a device handle @p device_handle, a pointer to a caller provided + * @details Given a device handle @p processor_handle, a pointer to a caller provided * char buffer @p name, and a length of this buffer @p len, this function will * write the name of the vendor (up to @p len characters) buffer @p name. The * @p id may be a device vendor or subsystem vendor ID. @@ -1333,7 +1333,7 @@ amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_ * as a string. Updating the system name files can be accompplished with * "sudo update-pciids". * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] name a pointer to a caller provided char buffer to which the * name will be written @@ -1350,14 +1350,14 @@ amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle device_handle, char *name, +amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle processor_handle, char *name, size_t len); /** * @brief Get the vram vendor string of a device. * * @details This function retrieves the vram vendor name given a device handle - * @p device_handle, a pointer to a caller provided + * @p processor_handle, a pointer to a caller provided * char buffer @p brand, and a length of this buffer @p len, this function * will write the vram vendor of the device (up to @p len characters) to the * buffer @p brand. @@ -1366,7 +1366,7 @@ amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle device_handle * contained within amdsmi_dev_get_vram_vendor, then this function will return * the string 'unknown' instead of the vram vendor. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] brand a pointer to a caller provided char buffer to which the * vram vendor will be written @@ -1375,18 +1375,18 @@ amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle device_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle, char *brand, +amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len); /** * @brief Get the subsystem device id associated with the device with * provided device handle. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p id, + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p id, * this function will write the subsystem device id value to the uint64_t * pointed to by @p id. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] id a pointer to uint64_t to which the subsystem device id * will be written @@ -1397,12 +1397,12 @@ amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handle, uint16_t *id); +amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id); /** * @brief Get the name string for the device subsytem * - * @details Given a device handle @p device_handle, a pointer to a caller provided + * @details Given a device handle @p processor_handle, a pointer to a caller provided * char buffer @p name, and a length of this buffer @p len, this function * will write the name of the device subsystem (up to @p len characters) * to the buffer @p name. @@ -1413,7 +1413,7 @@ amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handl * ID as a string. Updating the system name files can be accompplished with * "sudo update-pciids". * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] name a pointer to a caller provided char buffer to which the * name will be written @@ -1431,15 +1431,15 @@ amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handl * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_subsystem_name(amdsmi_processor_handle device_handle, char *name, size_t len); +amdsmi_dev_get_subsystem_name(amdsmi_processor_handle processor_handle, char *name, size_t len); /** * @brief Get the drm minor number associated with this device * - * @details Given a device handle @p device_handle, find its render device file + * @details Given a device handle @p processor_handle, find its render device file * /dev/dri/renderDN where N corresponds to its minor number. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] minor a pointer to a uint32_t into which minor number will * be copied @@ -1447,7 +1447,7 @@ amdsmi_dev_get_subsystem_name(amdsmi_processor_handle device_handle, char *name, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle device_handle, uint32_t *minor); +amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle processor_handle, uint32_t *minor); /** @} End IDQuer */ @@ -1460,12 +1460,12 @@ amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle device_handle, uint32_t /** * @brief Get the list of possible PCIe bandwidths that are available. * - * @details Given a device handle @p device_handle and a pointer to a to an + * @details Given a device handle @p processor_handle and a pointer to a to an * ::amdsmi_pcie_bandwidth_t structure @p bandwidth, this function will fill in * @p bandwidth with the possible T/s values and associated number of lanes, * and indication of the current selection. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] bandwidth a pointer to a caller provided * ::amdsmi_pcie_bandwidth_t structure to which the frequency information will be @@ -1474,14 +1474,14 @@ amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle device_handle, uint32_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_bandwidth_t *bandwidth); +amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth); /** * @brief Get the unique PCI device identifier associated for a device * - * @details Give a device handle @p device_handle and a pointer to a uint64_t @p + * @details Give a device handle @p processor_handle and a pointer to a uint64_t @p * bdfid, this function will write the Bus/Device/Function PCI identifier - * (BDFID) associated with device @p device_handle to the value pointed to by + * (BDFID) associated with device @p processor_handle to the value pointed to by * @p bdfid. * * The format of @p bdfid will be as follows: @@ -1497,7 +1497,7 @@ amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_ * | Device | [ 7: 3] | * | Function | [ 2: 0] | * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] bdfid a pointer to uint64_t to which the device bdfid value * will be written @@ -1508,17 +1508,17 @@ amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle device_handle, uint64_t *bdfid); +amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid); /** * @brief Get the NUMA node associated with a device * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p * numa_node, this function will retrieve the NUMA node value associated - * with device @p device_handle and store the value at location pointed to by + * with device @p processor_handle and store the value at location pointed to by * @p numa_node. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] numa_node pointer to location where NUMA node value will * be written. @@ -1529,18 +1529,18 @@ amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle device_handle, uin * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle device_handle, uint32_t *numa_node); +amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle processor_handle, uint32_t *numa_node); /** * @brief Get PCIe traffic information * - * @details Give a device handle @p device_handle and pointers to a uint64_t's, @p + * @details Give a device handle @p processor_handle and pointers to a uint64_t's, @p * sent, @p received and @p max_pkt_sz, this function will write the number * of bytes sent and received in 1 second to @p sent and @p received, * respectively. The maximum possible packet size will be written to * @p max_pkt_sz. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] sent a pointer to uint64_t to which the number of bytes sent * will be written in 1 second. If pointer is NULL, it will be ignored. @@ -1553,18 +1553,18 @@ amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle device_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle device_handle, uint64_t *sent, +amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz); /** * @brief Get PCIe replay counter * - * @details Given a device handle @p device_handle and a pointer to a uint64_t @p + * @details Given a device handle @p processor_handle and a pointer to a uint64_t @p * counter, this function will write the sum of the number of NAK's received * by the GPU and the NAK's generated by the GPU to memory pointed to by @p * counter. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] counter a pointer to uint64_t to which the sum of the NAK's * received and generated by the GPU is written @@ -1575,7 +1575,7 @@ amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle device_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle processor_handle, uint64_t *counter); /** @} End PCIeQuer */ @@ -1589,7 +1589,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle devic /** * @brief Control the set of allowed PCIe bandwidths that can be used. * - * @details Given a device handle @p device_handle and a 64 bit bitmask @p bw_bitmask, + * @details Given a device handle @p processor_handle and a 64 bit bitmask @p bw_bitmask, * this function will limit the set of allowable bandwidths. If a bit in @p * bw_bitmask has a value of 1, then the frequency (as ordered in an * ::amdsmi_frequencies_t returned by :: amdsmi_dev_get_gpu_clk_freq()) corresponding @@ -1606,7 +1606,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle devic * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] bw_bitmask A bitmask indicating the indices of the * bandwidths that are to be enabled (1) and disabled (0). Only the lowest @@ -1615,7 +1615,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle devic * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_handle, uint64_t bw_bitmask); +amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask); /** @} End PCIeCont */ @@ -1630,9 +1630,9 @@ amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_han * * @details This function will write the current average power consumption * (in microwatts) to the uint64_t pointed to by @p power, for the given - * device handle @p device_handle and a pointer to a uint64_t @p power + * device handle @p processor_handle and a pointer to a uint64_t @p power * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1647,20 +1647,20 @@ amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_han * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t *power); +amdsmi_dev_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 * device handle. * - * @details Given a device handle @p device_handle, a pointer to a uint64_t + * @details Given a device handle @p processor_handle, a pointer to a uint64_t * @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 * accumulates all energy consumed. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * @param[in,out] counter_resolution resolution of the counter @p power in * micro Joules * @@ -1677,7 +1677,7 @@ amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, uint32_t sensor_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *power, +amdsmi_dev_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp); /** @} End PowerQuer */ @@ -1694,7 +1694,7 @@ amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *pow * @p cap must be between the minimum and maximum power cap values set by the * system, which can be obtained from ::amdsmi_dev_power_cap_range_get. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1705,17 +1705,17 @@ amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *pow * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t cap); + amdsmi_dev_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap); /** * @brief Set the power performance profile * * @details This function will attempt to set the current profile to the provided - * profile, given a device handle @p device_handle and a @p profile. The provided + * profile, given a device handle @p processor_handle and a @p profile. The provided * profile must be one of the currently supported profiles, as indicated by a * call to :: amdsmi_dev_get_power_profile_presets() * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] reserved Not currently used. Set to 0. * @@ -1725,7 +1725,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_processor_handle device_handle, uint32_t reserved, + amdsmi_dev_set_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile); /** @} End PowerCont*/ @@ -1739,11 +1739,11 @@ amdsmi_status_t /** * @brief Get the total amount of memory that exists * - * @details Given a device handle @p device_handle, a type of memory @p mem_type, and + * @details Given a device handle @p processor_handle, a type of memory @p mem_type, and * a pointer to a uint64_t @p total, this function will write the total amount * of @p mem_type memory that exists to the location pointed to by @p total. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] mem_type The type of memory for which the total amount will be * found @@ -1758,7 +1758,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, +amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total); /** @@ -1767,7 +1767,7 @@ amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory * @details This function will write the amount of @p mem_type memory that * that is currently being used to the location pointed to by @p used. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] mem_type The type of memory for which the amount being used will * be found @@ -1782,17 +1782,17 @@ amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, +amdsmi_dev_get_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used); /** * @brief The first call to this API returns the number of bad pages which * should be used to allocate the buffer that should contain the bad page * records. - * @details This call will query the device @p device_handle for the + * @details This call will query the device @p processor_handle for the * number of bad pages (written to @p num_pages address). The results are * written to address held by the @p info pointer. - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * @param[out] num_pages Number of bad page records. * @param[out] info The results will be written to the * amdsmi_retired_page_record_t pointer. @@ -1800,16 +1800,16 @@ amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, amdsmi_memory * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); +amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); /** * @brief Returns if RAS features are enabled or disabled for given block * - * @details Given a device handle @p device_handle, this function queries the + * @details Given a device handle @p processor_handle, this function queries the * state of RAS features for a specific block @p block. Result will be written * to address held by pointer @p state. * - * @param[in] device_handle Device handle which to query + * @param[in] processor_handle Device handle which to query * * @param[in] block Block which to query * @@ -1823,17 +1823,17 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pa * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, +amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** * @brief Get percentage of time any device memory is being used * - * @details Given a device handle @p device_handle, this function returns the + * @details Given a device handle @p processor_handle, this function returns the * percentage of time that any device memory is being used for the specified * device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] busy_percent a pointer to the uint32_t to which the busy * percent will be written @@ -1845,18 +1845,18 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amd * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle device_handle, uint32_t *busy_percent); +amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); /** * @brief Get information about reserved ("retired") memory pages * - * @details Given a device handle @p device_handle, this function returns retired page + * @details Given a device handle @p processor_handle, this function returns retired page * information @p records corresponding to the device with the provided device - * handle @p device_handle. The number of retired page records is returned through @p + * handle @p processor_handle. The number of retired page records is returned through @p * num_pages. @p records may be NULL on input. In this case, the number of * records available for retrieval will be returned through @p num_pages. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] num_pages a pointer to a uint32. As input, the value passed * through this parameter is the number of ::amdsmi_retired_page_record_t's that @@ -1878,7 +1878,7 @@ amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle device_handle, uint32 * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint32_t *num_pages, +amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records); /** @} End MemQuer */ @@ -1893,11 +1893,11 @@ amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint * @brief Get the fan speed in RPMs of the device with the specified device * handle and 0-based sensor index. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t + * @details Given a device handle @p processor_handle and a pointer to a uint32_t * @p speed, this function will write the current fan speed in RPMs to the * uint32_t pointed to by @p speed * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1911,19 +1911,19 @@ amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, uint32_t sensor_ind, +amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed); /** * @brief Get the fan speed for the specified device as a value relative to * ::AMDSMI_MAX_FAN_SPEED * - * @details Given a device handle @p device_handle and a pointer to a uint32_t + * @details Given a device handle @p processor_handle and a pointer to a uint32_t * @p speed, this function will write the current fan speed (a value * between 0 and the maximum fan speed, ::AMDSMI_MAX_FAN_SPEED) to the uint32_t * pointed to by @p speed * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1937,17 +1937,17 @@ amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, u * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed); /** * @brief Get the max. fan speed of the device with provided device handle. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t + * @details Given a device handle @p processor_handle and a pointer to a uint32_t * @p max_speed, this function will write the maximum fan speed possible to * the uint32_t pointed to by @p max_speed * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1961,19 +1961,19 @@ amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *max_speed); /** * @brief Get the temperature metric value for the specified metric, from the * specified temperature sensor on the specified device. * - * @details Given a device handle @p device_handle, a sensor type @p sensor_type, a + * @details Given a device handle @p processor_handle, a sensor type @p sensor_type, a * ::amdsmi_temperature_metric_t @p metric and a pointer to an int64_t @p * temperature, this function will write the value of the metric indicated by * @p metric and @p sensor_type to the memory location @p temperature. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_type part of device from which temperature should be * obtained. This should come from the enum ::amdsmi_temperature_type_t @@ -1990,7 +1990,7 @@ amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle processor_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature); @@ -1998,12 +1998,12 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handl * @brief Get the voltage metric value for the specified metric, from the * specified voltage sensor on the specified device. * - * @details Given a device handle @p device_handle, a sensor type @p sensor_type, a + * @details Given a device handle @p processor_handle, a sensor type @p sensor_type, a * ::amdsmi_voltage_metric_t @p metric and a pointer to an int64_t @p * voltage, this function will write the value of the metric indicated by * @p metric and @p sensor_type to the memory location @p voltage. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_type part of device from which voltage should be * obtained. This should come from the enum ::amdsmi_voltage_type_t @@ -2020,7 +2020,7 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle processor_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage); @@ -2037,27 +2037,27 @@ amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handl * * @details This function returns control of the fan to the system * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, uint32_t sensor_ind); +amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind); /** * @brief Set the fan speed for the specified device with the provided speed, * in RPMs. * - * @details Given a device handle @p device_handle and a integer value indicating + * @details Given a device handle @p processor_handle and a integer value indicating * speed @p speed, this function will attempt to set the fan speed to @p speed. * An error will be returned if the specified speed is outside the allowable * range for the device. The maximum value is 255 and the minimum is 0. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -2066,7 +2066,7 @@ amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, uint * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t speed); /** @} End PhysCont */ @@ -2081,12 +2081,12 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, /** * @brief Get percentage of time device is busy doing any processing * - * @details Given a device handle @p device_handle, this function returns the + * @details Given a device handle @p processor_handle, this function returns the * percentage of time that the specified device is busy. The device is * considered busy if any one or more of its sub-blocks are working, and idle * if none of the sub-blocks are working. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] busy_percent a pointer to the uint32_t to which the busy * percent will be written @@ -2098,19 +2098,19 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, uint32_t *busy_percent); +amdsmi_dev_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); /** * @brief Get coarse grain utilization counter of the specified device * - * @details Given a device handle @p device_handle, the array of the utilization counters, + * @details Given a device handle @p processor_handle, the array of the utilization counters, * the size of the array, this function returns the coarse grain utilization counters * and timestamp. * The counter is the accumulated percentages. Every milliseconds the firmware calculates * % busy count and then accumulates that value in the counter. This provides minimally * invasive coarse grain GPU usage information. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] utilization_counters Multiple utilization counters can be retreived with a single * call. The caller must allocate enough space to the utilization_counters array. The caller also @@ -2125,7 +2125,7 @@ amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, uint32_t *bus * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, +amdsmi_get_utilization_count(amdsmi_processor_handle processor_handle, amdsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp); @@ -2133,39 +2133,39 @@ amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, /** * @brief Get current PCIE info of the device with provided device handle. * - * @details Given a device handle @p device_handle, this function returns PCIE info of the + * @details Given a device handle @p processor_handle, this function returns PCIE info of the * given device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[out] info amdsmi_pcie_info_t struct which will hold all the extracted PCIE info data. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info); +amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info); /** * @brief Get max PCIe capabilities of the device with provided device handle. * - * @details Given a device handle @p device_handle, this function returns PCIe caps info of the + * @details Given a device handle @p processor_handle, this function returns PCIe caps info of the * given device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[out] info amdsmi_pcie_info_t struct which will hold all the extracted PCIe caps data. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info); +amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info); /** * @brief Get the performance level of the device * * @details This function will write the ::amdsmi_dev_perf_level_t to the uint32_t - * pointed to by @p perf, for a given device handle @p device_handle and a pointer + * pointed to by @p perf, for a given device handle @p processor_handle and a pointer * to a uint32_t @p perf. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] perf a pointer to ::amdsmi_dev_perf_level_t to which the * performance level will be written @@ -2176,13 +2176,13 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t *perf); /** * @brief Enter performance determinism mode with provided device handle. * - * @details Given a device handle @p device_handle and @p clkvalue this function + * @details Given a device handle @p processor_handle and @p clkvalue this function * will enable performance determinism mode, which enforces a GFXCLK frequency * SoftMax limit per GPU set by the user. This prevents the GFXCLK PLL from * stretching when running the same workload on different GPUS, making @@ -2190,24 +2190,24 @@ amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, * level ::amdsmi_dev_perf_level_t of the device being * ::AMDSMI_DEV_PERF_LEVEL_DETERMINISM. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] clkvalue Softmax value for GFXCLK in MHz. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_set_perf_determinism_mode(amdsmi_processor_handle device_handle, uint64_t clkvalue); +amdsmi_set_perf_determinism_mode(amdsmi_processor_handle processor_handle, uint64_t clkvalue); /** * @brief Get the overdrive percent associated with the device with provided * device handle. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p od, + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p od, * this function will write the overdrive percentage to the uint32_t pointed * to by @p od * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] od a pointer to uint32_t to which the overdrive percentage * will be written @@ -2219,18 +2219,18 @@ amdsmi_set_perf_determinism_mode(amdsmi_processor_handle device_handle, uint64_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle device_handle, uint32_t *od); +amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t *od); /** * @brief Get the list of possible system clock speeds of device for a * specified clock type. * - * @details Given a device handle @p device_handle, a clock type @p clk_type, and a + * @details Given a device handle @p processor_handle, a clock type @p clk_type, and a * pointer to a to an ::amdsmi_frequencies_t structure @p f, this function will * fill in @p f with the possible clock speeds, and indication of the current * clock speed selection. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] clk_type the type of clock for which the frequency is desired * @@ -2240,28 +2240,28 @@ amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle device_ha * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f); /** * @brief Reset the gpu associated with the device with provided device handle * - * @details Given a device handle @p device_handle, this function will reset the GPU + * @details Given a device handle @p processor_handle, this function will reset the GPU * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle); +amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle processor_handle); /** * @brief This function retrieves the voltage/frequency curve information * - * @details Given a device handle @p device_handle and a pointer to a + * @details Given a device handle @p processor_handle and a pointer to a * ::amdsmi_od_volt_freq_data_t structure @p odv, this function will populate @p * odv. See ::amdsmi_od_volt_freq_data_t for more details. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] odv a pointer to an ::amdsmi_od_volt_freq_data_t structure * If this parameter is nullptr, this function will return @@ -2271,17 +2271,17 @@ amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle); * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_handle, amdsmi_od_volt_freq_data_t *odv); /** * @brief This function retrieves the gpu metrics information * - * @details Given a device handle @p device_handle and a pointer to a + * @details Given a device handle @p processor_handle and a pointer to a * ::amdsmi_gpu_metrics_t structure @p pgpu_metrics, this function will populate * @p pgpu_metrics. See ::amdsmi_gpu_metrics_t for more details. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] pgpu_metrics a pointer to an ::amdsmi_gpu_metrics_t structure * If this parameter is nullptr, this function will return @@ -2291,17 +2291,17 @@ amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_metrics_t *pgpu_metrics); /** * @brief This function sets the clock range information * - * @details Given a device handle @p device_handle, a minimum clock value @p minclkvalue, + * @details Given a device handle @p processor_handle, a minimum clock value @p minclkvalue, * a maximum clock value @p maxclkvalue and a clock type @p clkType this function * will set the sclk|mclk range * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] minclkvalue value to apply to the clock range. Frequency values * are in MHz. @@ -2313,18 +2313,18 @@ amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle device_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, uint64_t minclkvalue, +amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType); /** * @brief This function sets the clock frequency information * - * @details Given a device handle @p device_handle, a frequency level @p level, + * @details Given a device handle @p processor_handle, a frequency level @p level, * a clock value @p clkvalue and a clock type @p clkType this function * will set the sclk|mclk range * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] level AMDSMI_FREQ_IND_MIN|AMDSMI_FREQ_IND_MAX to set the * minimum (0) or maximum (1) speed. @@ -2336,17 +2336,17 @@ amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handle, amdsmi_freq_ind_t level, +amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType); /** * @brief This function sets 1 of the 3 voltage curve points. * - * @details Given a device handle @p device_handle, a voltage point @p vpoint + * @details Given a device handle @p processor_handle, a voltage point @p vpoint * and a voltage value @p voltvalue this function will set voltage curve point * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] vpoint voltage point [0|1|2] on the voltage curve * @@ -2358,14 +2358,14 @@ amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_handle, uint32_t vpoint, +amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue); /** * @brief This function will retrieve the current valid regions in the * frequency/voltage space. * - * @details Given a device handle @p device_handle, a pointer to an unsigned integer + * @details Given a device handle @p processor_handle, a pointer to an unsigned integer * @p num_regions and a buffer of ::amdsmi_freq_volt_region_t structures, @p * buffer, this function will populate @p buffer with the current * frequency-volt space regions. The caller should assign @p buffer to memory @@ -2376,7 +2376,7 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_hand * The number of regions to expect this function provide (@p num_regions) can * be obtained by calling :: amdsmi_dev_get_od_volt_info(). * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] num_regions As input, this is the number of * ::amdsmi_freq_volt_region_t structures that can be written to @p buffer. As @@ -2396,14 +2396,14 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle processor_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer); /** * @brief Get the list of available preset power profiles and an indication of * which profile is currently active. * - * @details Given a device handle @p device_handle and a pointer to a + * @details Given a device handle @p processor_handle and a pointer to a * ::amdsmi_power_profile_status_t @p status, this function will set the bits of * the ::amdsmi_power_profile_status_t.available_profiles bit field of @p status to * 1 if the profile corresponding to the respective @@ -2416,7 +2416,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle de * ::amdsmi_power_profile_status_t.current will be set to the * ::amdsmi_power_profile_preset_masks_t of the profile that is currently active. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -2431,7 +2431,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle de * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle device_handle, uint32_t sensor_ind, + amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status); /** @} End PerfQuer */ @@ -2450,39 +2450,39 @@ amdsmi_status_t * @deprecated :: amdsmi_dev_set_perf_level_v1() is preferred, with an * interface that more closely matches the rest of the amd_smi API. * - * @details Given a device handle @p device_handle and an ::amdsmi_dev_perf_level_t @p + * @details Given a device handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p * perf_level, this function will set the PowerPlay performance level for the * device to the value @p perf_lvl. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] perf_lvl the value to which the performance level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_dev_set_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the PowerPlay performance level associated with the device with * provided device handle with the provided value. * - * @details Given a device handle @p device_handle and an ::amdsmi_dev_perf_level_t @p + * @details Given a device handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p * perf_level, this function will set the PowerPlay performance level for the * device to the value @p perf_lvl. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] perf_lvl the value to which the performance level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the overdrive percent associated with the device with provided @@ -2492,7 +2492,7 @@ amdsmi_status_t * has the same functionaltiy, with an interface that more closely * matches the rest of the amd_smi API. * - * @details Given a device handle @p device_handle and an overdrive level @p od, + * @details Given a device handle @p processor_handle and an overdrive level @p od, * this function will set the overdrive level for the device to the value * @p od. The overdrive level is an integer value between 0 and 20, inclusive, * which represents the overdrive percentage; e.g., a value of 5 specifies @@ -2517,19 +2517,19 @@ amdsmi_status_t * WARRANTY AND MAY NOT BE COVERED BY YOUR BOARD OR SYSTEM MANUFACTURER'S * WARRANTY. Please use this utility with caution. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] od the value to which the overdrive level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle device_handle, uint32_t od); +amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t od); /** * @brief Set the overdrive percent associated with the device with provided * device handle with the provided value. See details for WARNING. * - * @details Given a device handle @p device_handle and an overdrive level @p od, + * @details Given a device handle @p processor_handle and an overdrive level @p od, * this function will set the overdrive level for the device to the value * @p od. The overdrive level is an integer value between 0 and 20, inclusive, * which represents the overdrive percentage; e.g., a value of 5 specifies @@ -2556,19 +2556,19 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle device_h * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] od the value to which the overdrive level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle device_handle, uint32_t od); +amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle processor_handle, uint32_t od); /** * @brief Control the set of allowed frequencies that can be used for the * specified clock. * - * @details Given a device handle @p device_handle, a clock type @p clk_type, and a + * @details Given a device handle @p processor_handle, a clock type @p clk_type, and a * 64 bit bitmask @p freq_bitmask, this function will limit the set of * allowable frequencies. If a bit in @p freq_bitmask has a value of 1, then * the frequency (as ordered in an ::amdsmi_frequencies_t returned by @@ -2585,7 +2585,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle devic * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] clk_type the type of clock for which the set of frequencies * will be modified @@ -2596,7 +2596,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle devic * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask); /** @} End PerfCont */ @@ -2661,12 +2661,12 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, /** * @brief Retrieve the error counts for a GPU block * - * @details Given a device handle @p device_handle, an ::amdsmi_gpu_block_t @p block and a + * @details Given a device handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and a * pointer to an ::amdsmi_error_count_t @p ec, this function will write the error * count values for the GPU block indicated by @p block to memory pointed to by * @p ec. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] block The block for which error counts should be retrieved * @@ -2679,13 +2679,13 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec); /** * @brief Retrieve the enabled ECC bit-mask * - * @details Given a device handle @p device_handle, and a pointer to a uint64_t @p + * @details Given a device handle @p processor_handle, and a pointer to a uint64_t @p * enabled_mask, this function will write bits to memory pointed to by * @p enabled_blocks. Upon a successful call, @p enabled_blocks can then be * AND'd with elements of the ::amdsmi_gpu_block_t ennumeration to determine if @@ -2695,7 +2695,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, * but there may not be kernel support for reading error counters for that * block. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] enabled_blocks A pointer to a uint64_t to which the enabled * blocks bits will be written. @@ -2706,18 +2706,18 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks); /** * @brief Retrieve the ECC status for a GPU block * - * @details Given a device handle @p device_handle, an ::amdsmi_gpu_block_t @p block and + * @details Given a device handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and * a pointer to an ::amdsmi_ras_err_state_t @p state, this function will write * the current state for the GPU block indicated by @p block to memory pointed * to by @p state. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] block The block for which error counts should be retrieved * @@ -2730,7 +2730,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, +amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** @@ -2856,11 +2856,11 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); /** * @brief Tell if an event group is supported by a given device * - * @details Given a device handle @p device_handle and an event group specifier @p + * @details Given a device handle @p processor_handle and an event group specifier @p * group, tell if @p group type events are supported by the device associated - * with @p device_handle + * with @p processor_handle * - * @param[in] device_handle device handle of device being queried + * @param[in] processor_handle device handle of device being queried * * @param[in] group ::amdsmi_event_group_t identifier of group for which support * is being queried @@ -2868,20 +2868,20 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_counter_group_supported(amdsmi_processor_handle device_handle, amdsmi_event_group_t group); +amdsmi_dev_counter_group_supported(amdsmi_processor_handle processor_handle, amdsmi_event_group_t group); /** * @brief Create a performance counter object * * @details Create a performance counter object of type @p type for the device - * with a device handle of @p device_handle, and write a handle to the object to the + * with a device handle of @p processor_handle, and write a handle to the object to the * memory location pointed to by @p evnt_handle. @p evnt_handle can be used * with other performance event operations. The handle should be deallocated * with ::amdsmi_dev_destroy_counter() when no longer needed. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] type the ::amdsmi_event_type_t of performance event to create * @@ -2895,7 +2895,7 @@ amdsmi_dev_counter_group_supported(amdsmi_processor_handle device_handle, amdsmi * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_create_counter(amdsmi_processor_handle device_handle, amdsmi_event_type_t type, +amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle); /** @@ -2956,12 +2956,12 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, /** * @brief Get the number of currently available counters * - * @details Given a device handle @p device_handle, a performance event group @p grp, + * @details Given a device handle @p processor_handle, a performance event group @p grp, * and a pointer to a uint32_t @p available, this function will write the * number of @p grp type counters that are available on the device with handle - * @p device_handle to the memory that @p available points to. + * @p processor_handle to the memory that @p available points to. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] grp an event device group * @@ -2971,7 +2971,7 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_processor_handle device_handle, + amdsmi_counter_get_available_counters(amdsmi_processor_handle processor_handle, amdsmi_event_group_t grp, uint32_t *available); /** @} End PerfCntr */ @@ -3036,14 +3036,14 @@ amdsmi_get_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t *proc * @brief Get the device indices currently being used by a process * * @details Given a process id @p pid, a non-NULL pointer to an array of - * uint32_t's @p device_handleices of length *@p num_devices, this function will + * uint32_t's @p processor_handleices of length *@p num_devices, this function will * write up to @p num_devices device indices to the memory pointed to by - * @p device_handleices. If @p device_handleices is not NULL, @p num_devices will be + * @p processor_handleices. If @p processor_handleices is not NULL, @p num_devices will be * updated with the number of gpu's currently being used by process @p pid. - * If @p device_handleices is NULL, @p device_handleices will be updated with the number of + * If @p processor_handleices is NULL, @p processor_handleices will be updated with the number of * gpus currently being used by @p pid. Calling this function with @p * dv_indices being NULL is a way to determine how much memory is required - * for when @p device_handleices is not NULL. + * for when @p processor_handleices is not NULL. * * @param[in] pid The process id of the process for which the number of gpus * currently being used is requested @@ -3055,8 +3055,8 @@ amdsmi_get_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t *proc * * @param[in,out] num_devices A pointer to a uint32_t, which on input, should * contain the amount of memory in uint32_t's which have been provided by the - * @p device_handleices argument. On output, if @p device_handleices is non-NULL, this will - * be updated with the number uint32_t's actually written. If @p device_handleices is + * @p processor_handleices argument. On output, if @p processor_handleices is non-NULL, this will + * be updated with the number uint32_t's actually written. If @p processor_handleices is * NULL, this argument will be updated with the number devices being used. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail @@ -3076,12 +3076,12 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, /** * @brief Retrieve the XGMI error status for a device * - * @details Given a device handle @p device_handle, and a pointer to an + * @details Given a device handle @p processor_handle, and a pointer to an * ::amdsmi_xgmi_status_t @p status, this function will write the current XGMI - * error state ::amdsmi_xgmi_status_t for the device @p device_handle to the memory + * error state ::amdsmi_xgmi_status_t for the device @p processor_handle to the memory * pointed to by @p status. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] status A pointer to an ::amdsmi_xgmi_status_t to which the * XGMI error state should be written @@ -3093,21 +3093,21 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_processor_handle device_handle, amdsmi_xgmi_status_t *status); +amdsmi_dev_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status); /** * @brief Reset the XGMI error status for a device * - * @details Given a device handle @p device_handle, this function will reset the - * current XGMI error state ::amdsmi_xgmi_status_t for the device @p device_handle to + * @details Given a device handle @p processor_handle, this function will reset the + * current XGMI error state ::amdsmi_xgmi_status_t for the device @p processor_handle to * amdsmi_xgmi_status_t::AMDSMI_XGMI_STATUS_NO_ERRORS * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle); +amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle processor_handle); /** @} End SysInfo */ @@ -3120,12 +3120,12 @@ amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle); /** * @brief Retrieve the NUMA CPU node number for a device * - * @details Given a device handle @p device_handle, and a pointer to an + * @details Given a device handle @p processor_handle, and a pointer to an * uint32_t @p numa_node, this function will write the - * node number of NUMA CPU for the device @p device_handle to the memory + * node number of NUMA CPU for the device @p processor_handle to the memory * pointed to by @p numa_node. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] numa_node A pointer to an uint32_t to which the * numa node number should be written. @@ -3133,20 +3133,20 @@ amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t *numa_node); +amdsmi_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint32_t *numa_node); /** * @brief Retrieve the weight for a connection between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, and a pointer to an + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, and a pointer to an * uint64_t @p weight, this function will write the - * weight for the connection between the device @p device_handle_src - * and @p device_handle_dst to the memory pointed to by @p weight. + * weight for the connection between the device @p processor_handle_src + * and @p processor_handle_dst to the memory pointed to by @p weight. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] weight A pointer to an uint64_t to which the * weight for the connection should be written. @@ -3154,21 +3154,21 @@ amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *weight); /** * @brief Retreive minimal and maximal io link bandwidth between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, pointer to an + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, pointer to an * uint64_t @p min_bandwidth, and a pointer to uint64_t @p max_bandiwidth, * this function will write theoretical minimal and maximal bandwidth limits. * API works if src and dst are connected via xgmi and have 1 hop distance. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] min_bandwidth A pointer to an uint64_t to which the * minimal bandwidth for the connection should be written. @@ -3179,22 +3179,22 @@ amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_pr * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_get_minmax_bandwidth(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, + amdsmi_get_minmax_bandwidth(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth); /** * @brief Retrieve the hops and the connection type between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, and a pointer to an + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, and a pointer to an * uint64_t @p hops and a pointer to an AMDSMI_IO_LINK_TYPE @p type, * this function will write the number of hops and the connection type - * between the device @p device_handle_src and @p device_handle_dst to the memory + * between the device @p processor_handle_src and @p processor_handle_dst to the memory * pointed to by @p hops and @p type. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] hops A pointer to an uint64_t to which the * hops for the connection should be written. @@ -3205,22 +3205,22 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, - amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_type(amdsmi_processor_handle processor_handle_src, + amdsmi_processor_handle processor_handle_dst, uint64_t *hops, AMDSMI_IO_LINK_TYPE *type); /** * @brief Return P2P availability status between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, and a pointer to a + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, and a pointer to a * bool @p accessible, this function will write the P2P connection status - * between the device @p device_handle_src and @p device_handle_dst to the memory + * between the device @p processor_handle_src and @p processor_handle_dst to the memory * pointed to by @p accessible. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] accessible A pointer to a bool to which the status for * the P2P connection availablity should be written. @@ -3228,7 +3228,7 @@ amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, bool *accessible); /** @} End HWTopo */ @@ -3279,7 +3279,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_proce * amdsmi_status_t err; * amdsmi_processor_handle device; * - * // Get the device handle via amdsmi_get_device_handles() + * // Get the device handle via amdsmi_get_processor_handles() * // ... ... * * std::cout << "Supported AMDSMI Functions:" << std::endl; * @@ -3347,17 +3347,17 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_proce /** * @brief Get a function name iterator of supported AMDSMI functions for a device * - * @details Given a device handle @p device_handle, this function will write a function + * @details Given a device handle @p processor_handle, this function will write a function * iterator handle to the caller-provided memory pointed to by @p handle. This * handle can be used to iterate through all the supported functions. * - * Note that although this function takes in @p device_handle as an argument, + * Note that although this function takes in @p processor_handle as an argument, * ::amdsmi_dev_open_supported_func_iterator itself will not be among the * functions listed as supported. This is because * ::amdsmi_dev_open_supported_func_iterator does not depend on hardware or * driver support and should always be supported. * - * @param[in] device_handle a device handle of device for which support information is + * @param[in] processor_handle a device handle of device for which support information is * requested * * @param[in,out] handle A pointer to caller-provided memory to which the @@ -3366,7 +3366,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_proce * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle device_handle, +amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle, amdsmi_func_id_iter_handle_t *handle); /** @@ -3461,27 +3461,27 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, * @brief Prepare to collect event notifications for a GPU * * @details This function prepares to collect events for the GPU with device - * ID @p device_handle, by initializing any required system parameters. This call + * ID @p processor_handle, by initializing any required system parameters. This call * may open files which will remain open until ::amdsmi_stop_event_notification() * is called. * - * @param device_handle a device handle corresponding to the device on which to + * @param processor_handle a device handle corresponding to the device on which to * listen for events * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_init_event_notification(amdsmi_processor_handle device_handle); +amdsmi_init_event_notification(amdsmi_processor_handle processor_handle); /** * @brief Specify which events to collect for a device * - * @details Given a device handle @p device_handle and a @p mask consisting of + * @details Given a device handle @p processor_handle and a @p mask consisting of * elements of ::amdsmi_evt_notification_type_t OR'd together, this function * will listen for the events specified in @p mask on the device - * corresponding to @p device_handle. + * corresponding to @p processor_handle. * - * @param device_handle a device handle corresponding to the device on which to + * @param processor_handle a device handle corresponding to the device on which to * listen for events * * @param mask Bitmask generated by OR'ing 1 or more elements of @@ -3500,7 +3500,7 @@ amdsmi_init_event_notification(amdsmi_processor_handle device_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_processor_handle device_handle, uint64_t mask); + amdsmi_set_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask); /** * @brief Collect event notifications, waiting a specified amount of time @@ -3546,35 +3546,35 @@ amdsmi_status_t * notification for a GPU * * @details Any resources used by event notification for the GPU with - * device handle @p device_handle will be free with this + * device handle @p processor_handle will be free with this * function. This includes freeing any memory and closing file handles. This * should be called for every call to ::amdsmi_init_event_notification() * - * @param[in] device_handle The device handle of the GPU for which event + * @param[in] processor_handle The device handle of the GPU for which event * notification resources will be free * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_stop_event_notification(amdsmi_processor_handle device_handle); +amdsmi_status_t amdsmi_stop_event_notification(amdsmi_processor_handle processor_handle); /** @} End EvntNotif */ /** * @brief Returns BDF of the given device * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] bdf Reference to BDF. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf); +amdsmi_get_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf); /** * @brief Returns the UUID of the device * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in,out] uuid_length Length of the uuid string. As input, must be * equal or greater than SMI_GPU_UUID_SIZE and be allocated by @@ -3586,7 +3586,7 @@ amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid_length, char *uuid); +amdsmi_get_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid); /*****************************************************************************/ /** @defgroup swversion SW Version Information @@ -3596,7 +3596,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid /** * @brief Returns the driver version information * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in,out] length As input parameter length of the user allocated * string buffer. As output parameter length of the returned @@ -3608,7 +3608,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, char *version); +amdsmi_get_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version); /** @} End swversion */ @@ -3624,7 +3624,7 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch * the family, the vendor ID, the subvendor ID, the device ID, * the revision ID and the serial number. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to static asic information structure. * Must be allocated by user. @@ -3632,12 +3632,12 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t *info); +amdsmi_get_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info); /** * @brief Returns the board part number and board information for the requested device * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to board info structure. * Must be allocated by user. @@ -3645,13 +3645,13 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t *info); +amdsmi_get_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *info); /** * @brief Returns the power caps as currently configured in the * system. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * @param[in] sensor_ind A 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. * @param[out] info Reference to power caps information structure. Must be @@ -3660,13 +3660,13 @@ amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, uint32_t sensor_ind, +amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info); /** * @brief Returns XGMI information for the GPU. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to xgmi information structure. Must be * allocated by user. @@ -3675,13 +3675,13 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, uint32_t sensor * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t *info); +amdsmi_get_xgmi_info(amdsmi_processor_handle processor_handle, amdsmi_xgmi_info_t *info); /** * @brief Returns the device capabilities as currently configured in * the system * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to caps information structure. Must be * allocated by user. @@ -3689,7 +3689,7 @@ amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amdsmi_gpu_caps_t *info); +amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_caps_t *info); /** @} End asicinfo */ @@ -3701,19 +3701,19 @@ amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amdsmi_gpu_caps_t *i /** * @brief Returns the firmware versions running on the device. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to the fw info. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_fw_info(amdsmi_processor_handle device_handle, amdsmi_fw_info_t *info); +amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *info); /** * @brief Returns the static information for the vBIOS on the device. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to static vBIOS information. * Must be allocated by user. @@ -3721,7 +3721,7 @@ amdsmi_get_fw_info(amdsmi_processor_handle device_handle, amdsmi_fw_info_t *info * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t *info); +amdsmi_get_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info); /** @} End fwinfo */ @@ -3734,34 +3734,34 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t * @brief Returns the current usage of the GPU engines (GFX, MM and MEM). * Each usage is reported as a percentage from 0-100%. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to the gpu engine usage structure. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usage_t *info); +amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_usage_t *info); /** * @brief Returns the current power and voltage of the GPU. * The voltage is in units of mV and the power in units of W. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to the gpu power structure. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_measure_t *info); +amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_measure_t *info); /** * @brief Returns the measurements of the clocks in the GPU * for the GFX and multimedia engines and Memory. This call * reports the averages over 1s in MHz. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in] clk_type Enum representing the clock type to query. * @@ -3771,13 +3771,13 @@ amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_mea * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info); +amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info); /** * @brief Returns the VRAM usage (both total and used memory) * in MegaBytes. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * * @param[out] info Reference to vram information. @@ -3786,7 +3786,7 @@ amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t *info); +amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info); /** @} End gpumon */ @@ -3799,7 +3799,7 @@ amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t * @brief Returns current and supported frequency range * for the specified clock type. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in] clk_type Clock type for which to get current and supported * frequency range. @@ -3810,7 +3810,7 @@ amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); +amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); /** @} End powermon */ @@ -3827,7 +3827,7 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ * sets max_processes to 0, the total number of processes will be * returned. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] list Reference to a user-provided buffer where the process * list will be returned. This buffer must contain at least @@ -3841,13 +3841,13 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes); +amdsmi_get_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes); /** * @brief Returns the process information of a given process. * Engine usage show how much time the process spend using these engines in ns. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in] process Handle of process to query. * @@ -3857,7 +3857,7 @@ amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_ha * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); +amdsmi_get_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); /** @} End processinfo */ @@ -3870,7 +3870,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha * @brief Returns the number of ECC errors (correctable and * uncorrectable) in the given GPU. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] ec Reference to ecc error count structure. * Must be allocated by user. @@ -3878,7 +3878,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_count_t *ec); +amdsmi_get_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec); /** @} End eccinfo */ diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h index 53fbf248d5..997d21aafe 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h @@ -69,11 +69,11 @@ class AMDSmiSystem { amdsmi_status_t handle_to_socket(amdsmi_socket_handle socket_handle, AMDSmiSocket** socket); - amdsmi_status_t handle_to_device(amdsmi_processor_handle device_handle, + amdsmi_status_t handle_to_device(amdsmi_processor_handle processor_handle, AMDSmiProcessor** device); amdsmi_status_t gpu_index_to_handle(uint32_t gpu_index, - amdsmi_processor_handle* device_handle); + amdsmi_processor_handle* processor_handle); private: AMDSmiSystem() : init_flag_(AMDSMI_INIT_AMD_GPUS) {} diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 75394dd900..573c460e89 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -47,7 +47,7 @@ in amdsmi-lib and `err_info` is a string that explains the error that occurred. Example: ```python try: - num_of_GPUs = len(amdsmi_get_device_handles()) + num_of_GPUs = len(amdsmi_get_processor_handles()) if num_of_GPUs == 0: print("No GPUs on machine") except AmdSmiException as e: @@ -115,27 +115,27 @@ Exceptions that can be thrown by `amdsmi_get_device_type` function: Example: ```python try: - type_of_GPU = amdsmi_get_device_type(device_handle) + type_of_GPU = amdsmi_get_device_type(processor_handle) if type_of_GPU == 1: print("This is an AMD GPU") except AmdSmiException as e: print(e) ``` -## amdsmi_get_device_handles +## amdsmi_get_processor_handles Description: Returns list of GPU device handle objects on current machine Input parameters: `None` Output: List of GPU device handle objects -Exceptions that can be thrown by `amdsmi_get_device_handles` function: +Exceptions that can be thrown by `amdsmi_get_processor_handles` function: * `AmdSmiLibraryException` Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -191,7 +191,7 @@ except AmdSmiException as e: ``` -## amdsmi_get_device_handle_from_bdf +## amdsmi_get_processor_handle_from_bdf Description: Returns device handle from the given BDF Input parameters: bdf string in form of either `::.` or `:.` in hexcode format. @@ -203,14 +203,14 @@ Where: Output: device handle object -Exceptions that can be thrown by `amdsmi_get_device_handle_from_bdf` function: +Exceptions that can be thrown by `amdsmi_get_processor_handle_from_bdf` function: * `AmdSmiLibraryException` * `AmdSmiBdfFormatException` Example: ```python try: - device = amdsmi_get_device_handle_from_bdf("0000:23:00.0") + device = amdsmi_get_processor_handle_from_bdf("0000:23:00.0") print(amdsmi_get_device_uuid(device)) except AmdSmiException as e: print(e) @@ -220,7 +220,7 @@ except AmdSmiException as e: Description: Returns BDF of the given device Input parameters: -* `device_handle` dev for which to query +* `processor_handle` dev for which to query Output: BDF string in form of `::.` in hexcode format. Where: @@ -236,7 +236,7 @@ Exceptions that can be thrown by `amdsmi_get_device_bdf` function: Example: ```python try: - device = amdsmi_get_device_handles()[0] + device = amdsmi_get_processor_handles()[0] print("Device's bdf:", amdsmi_get_device_bdf(device)) except AmdSmiException as e: print(e) @@ -246,7 +246,7 @@ except AmdSmiException as e: Description: Returns the UUID of the device Input parameters: -* `device_handle` dev for which to query +* `processor_handle` dev for which to query Output: UUID string unique to the device @@ -257,7 +257,7 @@ Exceptions that can be thrown by `amdsmi_get_device_uuid` function: Example: ```python try: - device = amdsmi_get_device_handles()[0] + device = amdsmi_get_processor_handles()[0] print("Device UUID: ", amdsmi_get_device_uuid(device)) except AmdSmiException as e: print(e) @@ -267,7 +267,7 @@ except AmdSmiException as e: Description: Returns the version string of the driver Input parameters: -* `device_handle` dev for which to query +* `processor_handle` dev for which to query Output: Driver version string that is handling the device @@ -278,7 +278,7 @@ Exceptions that can be thrown by `amdsmi_get_driver_version` function: Example: ```python try: - device = amdsmi_get_device_handles()[0] + device = amdsmi_get_processor_handles()[0] print("Driver version: ", amdsmi_get_driver_version(device)) except AmdSmiException as e: print(e) @@ -288,7 +288,7 @@ except AmdSmiException as e: Description: Returns asic information for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -309,7 +309,7 @@ Exceptions that can be thrown by `amdsmi_get_asic_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -329,7 +329,7 @@ Description: Returns dictionary of power capabilities as currently configured on the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -349,7 +349,7 @@ Exceptions that can be thrown by `amdsmi_get_power_cap_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -368,7 +368,7 @@ except AmdSmiException as e: Description: Returns capabilities as currently configured for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -388,7 +388,7 @@ Exceptions that can be thrown by `amdsmi_get_caps_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -409,7 +409,7 @@ except AmdSmiException as e: Description: Returns the static information for the VBIOS on the device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -429,7 +429,7 @@ Exceptions that can be thrown by `amdsmi_get_vbios_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -448,7 +448,7 @@ except AmdSmiException as e: Description: Returns GPU firmware related information. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -464,7 +464,7 @@ Exceptions that can be thrown by `amdsmi_get_fw_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -481,7 +481,7 @@ except AmdSmiException as e: Description: Returns the engine usage for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -499,7 +499,7 @@ Exceptions that can be thrown by `amdsmi_get_gpu_activity` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -515,7 +515,7 @@ except AmdSmiException as e: Description: Returns the current power and voltage for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -534,7 +534,7 @@ Exceptions that can be thrown by `amdsmi_get_power_measure` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -551,7 +551,7 @@ except AmdSmiException as e: Description: Returns total VRAM and VRAM in use Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -568,7 +568,7 @@ Exceptions that can be thrown by `amdsmi_get_vram_usage` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -583,7 +583,7 @@ except AmdSmiException as e: Description: Returns the clock measure for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `clock_type` one of `AmdSmiClkType` enum values: Field | Description @@ -617,7 +617,7 @@ Exceptions that can be thrown by `amdsmi_get_clock_measure` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -636,7 +636,7 @@ Description: Returns the pcie link status for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -653,7 +653,7 @@ Exceptions that can be thrown by `amdsmi_get_pcie_link_status` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -669,7 +669,7 @@ except AmdSmiException as e: Description: Returns the max pcie link capabilities for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -686,7 +686,7 @@ Exceptions that can be thrown by `amdsmi_get_pcie_link_caps` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -702,7 +702,7 @@ except AmdSmiException as e: Description: Returns bad page info for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: List consisting of dictionaries with fields for each bad page found @@ -721,7 +721,7 @@ Exceptions that can be thrown by `amdsmi_get_bad_page_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -746,7 +746,7 @@ Description: Returns the supported frequency target range for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `clock_type` one of `AmdSmiClkType` enum values: Field | Description @@ -780,7 +780,7 @@ Exceptions that can be thrown by `amdsmi_get_target_frequency_range` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -815,7 +815,7 @@ Description: Returns the list of processes for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: List of process handles found @@ -827,7 +827,7 @@ Exceptions that can be thrown by `amdsmi_get_process_list` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -842,7 +842,7 @@ Description: Returns the info for the given process Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `process_handle` process which to query Output: Dictionary with fields @@ -863,7 +863,7 @@ Exceptions that can be thrown by `amdsmi_get_process_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -880,7 +880,7 @@ Description: Returns the ECC error count for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -897,7 +897,7 @@ Exceptions that can be thrown by `amdsmi_get_ecc_error_count` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -914,7 +914,7 @@ Description: Returns board info for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields correctable and uncorrectable @@ -932,7 +932,7 @@ Exceptions that can be thrown by `amdsmi_get_board_info` function: Example: ```python try: - device = amdsmi_get_device_handle_from_bdf("0000:23.00.0") + device = amdsmi_get_processor_handle_from_bdf("0000:23.00.0") board_info = amdsmi_get_board_info(device) print(board_info["serial_number"]) print(board_info["product_serial"]) @@ -946,7 +946,7 @@ Description: Returns status of each RAS block for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: List containing dictionaries with fields for each RAS block @@ -963,7 +963,7 @@ Exceptions that can be thrown by `amdsmi_get_ras_block_features_enabled` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -986,7 +986,7 @@ Description: Allocates a new event reader notifier to monitor different types of Input parameters: -* `device_handle` device handle corresponding to the device on which to listen for events +* `processor_handle` device handle corresponding to the device on which to listen for events * `event_types` list of event types from AmdSmiEvtNotificationType enum. Specifying which events to collect for the given device. Event Type | Description @@ -1015,7 +1015,7 @@ Input parameters: `None` Example with manual cleanup of AmdSmiEventReader: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1030,7 +1030,7 @@ finally: Example with automatic cleanup using `with` statement: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1046,7 +1046,7 @@ Description: Get a function name iterator of supported AMDSMI functions for a de Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Handle for a function iterator @@ -1058,7 +1058,7 @@ Exceptions that can be thrown by `amdsmi_dev_open_supported_func_iterator` funct Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1087,7 +1087,7 @@ Exceptions that can be thrown by `amdsmi_dev_open_supported_variant_iterator` fu Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1118,7 +1118,7 @@ Exceptions that can be thrown by `amdsmi_next_func_iter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1149,7 +1149,7 @@ Exceptions that can be thrown by `amdsmi_dev_close_supported_func_iterator` func Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1183,7 +1183,7 @@ Exceptions that can be thrown by `amdsmi_get_func_iter_value` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1200,7 +1200,7 @@ except AmdSmiException as e: Description: Control the set of allowed PCIe bandwidths that can be used Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `bw_bitmask` A bitmask indicating the indices of the bandwidths that are to be enabled (1) and disabled (0) @@ -1214,7 +1214,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_pci_bandwidth` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1227,7 +1227,7 @@ except AmdSmiException as e: Description: Set the power cap value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_ind` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0 * `cap` int that indicates the desired power cap, in microwatts @@ -1242,7 +1242,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_power_cap` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1256,7 +1256,7 @@ except AmdSmiException as e: Description: Set the power profile Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `reserved` Not currently used, set to 0 * `profile` a amdsmi_power_profile_preset_masks_t that hold the mask of the desired new power profile @@ -1271,7 +1271,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_power_profile` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1287,7 +1287,7 @@ except AmdSmiException as e: Description: This function sets the clock range information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `min_clk_value` minimum clock value for desired clock range * `max_clk_value` maximum clock value for desired clock range * `clk_type`AMDSMI_CLK_TYPE_SYS | AMDSMI_CLK_TYPE_MEM range type @@ -1302,7 +1302,7 @@ Exceptions that can be thrown by `amdsmi_dev_set_clk_range` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1318,7 +1318,7 @@ Description: Get the unique PCI device identifier associated for a device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device bdf The format of bdfid will be as follows: @@ -1360,7 +1360,7 @@ Description: Get the list of possible PCIe bandwidths that are available. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with the possible T/s values and associated number of lanes @@ -1402,7 +1402,7 @@ Description: Get PCIe traffic information Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with the fields @@ -1437,7 +1437,7 @@ Description: Get PCIe replay counter Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: counter value The sum of the NAK's received and generated by the GPU @@ -1467,7 +1467,7 @@ Description: Get the NUMA node associated with a device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: NUMA node value @@ -1496,7 +1496,7 @@ Description: Get the average power consumption of the device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `sensor_id` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1528,7 +1528,7 @@ Description: Get the energy accumulator counter of the device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -1564,7 +1564,7 @@ Description: Get the total amount of memory that exists Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `mem_type` enum AmdSmiMemoryType Output: total amount of memory @@ -1595,7 +1595,7 @@ except AmdSmiException as e: Description: This function sets the clock frequency information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `level` AMDSMI_FREQ_IND_MIN|AMDSMI_FREQ_IND_MAX to set the minimum (0) or maximum (1) speed * `clk_value` value to apply to the clock range @@ -1611,7 +1611,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_od_clk_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1633,7 +1633,7 @@ Description: Get the current memory usage Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `mem_type` enum AmdSmiMemoryType Output: the amount of memory currently being used @@ -1662,7 +1662,7 @@ except AmdSmiException as e: Description: This function sets 1 of the 3 voltage curve points Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `vpoint` voltage point [0|1|2] on the voltage curve * `clk_value` clock value component of voltage curve point * `volt_value` voltage value component of voltage curve point @@ -1677,7 +1677,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_od_volt_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1694,7 +1694,7 @@ Description: Get percentage of time any device memory is being used Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: percentage of time that any device memory is being used for the specified device. @@ -1724,7 +1724,7 @@ Description: Set the PowerPlay performance level associated with the device with provided device handle with the provided value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `perf_lvl` the value to which the performance level should be set Output: None @@ -1737,7 +1737,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_perf_level_v1` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1751,7 +1751,7 @@ Description: Get the fan speed in RPMs of the device with the specified device handle and 0-based sensor index. Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1765,7 +1765,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_fan_rpms` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1780,7 +1780,7 @@ Description: Get the fan speed for the specified device as a value relative to AMDSMI_MAX_FAN_SPEED Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1794,7 +1794,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_fan_speed` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1808,7 +1808,7 @@ except AmdSmiException as e: Description: Get the max fan speed of the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1822,7 +1822,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_fan_speed_max` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1837,7 +1837,7 @@ Description: Get the temperature metric value for the specified metric, from the specified temperature sensor on the specified device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_type` part of device from which temperature should be obtained * `metric` enum indicated which temperature value should be retrieved @@ -1851,7 +1851,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_temp_metric` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1867,7 +1867,7 @@ Description: Get the voltage metric value for the specified metric, from the specified voltage sensor on the specified device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_type` part of device from which voltage should be obtained * `metric` enum indicated which voltage value should be retrieved @@ -1881,7 +1881,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_volt_metric` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1896,7 +1896,7 @@ except AmdSmiException as e: Description: Get percentage of time device is busy doing any processing Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: How busy the device is (as percentage of time) @@ -1908,7 +1908,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_busy_percent` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1922,7 +1922,7 @@ except AmdSmiException as e: Description: Get coarse grain utilization counter of the specified device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `counter_types` variable number of counter types desired Output: List containing dictionaries with fields @@ -1940,7 +1940,7 @@ Exceptions that can be thrown by `amdsmi_get_utilization_count` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1963,7 +1963,7 @@ except AmdSmiException as e: Description: Get the performance level of the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Performance level as enum value of dev_perf_level_t @@ -1975,7 +1975,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_perf_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1989,7 +1989,7 @@ except AmdSmiException as e: Description: Enter performance determinism mode with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `clkvalue` softmax value for GFXCLK in MHz Output: None @@ -2002,7 +2002,7 @@ Exceptions that can be thrown by `amdsmi_set_perf_determinism_mode` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2016,7 +2016,7 @@ Description: Get the overdrive percent associated with the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Overdrive percentage as integer @@ -2028,7 +2028,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_overdrive_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2043,7 +2043,7 @@ Description: Get the list of possible system clock speeds of device for a specified clock type Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `clk_type` the type of clock for which the frequency is desired Output: Dictionary with fields @@ -2062,7 +2062,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_gpu_clk_freq` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2075,7 +2075,7 @@ except AmdSmiException as e: Description: This function retrieves the voltage/frequency curve information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Dictionary with fields @@ -2097,7 +2097,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_od_volt_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2110,7 +2110,7 @@ except AmdSmiException as e: Description: This function retrieves the gpu metrics information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Dictionary with fields @@ -2159,7 +2159,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_gpu_metrics_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2173,7 +2173,7 @@ Description: This function will retrieve the current valid regions in the frequency/voltage space Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `num_regions` number of freq volt regions Output: List containing a dictionary with fields for each freq volt region @@ -2191,7 +2191,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_od_volt_curve_regions` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2205,7 +2205,7 @@ Description: Get the list of available preset power profiles and an indication which profile is currently active Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` number of freq volt regions Output: Dictionary with fields @@ -2224,7 +2224,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_power_profile_presets` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2239,7 +2239,7 @@ Description: Tell if an event group is supported by a given device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `event_group` event group being checked for support Output: None @@ -2252,7 +2252,7 @@ Exceptions that can be thrown by `amdsmi_dev_counter_group_supported` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2267,7 +2267,7 @@ Description: Creates a performance counter object Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `event_type` event group being checked for support Output: An event handle of the newly created performance counter object @@ -2280,7 +2280,7 @@ Exceptions that can be thrown by `amdsmi_dev_create_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2306,7 +2306,7 @@ Exceptions that can be thrown by `amdsmi_dev_destroy_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2334,7 +2334,7 @@ Exceptions that can be thrown by `amdsmi_control_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2367,7 +2367,7 @@ Exceptions that can be thrown by `amdsmi_read_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2382,7 +2382,7 @@ Description: Get the number of currently available counters Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `event_group` event group being checked as AmdSmiEventGroup Output: Number of available counters for the given device of the inputted event group @@ -2395,7 +2395,7 @@ Exceptions that can be thrown by ` amdsmi_counter_get_available_counters` functi Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2409,7 +2409,7 @@ except AmdSmiException as e: Description: Set a desired performance level for given device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `perf_level` performance level being set as AmdSmiDevPerfLevel Output: None @@ -2422,7 +2422,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_perf_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2436,7 +2436,7 @@ Description: Get the list of available preset power profiles and an indication o which profile is currently active. Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` sensor index as integer Output: Dictionary with fields @@ -2455,7 +2455,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_power_profile_presets` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2469,7 +2469,7 @@ except AmdSmiException as e: Description: Reset the gpu associated with the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: None @@ -2481,7 +2481,7 @@ Exceptions that can be thrown by `amdsmi_dev_reset_gpu` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2495,7 +2495,7 @@ Description: Set the fan speed for the specified device with the provided speed, in RPMs Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` sensor index as integer * `fan_speed` the speed to which the function will attempt to set the fan @@ -2509,7 +2509,7 @@ Exceptions that can be thrown by `amdsmi_dev_set_fan_speed` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2522,7 +2522,7 @@ except AmdSmiException as e: Description: Reset the fan to automatic driver control Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` sensor index as integer Output: None @@ -2535,7 +2535,7 @@ Exceptions that can be thrown by `amdsmi_dev_reset_fan` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2549,7 +2549,7 @@ Description: Control the set of allowed frequencies that can be used for the specified clock Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `clk_type` the type of clock for which the set of frequencies will be modified as AmdSmiClkType * `freq_bitmask` bitmask indicating the indices of the frequencies that are to @@ -2566,7 +2566,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_clk_freq` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2581,7 +2581,7 @@ Description: Set the overdrive percent associated with the device with provided device handle with the provided value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `overdrive_value` value to which the overdrive level should be set Output: None @@ -2594,7 +2594,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_overdrive_level_v1` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2608,7 +2608,7 @@ Description: **deprecated** Set the overdrive percent associated with the device with provided device handle with the provided value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `overdrive_value` value to which the overdrive level should be set Output: None @@ -2621,7 +2621,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_overdrive_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2635,7 +2635,7 @@ except AmdSmiException as e: Description: Retrieve the error counts for a GPU block Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `block` The block for which error counts should be retrieved Output: Dict containing information about error counts @@ -2653,7 +2653,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_ecc_count` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2668,7 +2668,7 @@ except AmdSmiException as e: Description: Retrieve the enabled ECC bit-mask Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Enabled ECC bit-mask @@ -2680,7 +2680,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_ecc_enabled` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2695,7 +2695,7 @@ except AmdSmiException as e: Description: Retrieve the ECC status for a GPU block Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `block` The block for which ECC status should be retrieved Output: ECC status for a requested GPU block @@ -2708,7 +2708,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_ecc_status` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2826,7 +2826,7 @@ except AmdSmiException as e: Description: Retrieve the XGMI error status for a device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: XGMI error status for a requested device @@ -2838,7 +2838,7 @@ Exceptions that can be thrown by `amdsmi_dev_xgmi_error_status` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2853,7 +2853,7 @@ except AmdSmiException as e: Description: Reset the XGMI error status for a device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: None @@ -2865,7 +2865,7 @@ Exceptions that can be thrown by `amdsmi_dev_reset_xgmi_error` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2879,7 +2879,7 @@ Description: Returns the device vendor name Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device vendor name @@ -2891,7 +2891,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_vendor_name` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2907,7 +2907,7 @@ Description: Get the device id associated with the device with provided device h Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device id @@ -2919,7 +2919,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_id` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2935,7 +2935,7 @@ Description: Get the vram vendor string of a gpu device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: vram vendor @@ -2947,7 +2947,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_vram_vendor` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2963,7 +2963,7 @@ Description: Get the drm minor number associated with this device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: drm minor number @@ -2975,7 +2975,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_drm_render_minor` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2991,7 +2991,7 @@ Description: Get the subsystem device id associated with the device with provide Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: subsystem device id @@ -3003,7 +3003,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_subsystem_id` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3020,7 +3020,7 @@ Description: Get the name string for the device subsytem Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device subsytem @@ -3032,7 +3032,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_subsystem_name` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3057,7 +3057,7 @@ Exceptions that can be thrown by `amdsmi_get_version` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3086,7 +3086,7 @@ Exceptions that can be thrown by `amdsmi_get_version_str` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3103,7 +3103,7 @@ Description: Retrieve the NUMA CPU node number for a device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: node number of NUMA CPU for the device @@ -3115,7 +3115,7 @@ Exceptions that can be thrown by `amdsmi_topo_get_numa_node_number` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3131,8 +3131,8 @@ Description: Retrieve the weight for a connection between 2 GPUs. Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: the weight for a connection between 2 GPUs @@ -3144,13 +3144,13 @@ Exceptions that can be thrown by `amdsmi_topo_get_link_weight` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - weight = amdsmi_topo_get_link_weight(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + weight = amdsmi_topo_get_link_weight(processor_handle_src, processor_handle_dest) print(weight) except AmdSmiException as e: print(e) @@ -3162,8 +3162,8 @@ Description: Retreive minimal and maximal io link bandwidth between 2 GPUs. Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: Dictionary with fields: @@ -3180,13 +3180,13 @@ Exceptions that can be thrown by ` amdsmi_get_minmax_bandwidth` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - bandwith = amdsmi_get_minmax_bandwidth(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + bandwith = amdsmi_get_minmax_bandwidth(processor_handle_src, processor_handle_dest) print(bandwith['min_bandwidth']) print(bandwith['max_bandwidth']) except AmdSmiException as e: @@ -3199,8 +3199,8 @@ Description: Retrieve the hops and the connection type between 2 GPUs Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: Dictionary with fields: @@ -3217,13 +3217,13 @@ Exceptions that can be thrown by `amdsmi_topo_get_link_type` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - link_type = amdsmi_topo_get_link_type(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + link_type = amdsmi_topo_get_link_type(processor_handle_src, processor_handle_dest) print(link_type['hops']) print(link_type['type']) except AmdSmiException as e: @@ -3236,8 +3236,8 @@ Description: Return P2P availability status between 2 GPUs Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: P2P availability status between 2 GPUs @@ -3249,13 +3249,13 @@ Exceptions that can be thrown by `amdsmi_is_P2P_accessible` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - accessible = amdsmi_is_P2P_accessible(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + accessible = amdsmi_is_P2P_accessible(processor_handle_src, processor_handle_dest) print(accessible) except AmdSmiException as e: print(e) @@ -3267,7 +3267,7 @@ Description: Returns XGMI information for the GPU. Input parameters: -* `device_handle` device handle +* `processor_handle` device handle Output: Dictionary with fields: @@ -3287,7 +3287,7 @@ Exceptions that can be thrown by `amdsmi_get_xgmi_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index d95f571307..da3e3d94b1 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -25,13 +25,13 @@ from .amdsmi_interface import amdsmi_shut_down # Device Descovery from .amdsmi_interface import amdsmi_get_device_type -from .amdsmi_interface import amdsmi_get_device_handles +from .amdsmi_interface import amdsmi_get_processor_handles from .amdsmi_interface import amdsmi_get_socket_handles from .amdsmi_interface import amdsmi_get_socket_info from .amdsmi_interface import amdsmi_get_device_bdf from .amdsmi_interface import amdsmi_get_device_uuid -from .amdsmi_interface import amdsmi_get_device_handle_from_bdf +from .amdsmi_interface import amdsmi_get_processor_handle_from_bdf # # SW Version Information from .amdsmi_interface import amdsmi_get_driver_version diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 29a8c8311f..a4aea1dc3f 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -293,11 +293,11 @@ class AmdSmiUtilizationCounterType(IntEnum): class AmdSmiEventReader: def __init__( - self, device_handle: amdsmi_wrapper.amdsmi_processor_handle, *event_types + self, processor_handle: amdsmi_wrapper.amdsmi_processor_handle, *event_types ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_types, Iterable): raise AmdSmiParameterException( @@ -310,14 +310,14 @@ class AmdSmiEventReader: event_type, AmdSmiEvtNotificationType ) - self.device_handle = device_handle + self.processor_handle = processor_handle mask = 0 for event_type in event_types: mask |= (1 << (int(event_type) - 1)) - _check_res(amdsmi_wrapper.amdsmi_init_event_notification(device_handle)) + _check_res(amdsmi_wrapper.amdsmi_init_event_notification(processor_handle)) _check_res(amdsmi_wrapper. amdsmi_set_event_notification_mask( - device_handle, ctypes.c_uint64(mask))) + processor_handle, ctypes.c_uint64(mask))) def read(self, timestamp, num_elem=10): self.event_info = ( @@ -337,7 +337,7 @@ class AmdSmiEventReader: ): ret.append( { - "device_handle": self.event_info[i].device_handle, + "processor_handle": self.event_info[i].processor_handle, "event": AmdSmiEvtNotificationType( self.event_info[i].event ).name, @@ -349,7 +349,7 @@ class AmdSmiEventReader: def stop(self): _check_res(amdsmi_wrapper.amdsmi_stop_event_notification( - self.device_handle)) + self.processor_handle)) def __enter__(self): return self @@ -508,31 +508,31 @@ def amdsmi_get_socket_info(socket_handle): return socket_info.value.decode() -def amdsmi_get_device_handles() -> List[amdsmi_wrapper.amdsmi_processor_handle]: +def amdsmi_get_processor_handles() -> List[amdsmi_wrapper.amdsmi_processor_handle]: socket_handles = amdsmi_get_socket_handles() devices = [] for socket in socket_handles: device_count = ctypes.c_uint32() null_ptr = ctypes.POINTER(amdsmi_wrapper.amdsmi_processor_handle)() _check_res( - amdsmi_wrapper.amdsmi_get_device_handles( + amdsmi_wrapper.amdsmi_get_processor_handles( socket, ctypes.byref(device_count), null_ptr, ) ) - device_handles = ( + processor_handles = ( amdsmi_wrapper.amdsmi_processor_handle * device_count.value)() _check_res( - amdsmi_wrapper.amdsmi_get_device_handles( + amdsmi_wrapper.amdsmi_get_processor_handles( socket, ctypes.byref(device_count), - device_handles, + processor_handles, ) ) devices.extend( [ - amdsmi_wrapper.amdsmi_processor_handle(device_handles[dev_idx]) + amdsmi_wrapper.amdsmi_processor_handle(processor_handles[dev_idx]) for dev_idx in range(device_count.value) ] ) @@ -551,48 +551,48 @@ def amdsmi_shut_down(): def amdsmi_get_device_type( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> ctypes.c_uint32: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) dev_type = amdsmi_wrapper.device_type_t() _check_res( amdsmi_wrapper.amdsmi_get_device_type( - device_handle, ctypes.byref(dev_type)) + processor_handle, ctypes.byref(dev_type)) ) return dev_type.value -def amdsmi_get_device_bdf(device_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_device_bdf(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) bdf_info = amdsmi_wrapper.amdsmi_bdf_t() _check_res( amdsmi_wrapper.amdsmi_get_device_bdf( - device_handle, ctypes.byref(bdf_info)) + processor_handle, ctypes.byref(bdf_info)) ) return _format_bdf(bdf_info) def amdsmi_get_asic_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) asic_info = amdsmi_wrapper.amdsmi_asic_info_t() _check_res( amdsmi_wrapper.amdsmi_get_asic_info( - device_handle, ctypes.byref(asic_info)) + processor_handle, ctypes.byref(asic_info)) ) return { @@ -606,17 +606,17 @@ def amdsmi_get_asic_info( def amdsmi_get_power_cap_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power_info = amdsmi_wrapper.amdsmi_power_cap_info_t() _check_res( amdsmi_wrapper.amdsmi_get_power_cap_info( - device_handle, ctypes.c_uint32(0), ctypes.byref(power_info) + processor_handle, ctypes.c_uint32(0), ctypes.byref(power_info) ) ) @@ -627,17 +627,17 @@ def amdsmi_get_power_cap_info( "max_power_cap": power_info.max_power_cap} def amdsmi_get_caps_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) gpu_caps = amdsmi_wrapper.amdsmi_gpu_caps_t() _check_res( amdsmi_wrapper.amdsmi_get_caps_info( - device_handle, ctypes.byref(gpu_caps)) + processor_handle, ctypes.byref(gpu_caps)) ) return { @@ -654,17 +654,17 @@ def amdsmi_get_caps_info( def amdsmi_get_vbios_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) vbios_info = amdsmi_wrapper.amdsmi_vbios_info_t() _check_res( amdsmi_wrapper.amdsmi_get_vbios_info( - device_handle, ctypes.byref(vbios_info)) + processor_handle, ctypes.byref(vbios_info)) ) return { @@ -677,17 +677,17 @@ def amdsmi_get_vbios_info( def amdsmi_get_gpu_activity( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) engine_usage = amdsmi_wrapper.amdsmi_engine_usage_t() _check_res( amdsmi_wrapper.amdsmi_get_gpu_activity( - device_handle, ctypes.byref(engine_usage) + processor_handle, ctypes.byref(engine_usage) ) ) @@ -699,12 +699,12 @@ def amdsmi_get_gpu_activity( def amdsmi_get_clock_measure( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_type, AmdSmiClkType): raise AmdSmiParameterException(clock_type, AmdSmiClkType) @@ -712,7 +712,7 @@ def amdsmi_get_clock_measure( clock_measure = amdsmi_wrapper.amdsmi_clk_measure_t() _check_res( amdsmi_wrapper.amdsmi_get_clock_measure( - device_handle, + processor_handle, amdsmi_wrapper.amdsmi_clk_type_t(clock_type), ctypes.byref(clock_measure), ) @@ -727,11 +727,11 @@ def amdsmi_get_clock_measure( def amdsmi_get_bad_page_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) num_pages = ctypes.c_uint32() @@ -739,7 +739,7 @@ def amdsmi_get_bad_page_info( amdsmi_wrapper.amdsmi_retired_page_record_t)() _check_res( amdsmi_wrapper.amdsmi_get_bad_page_info( - device_handle, ctypes.byref(num_pages), retired_page_record + processor_handle, ctypes.byref(num_pages), retired_page_record ) ) table_records = _format_bad_page_info(retired_page_record, num_pages) @@ -752,12 +752,12 @@ def amdsmi_get_bad_page_info( def amdsmi_get_target_frequency_range( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_type, AmdSmiClkType): raise AmdSmiParameterException(clock_type, AmdSmiClkType) @@ -765,7 +765,7 @@ def amdsmi_get_target_frequency_range( freq_range = amdsmi_wrapper.amdsmi_frequency_range_t() _check_res( amdsmi_wrapper.amdsmi_get_target_frequency_range( - device_handle, + processor_handle, amdsmi_wrapper.amdsmi_clk_type_t(clock_type), ctypes.byref(freq_range), ) @@ -780,17 +780,17 @@ def amdsmi_get_target_frequency_range( def amdsmi_get_ecc_error_count( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) error_count = amdsmi_wrapper.amdsmi_error_count_t() _check_res( amdsmi_wrapper.amdsmi_get_ecc_error_count( - device_handle, ctypes.byref(error_count) + processor_handle, ctypes.byref(error_count) ) ) @@ -801,17 +801,17 @@ def amdsmi_get_ecc_error_count( def amdsmi_get_board_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) board_info = amdsmi_wrapper.amdsmi_board_info_t() _check_res( amdsmi_wrapper.amdsmi_get_board_info( - device_handle, ctypes.byref(board_info)) + processor_handle, ctypes.byref(board_info)) ) return { @@ -822,11 +822,11 @@ def amdsmi_get_board_info( def amdsmi_get_ras_block_features_enabled( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) ras_state = amdsmi_wrapper.amdsmi_ras_err_state_t() @@ -838,7 +838,7 @@ def amdsmi_get_ras_block_features_enabled( gpu_block.name = "FUSE" _check_res( amdsmi_wrapper.amdsmi_get_ras_block_features_enabled( - device_handle, + processor_handle, amdsmi_wrapper.amdsmi_gpu_block_t(gpu_block.value), ctypes.byref(ras_state), ) @@ -854,11 +854,11 @@ def amdsmi_get_ras_block_features_enabled( def amdsmi_get_process_list( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> List[amdsmi_wrapper.amdsmi_process_handle]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) max_processes = ctypes.c_uint32(0) @@ -866,7 +866,7 @@ def amdsmi_get_process_list( max_processes.value)() _check_res( amdsmi_wrapper.amdsmi_get_process_list( - device_handle, process_list, ctypes.byref(max_processes) + processor_handle, process_list, ctypes.byref(max_processes) ) ) @@ -874,7 +874,7 @@ def amdsmi_get_process_list( max_processes.value)() _check_res( amdsmi_wrapper.amdsmi_get_process_list( - device_handle, process_list, ctypes.byref(max_processes) + processor_handle, process_list, ctypes.byref(max_processes) ) ) @@ -882,12 +882,12 @@ def amdsmi_get_process_list( def amdsmi_get_process_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, process: amdsmi_wrapper.amdsmi_process_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(process, amdsmi_wrapper.amdsmi_process_handle): @@ -897,7 +897,7 @@ def amdsmi_get_process_info( info = amdsmi_wrapper.amdsmi_proc_info_t() _check_res( amdsmi_wrapper.amdsmi_get_process_info( - device_handle, process, ctypes.byref(info) + processor_handle, process, ctypes.byref(info) ) ) @@ -920,10 +920,10 @@ def amdsmi_get_process_info( } -def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_device_uuid(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) uuid = ctypes.create_string_buffer(_AMDSMI_GPU_UUID_SIZE) @@ -933,7 +933,7 @@ def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_processor_handle _check_res( amdsmi_wrapper.amdsmi_get_device_uuid( - device_handle, ctypes.byref(uuid_length), uuid + processor_handle, ctypes.byref(uuid_length), uuid ) ) @@ -941,11 +941,11 @@ def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_processor_handle def amdsmi_get_driver_version( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_int() @@ -955,7 +955,7 @@ def amdsmi_get_driver_version( _check_res( amdsmi_wrapper.amdsmi_get_driver_version( - device_handle, ctypes.byref(length), version + processor_handle, ctypes.byref(length), version ) ) @@ -963,17 +963,17 @@ def amdsmi_get_driver_version( def amdsmi_get_power_measure( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power_measure = amdsmi_wrapper.amdsmi_power_measure_t() _check_res( amdsmi_wrapper.amdsmi_get_power_measure( - device_handle, ctypes.byref(power_measure) + processor_handle, ctypes.byref(power_measure) ) ) @@ -986,14 +986,14 @@ def amdsmi_get_power_measure( def amdsmi_get_fw_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle + processor_handle: amdsmi_wrapper.amdsmi_processor_handle ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle) + processor_handle, amdsmi_wrapper.amdsmi_processor_handle) fw_info = amdsmi_wrapper.amdsmi_fw_info_t() _check_res(amdsmi_wrapper.amdsmi_get_fw_info( - device_handle, ctypes.byref(fw_info))) + processor_handle, ctypes.byref(fw_info))) firmwares = list() for i in range(0, fw_info.num_fw_info): firmwares.append({ @@ -1006,34 +1006,34 @@ def amdsmi_get_fw_info( def amdsmi_get_vram_usage( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) vram_info = amdsmi_wrapper.amdsmi_vram_info_t() _check_res( amdsmi_wrapper.amdsmi_get_vram_usage( - device_handle, ctypes.byref(vram_info)) + processor_handle, ctypes.byref(vram_info)) ) return {"vram_total": vram_info.vram_total, "vram_used": vram_info.vram_used} def amdsmi_get_pcie_link_status( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) pcie_info = amdsmi_wrapper.amdsmi_pcie_info_t() _check_res( amdsmi_wrapper.amdsmi_get_pcie_link_status( - device_handle, ctypes.byref(pcie_info) + processor_handle, ctypes.byref(pcie_info) ) ) @@ -1041,39 +1041,39 @@ def amdsmi_get_pcie_link_status( def amdsmi_get_pcie_link_caps( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) pcie_info = amdsmi_wrapper.amdsmi_pcie_info_t() _check_res( amdsmi_wrapper.amdsmi_get_pcie_link_caps( - device_handle, ctypes.byref(pcie_info)) + processor_handle, ctypes.byref(pcie_info)) ) return {"pcie_lanes": pcie_info.pcie_lanes, "pcie_speed": pcie_info.pcie_speed} -def amdsmi_get_device_handle_from_bdf(bdf): +def amdsmi_get_processor_handle_from_bdf(bdf): bdf = _parse_bdf(bdf) if bdf is None: raise AmdSmiBdfFormatException(bdf) amdsmi_bdf = _make_amdsmi_bdf_from_list(bdf) - device_handle = amdsmi_wrapper.amdsmi_processor_handle() - _check_res(amdsmi_wrapper.amdsmi_get_device_handle_from_bdf( - amdsmi_bdf, ctypes.byref(device_handle))) - return device_handle + processor_handle = amdsmi_wrapper.amdsmi_processor_handle() + _check_res(amdsmi_wrapper.amdsmi_get_processor_handle_from_bdf( + amdsmi_bdf, ctypes.byref(processor_handle))) + return processor_handle def amdsmi_dev_get_vendor_name( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint64() @@ -1083,29 +1083,29 @@ def amdsmi_dev_get_vendor_name( _check_res( amdsmi_wrapper.amdsmi_dev_get_vendor_name( - device_handle, vendor_name, length) + processor_handle, vendor_name, length) ) return vendor_name.value.decode("utf-8") -def amdsmi_dev_get_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) id = ctypes.c_uint16() _check_res(amdsmi_wrapper.amdsmi_dev_get_id( - device_handle, ctypes.byref(id))) + processor_handle, ctypes.byref(id))) return id.value -def amdsmi_dev_get_vram_vendor(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_vram_vendor(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint32() @@ -1115,47 +1115,47 @@ def amdsmi_dev_get_vram_vendor(device_handle: amdsmi_wrapper.amdsmi_processor_ha _check_res( amdsmi_wrapper.amdsmi_dev_get_vram_vendor( - device_handle, vram_vendor, length) + processor_handle, vram_vendor, length) ) return vram_vendor.value.decode("utf-8") -def amdsmi_dev_get_drm_render_minor(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_drm_render_minor(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) minor = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_drm_render_minor( - device_handle, ctypes.byref(minor) + processor_handle, ctypes.byref(minor) ) ) return minor.value -def amdsmi_dev_get_subsystem_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_subsystem_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) id = ctypes.c_uint16() _check_res( amdsmi_wrapper.amdsmi_dev_get_subsystem_id( - device_handle, ctypes.byref(id)) + processor_handle, ctypes.byref(id)) ) return id.value -def amdsmi_dev_get_subsystem_name(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_subsystem_name(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint64() @@ -1165,7 +1165,7 @@ def amdsmi_dev_get_subsystem_name(device_handle: amdsmi_wrapper.amdsmi_processor _check_res( amdsmi_wrapper.amdsmi_dev_get_subsystem_name( - device_handle, name, length) + processor_handle, name, length) ) return name.value.decode("utf-8") @@ -1200,18 +1200,18 @@ def amdsmi_get_version_str(sw_component: AmdSmiSwComponent): def amdsmi_topo_get_numa_node_number( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) numa_node_number = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_topo_get_numa_node_number( - device_handle, ctypes.byref(numa_node_number) + processor_handle, ctypes.byref(numa_node_number) ) ) @@ -1219,24 +1219,24 @@ def amdsmi_topo_get_numa_node_number( def amdsmi_topo_get_link_weight( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) weight = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_topo_get_link_weight( - device_handle_src, device_handle_dst, ctypes.byref(weight) + processor_handle_src, processor_handle_dst, ctypes.byref(weight) ) ) @@ -1244,17 +1244,17 @@ def amdsmi_topo_get_link_weight( def amdsmi_get_minmax_bandwidth( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) min_bandwidth = ctypes.c_uint64() @@ -1262,8 +1262,8 @@ def amdsmi_get_minmax_bandwidth( _check_res( amdsmi_wrapper. amdsmi_get_minmax_bandwidth( - device_handle_src, - device_handle_dst, + processor_handle_src, + processor_handle_dst, ctypes.byref(min_bandwidth), ctypes.byref(max_bandwidth), ) @@ -1273,17 +1273,17 @@ def amdsmi_get_minmax_bandwidth( def amdsmi_topo_get_link_type( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) hops = ctypes.c_uint64() @@ -1292,8 +1292,8 @@ def amdsmi_topo_get_link_type( _check_res( amdsmi_wrapper.amdsmi_topo_get_link_type( - #device_handle_src, device_handle_dst, ctypes.byref(hops), type - device_handle_src, device_handle_dst, ctypes.byref( + #processor_handle_src, processor_handle_dst, ctypes.byref(hops), type + processor_handle_src, processor_handle_dst, ctypes.byref( hops), ctypes.byref(type) ) ) @@ -1302,39 +1302,39 @@ def amdsmi_topo_get_link_type( def amdsmi_is_P2P_accessible( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) accessible = ctypes.c_bool() _check_res( amdsmi_wrapper.amdsmi_is_P2P_accessible( - device_handle_src, device_handle_dst, ctypes.byref(accessible) + processor_handle_src, processor_handle_dst, ctypes.byref(accessible) ) ) return accessible.value -def amdsmi_get_xgmi_info(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_xgmi_info(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) xgmi_info = amdsmi_wrapper.amdsmi_xgmi_info_t() - _check_res(amdsmi_wrapper.amdsmi_get_xgmi_info(device_handle, xgmi_info)) + _check_res(amdsmi_wrapper.amdsmi_get_xgmi_info(processor_handle, xgmi_info)) return { "xgmi_lanes": xgmi_info.xgmi_lanes, @@ -1345,29 +1345,29 @@ def amdsmi_get_xgmi_info(device_handle: amdsmi_wrapper.amdsmi_processor_handle): def amdsmi_dev_counter_group_supported( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_group, AmdSmiEventGroup): raise AmdSmiParameterException(event_group, AmdSmiEventGroup) _check_res( amdsmi_wrapper.amdsmi_dev_counter_group_supported( - device_handle, event_group) + processor_handle, event_group) ) def amdsmi_dev_create_counter( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_type: AmdSmiEventType, ) -> amdsmi_wrapper.amdsmi_event_handle_t: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_type, AmdSmiEventType): raise AmdSmiParameterException(event_type, AmdSmiEventType) @@ -1375,7 +1375,7 @@ def amdsmi_dev_create_counter( event_handle = amdsmi_wrapper.amdsmi_event_handle_t() _check_res( amdsmi_wrapper.amdsmi_dev_create_counter( - device_handle, event_type, ctypes.byref(event_handle) + processor_handle, event_type, ctypes.byref(event_handle) ) ) @@ -1432,12 +1432,12 @@ def amdsmi_read_counter( def amdsmi_counter_get_available_counters( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_group, AmdSmiEventGroup): raise AmdSmiParameterException(event_group, AmdSmiEventGroup) @@ -1445,7 +1445,7 @@ def amdsmi_counter_get_available_counters( _check_res( amdsmi_wrapper. amdsmi_counter_get_available_counters( - device_handle, event_group, ctypes.byref(available) + processor_handle, event_group, ctypes.byref(available) ) ) @@ -1453,26 +1453,26 @@ def amdsmi_counter_get_available_counters( def amdsmi_dev_set_perf_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_level: AmdSmiDevPerfLevel, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(perf_level, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_level, AmdSmiDevPerfLevel) _check_res(amdsmi_wrapper. amdsmi_dev_set_perf_level( - device_handle, perf_level)) + processor_handle, perf_level)) def amdsmi_dev_get_power_profile_presets( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -1482,7 +1482,7 @@ def amdsmi_dev_get_power_profile_presets( _check_res( amdsmi_wrapper. amdsmi_dev_get_power_profile_presets( - device_handle, sensor_idx, ctypes.byref(status) + processor_handle, sensor_idx, ctypes.byref(status) ) ) @@ -1493,21 +1493,21 @@ def amdsmi_dev_get_power_profile_presets( } -def amdsmi_dev_reset_gpu(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_reset_gpu(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_gpu(device_handle)) + _check_res(amdsmi_wrapper.amdsmi_dev_reset_gpu(processor_handle)) def amdsmi_set_perf_determinism_mode( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_value: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_value, int): raise AmdSmiParameterException(clock_value, int) @@ -1515,16 +1515,16 @@ def amdsmi_set_perf_determinism_mode( _check_res( amdsmi_wrapper.amdsmi_set_perf_determinism_mode( - device_handle, clock_value) + processor_handle, clock_value) ) def amdsmi_dev_set_fan_speed( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int, fan_speed: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int, fan_speed: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -1535,32 +1535,32 @@ def amdsmi_dev_set_fan_speed( _check_res( amdsmi_wrapper.amdsmi_dev_set_fan_speed( - device_handle, sensor_idx, fan_speed) + processor_handle, sensor_idx, fan_speed) ) def amdsmi_dev_reset_fan( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) sensor_idx = ctypes.c_uint32(sensor_idx) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_fan(device_handle, sensor_idx)) + _check_res(amdsmi_wrapper.amdsmi_dev_reset_fan(processor_handle, sensor_idx)) def amdsmi_dev_set_clk_freq( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType, freq_bitmask: int, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clk_type, AmdSmiClkType): raise AmdSmiParameterException(clk_type, AmdSmiParameterException) @@ -1569,17 +1569,17 @@ def amdsmi_dev_set_clk_freq( freq_bitmask = ctypes.c_uint64(freq_bitmask) _check_res( amdsmi_wrapper. amdsmi_dev_set_clk_freq( - device_handle, clk_type, freq_bitmask + processor_handle, clk_type, freq_bitmask ) ) def amdsmi_dev_set_overdrive_level_v1( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(overdrive_value, int): raise AmdSmiParameterException(overdrive_value, int) @@ -1587,16 +1587,16 @@ def amdsmi_dev_set_overdrive_level_v1( _check_res( amdsmi_wrapper. amdsmi_dev_set_overdrive_level_v1( - device_handle, overdrive_value) + processor_handle, overdrive_value) ) def amdsmi_dev_set_overdrive_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(overdrive_value, int): raise AmdSmiParameterException(overdrive_value, int) @@ -1604,38 +1604,38 @@ def amdsmi_dev_set_overdrive_level( _check_res( amdsmi_wrapper. amdsmi_dev_set_overdrive_level( - device_handle, overdrive_value) + processor_handle, overdrive_value) ) def amdsmi_dev_open_supported_func_iterator( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> amdsmi_wrapper.amdsmi_func_id_iter_handle_t: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) obj_handle = amdsmi_wrapper.amdsmi_func_id_iter_handle_t() _check_res( amdsmi_wrapper.amdsmi_dev_open_supported_func_iterator( - device_handle, ctypes.byref(obj_handle) + processor_handle, ctypes.byref(obj_handle) ) ) return obj_handle -def amdsmi_dev_get_pci_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) bdfid = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_dev_get_pci_id( - device_handle, ctypes.byref(bdfid)) + processor_handle, ctypes.byref(bdfid)) ) return bdfid.value @@ -1717,11 +1717,11 @@ def amdsmi_get_func_iter_value( def amdsmi_dev_set_pci_bandwidth( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, bitmask: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, bitmask: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(bitmask, int): @@ -1729,7 +1729,7 @@ def amdsmi_dev_set_pci_bandwidth( _check_res( amdsmi_wrapper. amdsmi_dev_set_pci_bandwidth( - device_handle, ctypes.c_uint64(bitmask) + processor_handle, ctypes.c_uint64(bitmask) ) ) @@ -1742,17 +1742,17 @@ def _format_transfer_rate(transfer_rate): } -def amdsmi_dev_get_pci_bandwidth(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) bandwidth = amdsmi_wrapper.amdsmi_pcie_bandwidth_t() _check_res( amdsmi_wrapper.amdsmi_dev_get_pci_bandwidth( - device_handle, ctypes.byref(bandwidth)) + processor_handle, ctypes.byref(bandwidth)) ) transfer_rate = _format_transfer_rate(bandwidth.transfer_rate) @@ -1763,10 +1763,10 @@ def amdsmi_dev_get_pci_bandwidth(device_handle: amdsmi_wrapper.amdsmi_processor_ } -def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_throughput(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) sent = ctypes.c_uint64() @@ -1774,7 +1774,7 @@ def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_processor max_pkt_sz = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_pci_throughput(device_handle, ctypes.byref( + amdsmi_wrapper.amdsmi_dev_get_pci_throughput(processor_handle, ctypes.byref( sent), ctypes.byref(received), ctypes.byref(max_pkt_sz)) ) @@ -1785,44 +1785,44 @@ def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_processor } -def amdsmi_dev_get_pci_replay_counter(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_replay_counter(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) counter = ctypes.c_uint64() _check_res( amdsmi_wrapper. amdsmi_dev_get_pci_replay_counter( - device_handle, ctypes.byref(counter)) + processor_handle, ctypes.byref(counter)) ) return counter.value -def amdsmi_topo_get_numa_affinity(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_topo_get_numa_affinity(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) numa_node = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_topo_get_numa_affinity( - device_handle, ctypes.byref(numa_node)) + processor_handle, ctypes.byref(numa_node)) ) return numa_node.value def amdsmi_dev_set_power_cap( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_ind: int, cap: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_ind: int, cap: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_ind, int): @@ -1833,35 +1833,35 @@ def amdsmi_dev_set_power_cap( _check_res( amdsmi_wrapper. amdsmi_dev_set_power_cap( - device_handle, ctypes.c_uint32(sensor_ind), ctypes.c_uint64(cap) + processor_handle, ctypes.c_uint32(sensor_ind), ctypes.c_uint64(cap) ) ) -def amdsmi_dev_get_power_ave(device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_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( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_dev_get_power_ave( - device_handle, sensor_id, ctypes.byref(power)) + processor_handle, sensor_id, ctypes.byref(power)) ) return power.value def amdsmi_dev_set_power_profile( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, reserved: int, profile: AmdSmiPowerProfilePresetMasks, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(reserved, int): @@ -1872,15 +1872,15 @@ def amdsmi_dev_set_power_profile( _check_res( amdsmi_wrapper. amdsmi_dev_set_power_profile( - device_handle, ctypes.c_uint32(reserved), profile + processor_handle, ctypes.c_uint32(reserved), profile ) ) -def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_energy_count(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power = ctypes.c_uint64() @@ -1888,7 +1888,7 @@ def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_processor_h timestamp = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_energy_count(device_handle, ctypes.byref( + amdsmi_wrapper.amdsmi_dev_get_energy_count(processor_handle, ctypes.byref( power), ctypes.byref(counter_resolution), ctypes.byref(timestamp)) ) @@ -1900,14 +1900,14 @@ def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_processor_h def amdsmi_dev_set_clk_range( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, min_clk_value: int, max_clk_value: int, clk_type: AmdSmiClkType, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(min_clk_value, int): @@ -1921,7 +1921,7 @@ def amdsmi_dev_set_clk_range( _check_res( amdsmi_wrapper.amdsmi_dev_set_clk_range( - device_handle, + processor_handle, ctypes.c_uint64(min_clk_value), ctypes.c_uint64(max_clk_value), clk_type, @@ -1929,10 +1929,10 @@ def amdsmi_dev_set_clk_range( ) -def amdsmi_dev_get_memory_total(device_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(mem_type, AmdSmiMemoryType): @@ -1944,21 +1944,21 @@ def amdsmi_dev_get_memory_total(device_handle: amdsmi_wrapper.amdsmi_processor_h _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_total( - device_handle, mem_type, ctypes.byref(total)) + processor_handle, mem_type, ctypes.byref(total)) ) return total.value def amdsmi_dev_set_od_clk_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, level: AmdSmiFreqInd, value: int, clk_type: AmdSmiClkType, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(level, AmdSmiFreqInd): @@ -1972,15 +1972,15 @@ def amdsmi_dev_set_od_clk_info( _check_res( amdsmi_wrapper. amdsmi_dev_set_od_clk_info( - device_handle, level, ctypes.c_uint64(value), clk_type + processor_handle, level, ctypes.c_uint64(value), clk_type ) ) -def amdsmi_dev_get_memory_usage(device_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_memory_usage(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(mem_type, AmdSmiMemoryType): @@ -1992,21 +1992,21 @@ def amdsmi_dev_get_memory_usage(device_handle: amdsmi_wrapper.amdsmi_processor_h _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_usage( - device_handle, mem_type, ctypes.byref(used)) + processor_handle, mem_type, ctypes.byref(used)) ) return used.value def amdsmi_dev_set_od_volt_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, vpoint: int, clk_value: int, volt_value: int, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(vpoint, int): @@ -2020,7 +2020,7 @@ def amdsmi_dev_set_od_volt_info( _check_res( amdsmi_wrapper. amdsmi_dev_set_od_volt_info( - device_handle, + processor_handle, ctypes.c_uint32(vpoint), ctypes.c_uint64(clk_value), ctypes.c_uint64(volt_value), @@ -2028,51 +2028,51 @@ def amdsmi_dev_set_od_volt_info( ) -def amdsmi_dev_get_memory_busy_percent(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_memory_busy_percent(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) busy_percent = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_busy_percent( - device_handle, ctypes.byref(busy_percent)) + processor_handle, ctypes.byref(busy_percent)) ) return busy_percent.value def amdsmi_dev_set_perf_level_v1( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_lvl: AmdSmiDevPerfLevel, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(perf_lvl, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_lvl, AmdSmiDevPerfLevel) _check_res(amdsmi_wrapper. amdsmi_dev_set_perf_level_v1( - device_handle, perf_lvl)) + processor_handle, perf_lvl)) def amdsmi_dev_get_fan_rpms( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_int64() _check_res( amdsmi_wrapper.amdsmi_dev_get_fan_rpms( - device_handle, sensor_idx, ctypes.byref(fan_speed) + processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) @@ -2080,18 +2080,18 @@ def amdsmi_dev_get_fan_rpms( def amdsmi_dev_get_fan_speed( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_int64() _check_res( amdsmi_wrapper.amdsmi_dev_get_fan_speed( - device_handle, sensor_idx, ctypes.byref(fan_speed) + processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) @@ -2099,18 +2099,18 @@ def amdsmi_dev_get_fan_speed( def amdsmi_dev_get_fan_speed_max( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_dev_get_fan_speed_max( - device_handle, sensor_idx, ctypes.byref(fan_speed) + processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) @@ -2118,13 +2118,13 @@ def amdsmi_dev_get_fan_speed_max( def amdsmi_dev_get_temp_metric( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiTemperatureType, metric: AmdSmiTemperatureMetric, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_type, AmdSmiTemperatureType): raise AmdSmiParameterException(sensor_type, AmdSmiTemperatureType) @@ -2134,7 +2134,7 @@ def amdsmi_dev_get_temp_metric( temp_value = ctypes.c_int64() _check_res( amdsmi_wrapper. amdsmi_dev_get_temp_metric( - device_handle, sensor_type, metric, ctypes.byref(temp_value) + processor_handle, sensor_type, metric, ctypes.byref(temp_value) ) ) @@ -2142,13 +2142,13 @@ def amdsmi_dev_get_temp_metric( def amdsmi_dev_get_volt_metric( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiVoltageType, metric: AmdSmiVoltageMetric, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_type, AmdSmiVoltageType): raise AmdSmiParameterException(sensor_type, AmdSmiVoltageType) @@ -2158,7 +2158,7 @@ def amdsmi_dev_get_volt_metric( voltage = ctypes.c_int64() _check_res( amdsmi_wrapper. amdsmi_dev_get_volt_metric( - device_handle, sensor_type, metric, ctypes.byref(voltage) + processor_handle, sensor_type, metric, ctypes.byref(voltage) ) ) @@ -2166,17 +2166,17 @@ def amdsmi_dev_get_volt_metric( def amdsmi_dev_get_busy_percent( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) busy_percent = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_busy_percent( - device_handle, ctypes.byref(busy_percent) + processor_handle, ctypes.byref(busy_percent) ) ) @@ -2184,12 +2184,12 @@ def amdsmi_dev_get_busy_percent( def amdsmi_get_utilization_count( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, *counter_types: Tuple[AmdSmiUtilizationCounterType] ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not len(counter_types): raise AmdSmiLibraryException(amdsmi_wrapper.AMDSMI_STATUS_INVAL) @@ -2210,7 +2210,7 @@ def amdsmi_get_utilization_count( _check_res( amdsmi_wrapper.amdsmi_get_utilization_count( - device_handle, util_counter_list, count, ctypes.byref(timestamp) + processor_handle, util_counter_list, count, ctypes.byref(timestamp) ) ) if count.value != len(counters): @@ -2230,18 +2230,18 @@ def amdsmi_get_utilization_count( def amdsmi_dev_get_perf_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) perf = amdsmi_wrapper.amdsmi_dev_perf_level_t() _check_res( amdsmi_wrapper.amdsmi_dev_get_perf_level( - device_handle, ctypes.byref(perf)) + processor_handle, ctypes.byref(perf)) ) result = amdsmi_wrapper.c__EA_amdsmi_dev_perf_level_t__enumvalues[perf.value] @@ -2254,31 +2254,31 @@ def amdsmi_dev_get_perf_level( def amdsmi_set_perf_determinism_mode( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, clkvalue: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clkvalue: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clkvalue, int): raise AmdSmiParameterException(clkvalue, int) _check_res(amdsmi_wrapper.amdsmi_set_perf_determinism_mode( - device_handle, clkvalue)) + processor_handle, clkvalue)) def amdsmi_dev_get_overdrive_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) od_level = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_overdrive_level( - device_handle, ctypes.byref(od_level) + processor_handle, ctypes.byref(od_level) ) ) @@ -2286,11 +2286,11 @@ def amdsmi_dev_get_overdrive_level( def amdsmi_dev_get_gpu_clk_freq( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clk_type, AmdSmiClkType): raise AmdSmiParameterException(clk_type, AmdSmiClkType) @@ -2298,7 +2298,7 @@ def amdsmi_dev_get_gpu_clk_freq( freq = amdsmi_wrapper.amdsmi_frequencies_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_gpu_clk_freq( - device_handle, clk_type, ctypes.byref(freq) + processor_handle, clk_type, ctypes.byref(freq) ) ) @@ -2310,17 +2310,17 @@ def amdsmi_dev_get_gpu_clk_freq( def amdsmi_dev_get_od_volt_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) freq_data = amdsmi_wrapper.amdsmi_od_volt_freq_data_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_od_volt_info( - device_handle, ctypes.byref(freq_data) + processor_handle, ctypes.byref(freq_data) ) ) @@ -2347,17 +2347,17 @@ def amdsmi_dev_get_od_volt_info( def amdsmi_dev_get_gpu_metrics_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) gpu_metrics = amdsmi_wrapper.amdsmi_gpu_metrics_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_gpu_metrics_info( - device_handle, ctypes.byref(gpu_metrics) + processor_handle, ctypes.byref(gpu_metrics) ) ) @@ -2400,11 +2400,11 @@ def amdsmi_dev_get_gpu_metrics_info( def amdsmi_dev_get_od_volt_curve_regions( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, num_regions: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, num_regions: int ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(num_regions, int): raise AmdSmiParameterException(num_regions, int) @@ -2413,7 +2413,7 @@ def amdsmi_dev_get_od_volt_curve_regions( buffer = (amdsmi_wrapper.amdsmi_freq_volt_region_t * num_regions)() _check_res( amdsmi_wrapper. amdsmi_dev_get_od_volt_curve_regions( - device_handle, ctypes.byref(region_count), buffer + processor_handle, ctypes.byref(region_count), buffer ) ) @@ -2439,11 +2439,11 @@ def amdsmi_dev_get_od_volt_curve_regions( def amdsmi_dev_get_power_profile_presets( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -2451,7 +2451,7 @@ def amdsmi_dev_get_power_profile_presets( status = amdsmi_wrapper.amdsmi_power_profile_status_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_power_profile_presets( - device_handle, sensor_idx, ctypes.byref(status) + processor_handle, sensor_idx, ctypes.byref(status) ) ) @@ -2463,11 +2463,11 @@ def amdsmi_dev_get_power_profile_presets( def amdsmi_dev_get_ecc_count( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> Dict[str, int]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(block, AmdSmiGpuBlock): @@ -2475,8 +2475,8 @@ def amdsmi_dev_get_ecc_count( ec = amdsmi_wrapper.amdsmi_error_count_t() _check_res( - amdsmi_wrapper.amdsmi_dev_get_ecc_count( - device_handle, block, ctypes.byref(ec)) + amdsmi_wrapper. amdsmi_dev_get_ecc_count( + processor_handle, block, ctypes.byref(ec)) ) return { @@ -2486,28 +2486,28 @@ def amdsmi_dev_get_ecc_count( def amdsmi_dev_get_ecc_enabled( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) blocks = ctypes.c_uint64(0) _check_res( amdsmi_wrapper. amdsmi_dev_get_ecc_enabled( - device_handle, ctypes.byref(blocks)) + processor_handle, ctypes.byref(blocks)) ) return blocks.value def amdsmi_dev_get_ecc_status( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> AmdSmiRasErrState: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(block, AmdSmiGpuBlock): @@ -2516,7 +2516,7 @@ def amdsmi_dev_get_ecc_status( state = amdsmi_wrapper.amdsmi_ras_err_state_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_ecc_status( - device_handle, block, ctypes.byref(state) + processor_handle, block, ctypes.byref(state) ) ) @@ -2604,39 +2604,39 @@ def amdsmi_get_compute_process_gpus(pid: int) -> List[int]: def amdsmi_dev_xgmi_error_status( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> AmdSmiXgmiStatus: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) status = amdsmi_wrapper.amdsmi_xgmi_status_t() _check_res( amdsmi_wrapper.amdsmi_dev_xgmi_error_status( - device_handle, ctypes.byref(status)) + processor_handle, ctypes.byref(status)) ) return AmdSmiXgmiStatus(status.value) def amdsmi_dev_reset_xgmi_error( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_xgmi_error(device_handle)) + _check_res(amdsmi_wrapper.amdsmi_dev_reset_xgmi_error(processor_handle)) def amdsmi_dev_get_memory_reserved_pages( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) num_pages = ctypes.c_uint32() @@ -2644,7 +2644,7 @@ def amdsmi_dev_get_memory_reserved_pages( amdsmi_wrapper.amdsmi_retired_page_record_t)() _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_reserved_pages( - device_handle, ctypes.byref(num_pages), retired_page_record + processor_handle, ctypes.byref(num_pages), retired_page_record ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 105c190480..d2c07d3ec4 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -899,7 +899,7 @@ class struct_c__SA_amdsmi_evt_notification_data_t(Structure): struct_c__SA_amdsmi_evt_notification_data_t._pack_ = 1 # source:False struct_c__SA_amdsmi_evt_notification_data_t._fields_ = [ - ('device_handle', ctypes.POINTER(None)), + ('processor_handle', ctypes.POINTER(None)), ('event', amdsmi_evt_notification_type_t), ('message', ctypes.c_char * 64), ('PADDING_0', ctypes.c_ubyte * 4), @@ -1411,15 +1411,15 @@ size_t = ctypes.c_uint64 amdsmi_get_socket_info = _libraries['libamd_smi.so'].amdsmi_get_socket_info amdsmi_get_socket_info.restype = amdsmi_status_t amdsmi_get_socket_info.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_char), size_t] -amdsmi_get_device_handles = _libraries['libamd_smi.so'].amdsmi_get_device_handles -amdsmi_get_device_handles.restype = amdsmi_status_t -amdsmi_get_device_handles.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.POINTER(None))] +amdsmi_get_processor_handles = _libraries['libamd_smi.so'].amdsmi_get_processor_handles +amdsmi_get_processor_handles.restype = amdsmi_status_t +amdsmi_get_processor_handles.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.POINTER(None))] amdsmi_get_device_type = _libraries['libamd_smi.so'].amdsmi_get_device_type amdsmi_get_device_type.restype = amdsmi_status_t amdsmi_get_device_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_device_type_t)] -amdsmi_get_device_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_device_handle_from_bdf -amdsmi_get_device_handle_from_bdf.restype = amdsmi_status_t -amdsmi_get_device_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))] +amdsmi_get_processor_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_processor_handle_from_bdf +amdsmi_get_processor_handle_from_bdf.restype = amdsmi_status_t +amdsmi_get_processor_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))] amdsmi_dev_get_id = _libraries['libamd_smi.so'].amdsmi_dev_get_id amdsmi_dev_get_id.restype = amdsmi_status_t amdsmi_dev_get_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] @@ -1899,7 +1899,7 @@ __all__ = \ 'amdsmi_get_compute_process_gpus', 'amdsmi_get_compute_process_info', 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_device_bdf', - 'amdsmi_get_device_handle_from_bdf', 'amdsmi_get_device_handles', + 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_device_type', 'amdsmi_get_device_uuid', 'amdsmi_get_driver_version', 'amdsmi_get_ecc_error_count', 'amdsmi_get_event_notification', 'amdsmi_get_func_iter_value', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 93c973f3fd..bcf5c8ce55 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -100,16 +100,16 @@ class CmdLineParser: return True return False - def _get_device_handle_from_id(self, gpu_id, vf_id=None): - devices = smi_api.amdsmi_get_device_handles() + def _get_processor_handle_from_id(self, gpu_id, vf_id=None): + devices = smi_api.amdsmi_get_processor_handles() self._check_range("gpu id", gpu_id, 0, len(devices) - 1) - device_handle = devices[gpu_id] + processor_handle = devices[gpu_id] if vf_id is not None: - partitions = smi_api.amdsmi_get_vf_partition_info(device_handle) + partitions = smi_api.amdsmi_get_vf_partition_info(processor_handle) self._check_range("vf id", vf_id, 0, len(partitions) - 1) - device_handle = smi_api.amdsmi_get_vf_handle_from_vf_index(device_handle, vf_id) - return device_handle + processor_handle = smi_api.amdsmi_get_vf_handle_from_vf_index(processor_handle, vf_id) + return processor_handle def _parse_vf_id_if_exists(self): gpu_id = None @@ -156,32 +156,32 @@ class CmdLineParser: return self.command_entry[0] - def get_device_handle(self): - device_handles = [] + def get_processor_handle(self): + processor_handles = [] - def parse_device_handle(position): - self._check_if_arg_exists("Device identifier", "device bdf or device id", position) + def parse_processor_handle(possition): + self._check_if_arg_exists("Device identifier", "device bdf or device id", possition) ids = self._parse_vf_id_if_exists() if ids["gpu_id"] is not None and ids["vf_id"] is not None: - device_handle = self._get_device_handle_from_id(ids["gpu_id"], ids["vf_id"]) + processor_handle = self._get_processor_handle_from_id(ids["gpu_id"], ids["vf_id"]) else: gpu_arg = self.cmd_args[position] if gpu_arg.isdigit(): - device_handle = self._get_device_handle_from_id(int(gpu_arg)) + processor_handle = self._get_processor_handle_from_id(int(gpu_arg)) else: self._check_bdf(gpu_arg) - device_handle = smi_api.amdsmi_get_device_handle_from_bdf(gpu_arg) - device_handles.append(device_handle) + processor_handle = smi_api.amdsmi_get_processor_handle_from_bdf(gpu_arg) + processor_handles.append(processor_handle) for i in range(len(self.command_entry)): if f"device_identifier{i + 1}" in self.command_entry[1]: - parse_device_handle(i + 2) + parse_processor_handle(i + 2) - if len(device_handles) == 0: + if len(processor_handles) == 0: return None - return device_handles + return processor_handles def get_command_args(self): offset = 2 + self.extra_args @@ -336,7 +336,7 @@ class Formatter: | """ + self.style.text("47 Get topo get link type. Api: amdsmi_topo_get_link_type ") + """ | | """ + self.style.text("48 Get is P2P accessible. Api: amdsmi_is_P2P_accessible ") + """ | | """ + self.style.text("49 Get asic info. Api: amdsmi_get_asic_info ") + """ | - | """ + self.style.text("50 Get device_handles. Api: amdsmi_get_device_handles ") + """ | + | """ + self.style.text("50 Get processor_handles. Api: amdsmi_get_processor_handles ") + """ | | """ + self.style.text("51 Get event notification. Api: amdsmi_get_event_notification ") + """ | | """ + self.style.text("52 Init event notification. Api: amdsmi_init_event_notification ") + """ | | """ + self.style.text("53 Set event notification mask. Api: amdsmi_set_event_notification_mask ") + """ | @@ -874,7 +874,7 @@ commands = { 49: [smi_api.amdsmi_get_asic_info, { "device_identifier1": [None, True] }], - 50: [smi_api.amdsmi_get_device_handles, {}], + 50: [smi_api.amdsmi_get_processor_handles, {}], 51: [amdsmi_tool_event_notification_get, { "device_identifier1": [None, True] }], @@ -994,22 +994,22 @@ if __name__ == "__main__": smi_api.amdsmi_init() command = parser.get_command_handle() - device_handles = parser.get_device_handle() + processor_handles = parser.get_processor_handle() command_args = parser.get_command_args() result = None - if not device_handles and not command_args: + if not processor_handles and not command_args: result = command() - elif not device_handles and command_args: + elif not processor_handles and command_args: result = command(command_args) - elif len(device_handles) == 1 and not command_args: - result = command(device_handles[0]) - elif len(device_handles) > 1 and not command_args: - result = command(device_handles) - elif len(device_handles) == 1 and command_args: - result = command(device_handles[0], command_args) + elif len(processor_handles) == 1 and not command_args: + result = command(processor_handles[0]) + elif len(processor_handles) > 1 and not command_args: + result = command(processor_handles) + elif len(processor_handles) == 1 and command_args: + result = command(processor_handles[0], command_args) else: - result = command(device_handles, command_args) + result = command(processor_handles, command_args) formatter.print_output(result) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index ec9109c26e..1ce630123a 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -76,21 +76,21 @@ static bool initialized_lib = false; } \ } while (0) -static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle device_handle, +static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle processor_handle, amd::smi::AMDSmiGPUDevice** gpudevice) { AMDSMI_CHECK_INIT(); - if (device_handle == nullptr || gpudevice == nullptr) + if (processor_handle == nullptr || gpudevice == nullptr) return AMDSMI_STATUS_INVAL; amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &device); + .handle_to_device(processor_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; if (device->get_device_type() == AMD_GPU) { - *gpudevice = static_cast(device_handle); + *gpudevice = static_cast(processor_handle); return AMDSMI_STATUS_SUCCESS; } @@ -99,12 +99,12 @@ static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle device template amdsmi_status_t rsmi_wrapper(F && f, - amdsmi_processor_handle device_handle, Args &&... args) { + amdsmi_processor_handle processor_handle, Args &&... args) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -214,9 +214,9 @@ amdsmi_status_t amdsmi_get_socket_info( return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, +amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, uint32_t* device_count, - amdsmi_processor_handle* device_handles) { + amdsmi_processor_handle* processor_handles) { AMDSMI_CHECK_INIT(); if (device_count == nullptr) { @@ -233,23 +233,23 @@ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, std::vector& devices = socket->get_devices(); uint32_t device_size = static_cast(devices.size()); // Get the device count only - if (device_handles == nullptr) { + if (processor_handles == nullptr) { *device_count = device_size; return AMDSMI_STATUS_SUCCESS; } - // If the device_handles can hold all devices, return all of them. + // If the processor_handles can hold all devices, return all of them. *device_count = *device_count >= device_size ? device_size : *device_count; // Copy the device handles for (uint32_t i = 0; i < *device_count; i++) { - device_handles[i] = reinterpret_cast(devices[i]); + processor_handles[i] = reinterpret_cast(devices[i]); } return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle , +amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle processor_handle , device_type_t* device_type) { AMDSMI_CHECK_INIT(); @@ -259,7 +259,7 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle , } amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &device); + .handle_to_device(processor_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; *device_type = device->get_device_type(); @@ -267,7 +267,7 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle , } amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf) { +amdsmi_get_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf) { AMDSMI_CHECK_INIT(); @@ -276,7 +276,7 @@ amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf) } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -286,7 +286,7 @@ amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf) return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t *board_info) { +amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *board_info) { AMDSMI_CHECK_INIT(); @@ -296,7 +296,7 @@ amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amd amdsmi_status_t status; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -307,11 +307,11 @@ amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amd else { // ignore the errors so that it can populate as many fields as possible. // call rocm-smi which search multiple places for device name - status = rsmi_wrapper(rsmi_dev_name_get, device_handle, + status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, board_info->product_name, AMDSMI_PRODUCT_NAME_LENGTH); if (board_info->product_serial[0] == '\0') { - status = rsmi_wrapper(rsmi_dev_serial_number_get, device_handle, + status = rsmi_wrapper(rsmi_dev_serial_number_get, processor_handle, board_info->product_serial, AMDSMI_NORMAL_STRING_LENGTH); } } @@ -319,7 +319,7 @@ amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amd return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle processor_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature) { @@ -333,20 +333,20 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handl if (sensor_type == TEMPERATURE_TYPE_PLX) { amdsmi_gpu_metrics_t metric_info; auto r_status = amdsmi_dev_get_gpu_metrics_info( - device_handle, &metric_info); + processor_handle, &metric_info); if (r_status != AMDSMI_STATUS_SUCCESS) return r_status; *temperature = metric_info.temperature_vrsoc; return r_status; } - amdsmi_status_t amdsmi_status = rsmi_wrapper(rsmi_dev_temp_metric_get, device_handle, + amdsmi_status_t amdsmi_status = rsmi_wrapper(rsmi_dev_temp_metric_get, processor_handle, static_cast(sensor_type), static_cast(metric), temperature); *temperature /= 1000; return amdsmi_status; } -amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *vram_info) { AMDSMI_CHECK_INIT(); @@ -357,7 +357,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &device); + .handle_to_device(processor_handle, &device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; if (device->get_device_type() != AMD_GPU) { @@ -365,7 +365,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -388,7 +388,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_caps_t *info) { AMDSMI_CHECK_INIT(); @@ -399,14 +399,14 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amd::smi::AMDSmiProcessor* amd_device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &amd_device); + .handle_to_device(processor_handle, &amd_device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; if (amd_device->get_device_type() != AMD_GPU) { return AMDSMI_STATUS_NOT_SUPPORTED; } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -478,42 +478,42 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed) { - return rsmi_wrapper(rsmi_dev_fan_rpms_get, device_handle, sensor_ind, + return rsmi_wrapper(rsmi_dev_fan_rpms_get, processor_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed) { - return rsmi_wrapper(rsmi_dev_fan_speed_get, device_handle, + return rsmi_wrapper(rsmi_dev_fan_speed_get, processor_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *max_speed) { - return rsmi_wrapper(rsmi_dev_fan_speed_max_get, device_handle, + return rsmi_wrapper(rsmi_dev_fan_speed_max_get, processor_handle, sensor_ind, max_speed); } -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind) { - return rsmi_wrapper(rsmi_dev_fan_reset, device_handle, sensor_ind); + return rsmi_wrapper(rsmi_dev_fan_reset, processor_handle, sensor_ind); } -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t speed) { - return rsmi_wrapper(rsmi_dev_fan_speed_set, device_handle, + return rsmi_wrapper(rsmi_dev_fan_speed_set, processor_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, uint16_t *id) { - return rsmi_wrapper(rsmi_dev_id_get, device_handle, id); + return rsmi_wrapper(rsmi_dev_id_get, processor_handle, id); } // TODO(bliu) : add fw info from libdrm -amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *info) { const std::map fw_in_rsmi = { { FW_ID_ASD, RSMI_FW_BLOCK_ASD}, @@ -547,7 +547,7 @@ amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle device_handle, // collect all rsmi supported fw block for (auto ite = fw_in_rsmi.begin(); ite != fw_in_rsmi.end(); ite ++) { - auto status = rsmi_wrapper(rsmi_dev_firmware_version_get, device_handle, + auto status = rsmi_wrapper(rsmi_dev_firmware_version_get, processor_handle, (*ite).second, &(info->fw_info_list[info->num_fw_info].fw_version)); if (status == AMDSMI_STATUS_SUCCESS) { @@ -559,7 +559,7 @@ amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle device_handle, } amdsmi_status_t -amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t *info) { +amdsmi_get_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info) { AMDSMI_CHECK_INIT(); @@ -572,7 +572,7 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * uint16_t subvendor_id = 0; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -592,7 +592,7 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * status = smi_amdgpu_get_market_name_from_dev_id(dev_info.device_id, info->market_name); if (status != AMDSMI_STATUS_SUCCESS) { - rsmi_wrapper(rsmi_dev_brand_get, device_handle, + rsmi_wrapper(rsmi_dev_brand_get, processor_handle, info->market_name, AMDSMI_NORMAL_STRING_LENGTH); } @@ -603,17 +603,17 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * } // For other sysfs related information, get from rocm-smi else { - status = rsmi_wrapper(rsmi_dev_serial_number_get, device_handle, + status = rsmi_wrapper(rsmi_dev_serial_number_get, processor_handle, info->asic_serial, AMDSMI_NORMAL_STRING_LENGTH); - status = rsmi_wrapper(rsmi_dev_brand_get, device_handle, + status = rsmi_wrapper(rsmi_dev_brand_get, processor_handle, info->market_name, AMDSMI_NORMAL_STRING_LENGTH); - status = rsmi_wrapper(rsmi_dev_vendor_id_get, device_handle, + status = rsmi_wrapper(rsmi_dev_vendor_id_get, processor_handle, &vendor_id); if (status == AMDSMI_STATUS_SUCCESS) info->vendor_id = vendor_id; - status = rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, device_handle, + status = rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, processor_handle, &subvendor_id); if (status == AMDSMI_STATUS_SUCCESS) info->subvendor_id = subvendor_id; } @@ -622,36 +622,36 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * } -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id) { - return rsmi_wrapper(rsmi_dev_subsystem_id_get, device_handle, id); + return rsmi_wrapper(rsmi_dev_subsystem_id_get, processor_handle, id); } amdsmi_status_t amdsmi_dev_get_subsystem_name( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, char *name, size_t len) { - return rsmi_wrapper(rsmi_dev_subsystem_name_get, device_handle, name, len); + return rsmi_wrapper(rsmi_dev_subsystem_name_get, processor_handle, name, len); } amdsmi_status_t amdsmi_dev_get_vendor_name( - amdsmi_processor_handle device_handle, char *name, size_t len) { - return rsmi_wrapper(rsmi_dev_vendor_name_get, device_handle, name, len); + amdsmi_processor_handle processor_handle, char *name, size_t len) { + return rsmi_wrapper(rsmi_dev_vendor_name_get, processor_handle, name, len); } -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len) { - return rsmi_wrapper(rsmi_dev_vram_vendor_get, device_handle, brand, len); + return rsmi_wrapper(rsmi_dev_vram_vendor_get, processor_handle, brand, len); } amdsmi_status_t -amdsmi_init_event_notification(amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_event_notification_init, device_handle); +amdsmi_init_event_notification(amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_event_notification_init, processor_handle); } amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_processor_handle device_handle, + amdsmi_set_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask) { - return rsmi_wrapper(rsmi_event_notification_mask_set, device_handle, mask); + return rsmi_wrapper(rsmi_event_notification_mask_set, processor_handle, mask); } amdsmi_status_t @@ -678,7 +678,7 @@ amdsmi_status_t strncpy(data[i].message, rsmi_data.message, MAX_EVENT_NOTIFICATION_MSG_SIZE); amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .gpu_index_to_handle(rsmi_data.dv_ind, &(data[i].device_handle)); + .gpu_index_to_handle(rsmi_data.dv_ind, &(data[i].processor_handle)); if (r != AMDSMI_STATUS_SUCCESS) return r; } @@ -686,19 +686,19 @@ amdsmi_status_t } amdsmi_status_t amdsmi_stop_event_notification( - amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_event_notification_stop, device_handle); + amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_event_notification_stop, processor_handle); } amdsmi_status_t amdsmi_dev_counter_group_supported( - amdsmi_processor_handle device_handle, amdsmi_event_group_t group) { - return rsmi_wrapper(rsmi_dev_counter_group_supported, device_handle, + amdsmi_processor_handle processor_handle, amdsmi_event_group_t group) { + return rsmi_wrapper(rsmi_dev_counter_group_supported, processor_handle, static_cast(group)); } -amdsmi_status_t amdsmi_dev_create_counter(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle) { - return rsmi_wrapper(rsmi_dev_counter_create, device_handle, + return rsmi_wrapper(rsmi_dev_counter_create, processor_handle, static_cast(type), static_cast(evnt_handle)); } @@ -727,29 +727,29 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, } amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_processor_handle device_handle, + amdsmi_counter_get_available_counters(amdsmi_processor_handle processor_handle, amdsmi_event_group_t grp, uint32_t *available) { - return rsmi_wrapper(rsmi_counter_available_counters_get, device_handle, + return rsmi_wrapper(rsmi_counter_available_counters_get, processor_handle, static_cast(grp), available); } amdsmi_status_t -amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t *numa_node) { - return rsmi_wrapper(rsmi_topo_get_numa_node_number, device_handle, numa_node); +amdsmi_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint32_t *numa_node) { + return rsmi_wrapper(rsmi_topo_get_numa_node_number, processor_handle, numa_node); } amdsmi_status_t -amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *weight) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_topo_get_link_weight(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -758,16 +758,16 @@ amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_pr } amdsmi_status_t - amdsmi_get_minmax_bandwidth(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, + amdsmi_get_minmax_bandwidth(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_minmax_bandwidth_get(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -776,16 +776,16 @@ amdsmi_status_t } amdsmi_status_t -amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_type(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *hops, AMDSMI_IO_LINK_TYPE *type) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_topo_get_link_type(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -794,17 +794,17 @@ amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, amdsmi_proc } amdsmi_status_t -amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, - amdsmi_processor_handle device_handle_dst, +amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, + amdsmi_processor_handle processor_handle_dst, bool *accessible) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_is_P2P_accessible(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -814,34 +814,34 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, // TODO(bliu) : other xgmi related information amdsmi_status_t -amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t *info) { +amdsmi_get_xgmi_info(amdsmi_processor_handle processor_handle, amdsmi_xgmi_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_xgmi_hive_id_get, device_handle, + return rsmi_wrapper(rsmi_dev_xgmi_hive_id_get, processor_handle, &(info->xgmi_hive_id)); } amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_processor_handle device_handle, amdsmi_xgmi_status_t *status) { - return rsmi_wrapper(rsmi_dev_xgmi_error_status, device_handle, +amdsmi_dev_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status) { + return rsmi_wrapper(rsmi_dev_xgmi_error_status, processor_handle, reinterpret_cast(status)); } amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_dev_xgmi_error_reset, device_handle); +amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_dev_xgmi_error_reset, processor_handle); } amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle device_handle, +amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle, amdsmi_func_id_iter_handle_t *handle) { AMDSMI_CHECK_INIT(); if (handle == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_supported_func_iterator_open, device_handle, + return rsmi_wrapper(rsmi_dev_supported_func_iterator_open, processor_handle, reinterpret_cast(handle)); } @@ -1008,60 +1008,60 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, return amd::smi::rsmi_to_amdsmi_status(r); } -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); if (ec == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_ecc_count_get, device_handle, + return rsmi_wrapper(rsmi_dev_ecc_count_get, processor_handle, static_cast(block), reinterpret_cast(ec)); } -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks) { AMDSMI_CHECK_INIT(); if (enabled_blocks == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_ecc_enabled_get, device_handle, + return rsmi_wrapper(rsmi_dev_ecc_enabled_get, processor_handle, enabled_blocks); } -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); if (state == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_ecc_status_get, device_handle, + return rsmi_wrapper(rsmi_dev_ecc_status_get, processor_handle, static_cast(block), reinterpret_cast(state)); } amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, +amdsmi_dev_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent) { AMDSMI_CHECK_INIT(); if (busy_percent == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_busy_percent_get, device_handle, + return rsmi_wrapper(rsmi_dev_busy_percent_get, processor_handle, busy_percent); } amdsmi_status_t amdsmi_dev_get_gpu_metrics_info( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, amdsmi_gpu_metrics_t *pgpu_metrics) { AMDSMI_CHECK_INIT(); if (pgpu_metrics == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_gpu_metrics_info_get, device_handle, + return rsmi_wrapper(rsmi_dev_gpu_metrics_info_get, processor_handle, reinterpret_cast(pgpu_metrics)); } amdsmi_status_t -amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, +amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info) { AMDSMI_CHECK_INIT(); @@ -1071,9 +1071,13 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, bool set_ret_success = false; amd::smi::AMDSmiGPUDevice* gpudevice = nullptr; + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpudevice); + if (r != AMDSMI_STATUS_SUCCESS) + return r; + amdsmi_status_t status; - status = get_gpu_device_from_handle(device_handle, &gpudevice); + status = get_gpu_device_from_handle(processor_handle, &gpudevice); if (status != AMDSMI_STATUS_SUCCESS) { return status; @@ -1097,20 +1101,20 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, info->dpm_cap = dpm; } else { - status = rsmi_wrapper(rsmi_dev_power_cap_get, device_handle, + status = rsmi_wrapper(rsmi_dev_power_cap_get, processor_handle, sensor_ind, &(info->power_cap)); if ((status == AMDSMI_STATUS_SUCCESS) && !set_ret_success) set_ret_success = true; } // Get other information from rocm-smi - status = rsmi_wrapper(rsmi_dev_power_cap_default_get, device_handle, + status = rsmi_wrapper(rsmi_dev_power_cap_default_get, processor_handle, &(info->default_power_cap)); if ((status == AMDSMI_STATUS_SUCCESS) && !set_ret_success) set_ret_success = true; - status = rsmi_wrapper(rsmi_dev_power_cap_range_get, device_handle, sensor_ind, + status = rsmi_wrapper(rsmi_dev_power_cap_range_get, processor_handle, sensor_ind, &(info->max_power_cap), &(info->min_power_cap)); if ((status == AMDSMI_STATUS_SUCCESS) && !set_ret_success) @@ -1120,85 +1124,85 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, } amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_processor_handle device_handle, + amdsmi_dev_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap) { - return rsmi_wrapper(rsmi_dev_power_cap_set, device_handle, + return rsmi_wrapper(rsmi_dev_power_cap_set, processor_handle, sensor_ind, cap); } amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, +amdsmi_dev_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *power) { AMDSMI_CHECK_INIT(); if (power == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_power_ave_get, device_handle, + return rsmi_wrapper(rsmi_dev_power_ave_get, processor_handle, sensor_ind, power); } amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle device_handle, + amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status) { AMDSMI_CHECK_INIT(); if (status == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_power_profile_presets_get, device_handle, + return rsmi_wrapper(rsmi_dev_power_profile_presets_get, processor_handle, sensor_ind, reinterpret_cast(status)); } amdsmi_status_t amdsmi_set_perf_determinism_mode( - amdsmi_processor_handle device_handle, uint64_t clkvalue) { - return rsmi_wrapper(rsmi_perf_determinism_mode_set, device_handle, + amdsmi_processor_handle processor_handle, uint64_t clkvalue) { + return rsmi_wrapper(rsmi_perf_determinism_mode_set, processor_handle, clkvalue); } amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_processor_handle device_handle, + amdsmi_dev_set_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile) { - return rsmi_wrapper(rsmi_dev_power_profile_set, device_handle, + return rsmi_wrapper(rsmi_dev_power_profile_set, processor_handle, reserved, static_cast(profile)); } -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t *perf) { AMDSMI_CHECK_INIT(); if (perf == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_perf_level_get, device_handle, + return rsmi_wrapper(rsmi_dev_perf_level_get, processor_handle, reinterpret_cast(perf)); } amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_processor_handle device_handle, + amdsmi_dev_set_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl) { - return rsmi_wrapper(rsmi_dev_perf_level_set, device_handle, + return rsmi_wrapper(rsmi_dev_perf_level_set, processor_handle, static_cast(perf_lvl)); } amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle device_handle, + amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl) { - return rsmi_wrapper(rsmi_dev_perf_level_set_v1, device_handle, + return rsmi_wrapper(rsmi_dev_perf_level_set_v1, processor_handle, static_cast(perf_lvl)); } -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask) { - return rsmi_wrapper(rsmi_dev_pci_bandwidth_set, device_handle, + return rsmi_wrapper(rsmi_dev_pci_bandwidth_set, processor_handle, bw_bitmask); } -amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth) { - return rsmi_wrapper(rsmi_dev_pci_bandwidth_get, device_handle, + return rsmi_wrapper(rsmi_dev_pci_bandwidth_get, processor_handle, reinterpret_cast(bandwidth)); } // TODO(bliu): other frequencies in amdsmi_clk_type_t -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f) { AMDSMI_CHECK_INIT(); @@ -1212,7 +1216,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_hand clk_type == CLK_TYPE_DCLK1 ) { amdsmi_gpu_metrics_t metric_info; auto r_status = amdsmi_dev_get_gpu_metrics_info( - device_handle, &metric_info); + processor_handle, &metric_info); if (r_status != AMDSMI_STATUS_SUCCESS) return r_status; @@ -1237,12 +1241,12 @@ amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_hand return r_status; } - return rsmi_wrapper(rsmi_dev_gpu_clk_freq_get, device_handle, + return rsmi_wrapper(rsmi_dev_gpu_clk_freq_get, processor_handle, static_cast(clk_type), reinterpret_cast(f)); } -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask) { AMDSMI_CHECK_INIT(); @@ -1254,142 +1258,142 @@ amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_NOT_SUPPORTED; } - return rsmi_wrapper(rsmi_dev_gpu_clk_freq_set, device_handle, + return rsmi_wrapper(rsmi_dev_gpu_clk_freq_set, processor_handle, static_cast(clk_type), freq_bitmask); } amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, +amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records) { - return rsmi_wrapper(rsmi_dev_memory_reserved_pages_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_reserved_pages_get, processor_handle, num_pages, reinterpret_cast(records)); } -amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total) { - return rsmi_wrapper(rsmi_dev_memory_total_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_total_get, processor_handle, static_cast(mem_type), total); } -amdsmi_status_t amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used) { - return rsmi_wrapper(rsmi_dev_memory_usage_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_usage_get, processor_handle, static_cast(mem_type), used); } amdsmi_status_t amdsmi_dev_get_overdrive_level( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t *od) { - return rsmi_wrapper(rsmi_dev_overdrive_level_get, device_handle, od); + return rsmi_wrapper(rsmi_dev_overdrive_level_get, processor_handle, od); } amdsmi_status_t amdsmi_dev_set_overdrive_level( - amdsmi_processor_handle device_handle, uint32_t od) { - return rsmi_wrapper(rsmi_dev_overdrive_level_set, device_handle, od); + amdsmi_processor_handle processor_handle, uint32_t od) { + return rsmi_wrapper(rsmi_dev_overdrive_level_set, processor_handle, od); } amdsmi_status_t amdsmi_dev_get_pci_replay_counter( - amdsmi_processor_handle device_handle, uint64_t *counter) { + amdsmi_processor_handle processor_handle, uint64_t *counter) { return rsmi_wrapper(rsmi_dev_pci_replay_counter_get, - device_handle, counter); + processor_handle, counter); } amdsmi_status_t amdsmi_dev_get_pci_throughput( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz) { - return rsmi_wrapper(rsmi_dev_pci_throughput_get, device_handle, + return rsmi_wrapper(rsmi_dev_pci_throughput_get, processor_handle, sent, received, max_pkt_sz); } -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_handle, amdsmi_od_volt_freq_data_t *odv) { - return rsmi_wrapper(rsmi_dev_od_volt_info_get, device_handle, + return rsmi_wrapper(rsmi_dev_od_volt_info_get, processor_handle, reinterpret_cast(odv)); } amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer) { - return rsmi_wrapper(rsmi_dev_od_volt_curve_regions_get, device_handle, + return rsmi_wrapper(rsmi_dev_od_volt_curve_regions_get, processor_handle, num_regions, reinterpret_cast(buffer)); } -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle processor_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage) { - return rsmi_wrapper(rsmi_dev_volt_metric_get, device_handle, + return rsmi_wrapper(rsmi_dev_volt_metric_get, processor_handle, static_cast(sensor_type), static_cast(metric), voltage); } -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType) { - return rsmi_wrapper(rsmi_dev_od_clk_info_set, device_handle, + return rsmi_wrapper(rsmi_dev_od_clk_info_set, processor_handle, static_cast(level), clkvalue, static_cast(clkType)); } -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue) { - return rsmi_wrapper(rsmi_dev_od_volt_info_set, device_handle, + return rsmi_wrapper(rsmi_dev_od_volt_info_set, processor_handle, vpoint, clkvalue, voltvalue); } -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType) { - return rsmi_wrapper(rsmi_dev_clk_range_set, device_handle, + return rsmi_wrapper(rsmi_dev_clk_range_set, processor_handle, minclkvalue, maxclkvalue, static_cast(clkType)); } amdsmi_status_t amdsmi_dev_set_overdrive_level_v1( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t od) { - return rsmi_wrapper(rsmi_dev_overdrive_level_set_v1, device_handle, + return rsmi_wrapper(rsmi_dev_overdrive_level_set_v1, processor_handle, od); } -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_dev_gpu_reset, device_handle); +amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_dev_gpu_reset, processor_handle); } -amdsmi_status_t amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_utilization_count(amdsmi_processor_handle processor_handle, amdsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp) { - return rsmi_wrapper(rsmi_utilization_count_get, device_handle, + return rsmi_wrapper(rsmi_utilization_count_get, processor_handle, reinterpret_cast(utilization_counters), count, timestamp); } amdsmi_status_t amdsmi_dev_get_memory_busy_percent( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t *busy_percent) { - return rsmi_wrapper(rsmi_dev_memory_busy_percent_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_busy_percent_get, processor_handle, busy_percent); } -amdsmi_status_t amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_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, device_handle, + return rsmi_wrapper(rsmi_dev_energy_count_get, processor_handle, power, counter_resolution, timestamp); } amdsmi_status_t amdsmi_dev_get_drm_render_minor( - amdsmi_processor_handle device_handle, uint32_t *minor) { - return rsmi_wrapper(rsmi_dev_drm_render_minor_get, device_handle, + amdsmi_processor_handle processor_handle, uint32_t *minor) { + return rsmi_wrapper(rsmi_dev_drm_render_minor_get, processor_handle, minor); } amdsmi_status_t amdsmi_dev_get_pci_id( - amdsmi_processor_handle device_handle, uint64_t *bdfid) { - return rsmi_wrapper(rsmi_dev_pci_id_get, device_handle, + amdsmi_processor_handle processor_handle, uint64_t *bdfid) { + return rsmi_wrapper(rsmi_dev_pci_id_get, processor_handle, bdfid); } amdsmi_status_t amdsmi_topo_get_numa_affinity( - amdsmi_processor_handle device_handle, uint32_t *numa_node) { - return rsmi_wrapper(rsmi_topo_numa_affinity_get, device_handle, + amdsmi_processor_handle processor_handle, uint32_t *numa_node) { + return rsmi_wrapper(rsmi_topo_numa_affinity_get, processor_handle, numa_node); } @@ -1418,7 +1422,7 @@ amdsmi_status_t amdsmi_get_version_str(amdsmi_sw_component_t component, } amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t *info) { +amdsmi_get_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1429,7 +1433,7 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t amdsmi_status_t status; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1448,7 +1452,7 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t else { // get vbios version string from rocm_smi char vbios_version[AMDSMI_NORMAL_STRING_LENGTH]; - status = rsmi_wrapper(rsmi_dev_vbios_version_get, device_handle, + status = rsmi_wrapper(rsmi_dev_vbios_version_get, processor_handle, vbios_version, AMDSMI_NORMAL_STRING_LENGTH); @@ -1463,7 +1467,7 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t } amdsmi_status_t -amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usage_t *info) { +amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_usage_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1472,11 +1476,11 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usa amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1488,7 +1492,7 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usa } amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) { +amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1501,12 +1505,12 @@ amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_ amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1543,7 +1547,7 @@ amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_ } amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { +amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); if (state == nullptr || block > AMDSMI_GPU_BLOCK_LAST) { @@ -1552,7 +1556,7 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amd uint64_t features_mask = 0; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1567,7 +1571,7 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amd } amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { +amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { AMDSMI_CHECK_INIT(); if (num_pages == nullptr) { @@ -1575,7 +1579,7 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pa } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1594,7 +1598,7 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pa } amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_count_t *ec) { +amdsmi_get_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); if (ec == nullptr) { @@ -1602,7 +1606,7 @@ amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_c } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1621,7 +1625,7 @@ amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_c } amdsmi_status_t -amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes) { +amdsmi_get_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes) { AMDSMI_CHECK_INIT(); if (max_processes == nullptr) { @@ -1633,7 +1637,7 @@ amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_ha uint64_t size = 0; amdsmi_status_t status; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1669,7 +1673,7 @@ amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_ha } amdsmi_status_t -amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { +amdsmi_get_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1677,7 +1681,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1694,7 +1698,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha } amdsmi_status_t -amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_measure_t *info) { +amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_measure_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1703,20 +1707,20 @@ amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_mea amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } int64_t voltage_read = 0; - status = amdsmi_dev_get_volt_metric(device_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read); + status = amdsmi_dev_get_volt_metric(processor_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1737,7 +1741,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_mea } amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { +amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { AMDSMI_CHECK_INIT(); if (range == nullptr || clk_type > CLK_TYPE__MAX) { @@ -1746,14 +1750,14 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; int min = 0, max = 0; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1788,7 +1792,7 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ } amdsmi_status_t -amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, char *version) { +amdsmi_get_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version) { AMDSMI_CHECK_INIT(); if (length == nullptr || version == nullptr) { @@ -1796,7 +1800,7 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch } amdsmi_status_t status = AMDSMI_STATUS_SUCCESS; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1806,7 +1810,7 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch } amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid_length, char *uuid) { +amdsmi_get_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid) { AMDSMI_CHECK_INIT(); if (uuid_length == nullptr || uuid == nullptr) { @@ -1814,7 +1818,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1828,7 +1832,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid const uint8_t fcn = 0xff; std::string path = "/sys/class/drm/" + gpu_device->get_gpu_path() + "/device/uuid_info"; - status = amdsmi_get_asic_info(device_handle, &asic_info); + status = amdsmi_get_asic_info(processor_handle, &asic_info); if (status != AMDSMI_STATUS_SUCCESS) { printf("Getting asic info failed. Return code: %d", status); return status; @@ -1854,7 +1858,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid } amdsmi_status_t -amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info){ +amdsmi_get_pcie_link_status(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info){ AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1863,7 +1867,7 @@ amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_i amdsmi_status_t status = AMDSMI_STATUS_SUCCESS; amdsmi_gpu_metrics_t metric_info = {}; status = amdsmi_dev_get_gpu_metrics_info( - device_handle, &metric_info); + processor_handle, &metric_info); if (status != AMDSMI_STATUS_SUCCESS) return status; @@ -1873,7 +1877,7 @@ amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_i return status; } -amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info) { +amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1882,7 +1886,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_status_t status = AMDSMI_STATUS_SUCCESS; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1919,7 +1923,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_API_FAILED; } - status = amdsmi_get_asic_info(device_handle, &asic_info); + status = amdsmi_get_asic_info(processor_handle, &asic_info); if (status != AMDSMI_STATUS_SUCCESS) return status; @@ -1931,8 +1935,8 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, return status; } -amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, - amdsmi_processor_handle* device_handle) +amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, + amdsmi_processor_handle* processor_handle) { amdsmi_status_t status; uint32_t socket_count = 0; @@ -1942,7 +1946,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, AMDSMI_CHECK_INIT(); - if (device_handle == nullptr) { + if (processor_handle == nullptr) { return AMDSMI_STATUS_INVAL; } @@ -1959,7 +1963,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, } for (unsigned int i = 0; i < socket_count; i++) { - status = amdsmi_get_device_handles(sockets[i], &device_count, devs); + status = amdsmi_get_processor_handles(sockets[i], &device_count, devs); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1975,7 +1979,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, bdf.device_number == found_bdf.device_number && bdf.domain_number == found_bdf.domain_number && bdf.function_number == found_bdf.function_number) { - *device_handle = devs[idx]; + *processor_handle = devs[idx]; return AMDSMI_STATUS_SUCCESS; } } diff --git a/projects/amdsmi/src/amd_smi/amd_smi_system.cc b/projects/amdsmi/src/amd_smi/amd_smi_system.cc index d81dfb0c00..19c9c51292 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_system.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_system.cc @@ -165,12 +165,12 @@ amdsmi_status_t AMDSmiSystem::handle_to_socket( } amdsmi_status_t AMDSmiSystem::handle_to_device( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, AMDSmiProcessor** device) { - if (device_handle == nullptr || device == nullptr) { + if (processor_handle == nullptr || device == nullptr) { return AMDSMI_STATUS_INVAL; } - *device = static_cast(device_handle); + *device = static_cast(processor_handle); // double check handlers is here if (std::find(devices_.begin(), devices_.end(), *device) @@ -181,8 +181,8 @@ amdsmi_status_t AMDSmiSystem::handle_to_device( } amdsmi_status_t AMDSmiSystem::gpu_index_to_handle(uint32_t gpu_index, - amdsmi_processor_handle* device_handle) { - if (device_handle == nullptr) + amdsmi_processor_handle* processor_handle) { + if (processor_handle == nullptr) return AMDSMI_STATUS_INVAL; auto iter = devices_.begin(); @@ -194,7 +194,7 @@ amdsmi_status_t AMDSmiSystem::gpu_index_to_handle(uint32_t gpu_index, static_cast(cur_device); uint32_t cur_gpu_index = gpu_device->get_gpu_id(); if (gpu_index == cur_gpu_index) { - *device_handle = cur_device; + *processor_handle = cur_device; return AMDSMI_STATUS_SUCCESS; } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc index 5856ea1b91..d7de667630 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc @@ -102,11 +102,11 @@ void TestAPISupportRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { IF_VERB(STANDARD) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); std::cout << "Supported AMDSMI Functions:" << std::endl; std::cout << "\tVariants (Monitors)" << std::endl; } - err = amdsmi_dev_open_supported_func_iterator(device_handles_[i], &iter_handle); + err = amdsmi_dev_open_supported_func_iterator(processor_handles_[i], &iter_handle); CHK_ERR_ASRT(err) while (1) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc index ca57be0c24..db8dc6ba09 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc @@ -98,9 +98,9 @@ void TestErrCntRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_ecc_enabled(device_handles_[i], &enabled_mask); + err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], &enabled_mask); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -108,7 +108,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr); + err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); continue; @@ -116,7 +116,7 @@ void TestErrCntRead::Run(void) { CHK_ERR_ASRT(err) // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr); + err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { @@ -126,7 +126,7 @@ void TestErrCntRead::Run(void) { } for (uint32_t b = AMDSMI_GPU_BLOCK_FIRST; b <= AMDSMI_GPU_BLOCK_LAST; b = b*2) { - err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast(b), &err_state); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { @@ -135,11 +135,11 @@ void TestErrCntRead::Run(void) { " block: " << GetErrStateNameStr(err_state) << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast(b), &ec); + err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), &ec); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -148,7 +148,7 @@ void TestErrCntRead::Run(void) { ": Not supported for this device" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); @@ -164,7 +164,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc index e7f820b1b5..9a7505611b 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc @@ -109,7 +109,7 @@ void TestEvtNotifReadWrite::Run(void) { } for (dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - ret = amdsmi_init_event_notification(device_handles_[dv_ind]); + ret = amdsmi_init_event_notification(processor_handles_[dv_ind]); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -119,7 +119,7 @@ void TestEvtNotifReadWrite::Run(void) { return; } ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); - ret = amdsmi_set_event_notification_mask(device_handles_[dv_ind], mask); + ret = amdsmi_set_event_notification_mask(processor_handles_[dv_ind], mask); ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); } @@ -133,7 +133,7 @@ void TestEvtNotifReadWrite::Run(void) { "Expected the number of elements found to be <= buffer size (10)"; IF_VERB(STANDARD) { for (uint32_t i = 0; i < num_elem; ++i) { - std::cout << "\tdv_handle=" << data[i].device_handle << + std::cout << "\tdv_handle=" << data[i].processor_handle << " Type: " << NameFromEvtNotifType(data[i].event) << " Mesg: " << data[i].message << std::endl; if (data[i].event == AMDSMI_EVT_NOTIF_GPU_PRE_RESET) { @@ -167,7 +167,7 @@ void TestEvtNotifReadWrite::Run(void) { "Expected the number of elements found to be <= buffer size (10)"; IF_VERB(STANDARD) { for (uint32_t i = 0; i < num_elem; ++i) { - std::cout << "\tdv_handle=" << data[i].device_handle << + std::cout << "\tdv_handle=" << data[i].processor_handle << " Type: " << NameFromEvtNotifType(data[i].event) << " Mesg: " << data[i].message << std::endl; } @@ -191,7 +191,7 @@ void TestEvtNotifReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - ret = amdsmi_stop_event_notification(device_handles_[dv_ind]); + ret = amdsmi_stop_event_notification(processor_handles_[dv_ind]); ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc index 53ce8322b2..d8fb52265f 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc @@ -96,12 +96,12 @@ void TestFanRead::Run(void) { } for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); IF_VERB(STANDARD) { std::cout << "\t**Current Fan Speed: "; } - err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, &val_i64); + err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, &val_i64); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**" << ": " << @@ -114,30 +114,30 @@ void TestFanRead::Run(void) { // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, &val_ui64); + err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, &val_ui64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << val_i64/static_cast(val_ui64)*100; std::cout << "% ("<< val_i64 << "/" << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { std::cout << "\t**Current fan RPMs: "; } - err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, &val_i64); + err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, &val_i64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << val_i64 << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc index ade6fdd04a..a62b8d40ed 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc @@ -98,9 +98,9 @@ void TestFanReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &orig_speed); + ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &orig_speed); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**" << ": " << @@ -120,7 +120,7 @@ void TestFanReadWrite::Run(void) { return; } - ret = amdsmi_dev_get_fan_speed_max(device_handles_[dv_ind], 0, &max_speed); + ret = amdsmi_dev_get_fan_speed_max(processor_handles_[dv_ind], 0, &max_speed); CHK_ERR_ASRT(ret) new_speed = 1.1 * orig_speed; @@ -136,12 +136,12 @@ void TestFanReadWrite::Run(void) { std::cout << "Setting fan speed to " << new_speed << std::endl; } - ret = amdsmi_dev_set_fan_speed(device_handles_[dv_ind], 0, new_speed); + ret = amdsmi_dev_set_fan_speed(processor_handles_[dv_ind], 0, new_speed); CHK_ERR_ASRT(ret) sleep(4); - ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed); + ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -163,12 +163,12 @@ void TestFanReadWrite::Run(void) { std::cout << "Resetting fan control to auto..." << std::endl; } - ret = amdsmi_dev_reset_fan(device_handles_[dv_ind], 0); + ret = amdsmi_dev_reset_fan(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) sleep(3); - ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed); + ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc index 3f4e7e727f..dd05912dc7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc @@ -116,12 +116,12 @@ void TestFrequenciesRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { auto freq_output = [&](amdsmi_clk_type_t t, const char *name) { - err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, &f); + err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, &f); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Get " << name << ": Not supported on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr); + err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) { std::cout << "\t**Get " << name << @@ -133,13 +133,13 @@ void TestFrequenciesRead::Run(void) { std::cout << f.num_supported << std::endl; print_frequencies(&f); // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr); + err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } }; - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); freq_output(CLK_TYPE_MEM, "Supported GPU Memory"); freq_output(CLK_TYPE_SYS, "Supported GPU"); @@ -147,12 +147,12 @@ void TestFrequenciesRead::Run(void) { freq_output(CLK_TYPE_DCEF, "Display Controller Engine Clock"); freq_output(CLK_TYPE_SOC, "SOC Clock"); - err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], &b); + err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], &b); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Get PCIE Bandwidth: Not supported on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], nullptr); + err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) { std::cout << "\t**Get PCIE Bandwidth " @@ -164,7 +164,7 @@ void TestFrequenciesRead::Run(void) { std::cout << b.transfer_rate.num_supported << std::endl; print_frequencies(&b.transfer_rate, b.lanes); // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], nullptr); + err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc index 818662683c..af7b3cb36b 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc @@ -102,7 +102,7 @@ void TestFrequenciesReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); for (uint32_t clk = (uint32_t)CLK_TYPE_FIRST; clk <= CLK_TYPE__MAX; ++clk) { @@ -113,7 +113,7 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << amdsmi_clk << std::endl; if (amdsmi_clk == CLK_TYPE_PCIE) return false; - ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f); + ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); std::cout << ret << std::endl; if (ret == AMDSMI_STATUS_NOT_SUPPORTED || @@ -151,7 +151,7 @@ void TestFrequenciesReadWrite::Run(void) { FreqEnumToStr(amdsmi_clk) << " to 0b" << freq_bm_str << " ..." << std::endl; } - ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, freq_bitmask); + ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, freq_bitmask); //Certain ASICs does not allow to set particular clocks. If set function for a clock returns //permission error despite root access, manually set ret value to success and return if (ret == AMDSMI_STATUS_NO_PERM && geteuid() == 0) { @@ -166,7 +166,7 @@ void TestFrequenciesReadWrite::Run(void) { return; } CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f); + ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); if (ret != AMDSMI_STATUS_SUCCESS) { return; } @@ -175,12 +175,12 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << "Frequency is now index " << f.current << std::endl; std::cout << "Resetting mask to all frequencies." << std::endl; } - ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF); + ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF); if (ret != AMDSMI_STATUS_SUCCESS) { return; } - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); if (ret != AMDSMI_STATUS_SUCCESS) { return; } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc index 66dda12b44..2ad6058ba9 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc @@ -97,9 +97,9 @@ void TestGPUBusyRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_busy_percent(device_handles_[i], &val_ui32); + err = amdsmi_dev_get_busy_percent(processor_handles_[i], &val_ui32); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_FILE_ERROR) { IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc index 4f81758626..0f485ff910 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc @@ -97,13 +97,13 @@ void TestGpuMetricsRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); IF_VERB(STANDARD) { std::cout << "\t**GPU METRICS:\n"; } amdsmi_gpu_metrics_t smu; - err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], &smu); + err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], &smu); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -188,7 +188,7 @@ void TestGpuMetricsRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], nullptr); + err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc index f46c33627d..68204afb7f 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/hw_topology_read.cc @@ -113,7 +113,7 @@ void TestHWTopologyRead::Run(void) { std::vector numa_numbers(num_devices); for (uint32_t dv_ind = 0; dv_ind < num_devices; ++dv_ind) { - amdsmi_processor_handle dev_handle = device_handles_[dv_ind]; + amdsmi_processor_handle dev_handle = processor_handles_[dv_ind]; err = amdsmi_topo_get_numa_node_number(dev_handle, &numa_numbers[dv_ind]); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -138,8 +138,8 @@ void TestHWTopologyRead::Run(void) { gpu_links[dv_ind_src][dv_ind_dst].accessible = true; } else { AMDSMI_IO_LINK_TYPE type; - err = amdsmi_topo_get_link_type(device_handles_[dv_ind_src], - device_handles_[dv_ind_dst], + err = amdsmi_topo_get_link_type(processor_handles_[dv_ind_src], + processor_handles_[dv_ind_dst], &gpu_links[dv_ind_src][dv_ind_dst].hops, &type); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -170,8 +170,8 @@ void TestHWTopologyRead::Run(void) { } } } - err = amdsmi_topo_get_link_weight(device_handles_[dv_ind_src], - device_handles_[dv_ind_dst], + err = amdsmi_topo_get_link_weight(processor_handles_[dv_ind_src], + processor_handles_[dv_ind_dst], &gpu_links[dv_ind_src][dv_ind_dst].weight); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -185,8 +185,8 @@ void TestHWTopologyRead::Run(void) { CHK_ERR_ASRT(err) } } - err = amdsmi_is_P2P_accessible(device_handles_[dv_ind_src], - device_handles_[dv_ind_dst], + err = amdsmi_is_P2P_accessible(processor_handles_[dv_ind_src], + processor_handles_[dv_ind_dst], &gpu_links[dv_ind_src][dv_ind_dst].accessible); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index bcdb428324..414d9b3dcd 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -105,11 +105,11 @@ void TestIdInfoRead::Run(void) { } // Get the device ID, name, vendor ID and vendor name for the device - err = amdsmi_dev_get_id(device_handles_[i], &id); + err = amdsmi_dev_get_id(processor_handles_[i], &id); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { amdsmi_status_t ret; // Verify api support checking functionality is working - ret = amdsmi_dev_get_id(device_handles_[i], nullptr); + ret = amdsmi_dev_get_id(processor_handles_[i], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -118,25 +118,25 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } // vendor_id, unique_id amdsmi_asic_info_t asci_info; - err = amdsmi_get_asic_info(device_handles_[0], &asci_info); + err = amdsmi_get_asic_info(processor_handles_[0], &asci_info); CHK_ERR_ASRT(err) // device name, brand, serial_number amdsmi_board_info_t board_info; - err = amdsmi_get_board_info(device_handles_[0], &board_info); + err = amdsmi_get_board_info(processor_handles_[0], &board_info); CHK_ERR_ASRT(err) - err = amdsmi_dev_get_vram_vendor(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_vram_vendor(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Vram Vendor string not supported on this system." << std::endl; - err = amdsmi_dev_get_vram_vendor(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vram_vendor(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -145,10 +145,10 @@ void TestIdInfoRead::Run(void) { } } - err = amdsmi_dev_get_drm_render_minor(device_handles_[i], &drm_render_minor); + err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], &drm_render_minor); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { // Verify api support checking functionality is working - err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr); + err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -156,15 +156,15 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**DRM Render Minor: " << drm_render_minor << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr); + err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Device Vendor name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -172,15 +172,15 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Device Vendor name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } // Get the device ID, name, vendor ID and vendor name for the sub-device - err = amdsmi_dev_get_subsystem_id(device_handles_[i], &id); + err = amdsmi_dev_get_subsystem_id(processor_handles_[i], &id); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -188,15 +188,15 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem ID: 0x" << std::hex << id << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_subsystem_name(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_subsystem_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Subsystem name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -204,7 +204,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -213,13 +213,13 @@ void TestIdInfoRead::Run(void) { asci_info.subvendor_id << std::endl; } - err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Subsystem Vendor name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -227,11 +227,11 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem Vendor name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64); + err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64); // Don't check for AMDSMI_STATUS_NOT_SUPPORTED since this should always be // supported. It is not based on a sysfs file. CHK_ERR_ASRT(err) @@ -240,7 +240,7 @@ void TestIdInfoRead::Run(void) { std::cout << " (" << std::dec << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc index c662726722..7a9f5d9626 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc @@ -94,9 +94,9 @@ void TestMemPageInfoRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, nullptr); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, nullptr); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << @@ -104,7 +104,7 @@ void TestMemPageInfoRead::Run(void) { << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); continue; @@ -115,7 +115,7 @@ void TestMemPageInfoRead::Run(void) { std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -124,7 +124,7 @@ void TestMemPageInfoRead::Run(void) { assert(records != nullptr); - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, records); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, records); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Getting Memory Page Retirement Status not " "supported for this device" << std::endl; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc index f9a1bac7d1..3f12b77c94 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc @@ -116,7 +116,7 @@ void TestMemUtilRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); #if 0 err = amdsmi_dev_get_memory_busy_percent(i, &mem_busy_percent); @@ -131,14 +131,14 @@ void TestMemUtilRead::Run(void) { #endif for (uint32_t mem_type = AMDSMI_MEM_TYPE_FIRST; mem_type <= AMDSMI_MEM_TYPE_LAST; ++mem_type) { - err = amdsmi_dev_get_memory_total(device_handles_[i], + err = amdsmi_dev_get_memory_total(processor_handles_[i], static_cast(mem_type), &total); err_chk("amdsmi_dev_get_memory_total()"); if (err != AMDSMI_STATUS_SUCCESS) { return; } - err = amdsmi_dev_get_memory_usage(device_handles_[i], + err = amdsmi_dev_get_memory_usage(processor_handles_[i], static_cast(mem_type), &usage); err_chk("amdsmi_dev_get_memory_usage()"); if (err != AMDSMI_STATUS_SUCCESS) { 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 0bb6cf4510..657bb30137 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 @@ -97,7 +97,7 @@ void TestMetricsCounterRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); IF_VERB(STANDARD) { std::cout << "\t**GPU METRICS ENERGY COUNTER:\n"; @@ -106,7 +106,7 @@ void TestMetricsCounterRead::Run(void) { uint64_t power; uint64_t timestamp; float counter_resolution; - err = amdsmi_dev_get_energy_count(device_handles_[i], &power, &counter_resolution, ×tamp); + err = amdsmi_dev_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,14 +128,14 @@ void TestMetricsCounterRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_energy_count(device_handles_[i], nullptr, nullptr, nullptr); + err = amdsmi_dev_get_energy_count(processor_handles_[i], nullptr, nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); // Coarse Grain counters amdsmi_utilization_counter_t utilization_counters[2]; utilization_counters[0].type = AMDSMI_COARSE_GRAIN_GFX_ACTIVITY; utilization_counters[1].type = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY; - err = amdsmi_get_utilization_count(device_handles_[i], utilization_counters, + err = amdsmi_get_utilization_count(processor_handles_[i], utilization_counters, 2, ×tamp); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -158,7 +158,7 @@ void TestMetricsCounterRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_get_utilization_count(device_handles_[i], nullptr, + err = amdsmi_get_utilization_count(processor_handles_[i], nullptr, 1 , nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } // end for diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 0f5b92f81b..20df77b272 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -197,63 +197,63 @@ void TestMutualExclusion::Run(void) { std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \ } \ } - ret = amdsmi_dev_get_id(device_handles_[0], &dmy_ui16); + ret = amdsmi_dev_get_id(processor_handles_[0], &dmy_ui16); // vendor_id, unique_id amdsmi_asic_info_t asci_info; - ret = amdsmi_get_asic_info(device_handles_[0], &asci_info); + ret = amdsmi_get_asic_info(processor_handles_[0], &asci_info); CHECK_RET(ret, AMDSMI_STATUS_BUSY); // device name, brand, serial_number amdsmi_board_info_t board_info; - ret = amdsmi_get_board_info(device_handles_[0], &board_info); + ret = amdsmi_get_board_info(processor_handles_[0], &board_info); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_vendor_name(device_handles_[0], dmy_str, 10); + ret = amdsmi_dev_get_vendor_name(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_vram_vendor(device_handles_[0], dmy_str, 10); + ret = amdsmi_dev_get_vram_vendor(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_subsystem_id(device_handles_[0], &dmy_ui16); + ret = amdsmi_dev_get_subsystem_id(processor_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_id(device_handles_[0], &dmy_ui64); + ret = amdsmi_dev_get_pci_id(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_throughput(device_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); + ret = amdsmi_dev_get_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[0], &dmy_ui64); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_pci_bandwidth(device_handles_[0], 0); + ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_rpms(device_handles_[0], dmy_ui32, &dmy_i64); + ret = amdsmi_dev_get_fan_rpms(processor_handles_[0], dmy_ui32, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_speed(device_handles_[0], 0, &dmy_i64); + ret = amdsmi_dev_get_fan_speed(processor_handles_[0], 0, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_speed_max(device_handles_[0], 0, &dmy_ui64); + ret = amdsmi_dev_get_fan_speed_max(processor_handles_[0], 0, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_temp_metric(device_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); + ret = amdsmi_dev_get_temp_metric(processor_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_reset_fan(device_handles_[0], 0); + ret = amdsmi_dev_reset_fan(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_fan_speed(device_handles_[0], dmy_ui32, 0); + ret = amdsmi_dev_set_fan_speed(processor_handles_[0], dmy_ui32, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_perf_level(device_handles_[0], &dmy_perf_lvl); + ret = amdsmi_dev_get_perf_level(processor_handles_[0], &dmy_perf_lvl); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_overdrive_level(device_handles_[0], &dmy_ui32); + ret = amdsmi_dev_get_overdrive_level(processor_handles_[0], &dmy_ui32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[0], CLK_TYPE_SYS, &dmy_freqs); + ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_od_volt_info(device_handles_[0], &dmy_od_volt); + ret = amdsmi_dev_get_od_volt_info(processor_handles_[0], &dmy_od_volt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_od_volt_curve_regions(device_handles_[0], &dmy_ui32, &dmy_vlt_reg); + ret = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[0], &dmy_ui32, &dmy_vlt_reg); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_overdrive_level_v1(device_handles_[0], dmy_i32); + ret = amdsmi_dev_set_overdrive_level_v1(processor_handles_[0], dmy_i32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_clk_freq(device_handles_[0], CLK_TYPE_SYS, 0); + ret = amdsmi_dev_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_count(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); + ret = amdsmi_dev_get_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_enabled(device_handles_[0], &dmy_ui64); + ret = amdsmi_dev_get_ecc_enabled(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_status(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); + ret = amdsmi_dev_get_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); CHECK_RET(ret, AMDSMI_STATUS_BUSY); /* Other functions holding device mutexes. Listed for reference. diff --git a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc index 025e919a37..2aa7e45e39 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc @@ -96,14 +96,14 @@ void TestOverdriveRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_overdrive_level(device_handles_[i], &val_ui32); + err = amdsmi_dev_get_overdrive_level(processor_handles_[i], &val_ui32); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**OverDrive Level:" << val_ui32 << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_overdrive_level(device_handles_[i], nullptr); + err = amdsmi_dev_get_overdrive_level(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc index 030ece5e55..08f700ec2a 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc @@ -95,27 +95,27 @@ void TestOverdriveReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); IF_VERB(STANDARD) { std::cout << "Set Overdrive level to 0%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0); + ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "Set Overdrive level to 10%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 10); + ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 10); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val); + ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New OverDrive Level:" << val << std::endl; std::cout << "Reset Overdrive level to 0%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0); + ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val); + ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New OverDrive Level:" << val << std::endl; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc index e0e5ec663d..2811e1777e 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc @@ -98,9 +98,9 @@ void TestPciReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], &u64int); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], &u64int); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << @@ -108,7 +108,7 @@ void TestPciReadWrite::Run(void) { " on this machine" << std::endl; // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(ret) @@ -116,11 +116,11 @@ void TestPciReadWrite::Run(void) { std::cout << "\tPCIe Replay Counter: " << u64int << std::endl; } // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); } - ret = amdsmi_dev_get_pci_throughput(device_handles_[dv_ind], &sent, &received, &max_pkt_sz); + ret = amdsmi_dev_get_pci_throughput(processor_handles_[dv_ind], &sent, &received, &max_pkt_sz); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "TEST FAILURE: Current PCIe throughput is not detected. " "This is likely because it is not indicated in the pcie_bw sysfs " @@ -141,14 +141,14 @@ void TestPciReadWrite::Run(void) { std::cout << std::endl; } - ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw); + ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "TEST FAILURE: Current PCIe bandwidth is not detected. " "This is likely because it is not indicated in the pp_dpm_pcie sysfs " "file. Aborting test." << std::endl; // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); return; @@ -163,7 +163,7 @@ void TestPciReadWrite::Run(void) { std::endl; } // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); // First set the bitmask to all supported bandwidths @@ -182,10 +182,10 @@ void TestPciReadWrite::Run(void) { std::cout << "\tSetting bandwidth mask to " << "0b" << freq_bm_str << " ..." << std::endl; } - ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], freq_bitmask); + ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], freq_bitmask); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw); + ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -193,10 +193,10 @@ void TestPciReadWrite::Run(void) { std::endl; std::cout << "\tResetting mask to all bandwidths." << std::endl; } - ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], 0xFFFFFFFF); + ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], 0xFFFFFFFF); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index a37ff24027..ca27023d67 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -352,7 +352,7 @@ void TestPerfCntrReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - amdsmi_processor_handle dev_handle = device_handles_[dv_ind]; + amdsmi_processor_handle dev_handle = processor_handles_[dv_ind]; PrintDeviceHeader(dev_handle); try { testEventsIndividually(dev_handle); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc index c931b61308..77c45ae5ca 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc @@ -102,8 +102,8 @@ void TestPerfDeterminism::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); - err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv); + PrintDeviceHeader(processor_handles_[i]); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t** Not supported on this machine" << std::endl; @@ -114,14 +114,14 @@ void TestPerfDeterminism::Run(void) { clkvalue = (odv.curr_sclk_range.lower_bound/1000000) + 50; } - err = amdsmi_set_perf_determinism_mode(device_handles_[i], clkvalue); + err = amdsmi_set_perf_determinism_mode(processor_handles_[i], clkvalue); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**Not supported on this machine" << std::endl; } return; } else { - ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << @@ -130,9 +130,9 @@ void TestPerfDeterminism::Run(void) { } std::cout << "\t**Resetting performance determinism" << std::endl; - err = amdsmi_dev_set_perf_level(device_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);; + err = amdsmi_dev_set_perf_level(processor_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);; CHK_ERR_ASRT(err) - ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc index 490dfc8e4c..0b27f421c7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc @@ -96,16 +96,16 @@ void TestPerfLevelRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_perf_level(device_handles_[i], &pfl); + err = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Performance Level:" << std::dec << (uint32_t)pfl << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_perf_level(device_handles_[i], nullptr); + err = amdsmi_dev_get_perf_level(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc index 16d73191ec..71ff372b89 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc @@ -99,9 +99,9 @@ void TestPerfLevelReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &orig_pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &orig_pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -120,14 +120,14 @@ void TestPerfLevelReadWrite::Run(void) { GetPerfLevelStr(static_cast(pfl_i)) << " ..." << std::endl; } - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], static_cast(pfl_i)); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**" << GetPerfLevelStr(static_cast(pfl_i)) << " returned AMDSMI_STATUS_NOT_SUPPORTED" << std::endl; } else { CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << @@ -139,9 +139,9 @@ void TestPerfLevelReadWrite::Run(void) { std::cout << "Reset Perf level to " << GetPerfLevelStr(orig_pfl) << " ..." << std::endl; } - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], orig_pfl); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], orig_pfl); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc index 9c87cd1b91..f26a736d6a 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc @@ -100,13 +100,13 @@ void TestPowerCapReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); amdsmi_power_cap_info_t info; - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); CHK_ERR_ASRT(ret) // Verify api support checking functionality is working - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, nullptr); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); min = info.min_power_cap; max = info.max_power_cap; @@ -121,13 +121,13 @@ void TestPowerCapReadWrite::Run(void) { std::cout << "Setting new cap to " << new_cap << "..." << std::endl; } start = clock(); - ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, new_cap); + ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, new_cap); end = clock(); cpu_time_used = ((double) (end - start)) * 1000000UL / CLOCKS_PER_SEC; CHK_ERR_ASRT(ret) - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); CHK_ERR_ASRT(ret) new_cap = info.default_power_cap; @@ -139,10 +139,10 @@ void TestPowerCapReadWrite::Run(void) { std::cout << "Resetting cap to " << orig << "..." << std::endl; } - ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, orig); + ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, orig); CHK_ERR_ASRT(ret) - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); CHK_ERR_ASRT(ret) new_cap = info.default_power_cap; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc index 6d69e708bc..bad4ab6f1f 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc @@ -97,10 +97,10 @@ void TestPowerRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); amdsmi_power_cap_info_t info; - err = amdsmi_get_power_cap_info(device_handles_[i], 0, &info); + err = amdsmi_get_power_cap_info(processor_handles_[i], 0, &info); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Current Power Cap: " << info.power_cap << "uW" <(val_ui64)/1000 << " mW" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_power_ave(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_power_ave(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc index fa45c9c11f..c6325dedd1 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc @@ -120,9 +120,9 @@ void TestPowerReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "The power profile presets settings is not supported. " << std::endl; @@ -131,7 +131,7 @@ void TestPowerReadWrite::Run(void) { CHK_ERR_ASRT(ret) // Verify api support checking functionality is working - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, nullptr); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { @@ -172,27 +172,27 @@ void TestPowerReadWrite::Run(void) { return; } - ret = amdsmi_dev_set_power_profile(device_handles_[dv_ind], 0, new_prof); + ret = amdsmi_dev_set_power_profile(processor_handles_[dv_ind], 0, new_prof); CHK_ERR_ASRT(ret) amdsmi_dev_perf_level_t pfl; - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_MANUAL); - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); CHK_ERR_ASRT(ret) ASSERT_EQ(status.current, new_prof); - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_AUTO); - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); CHK_ERR_ASRT(ret) ASSERT_EQ(status.current, orig_profile); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc index 3bc9be8c7b..e28422a70a 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc @@ -100,10 +100,10 @@ void TestSysInfoRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); amdsmi_vbios_info_t info; - err = amdsmi_get_vbios_info(device_handles_[i], &info); + err = amdsmi_get_vbios_info(processor_handles_[i], &info); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_FILE_ERROR) { @@ -112,11 +112,11 @@ void TestSysInfoRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_get_vbios_info(device_handles_[i], nullptr); + err = amdsmi_get_vbios_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { // Verify api support checking functionality is working - err = amdsmi_get_vbios_info(device_handles_[i], nullptr); + err = amdsmi_get_vbios_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); CHK_ERR_ASRT(err) @@ -128,36 +128,36 @@ void TestSysInfoRead::Run(void) { } } - err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64); + err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**PCI ID (BDFID): 0x" << std::hex << val_ui64; std::cout << " (" << std::dec << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_topo_get_numa_affinity(device_handles_[i], &val_ui32); + err = amdsmi_topo_get_numa_affinity(processor_handles_[i], &val_ui32); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**NUMA NODE: 0x" << std::hex << val_ui32; std::cout << " (" << std::dec << val_ui32 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_topo_get_numa_affinity(device_handles_[i], nullptr); + err = amdsmi_topo_get_numa_affinity(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); // vendor_id, unique_id amdsmi_asic_info_t asci_info; - err = amdsmi_get_asic_info(device_handles_[0], &asci_info); + err = amdsmi_get_asic_info(processor_handles_[0], &asci_info); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**amdsmi_dev_unique_id() is not supported" " on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_get_asic_info(device_handles_[i], nullptr); + err = amdsmi_get_asic_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { if (err == AMDSMI_STATUS_SUCCESS) { @@ -169,7 +169,7 @@ void TestSysInfoRead::Run(void) { */ } // Verify api support checking functionality is working - err = amdsmi_get_asic_info(device_handles_[i], nullptr); + err = amdsmi_get_asic_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } else { std::cout << "amdsmi_dev_unique_id_get() failed with error " << @@ -190,11 +190,11 @@ void TestSysInfoRead::Run(void) { std::cout << std::setbase(10); amdsmi_fw_info_t fw_info; - err = amdsmi_get_fw_info(device_handles_[i], &fw_info); + err = amdsmi_get_fw_info(processor_handles_[i], &fw_info); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**No FW " << " available on this system" << std::endl; - err = amdsmi_get_fw_info(device_handles_[i], nullptr); + err = amdsmi_get_fw_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) diff --git a/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc index 7ddd429c71..de32dc0c54 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc @@ -110,11 +110,11 @@ void TestTempRead::Run(void) { uint32_t type; for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); auto print_temp_metric = [&](amdsmi_temperature_metric_t met, std::string label) { - err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast(type), met, &val_i64); + err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, &val_i64); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -124,7 +124,7 @@ void TestTempRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast(type), met, nullptr); + err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); return; } else { @@ -132,7 +132,7 @@ void TestTempRead::Run(void) { } } // Verify api support checking functionality is working - err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast(type), met, nullptr); + err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc index a0c18ee7ba..484c9964c7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc @@ -155,9 +155,9 @@ void TestVoltCurvRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -165,12 +165,12 @@ void TestVoltCurvRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) // Verify api support checking functionality is working - err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -184,7 +184,7 @@ void TestVoltCurvRead::Run(void) { ASSERT_TRUE(regions != nullptr); num_regions = odv.num_regions; - err = amdsmi_dev_get_od_volt_curve_regions(device_handles_[i], &num_regions, regions); + err = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[i], &num_regions, regions); CHK_ERR_ASRT(err) ASSERT_TRUE(num_regions == odv.num_regions); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc index 961115d816..6dc1f507e8 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc @@ -100,11 +100,11 @@ void TestVoltRead::Run(void) { amdsmi_voltage_type_t type = AMDSMI_VOLT_TYPE_VDDGFX; for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); auto print_volt_metric = [&](amdsmi_voltage_metric_t met, std::string label) { - err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, &val_i64); + err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, &val_i64); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -113,7 +113,7 @@ void TestVoltRead::Run(void) { "Not supported on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, nullptr); + err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); return; } @@ -122,7 +122,7 @@ void TestVoltRead::Run(void) { } } // Verify api support checking functionality is working - err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, nullptr); + err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc index 2a8f391e35..6312b5e7c2 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc @@ -98,7 +98,7 @@ void TestXGMIReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - auto device = device_handles_[dv_ind]; + auto device = processor_handles_[dv_ind]; PrintDeviceHeader(device); amdsmi_xgmi_info_t info; diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.cc b/projects/amdsmi/tests/amd_smi_test/test_base.cc index 3b4d93c9fd..7f458c1ff8 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.cc +++ b/projects/amdsmi/tests/amd_smi_test/test_base.cc @@ -124,16 +124,16 @@ void TestBase::SetUp(uint64_t init_flags) { for (uint32_t i=0; i < socket_count_; i++) { // Get all devices of the socket uint32_t device_count = 0; - err = amdsmi_get_device_handles(sockets_[i], + err = amdsmi_get_processor_handles(sockets_[i], &device_count, nullptr); if (err != AMDSMI_STATUS_SUCCESS) { setup_failed_ = true; } ASSERT_EQ(err, AMDSMI_STATUS_SUCCESS); - std::vector device_handles(device_count); - err = amdsmi_get_device_handles(sockets_[i], - &device_count, &device_handles[0]); + std::vector processor_handles(device_count); + err = amdsmi_get_processor_handles(sockets_[i], + &device_count, &processor_handles[0]); if (err != AMDSMI_STATUS_SUCCESS) { setup_failed_ = true; } @@ -144,7 +144,7 @@ void TestBase::SetUp(uint64_t init_flags) { setup_failed_ = true; ASSERT_EQ(AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS, AMDSMI_STATUS_SUCCESS); } - device_handles_[num_monitor_devs_] = device_handles[j]; + processor_handles_[num_monitor_devs_] = processor_handles[j]; num_monitor_devs_++; } } diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.h b/projects/amdsmi/tests/amd_smi_test/test_base.h index 935e265239..104e450db4 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.h +++ b/projects/amdsmi/tests/amd_smi_test/test_base.h @@ -125,7 +125,7 @@ class TestBase { bool setup_failed_; ///< Record that setup failed to return ierr in Run uint32_t num_monitor_devs_; ///< Number of monitor devices found ///< device handles - amdsmi_processor_handle device_handles_[MAX_MONITOR_DEVICES]; + amdsmi_processor_handle processor_handles_[MAX_MONITOR_DEVICES]; uint32_t socket_count_; ///< socket count std::vector sockets_; ///< sockets From 746e0ffb5c999b6fe559b91367e9eaf6d0723e02 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sat, 25 Feb 2023 05:30:19 -0500 Subject: [PATCH 07/95] Change device_type to processor_type also rename amdsmi_get_device_type to amdsmi_get_processor_type grep -rli 'device_type' * | xargs -i@ sed -i 's/device_type/processor_type/g' @ Change-Id: Ic6a73c1a170757d5ab5d10ad20b4fc2f0b280e78 [ROCm/amdsmi commit: dd00a16124d8f888284bff3b82d680d75702ba46] --- projects/amdsmi/README.md | 8 +++---- .../amdsmi/example/amd_smi_drm_example.cc | 8 +++---- .../amdsmi/example/amd_smi_nodrm_example.cc | 8 +++---- projects/amdsmi/include/amd_smi/amdsmi.h | 8 +++---- .../include/amd_smi/impl/amd_smi_device.h | 6 ++--- projects/amdsmi/py-interface/README.md | 6 ++--- projects/amdsmi/py-interface/__init__.py | 2 +- .../amdsmi/py-interface/amdsmi_interface.py | 6 ++--- .../amdsmi/py-interface/amdsmi_wrapper.py | 22 +++++++++---------- projects/amdsmi/src/amd_smi/amd_smi.cc | 14 ++++++------ projects/amdsmi/src/amd_smi/amd_smi_system.cc | 2 +- 11 files changed, 45 insertions(+), 45 deletions(-) diff --git a/projects/amdsmi/README.md b/projects/amdsmi/README.md index 64bbab66aa..82614e3851 100755 --- a/projects/amdsmi/README.md +++ b/projects/amdsmi/README.md @@ -127,10 +127,10 @@ int main() { // For each device of the socket, get name and temperature. for (uint32_t j=0; j < device_count; j++) { // Get device type. Since the amdsmi is initialized with - // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. - device_type_t device_type; - ret = amdsmi_get_device_type(processor_handles[j], &device_type); - if (device_type != AMD_GPU) { + // AMD_SMI_INIT_AMD_GPUS, the processor_type must be AMD_GPU. + processor_type_t processor_type; + ret = amdsmi_get_processor_type(processor_handles[j], &processor_type); + if (processor_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; return 1; } diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index b70e16cf75..27f2f37e4d 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -257,11 +257,11 @@ int main() { // For each device of the socket, get name and temperature. for (uint32_t j = 0; j < device_count; j++) { // Get device type. Since the amdsmi is initialized with - // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. - device_type_t device_type = {}; - ret = amdsmi_get_device_type(processor_handles[j], &device_type); + // AMD_SMI_INIT_AMD_GPUS, the processor_type must be AMD_GPU. + processor_type_t processor_type = {}; + ret = amdsmi_get_processor_type(processor_handles[j], &processor_type); CHK_AMDSMI_RET(ret) - if (device_type != AMD_GPU) { + if (processor_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; return AMDSMI_STATUS_NOT_SUPPORTED; } diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 9a89699d51..885334133d 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -109,11 +109,11 @@ int main() { // For each device of the socket, get name and temperature. for (uint32_t j = 0; j < device_count; j++) { // Get device type. Since the amdsmi is initialized with - // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. - device_type_t device_type = {}; - ret = amdsmi_get_device_type(processor_handles[j], &device_type); + // AMD_SMI_INIT_AMD_GPUS, the processor_type must be AMD_GPU. + processor_type_t processor_type = {}; + ret = amdsmi_get_processor_type(processor_handles[j], &processor_type); CHK_AMDSMI_RET(ret) - if (device_type != AMD_GPU) { + if (processor_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; return AMDSMI_STATUS_NOT_SUPPORTED; } diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 4bc3216d00..6da9945892 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -132,7 +132,7 @@ typedef enum { AMD_CPU, NON_AMD_GPU, NON_AMD_CPU -} device_type_t; +} processor_type_t; /** * @brief Error codes returned by amdsmi functions @@ -1263,14 +1263,14 @@ amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, * * @param[in] processor_handle a device handle * - * @param[out] device_type a pointer to device_type_t to which the device type + * @param[out] processor_type a pointer to processor_type_t to which the device type * will be written. If this parameter is nullptr, this function will return * ::AMDSMI_STATUS_INVAL. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle processor_handle, - device_type_t* device_type); +amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_handle, + processor_type_t* processor_type); /** * @brief Get device handle with the matching bdf. diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h index be1bfb9cd9..10c2074a68 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h @@ -51,11 +51,11 @@ namespace smi { class AMDSmiProcessor { public: - explicit AMDSmiProcessor(device_type_t device) : device_type_(device) {} + explicit AMDSmiProcessor(processor_type_t device) : processor_type_(device) {} virtual ~AMDSmiProcessor() {} - device_type_t get_device_type() const { return device_type_;} + processor_type_t get_processor_type() const { return processor_type_;} private: - device_type_t device_type_; + processor_type_t processor_type_; }; diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 573c460e89..867cf7fc68 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -102,20 +102,20 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_device_type +## amdsmi_get_processor_type Description: Checks the type of device with provided handle. Input parameters: device handle as an instance of `amdsmi_processor_handle` Output: Integer, type of gpu -Exceptions that can be thrown by `amdsmi_get_device_type` function: +Exceptions that can be thrown by `amdsmi_get_processor_type` function: * `AmdSmiLibraryException` Example: ```python try: - type_of_GPU = amdsmi_get_device_type(processor_handle) + type_of_GPU = amdsmi_get_processor_type(processor_handle) if type_of_GPU == 1: print("This is an AMD GPU") except AmdSmiException as e: diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index da3e3d94b1..ffc64a617b 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -24,7 +24,7 @@ from .amdsmi_interface import amdsmi_init from .amdsmi_interface import amdsmi_shut_down # Device Descovery -from .amdsmi_interface import amdsmi_get_device_type +from .amdsmi_interface import amdsmi_get_processor_type from .amdsmi_interface import amdsmi_get_processor_handles from .amdsmi_interface import amdsmi_get_socket_handles from .amdsmi_interface import amdsmi_get_socket_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index a4aea1dc3f..b1ddb4cae9 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -550,7 +550,7 @@ def amdsmi_shut_down(): _check_res(amdsmi_wrapper.amdsmi_shut_down()) -def amdsmi_get_device_type( +def amdsmi_get_processor_type( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> ctypes.c_uint32: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -558,9 +558,9 @@ def amdsmi_get_device_type( processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) - dev_type = amdsmi_wrapper.device_type_t() + dev_type = amdsmi_wrapper.processor_type_t() _check_res( - amdsmi_wrapper.amdsmi_get_device_type( + amdsmi_wrapper.amdsmi_get_processor_type( processor_handle, ctypes.byref(dev_type)) ) return dev_type.value diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index d2c07d3ec4..6df7c6e2a3 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -232,8 +232,8 @@ amdsmi_container_types_t__enumvalues = c__EA_amdsmi_container_types_t__enumvalue amdsmi_processor_handle = ctypes.POINTER(None) amdsmi_socket_handle = ctypes.POINTER(None) -# values for enumeration 'c__EA_device_type_t' -c__EA_device_type_t__enumvalues = { +# values for enumeration 'c__EA_processor_type_t' +c__EA_processor_type_t__enumvalues = { 0: 'UNKNOWN', 1: 'AMD_GPU', 2: 'AMD_CPU', @@ -245,9 +245,9 @@ AMD_GPU = 1 AMD_CPU = 2 NON_AMD_GPU = 3 NON_AMD_CPU = 4 -c__EA_device_type_t = ctypes.c_uint32 # enum -device_type_t = c__EA_device_type_t -device_type_t__enumvalues = c__EA_device_type_t__enumvalues +c__EA_processor_type_t = ctypes.c_uint32 # enum +processor_type_t = c__EA_processor_type_t +processor_type_t__enumvalues = c__EA_processor_type_t__enumvalues # values for enumeration 'c__EA_amdsmi_status_t' c__EA_amdsmi_status_t__enumvalues = { @@ -1414,9 +1414,9 @@ amdsmi_get_socket_info.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c amdsmi_get_processor_handles = _libraries['libamd_smi.so'].amdsmi_get_processor_handles amdsmi_get_processor_handles.restype = amdsmi_status_t amdsmi_get_processor_handles.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.POINTER(None))] -amdsmi_get_device_type = _libraries['libamd_smi.so'].amdsmi_get_device_type -amdsmi_get_device_type.restype = amdsmi_status_t -amdsmi_get_device_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_device_type_t)] +amdsmi_get_processor_type = _libraries['libamd_smi.so'].amdsmi_get_processor_type +amdsmi_get_processor_type.restype = amdsmi_status_t +amdsmi_get_processor_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_processor_type_t)] amdsmi_get_processor_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_processor_handle_from_bdf amdsmi_get_processor_handle_from_bdf.restype = amdsmi_status_t amdsmi_get_processor_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))] @@ -1900,7 +1900,7 @@ __all__ = \ 'amdsmi_get_compute_process_info', 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_device_bdf', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', - 'amdsmi_get_device_type', 'amdsmi_get_device_uuid', + 'amdsmi_get_processor_type', 'amdsmi_get_device_uuid', 'amdsmi_get_driver_version', 'amdsmi_get_ecc_error_count', 'amdsmi_get_event_notification', 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', @@ -1964,8 +1964,8 @@ __all__ = \ 'c__EA_amdsmi_temperature_metric_t', 'c__EA_amdsmi_temperature_type_t', 'c__EA_amdsmi_voltage_metric_t', 'c__EA_amdsmi_voltage_type_t', - 'c__EA_amdsmi_xgmi_status_t', 'c__EA_device_type_t', - 'device_type_t', 'device_type_t__enumvalues', 'size_t', + 'c__EA_amdsmi_xgmi_status_t', 'c__EA_processor_type_t', + 'processor_type_t', 'processor_type_t__enumvalues', 'size_t', 'struct_amdsmi_func_id_iter_handle', 'struct_c__SA_amd_metrics_table_header_t', 'struct_c__SA_amdsmi_asic_info_t', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 1ce630123a..0bf288a665 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -89,7 +89,7 @@ static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle proces .handle_to_device(processor_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; - if (device->get_device_type() == AMD_GPU) { + if (device->get_processor_type() == AMD_GPU) { *gpudevice = static_cast(processor_handle); return AMDSMI_STATUS_SUCCESS; } @@ -249,19 +249,19 @@ amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle processor_handle , - device_type_t* device_type) { +amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_handle , + processor_type_t* processor_type) { AMDSMI_CHECK_INIT(); - if (device_type == nullptr) { + if (processor_type == nullptr) { return AMDSMI_STATUS_INVAL; } amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() .handle_to_device(processor_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; - *device_type = device->get_device_type(); + *processor_type = device->get_processor_type(); return AMDSMI_STATUS_SUCCESS; } @@ -360,7 +360,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, .handle_to_device(processor_handle, &device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; - if (device->get_device_type() != AMD_GPU) { + if (device->get_processor_type() != AMD_GPU) { return AMDSMI_STATUS_NOT_SUPPORTED; } @@ -402,7 +402,7 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, .handle_to_device(processor_handle, &amd_device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; - if (amd_device->get_device_type() != AMD_GPU) { + if (amd_device->get_processor_type() != AMD_GPU) { return AMDSMI_STATUS_NOT_SUPPORTED; } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; diff --git a/projects/amdsmi/src/amd_smi/amd_smi_system.cc b/projects/amdsmi/src/amd_smi/amd_smi_system.cc index 19c9c51292..5daee940ba 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_system.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_system.cc @@ -188,7 +188,7 @@ amdsmi_status_t AMDSmiSystem::gpu_index_to_handle(uint32_t gpu_index, auto iter = devices_.begin(); for (; iter != devices_.end(); iter++) { auto cur_device = (*iter); - if (cur_device->get_device_type() != AMD_GPU) + if (cur_device->get_processor_type() != AMD_GPU) continue; amd::smi::AMDSmiGPUDevice* gpu_device = static_cast(cur_device); From dd840db70882253e0430766e0807805e97e72267 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sat, 25 Feb 2023 05:43:42 -0500 Subject: [PATCH 08/95] Change device to processor in API names and variable names Change-Id: Ide71fabeaa837f2035dc9726162cc537e40b4a57 [ROCm/amdsmi commit: ae39d9707df0264c30bcfd8fedf740818e955f09] --- projects/amdsmi/include/amd_smi/impl/amd_smi_device.h | 2 +- projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- projects/amdsmi/src/amd_smi/amd_smi_socket.cc | 10 +++++----- projects/amdsmi/src/amd_smi/amd_smi_system.cc | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h index 10c2074a68..3db7b0f53c 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h @@ -51,7 +51,7 @@ namespace smi { class AMDSmiProcessor { public: - explicit AMDSmiProcessor(processor_type_t device) : processor_type_(device) {} + explicit AMDSmiProcessor(processor_type_t processor) : processor_type_(processor) {} virtual ~AMDSmiProcessor() {} processor_type_t get_processor_type() const { return processor_type_;} private: diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h index a6d91e156e..9fb95be375 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h @@ -58,12 +58,12 @@ class AMDSmiSocket { explicit AMDSmiSocket(const std::string& id) : socket_identifier_(id) {} ~AMDSmiSocket(); const std::string& get_socket_id() const { return socket_identifier_;} - void add_device(AMDSmiProcessor* device) { devices_.push_back(device); } - std::vector& get_devices() { return devices_;} - amdsmi_status_t get_device_count(uint32_t* device_count) const; + void add_processor(AMDSmiProcessor* processor) { processors_.push_back(processor); } + std::vector& get_processors() { return processors_;} + amdsmi_status_t get_processor_count(uint32_t* processor_count) const; private: std::string socket_identifier_; - std::vector devices_; + std::vector processors_; }; } // namespace smi diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 0bf288a665..0546ce65e9 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -230,7 +230,7 @@ amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, if (r != AMDSMI_STATUS_SUCCESS) return r; - std::vector& devices = socket->get_devices(); + std::vector& devices = socket->get_processors(); uint32_t device_size = static_cast(devices.size()); // Get the device count only if (processor_handles == nullptr) { diff --git a/projects/amdsmi/src/amd_smi/amd_smi_socket.cc b/projects/amdsmi/src/amd_smi/amd_smi_socket.cc index 0c824e513b..a563d72b93 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_socket.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_socket.cc @@ -49,14 +49,14 @@ namespace amd { namespace smi { AMDSmiSocket::~AMDSmiSocket() { - for (uint32_t i = 0; i < devices_.size(); i++) { - delete devices_[i]; + for (uint32_t i = 0; i < processors_.size(); i++) { + delete processors_[i]; } - devices_.clear(); + processors_.clear(); } -amdsmi_status_t AMDSmiSocket::get_device_count(uint32_t* device_count) const { - *device_count = static_cast(devices_.size()); +amdsmi_status_t AMDSmiSocket::get_processor_count(uint32_t* processor_count) const { + *processor_count = static_cast(processors_.size()); return AMDSMI_STATUS_SUCCESS; } diff --git a/projects/amdsmi/src/amd_smi/amd_smi_system.cc b/projects/amdsmi/src/amd_smi/amd_smi_system.cc index 5daee940ba..9557f8f021 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_system.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_system.cc @@ -105,7 +105,7 @@ amdsmi_status_t AMDSmiSystem::populate_amd_gpu_devices() { } AMDSmiProcessor* device = new AMDSmiGPUDevice(i, drm_); - socket->add_device(device); + socket->add_processor(device); devices_.insert(device); } return AMDSMI_STATUS_SUCCESS; From 320b708b6e234d6965bf1f90c72a0e966fc38ffe Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sat, 25 Feb 2023 06:04:15 -0500 Subject: [PATCH 09/95] Change variable name from device to processor device_count to processor_count devices to processor device to processor also handle_to_device is renamed to handle_to_processor Change-Id: Ie9c7e01bc1b83058eeaae80934526d06468f4f5c [ROCm/amdsmi commit: 6e6176b04a26620f054c0a9f141510e6dedb5be5] --- .../include/amd_smi/impl/amd_smi_system.h | 4 +-- projects/amdsmi/src/amd_smi/amd_smi.cc | 34 +++++++++---------- projects/amdsmi/src/amd_smi/amd_smi_system.cc | 22 ++++++------ 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h index 997d21aafe..f388df6652 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h @@ -69,7 +69,7 @@ class AMDSmiSystem { amdsmi_status_t handle_to_socket(amdsmi_socket_handle socket_handle, AMDSmiSocket** socket); - amdsmi_status_t handle_to_device(amdsmi_processor_handle processor_handle, + amdsmi_status_t handle_to_processor(amdsmi_processor_handle processor_handle, AMDSmiProcessor** device); amdsmi_status_t gpu_index_to_handle(uint32_t gpu_index, @@ -82,7 +82,7 @@ class AMDSmiSystem { uint64_t init_flag_; AMDSmiDrm drm_; std::vector sockets_; - std::set devices_; // Track valid devices + std::set processors_; // Track valid processors }; diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 0546ce65e9..1b2c4ff785 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -86,7 +86,7 @@ static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle proces amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(processor_handle, &device); + .handle_to_processor(processor_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; if (device->get_processor_type() == AMD_GPU) { @@ -215,11 +215,11 @@ amdsmi_status_t amdsmi_get_socket_info( } amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, - uint32_t* device_count, + uint32_t* processor_count, amdsmi_processor_handle* processor_handles) { AMDSMI_CHECK_INIT(); - if (device_count == nullptr) { + if (processor_count == nullptr) { return AMDSMI_STATUS_INVAL; } @@ -230,20 +230,20 @@ amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, if (r != AMDSMI_STATUS_SUCCESS) return r; - std::vector& devices = socket->get_processors(); - uint32_t device_size = static_cast(devices.size()); - // Get the device count only + std::vector& processors = socket->get_processors(); + uint32_t processor_size = static_cast(processors.size()); + // Get the processor count only if (processor_handles == nullptr) { - *device_count = device_size; + *processor_count = processor_size; return AMDSMI_STATUS_SUCCESS; } - // If the processor_handles can hold all devices, return all of them. - *device_count = *device_count >= device_size ? device_size : *device_count; + // If the processor_handles can hold all processors, return all of them. + *processor_count = *processor_count >= processor_size ? processor_size : *processor_count; - // Copy the device handles - for (uint32_t i = 0; i < *device_count; i++) { - processor_handles[i] = reinterpret_cast(devices[i]); + // Copy the processor handles + for (uint32_t i = 0; i < *processor_count; i++) { + processor_handles[i] = reinterpret_cast(processors[i]); } return AMDSMI_STATUS_SUCCESS; @@ -257,11 +257,11 @@ amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_hand if (processor_type == nullptr) { return AMDSMI_STATUS_INVAL; } - amd::smi::AMDSmiProcessor* device = nullptr; + amd::smi::AMDSmiProcessor* processor = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(processor_handle, &device); + .handle_to_processor(processor_handle, &processor); if (r != AMDSMI_STATUS_SUCCESS) return r; - *processor_type = device->get_processor_type(); + *processor_type = processor->get_processor_type(); return AMDSMI_STATUS_SUCCESS; } @@ -357,7 +357,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(processor_handle, &device); + .handle_to_processor(processor_handle, &device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; if (device->get_processor_type() != AMD_GPU) { @@ -399,7 +399,7 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, amd::smi::AMDSmiProcessor* amd_device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(processor_handle, &amd_device); + .handle_to_processor(processor_handle, &amd_device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; if (amd_device->get_processor_type() != AMD_GPU) { diff --git a/projects/amdsmi/src/amd_smi/amd_smi_system.cc b/projects/amdsmi/src/amd_smi/amd_smi_system.cc index 9557f8f021..a872674acf 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi_system.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi_system.cc @@ -57,7 +57,7 @@ namespace smi { amdsmi_status_t AMDSmiSystem::init(uint64_t flags) { init_flag_ = flags; amdsmi_status_t amd_smi_status; - // populate sockets and devices + // populate sockets and processors if (flags & AMDSMI_INIT_AMD_GPUS) { amd_smi_status = populate_amd_gpu_devices(); if (amd_smi_status != AMDSMI_STATUS_SUCCESS) @@ -106,7 +106,7 @@ amdsmi_status_t AMDSmiSystem::populate_amd_gpu_devices() { AMDSmiProcessor* device = new AMDSmiGPUDevice(i, drm_); socket->add_processor(device); - devices_.insert(device); + processors_.insert(device); } return AMDSMI_STATUS_SUCCESS; } @@ -136,7 +136,7 @@ amdsmi_status_t AMDSmiSystem::cleanup() { for (uint32_t i = 0; i < sockets_.size(); i++) { delete sockets_[i]; } - devices_.clear(); + processors_.clear(); sockets_.clear(); init_flag_ = AMDSMI_INIT_ALL_DEVICES; rsmi_status_t ret = rsmi_shut_down(); @@ -164,17 +164,17 @@ amdsmi_status_t AMDSmiSystem::handle_to_socket( return AMDSMI_STATUS_INVAL; } -amdsmi_status_t AMDSmiSystem::handle_to_device( +amdsmi_status_t AMDSmiSystem::handle_to_processor( amdsmi_processor_handle processor_handle, - AMDSmiProcessor** device) { - if (processor_handle == nullptr || device == nullptr) { + AMDSmiProcessor** processor) { + if (processor_handle == nullptr || processor == nullptr) { return AMDSMI_STATUS_INVAL; } - *device = static_cast(processor_handle); + *processor = static_cast(processor_handle); // double check handlers is here - if (std::find(devices_.begin(), devices_.end(), *device) - != devices_.end()) { + if (std::find(processors_.begin(), processors_.end(), *processor) + != processors_.end()) { return AMDSMI_STATUS_SUCCESS; } return AMDSMI_STATUS_NOT_FOUND; @@ -185,8 +185,8 @@ amdsmi_status_t AMDSmiSystem::gpu_index_to_handle(uint32_t gpu_index, if (processor_handle == nullptr) return AMDSMI_STATUS_INVAL; - auto iter = devices_.begin(); - for (; iter != devices_.end(); iter++) { + auto iter = processors_.begin(); + for (; iter != processors_.end(); iter++) { auto cur_device = (*iter); if (cur_device->get_processor_type() != AMD_GPU) continue; From fc8df2885e6843723b0047e00166a5451c40f68c Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 06:38:47 -0500 Subject: [PATCH 10/95] Renamed API amdsmi_get_device_bdf to amdsmi_get_gpu_device_bdf grep -rli 'amdsmi_get_device_bdf' * | xargs -i@ sed -i 's/amdsmi_get_device_bdf/amdsmi_get_gpu_device_bdf/g' @ Change-Id: I3db605f8bdb0a83b1f0f7f300a663c47563ba651 [ROCm/amdsmi commit: 3fec3b4b4a81abb79f74dd417be3e13a2481fb6e] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/example/amd_smi_nodrm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 2 +- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 27f2f37e4d..fb68610184 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -268,9 +268,9 @@ int main() { // Get BDF info amdsmi_bdf_t bdf = {}; - ret = amdsmi_get_device_bdf(processor_handles[j], &bdf); + ret = amdsmi_get_gpu_device_bdf(processor_handles[j], &bdf); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_device_bdf:\n"); + printf(" Output of amdsmi_get_gpu_device_bdf:\n"); printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i, bdf.domain_number, bdf.bus_number, bdf.device_number, bdf.function_number); diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 885334133d..df8de39a3c 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -119,9 +119,9 @@ int main() { } amdsmi_bdf_t bdf = {}; - ret = amdsmi_get_device_bdf(processor_handles[j], &bdf); + ret = amdsmi_get_gpu_device_bdf(processor_handles[j], &bdf); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_device_bdf:\n"); + printf(" Output of amdsmi_get_gpu_device_bdf:\n"); printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i, bdf.domain_number, bdf.bus_number, bdf.device_number, bdf.function_number); diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 6da9945892..137139810c 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3569,7 +3569,7 @@ amdsmi_status_t amdsmi_stop_event_notification(amdsmi_processor_handle processor * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf); +amdsmi_get_gpu_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf); /** * @brief Returns the UUID of the device diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 867cf7fc68..9c8802b635 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -216,7 +216,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_device_bdf +## amdsmi_get_gpu_device_bdf Description: Returns BDF of the given device Input parameters: @@ -229,7 +229,7 @@ Where: * `` is 2 hex digits long from 00-1F interval * `` is 1 hex digit long from 0-7 interval -Exceptions that can be thrown by `amdsmi_get_device_bdf` function: +Exceptions that can be thrown by `amdsmi_get_gpu_device_bdf` function: * `AmdSmiParameterException` * `AmdSmiLibraryException` @@ -237,7 +237,7 @@ Example: ```python try: device = amdsmi_get_processor_handles()[0] - print("Device's bdf:", amdsmi_get_device_bdf(device)) + print("Device's bdf:", amdsmi_get_gpu_device_bdf(device)) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index ffc64a617b..ed16c50a2f 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -29,7 +29,7 @@ from .amdsmi_interface import amdsmi_get_processor_handles from .amdsmi_interface import amdsmi_get_socket_handles from .amdsmi_interface import amdsmi_get_socket_info -from .amdsmi_interface import amdsmi_get_device_bdf +from .amdsmi_interface import amdsmi_get_gpu_device_bdf from .amdsmi_interface import amdsmi_get_device_uuid from .amdsmi_interface import amdsmi_get_processor_handle_from_bdf diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index b1ddb4cae9..c42082022d 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -566,7 +566,7 @@ def amdsmi_get_processor_type( return dev_type.value -def amdsmi_get_device_bdf(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: +def amdsmi_get_gpu_device_bdf(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( processor_handle, amdsmi_wrapper.amdsmi_processor_handle @@ -574,7 +574,7 @@ def amdsmi_get_device_bdf(processor_handle: amdsmi_wrapper.amdsmi_processor_hand bdf_info = amdsmi_wrapper.amdsmi_bdf_t() _check_res( - amdsmi_wrapper.amdsmi_get_device_bdf( + amdsmi_wrapper.amdsmi_get_gpu_device_bdf( processor_handle, ctypes.byref(bdf_info)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 6df7c6e2a3..db4aafbee2 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1664,9 +1664,9 @@ amdsmi_get_event_notification.argtypes = [ctypes.c_int32, ctypes.POINTER(ctypes. amdsmi_stop_event_notification = _libraries['libamd_smi.so'].amdsmi_stop_event_notification amdsmi_stop_event_notification.restype = amdsmi_status_t amdsmi_stop_event_notification.argtypes = [amdsmi_processor_handle] -amdsmi_get_device_bdf = _libraries['libamd_smi.so'].amdsmi_get_device_bdf -amdsmi_get_device_bdf.restype = amdsmi_status_t -amdsmi_get_device_bdf.argtypes = [amdsmi_processor_handle, ctypes.POINTER(union_c__UA_amdsmi_bdf_t)] +amdsmi_get_gpu_device_bdf = _libraries['libamd_smi.so'].amdsmi_get_gpu_device_bdf +amdsmi_get_gpu_device_bdf.restype = amdsmi_status_t +amdsmi_get_gpu_device_bdf.argtypes = [amdsmi_processor_handle, ctypes.POINTER(union_c__UA_amdsmi_bdf_t)] amdsmi_get_device_uuid = _libraries['libamd_smi.so'].amdsmi_get_device_uuid amdsmi_get_device_uuid.restype = amdsmi_status_t amdsmi_get_device_uuid.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_char)] @@ -1898,7 +1898,7 @@ __all__ = \ 'amdsmi_get_caps_info', 'amdsmi_get_clock_measure', 'amdsmi_get_compute_process_gpus', 'amdsmi_get_compute_process_info', - 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_device_bdf', + 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', 'amdsmi_get_device_uuid', 'amdsmi_get_driver_version', 'amdsmi_get_ecc_error_count', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index bcf5c8ce55..7deb7f4b44 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -263,7 +263,7 @@ class Formatter: print("{}{:25} :{}".format(space, self.style.background(key), str(value))) def print_handle(self, handle): - bdf = smi_api.amdsmi_get_device_bdf(handle) + bdf = smi_api.amdsmi_get_gpu_device_bdf(handle) print("{:25} :{}".format(self.style.background("BDF"), str(bdf))) def print_usage(self): diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 1b2c4ff785..01e9ed9021 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -267,7 +267,7 @@ amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_hand } amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf) { +amdsmi_get_gpu_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf) { AMDSMI_CHECK_INIT(); From cb1d3ef3ce6be419a713ab299d09d3fcc4b3dad1 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 06:52:56 -0500 Subject: [PATCH 11/95] Renamed API amdsmi_get_device_uuid to amdsmi_get_gpu_device_uuid grep -rli 'amdsmi_get_device_uuid' * | xargs -i@ sed -i 's/amdsmi_get_device_uuid/amdsmi_get_gpu_device_uuid/g' @ Change-Id: I40bf740235a1a98d7d12964378b0b45208987c9e [ROCm/amdsmi commit: 5ed24711c7ec43a08f6a04d3859d0270e2e38e7c] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 10 +++++----- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index fb68610184..19afc9a109 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -328,9 +328,9 @@ int main() { // Get device uuid unsigned int uuid_length = AMDSMI_GPU_UUID_SIZE; char uuid[AMDSMI_GPU_UUID_SIZE]; - ret = amdsmi_get_device_uuid(processor_handles[j], &uuid_length, uuid); + ret = amdsmi_get_gpu_device_uuid(processor_handles[j], &uuid_length, uuid); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_device_uuid:\n"); + printf(" Output of amdsmi_get_gpu_device_uuid:\n"); printf("\tDevice uuid: %s\n\n", uuid); // Get engine usage info diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 137139810c..970008ed14 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3586,7 +3586,7 @@ amdsmi_get_gpu_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid); +amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid); /*****************************************************************************/ /** @defgroup swversion SW Version Information diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 9c8802b635..e41ac0ce08 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -140,7 +140,7 @@ try: print("No GPUs on machine") else: for device in devices: - print(amdsmi_get_device_uuid(device)) + print(amdsmi_get_gpu_device_uuid(device)) except AmdSmiException as e: print(e) ``` @@ -211,7 +211,7 @@ Example: ```python try: device = amdsmi_get_processor_handle_from_bdf("0000:23:00.0") - print(amdsmi_get_device_uuid(device)) + print(amdsmi_get_gpu_device_uuid(device)) except AmdSmiException as e: print(e) ``` @@ -242,7 +242,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_device_uuid +## amdsmi_get_gpu_device_uuid Description: Returns the UUID of the device Input parameters: @@ -250,7 +250,7 @@ Input parameters: Output: UUID string unique to the device -Exceptions that can be thrown by `amdsmi_get_device_uuid` function: +Exceptions that can be thrown by `amdsmi_get_gpu_device_uuid` function: * `AmdSmiParameterException` * `AmdSmiLibraryException` @@ -258,7 +258,7 @@ Example: ```python try: device = amdsmi_get_processor_handles()[0] - print("Device UUID: ", amdsmi_get_device_uuid(device)) + print("Device UUID: ", amdsmi_get_gpu_device_uuid(device)) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index ed16c50a2f..9c658451cb 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -30,7 +30,7 @@ from .amdsmi_interface import amdsmi_get_socket_handles from .amdsmi_interface import amdsmi_get_socket_info from .amdsmi_interface import amdsmi_get_gpu_device_bdf -from .amdsmi_interface import amdsmi_get_device_uuid +from .amdsmi_interface import amdsmi_get_gpu_device_uuid from .amdsmi_interface import amdsmi_get_processor_handle_from_bdf # # SW Version Information diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index c42082022d..7a1cd605b2 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -920,7 +920,7 @@ def amdsmi_get_process_info( } -def amdsmi_get_device_uuid(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: +def amdsmi_get_gpu_device_uuid(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( processor_handle, amdsmi_wrapper.amdsmi_processor_handle @@ -932,7 +932,7 @@ def amdsmi_get_device_uuid(processor_handle: amdsmi_wrapper.amdsmi_processor_han uuid_length.value = _AMDSMI_GPU_UUID_SIZE _check_res( - amdsmi_wrapper.amdsmi_get_device_uuid( + amdsmi_wrapper.amdsmi_get_gpu_device_uuid( processor_handle, ctypes.byref(uuid_length), uuid ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index db4aafbee2..f0f547f702 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1667,9 +1667,9 @@ amdsmi_stop_event_notification.argtypes = [amdsmi_processor_handle] amdsmi_get_gpu_device_bdf = _libraries['libamd_smi.so'].amdsmi_get_gpu_device_bdf amdsmi_get_gpu_device_bdf.restype = amdsmi_status_t amdsmi_get_gpu_device_bdf.argtypes = [amdsmi_processor_handle, ctypes.POINTER(union_c__UA_amdsmi_bdf_t)] -amdsmi_get_device_uuid = _libraries['libamd_smi.so'].amdsmi_get_device_uuid -amdsmi_get_device_uuid.restype = amdsmi_status_t -amdsmi_get_device_uuid.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_char)] +amdsmi_get_gpu_device_uuid = _libraries['libamd_smi.so'].amdsmi_get_gpu_device_uuid +amdsmi_get_gpu_device_uuid.restype = amdsmi_status_t +amdsmi_get_gpu_device_uuid.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_char)] amdsmi_get_driver_version = _libraries['libamd_smi.so'].amdsmi_get_driver_version amdsmi_get_driver_version.restype = amdsmi_status_t amdsmi_get_driver_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_char)] @@ -1900,7 +1900,7 @@ __all__ = \ 'amdsmi_get_compute_process_info', 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', - 'amdsmi_get_processor_type', 'amdsmi_get_device_uuid', + 'amdsmi_get_processor_type', 'amdsmi_get_gpu_device_uuid', 'amdsmi_get_driver_version', 'amdsmi_get_ecc_error_count', 'amdsmi_get_event_notification', 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 01e9ed9021..3c92dff619 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1810,7 +1810,7 @@ amdsmi_get_driver_version(amdsmi_processor_handle processor_handle, int *length, } amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid) { +amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid) { AMDSMI_CHECK_INIT(); if (uuid_length == nullptr || uuid == nullptr) { From 365abf6b0e2dab196d64e2f63bf7d2fb47dfc5ee Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 06:58:22 -0500 Subject: [PATCH 12/95] Renamed API amdsmi_dev_get_id to amdsmi_get_gpu_id grep -rli 'amdsmi_dev_get_id' * | xargs -i@ sed -i 's/amdsmi_dev_get_id/amdsmi_get_gpu_id/g' @ Change-Id: I78faeff9a94250454bcecfaa50b5c7cc7e04cb98 [ROCm/amdsmi commit: 20222f771ec21264ee5c5d86241c8044b3508891] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- projects/amdsmi/tests/amd_smi_test/test_base.cc | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 970008ed14..b3002a63d8 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1317,7 +1317,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, uint16_t *id); +amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint16_t *id); /** * @brief Get the name string for a give vendor ID diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index e41ac0ce08..b11cf7a08d 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2902,7 +2902,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_id +## amdsmi_get_gpu_id Description: Get the device id associated with the device with provided device handler Input parameters: @@ -2911,7 +2911,7 @@ Input parameters: Output: device id -Exceptions that can be thrown by `amdsmi_dev_get_id` function: +Exceptions that can be thrown by `amdsmi_get_gpu_id` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2924,7 +2924,7 @@ try: print("No GPUs on machine") else: for device in devices: - dev_id = amdsmi_dev_get_id(device) + dev_id = amdsmi_get_gpu_id(device) print(dev_id) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 9c658451cb..44aa58286c 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -158,7 +158,7 @@ from .amdsmi_interface import AmdSmiEventReader # # Device Identification information from .amdsmi_interface import amdsmi_dev_get_vendor_name -from .amdsmi_interface import amdsmi_dev_get_id +from .amdsmi_interface import amdsmi_get_gpu_id from .amdsmi_interface import amdsmi_dev_get_vram_vendor from .amdsmi_interface import amdsmi_dev_get_drm_render_minor from .amdsmi_interface import amdsmi_dev_get_subsystem_id diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 7a1cd605b2..26e8031009 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1089,14 +1089,14 @@ def amdsmi_dev_get_vendor_name( return vendor_name.value.decode("utf-8") -def amdsmi_dev_get_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_id(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 ) id = ctypes.c_uint16() - _check_res(amdsmi_wrapper.amdsmi_dev_get_id( + _check_res(amdsmi_wrapper.amdsmi_get_gpu_id( processor_handle, ctypes.byref(id))) return id.value diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index f0f547f702..0690a9d5d8 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1420,9 +1420,9 @@ amdsmi_get_processor_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c_ amdsmi_get_processor_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_processor_handle_from_bdf amdsmi_get_processor_handle_from_bdf.restype = amdsmi_status_t amdsmi_get_processor_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))] -amdsmi_dev_get_id = _libraries['libamd_smi.so'].amdsmi_dev_get_id -amdsmi_dev_get_id.restype = amdsmi_status_t -amdsmi_dev_get_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] +amdsmi_get_gpu_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_id +amdsmi_get_gpu_id.restype = amdsmi_status_t +amdsmi_get_gpu_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] amdsmi_dev_get_vendor_name = _libraries['libamd_smi.so'].amdsmi_dev_get_vendor_name amdsmi_dev_get_vendor_name.restype = amdsmi_status_t amdsmi_dev_get_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] @@ -1857,7 +1857,7 @@ __all__ = \ 'amdsmi_dev_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_dev_get_id', 'amdsmi_dev_get_memory_busy_percent', + 'amdsmi_get_gpu_id', 'amdsmi_dev_get_memory_busy_percent', 'amdsmi_dev_get_memory_reserved_pages', 'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 7deb7f4b44..b8c165cbea 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -288,7 +288,7 @@ class Formatter: | """ + self.style.header("COMMANDS:") + """ | | | | """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_dev_get_vendor_name ") + """ | - | """ + self.style.text(" 2 Get device id. Api: amdsmi_dev_get_id ") + """ | + | """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id ") + """ | | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor ") + """ | | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor ") + """ | | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id ") + """ | @@ -725,7 +725,7 @@ commands = { 1: [smi_api.amdsmi_dev_get_vendor_name, { "device_identifier1": [None, True] }], - 2: [smi_api.amdsmi_dev_get_id, { + 2: [smi_api.amdsmi_get_gpu_id, { "device_identifier1": [None, True] }], 3: [smi_api.amdsmi_dev_get_vram_vendor, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 3c92dff619..d2debe13c8 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -507,7 +507,7 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handl sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint16_t *id) { return rsmi_wrapper(rsmi_dev_id_get, processor_handle, id); } @@ -889,7 +889,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, static const std::map rsmi_2_amdsmi = { {"rsmi_dev_vram_vendor_get", "amdsmi_dev_get_vram_vendor"}, - {"rsmi_dev_id_get", "amdsmi_dev_get_id"}, + {"rsmi_dev_id_get", "amdsmi_get_gpu_id"}, {"rsmi_dev_vendor_id_get", "amdsmi_get_asic_info"}, {"rsmi_dev_name_get", "amdsmi_get_board_info"}, {"rsmi_dev_sku_get", "amdsmi_get_board_info"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index 414d9b3dcd..d09175fc23 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -105,11 +105,11 @@ void TestIdInfoRead::Run(void) { } // Get the device ID, name, vendor ID and vendor name for the device - err = amdsmi_dev_get_id(processor_handles_[i], &id); + err = amdsmi_get_gpu_id(processor_handles_[i], &id); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { amdsmi_status_t ret; // Verify api support checking functionality is working - ret = amdsmi_dev_get_id(processor_handles_[i], nullptr); + ret = amdsmi_get_gpu_id(processor_handles_[i], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -118,7 +118,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_id(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 20df77b272..f52189f7f8 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -197,7 +197,7 @@ void TestMutualExclusion::Run(void) { std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \ } \ } - ret = amdsmi_dev_get_id(processor_handles_[0], &dmy_ui16); + ret = amdsmi_get_gpu_id(processor_handles_[0], &dmy_ui16); // vendor_id, unique_id amdsmi_asic_info_t asci_info; diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.cc b/projects/amdsmi/tests/amd_smi_test/test_base.cc index 7f458c1ff8..855dc6c161 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.cc +++ b/projects/amdsmi/tests/amd_smi_test/test_base.cc @@ -167,7 +167,7 @@ void TestBase::PrintDeviceHeader(amdsmi_processor_handle dv_ind) { IF_VERB(STANDARD) { std::cout << "\t**Device handle: " << dv_ind << std::endl; } - err = amdsmi_dev_get_id(dv_ind, &val_ui16); + err = amdsmi_get_gpu_id(dv_ind, &val_ui16); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Device ID: 0x" << std::hex << val_ui16 << std::endl; From 60a4679846d1c7a135dc4fc3104e017e0851878d Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:00:50 -0500 Subject: [PATCH 13/95] Renamed API amdsmi_dev_get_vendor_name to amdsmi_get_gpu_vendor_name grep -rli 'amdsmi_dev_get_vendor_name' * | xargs -i@ sed -i 's/amdsmi_dev_get_vendor_name/amdsmi_get_gpu_vendor_name/g' @ Change-Id: Ib31c1387150d0dd268d1bd54cfb43786c7ec41c1 [ROCm/amdsmi commit: 21da55b9df8911d652f3f7c58c7ac84f598a4c2f] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/id_info_read.cc | 12 ++++++------ .../amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index b3002a63d8..e91a531b17 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1350,7 +1350,7 @@ amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle processor_handle, char *name, +amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_handle, char *name, size_t len); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index b11cf7a08d..ce8d5345bd 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2874,7 +2874,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_vendor_name +## amdsmi_get_gpu_vendor_name Description: Returns the device vendor name Input parameters: @@ -2883,7 +2883,7 @@ Input parameters: Output: device vendor name -Exceptions that can be thrown by `amdsmi_dev_get_vendor_name` function: +Exceptions that can be thrown by `amdsmi_get_gpu_vendor_name` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2896,7 +2896,7 @@ try: print("No GPUs on machine") else: for device in devices: - vendor_name = amdsmi_dev_get_vendor_name(device) + vendor_name = amdsmi_get_gpu_vendor_name(device) print(vendor_name) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 44aa58286c..d6e342f1b8 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -157,7 +157,7 @@ from .amdsmi_interface import amdsmi_dev_get_memory_reserved_pages from .amdsmi_interface import AmdSmiEventReader # # Device Identification information -from .amdsmi_interface import amdsmi_dev_get_vendor_name +from .amdsmi_interface import amdsmi_get_gpu_vendor_name from .amdsmi_interface import amdsmi_get_gpu_id from .amdsmi_interface import amdsmi_dev_get_vram_vendor from .amdsmi_interface import amdsmi_dev_get_drm_render_minor diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 26e8031009..66cfe9845f 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1068,7 +1068,7 @@ def amdsmi_get_processor_handle_from_bdf(bdf): return processor_handle -def amdsmi_dev_get_vendor_name( +def amdsmi_get_gpu_vendor_name( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1082,7 +1082,7 @@ def amdsmi_dev_get_vendor_name( vendor_name = ctypes.create_string_buffer(_AMDSMI_STRING_LENGTH) _check_res( - amdsmi_wrapper.amdsmi_dev_get_vendor_name( + amdsmi_wrapper.amdsmi_get_gpu_vendor_name( processor_handle, vendor_name, length) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 0690a9d5d8..a13dbec41d 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1423,9 +1423,9 @@ amdsmi_get_processor_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ct amdsmi_get_gpu_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_id amdsmi_get_gpu_id.restype = amdsmi_status_t amdsmi_get_gpu_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] -amdsmi_dev_get_vendor_name = _libraries['libamd_smi.so'].amdsmi_dev_get_vendor_name -amdsmi_dev_get_vendor_name.restype = amdsmi_status_t -amdsmi_dev_get_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] +amdsmi_get_gpu_vendor_name = _libraries['libamd_smi.so'].amdsmi_get_gpu_vendor_name +amdsmi_get_gpu_vendor_name.restype = amdsmi_status_t +amdsmi_get_gpu_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] uint32_t = ctypes.c_uint32 amdsmi_dev_get_vram_vendor = _libraries['libamd_smi.so'].amdsmi_dev_get_vram_vendor amdsmi_dev_get_vram_vendor.restype = amdsmi_status_t @@ -1868,7 +1868,7 @@ __all__ = \ 'amdsmi_dev_get_power_ave', 'amdsmi_dev_get_power_profile_presets', 'amdsmi_dev_get_subsystem_id', 'amdsmi_dev_get_subsystem_name', - 'amdsmi_dev_get_temp_metric', 'amdsmi_dev_get_vendor_name', + 'amdsmi_dev_get_temp_metric', 'amdsmi_get_gpu_vendor_name', 'amdsmi_dev_get_volt_metric', 'amdsmi_dev_get_vram_vendor', 'amdsmi_dev_open_supported_func_iterator', 'amdsmi_dev_open_supported_variant_iterator', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index b8c165cbea..5352105245 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -287,7 +287,7 @@ class Formatter: | | | """ + self.style.header("COMMANDS:") + """ | | | - | """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_dev_get_vendor_name ") + """ | + | """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_get_gpu_vendor_name ") + """ | | """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id ") + """ | | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor ") + """ | | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor ") + """ | @@ -722,7 +722,7 @@ def amdsmi_tool_func_iter_next(dev): commands = { # idx: [func, {arg_name : [arg_type, is_arg_obligatory]}] - 1: [smi_api.amdsmi_dev_get_vendor_name, { + 1: [smi_api.amdsmi_get_gpu_vendor_name, { "device_identifier1": [None, True] }], 2: [smi_api.amdsmi_get_gpu_id, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index d2debe13c8..e25dd47f85 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -633,7 +633,7 @@ amdsmi_status_t amdsmi_dev_get_subsystem_name( return rsmi_wrapper(rsmi_dev_subsystem_name_get, processor_handle, name, len); } -amdsmi_status_t amdsmi_dev_get_vendor_name( +amdsmi_status_t amdsmi_get_gpu_vendor_name( amdsmi_processor_handle processor_handle, char *name, size_t len) { return rsmi_wrapper(rsmi_dev_vendor_name_get, processor_handle, name, len); } @@ -894,7 +894,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_name_get", "amdsmi_get_board_info"}, {"rsmi_dev_sku_get", "amdsmi_get_board_info"}, {"rsmi_dev_brand_get", "amdsmi_get_asic_info"}, - {"rsmi_dev_vendor_name_get", "amdsmi_dev_get_vendor_name"}, + {"rsmi_dev_vendor_name_get", "amdsmi_get_gpu_vendor_name"}, {"rsmi_dev_serial_number_get", "amdsmi_get_asic_info"}, {"rsmi_dev_subsystem_id_get", "amdsmi_dev_get_subsystem_id"}, {"rsmi_dev_subsystem_name_get", "amdsmi_dev_get_subsystem_name"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index d09175fc23..d8f745affd 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -159,12 +159,12 @@ void TestIdInfoRead::Run(void) { err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen); + err = amdsmi_get_gpu_vendor_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Device Vendor name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -172,7 +172,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Device Vendor name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -213,13 +213,13 @@ void TestIdInfoRead::Run(void) { asci_info.subvendor_id << std::endl; } - err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen); + err = amdsmi_get_gpu_vendor_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Subsystem Vendor name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -227,7 +227,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem Vendor name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index f52189f7f8..c77709526c 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -209,7 +209,7 @@ void TestMutualExclusion::Run(void) { ret = amdsmi_get_board_info(processor_handles_[0], &board_info); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_vendor_name(processor_handles_[0], dmy_str, 10); + ret = amdsmi_get_gpu_vendor_name(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_vram_vendor(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -268,7 +268,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_get_vram_vendor amdsmi_dev_get_subsystem_name amdsmi_dev_get_drm_render_minor - amdsmi_dev_get_vendor_name + amdsmi_get_gpu_vendor_name amdsmi_dev_get_pci_bandwidth amdsmi_dev_set_pci_bandwidth amdsmi_dev_get_pci_throughput From 06cedb0eed45f22151c21e0daeddba115bd3742e Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:06:13 -0500 Subject: [PATCH 14/95] Renamed API amdsmi_dev_get_vram_vendor to amdsmi_get_gpu_vram_vendor grep -rli 'amdsmi_dev_get_vram_vendor' * | xargs -i@ sed -i 's/amdsmi_dev_get_vram_vendor/amdsmi_get_gpu_vram_vendor/g' @ Change-Id: I3c11643a778f147027d0d3121b9782931439c752 [ROCm/amdsmi commit: f69a6ea64e31ab2839d99c5b9e253a21be5d2d13] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e91a531b17..9b119f8abc 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1363,7 +1363,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_han * buffer @p brand. * * If the vram vendor for the device is not found as one of the values - * contained within amdsmi_dev_get_vram_vendor, then this function will return + * contained within amdsmi_get_gpu_vram_vendor, then this function will return * the string 'unknown' instead of the vram vendor. * * @param[in] processor_handle a device handle @@ -1375,7 +1375,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, +amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index ce8d5345bd..59c573e3f4 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2930,7 +2930,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_vram_vendor +## amdsmi_get_gpu_vram_vendor Description: Get the vram vendor string of a gpu device. Input parameters: @@ -2939,7 +2939,7 @@ Input parameters: Output: vram vendor -Exceptions that can be thrown by `amdsmi_dev_get_vram_vendor` function: +Exceptions that can be thrown by `amdsmi_get_gpu_vram_vendor` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2952,7 +2952,7 @@ try: print("No GPUs on machine") else: for device in devices: - vram_vendor = amdsmi_dev_get_vram_vendor(device) + vram_vendor = amdsmi_get_gpu_vram_vendor(device) print(vram_vendor) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index d6e342f1b8..3c58da1050 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -159,7 +159,7 @@ from .amdsmi_interface import AmdSmiEventReader # # Device Identification information from .amdsmi_interface import amdsmi_get_gpu_vendor_name from .amdsmi_interface import amdsmi_get_gpu_id -from .amdsmi_interface import amdsmi_dev_get_vram_vendor +from .amdsmi_interface import amdsmi_get_gpu_vram_vendor from .amdsmi_interface import amdsmi_dev_get_drm_render_minor from .amdsmi_interface import amdsmi_dev_get_subsystem_id from .amdsmi_interface import amdsmi_dev_get_subsystem_name diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 66cfe9845f..c56a6ea07d 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1102,7 +1102,7 @@ def amdsmi_get_gpu_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): return id.value -def amdsmi_dev_get_vram_vendor(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_vram_vendor(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 @@ -1114,7 +1114,7 @@ def amdsmi_dev_get_vram_vendor(processor_handle: amdsmi_wrapper.amdsmi_processor vram_vendor = ctypes.create_string_buffer(_AMDSMI_STRING_LENGTH) _check_res( - amdsmi_wrapper.amdsmi_dev_get_vram_vendor( + amdsmi_wrapper.amdsmi_get_gpu_vram_vendor( processor_handle, vram_vendor, length) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index a13dbec41d..bed67a046d 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1427,9 +1427,9 @@ amdsmi_get_gpu_vendor_name = _libraries['libamd_smi.so'].amdsmi_get_gpu_vendor_n amdsmi_get_gpu_vendor_name.restype = amdsmi_status_t amdsmi_get_gpu_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] uint32_t = ctypes.c_uint32 -amdsmi_dev_get_vram_vendor = _libraries['libamd_smi.so'].amdsmi_dev_get_vram_vendor -amdsmi_dev_get_vram_vendor.restype = amdsmi_status_t -amdsmi_dev_get_vram_vendor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), uint32_t] +amdsmi_get_gpu_vram_vendor = _libraries['libamd_smi.so'].amdsmi_get_gpu_vram_vendor +amdsmi_get_gpu_vram_vendor.restype = amdsmi_status_t +amdsmi_get_gpu_vram_vendor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), uint32_t] amdsmi_dev_get_subsystem_id = _libraries['libamd_smi.so'].amdsmi_dev_get_subsystem_id amdsmi_dev_get_subsystem_id.restype = amdsmi_status_t amdsmi_dev_get_subsystem_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] @@ -1869,7 +1869,7 @@ __all__ = \ 'amdsmi_dev_get_power_profile_presets', 'amdsmi_dev_get_subsystem_id', 'amdsmi_dev_get_subsystem_name', 'amdsmi_dev_get_temp_metric', 'amdsmi_get_gpu_vendor_name', - 'amdsmi_dev_get_volt_metric', 'amdsmi_dev_get_vram_vendor', + 'amdsmi_dev_get_volt_metric', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_dev_open_supported_func_iterator', 'amdsmi_dev_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 5352105245..f4fb46a6bc 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -289,7 +289,7 @@ class Formatter: | | | """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_get_gpu_vendor_name ") + """ | | """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id ") + """ | - | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor ") + """ | + | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_get_gpu_vram_vendor ") + """ | | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor ") + """ | | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id ") + """ | | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_dev_get_subsystem_name ") + """ | @@ -728,7 +728,7 @@ commands = { 2: [smi_api.amdsmi_get_gpu_id, { "device_identifier1": [None, True] }], - 3: [smi_api.amdsmi_dev_get_vram_vendor, { + 3: [smi_api.amdsmi_get_gpu_vram_vendor, { "device_identifier1": [None, True] }], 4: [smi_api.amdsmi_dev_get_drm_render_minor, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index e25dd47f85..d511ab69f2 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -638,7 +638,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name( return rsmi_wrapper(rsmi_dev_vendor_name_get, processor_handle, name, len); } -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len) { return rsmi_wrapper(rsmi_dev_vram_vendor_get, processor_handle, brand, len); } @@ -888,7 +888,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, return AMDSMI_STATUS_INVAL; static const std::map rsmi_2_amdsmi = { - {"rsmi_dev_vram_vendor_get", "amdsmi_dev_get_vram_vendor"}, + {"rsmi_dev_vram_vendor_get", "amdsmi_get_gpu_vram_vendor"}, {"rsmi_dev_id_get", "amdsmi_get_gpu_id"}, {"rsmi_dev_vendor_id_get", "amdsmi_get_asic_info"}, {"rsmi_dev_name_get", "amdsmi_get_board_info"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index d8f745affd..b91e6a1186 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -132,11 +132,11 @@ void TestIdInfoRead::Run(void) { err = amdsmi_get_board_info(processor_handles_[0], &board_info); CHK_ERR_ASRT(err) - err = amdsmi_dev_get_vram_vendor(processor_handles_[i], buffer, kBufferLen); + err = amdsmi_get_gpu_vram_vendor(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Vram Vendor string not supported on this system." << std::endl; - err = amdsmi_dev_get_vram_vendor(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_vram_vendor(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index c77709526c..5df04d1d59 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -211,7 +211,7 @@ void TestMutualExclusion::Run(void) { ret = amdsmi_get_gpu_vendor_name(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_vram_vendor(processor_handles_[0], dmy_str, 10); + ret = amdsmi_get_gpu_vram_vendor(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_subsystem_id(processor_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -265,7 +265,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_firmware_version_get amdsmi_dev_name_get amdsmi_dev_brand_get - amdsmi_dev_get_vram_vendor + amdsmi_get_gpu_vram_vendor amdsmi_dev_get_subsystem_name amdsmi_dev_get_drm_render_minor amdsmi_get_gpu_vendor_name From cccbca0e65b6d95c8c0b6fe7bbc96b50e168a59a Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:08:28 -0500 Subject: [PATCH 15/95] Renamed API amdsmi_dev_get_subsystem_id to amdsmi_get_gpu_subsystem_id grep -rli 'amdsmi_dev_get_subsystem_id' * | xargs -i@ sed -i 's/amdsmi_dev_get_subsystem_id/amdsmi_get_gpu_subsystem_id/g' @ Change-Id: I64616ac4c001f7761b8d83120d05d21c5c8e763f [ROCm/amdsmi commit: 14f1367d6b94f7bc7591388cf3dfccbff7c63572] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- projects/amdsmi/tests/amd_smi_test/test_base.cc | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 9b119f8abc..2ff24c7f72 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1397,7 +1397,7 @@ amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id); +amdsmi_status_t amdsmi_get_gpu_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id); /** * @brief Get the name string for the device subsytem diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 59c573e3f4..f777e8733c 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2986,7 +2986,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_subsystem_id +## amdsmi_get_gpu_subsystem_id Description: Get the subsystem device id associated with the device with provided device handle. Input parameters: @@ -2995,7 +2995,7 @@ Input parameters: Output: subsystem device id -Exceptions that can be thrown by `amdsmi_dev_get_subsystem_id` function: +Exceptions that can be thrown by `amdsmi_get_gpu_subsystem_id` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -3008,7 +3008,7 @@ try: print("No GPUs on machine") else: for device in devices: - id = amdsmi_dev_get_subsystem_id(device) + id = amdsmi_get_gpu_subsystem_id(device) print(id) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 3c58da1050..c8b742ae1d 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -161,7 +161,7 @@ from .amdsmi_interface import amdsmi_get_gpu_vendor_name from .amdsmi_interface import amdsmi_get_gpu_id from .amdsmi_interface import amdsmi_get_gpu_vram_vendor from .amdsmi_interface import amdsmi_dev_get_drm_render_minor -from .amdsmi_interface import amdsmi_dev_get_subsystem_id +from .amdsmi_interface import amdsmi_get_gpu_subsystem_id from .amdsmi_interface import amdsmi_dev_get_subsystem_name # # Version information diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index c56a6ea07d..ec98f9eaef 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1137,7 +1137,7 @@ def amdsmi_dev_get_drm_render_minor(processor_handle: amdsmi_wrapper.amdsmi_proc return minor.value -def amdsmi_dev_get_subsystem_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_subsystem_id(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 @@ -1145,7 +1145,7 @@ def amdsmi_dev_get_subsystem_id(processor_handle: amdsmi_wrapper.amdsmi_processo id = ctypes.c_uint16() _check_res( - amdsmi_wrapper.amdsmi_dev_get_subsystem_id( + amdsmi_wrapper.amdsmi_get_gpu_subsystem_id( processor_handle, ctypes.byref(id)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index bed67a046d..54080a6cb8 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1430,9 +1430,9 @@ uint32_t = ctypes.c_uint32 amdsmi_get_gpu_vram_vendor = _libraries['libamd_smi.so'].amdsmi_get_gpu_vram_vendor amdsmi_get_gpu_vram_vendor.restype = amdsmi_status_t amdsmi_get_gpu_vram_vendor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), uint32_t] -amdsmi_dev_get_subsystem_id = _libraries['libamd_smi.so'].amdsmi_dev_get_subsystem_id -amdsmi_dev_get_subsystem_id.restype = amdsmi_status_t -amdsmi_dev_get_subsystem_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] +amdsmi_get_gpu_subsystem_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_subsystem_id +amdsmi_get_gpu_subsystem_id.restype = amdsmi_status_t +amdsmi_get_gpu_subsystem_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] amdsmi_dev_get_subsystem_name = _libraries['libamd_smi.so'].amdsmi_dev_get_subsystem_name amdsmi_dev_get_subsystem_name.restype = amdsmi_status_t amdsmi_dev_get_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] @@ -1867,7 +1867,7 @@ __all__ = \ 'amdsmi_dev_get_pci_throughput', 'amdsmi_dev_get_perf_level', 'amdsmi_dev_get_power_ave', 'amdsmi_dev_get_power_profile_presets', - 'amdsmi_dev_get_subsystem_id', 'amdsmi_dev_get_subsystem_name', + 'amdsmi_get_gpu_subsystem_id', 'amdsmi_dev_get_subsystem_name', 'amdsmi_dev_get_temp_metric', 'amdsmi_get_gpu_vendor_name', 'amdsmi_dev_get_volt_metric', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_dev_open_supported_func_iterator', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index f4fb46a6bc..efc7dc15cd 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -291,7 +291,7 @@ class Formatter: | """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id ") + """ | | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_get_gpu_vram_vendor ") + """ | | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor ") + """ | - | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id ") + """ | + | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_get_gpu_subsystem_id ") + """ | | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_dev_get_subsystem_name ") + """ | | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_dev_get_pci_id ") + """ | | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_dev_get_pci_bandwidth ") + """ | @@ -734,7 +734,7 @@ commands = { 4: [smi_api.amdsmi_dev_get_drm_render_minor, { "device_identifier1": [None, True] }], - 5: [smi_api.amdsmi_dev_get_subsystem_id, { + 5: [smi_api.amdsmi_get_gpu_subsystem_id, { "device_identifier1": [None, True] }], 6: [smi_api.amdsmi_dev_get_subsystem_name, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index d511ab69f2..95c3193670 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -622,7 +622,7 @@ amdsmi_get_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_ } -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id) { return rsmi_wrapper(rsmi_dev_subsystem_id_get, processor_handle, id); } @@ -896,7 +896,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_brand_get", "amdsmi_get_asic_info"}, {"rsmi_dev_vendor_name_get", "amdsmi_get_gpu_vendor_name"}, {"rsmi_dev_serial_number_get", "amdsmi_get_asic_info"}, - {"rsmi_dev_subsystem_id_get", "amdsmi_dev_get_subsystem_id"}, + {"rsmi_dev_subsystem_id_get", "amdsmi_get_gpu_subsystem_id"}, {"rsmi_dev_subsystem_name_get", "amdsmi_dev_get_subsystem_name"}, {"rsmi_dev_drm_render_minor_get", "amdsmi_dev_get_drm_render_minor"}, {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_asic_info"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index b91e6a1186..c0b34de5ce 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -177,10 +177,10 @@ void TestIdInfoRead::Run(void) { } // Get the device ID, name, vendor ID and vendor name for the sub-device - err = amdsmi_dev_get_subsystem_id(processor_handles_[i], &id); + err = amdsmi_get_gpu_subsystem_id(processor_handles_[i], &id); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_subsystem_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -188,7 +188,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem ID: 0x" << std::hex << id << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_subsystem_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } err = amdsmi_dev_get_subsystem_name(processor_handles_[i], buffer, kBufferLen); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 5df04d1d59..bf7d8b7759 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -213,7 +213,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_vram_vendor(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_subsystem_id(processor_handles_[0], &dmy_ui16); + ret = amdsmi_get_gpu_subsystem_id(processor_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_pci_id(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.cc b/projects/amdsmi/tests/amd_smi_test/test_base.cc index 855dc6c161..af3f6c6734 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.cc +++ b/projects/amdsmi/tests/amd_smi_test/test_base.cc @@ -187,7 +187,7 @@ void TestBase::PrintDeviceHeader(amdsmi_processor_handle dv_ind) { } } - err = amdsmi_dev_get_subsystem_id(dv_ind, &val_ui16); + err = amdsmi_get_gpu_subsystem_id(dv_ind, &val_ui16); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Subsystem ID: 0x" << std::hex << val_ui16 << std::endl; From acd7475ad07bb72654c20fb6d42505b1eda0086a Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:11:22 -0500 Subject: [PATCH 16/95] Renamed API amdsmi_dev_get_subsystem_name to amdsmi_get_gpu_subsystem_name grep -rli 'amdsmi_dev_get_subsystem_name' * | xargs -i@ sed -i 's/amdsmi_dev_get_subsystem_name/amdsmi_get_gpu_subsystem_name/g' @ Change-Id: Ib6f2b03f824e1ee910cfbbd0bab09ad859ec252b [ROCm/amdsmi commit: 82dbd07b2cce8b43055adcdfb5597ec6b977d521] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 2ff24c7f72..27ab70830d 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1431,7 +1431,7 @@ amdsmi_status_t amdsmi_get_gpu_subsystem_id(amdsmi_processor_handle processor_ha * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_subsystem_name(amdsmi_processor_handle processor_handle, char *name, size_t len); +amdsmi_get_gpu_subsystem_name(amdsmi_processor_handle processor_handle, char *name, size_t len); /** * @brief Get the drm minor number associated with this device diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index f777e8733c..58b320bcad 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -3015,7 +3015,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_get_subsystem_name +## amdsmi_get_gpu_subsystem_name Description: Get the name string for the device subsytem Input parameters: @@ -3024,7 +3024,7 @@ Input parameters: Output: device subsytem -Exceptions that can be thrown by `amdsmi_dev_get_subsystem_name` function: +Exceptions that can be thrown by `amdsmi_get_gpu_subsystem_name` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -3037,7 +3037,7 @@ try: print("No GPUs on machine") else: for device in devices: - subsystem_nam = amdsmi_dev_get_subsystem_name(device) + subsystem_nam = amdsmi_get_gpu_subsystem_name(device) print(subsystem_nam) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index c8b742ae1d..5bcd8b40b3 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -162,7 +162,7 @@ from .amdsmi_interface import amdsmi_get_gpu_id from .amdsmi_interface import amdsmi_get_gpu_vram_vendor from .amdsmi_interface import amdsmi_dev_get_drm_render_minor from .amdsmi_interface import amdsmi_get_gpu_subsystem_id -from .amdsmi_interface import amdsmi_dev_get_subsystem_name +from .amdsmi_interface import amdsmi_get_gpu_subsystem_name # # Version information from .amdsmi_interface import amdsmi_get_version diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ec98f9eaef..a48d33a1e9 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1152,7 +1152,7 @@ def amdsmi_get_gpu_subsystem_id(processor_handle: amdsmi_wrapper.amdsmi_processo return id.value -def amdsmi_dev_get_subsystem_name(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_subsystem_name(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 @@ -1164,7 +1164,7 @@ def amdsmi_dev_get_subsystem_name(processor_handle: amdsmi_wrapper.amdsmi_proces name = ctypes.create_string_buffer(_AMDSMI_STRING_LENGTH) _check_res( - amdsmi_wrapper.amdsmi_dev_get_subsystem_name( + amdsmi_wrapper.amdsmi_get_gpu_subsystem_name( processor_handle, name, length) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 54080a6cb8..641a3984db 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1433,9 +1433,9 @@ amdsmi_get_gpu_vram_vendor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c amdsmi_get_gpu_subsystem_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_subsystem_id amdsmi_get_gpu_subsystem_id.restype = amdsmi_status_t amdsmi_get_gpu_subsystem_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] -amdsmi_dev_get_subsystem_name = _libraries['libamd_smi.so'].amdsmi_dev_get_subsystem_name -amdsmi_dev_get_subsystem_name.restype = amdsmi_status_t -amdsmi_dev_get_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] +amdsmi_get_gpu_subsystem_name = _libraries['libamd_smi.so'].amdsmi_get_gpu_subsystem_name +amdsmi_get_gpu_subsystem_name.restype = amdsmi_status_t +amdsmi_get_gpu_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] amdsmi_dev_get_drm_render_minor = _libraries['libamd_smi.so'].amdsmi_dev_get_drm_render_minor amdsmi_dev_get_drm_render_minor.restype = amdsmi_status_t amdsmi_dev_get_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] @@ -1867,7 +1867,7 @@ __all__ = \ 'amdsmi_dev_get_pci_throughput', 'amdsmi_dev_get_perf_level', 'amdsmi_dev_get_power_ave', 'amdsmi_dev_get_power_profile_presets', - 'amdsmi_get_gpu_subsystem_id', 'amdsmi_dev_get_subsystem_name', + 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', 'amdsmi_dev_get_temp_metric', 'amdsmi_get_gpu_vendor_name', 'amdsmi_dev_get_volt_metric', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_dev_open_supported_func_iterator', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index efc7dc15cd..b7d25d891d 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -292,7 +292,7 @@ class Formatter: | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_get_gpu_vram_vendor ") + """ | | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor ") + """ | | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_get_gpu_subsystem_id ") + """ | - | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_dev_get_subsystem_name ") + """ | + | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_get_gpu_subsystem_name ") + """ | | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_dev_get_pci_id ") + """ | | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_dev_get_pci_bandwidth ") + """ | | """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_dev_get_pci_throughput ") + """ | @@ -737,7 +737,7 @@ commands = { 5: [smi_api.amdsmi_get_gpu_subsystem_id, { "device_identifier1": [None, True] }], - 6: [smi_api.amdsmi_dev_get_subsystem_name, { + 6: [smi_api.amdsmi_get_gpu_subsystem_name, { "device_identifier1": [None, True] }], 7: [smi_api.amdsmi_dev_get_pci_id, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 95c3193670..91296046f2 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -627,7 +627,7 @@ amdsmi_status_t amdsmi_get_gpu_subsystem_id(amdsmi_processor_handle processor_ha return rsmi_wrapper(rsmi_dev_subsystem_id_get, processor_handle, id); } -amdsmi_status_t amdsmi_dev_get_subsystem_name( +amdsmi_status_t amdsmi_get_gpu_subsystem_name( amdsmi_processor_handle processor_handle, char *name, size_t len) { return rsmi_wrapper(rsmi_dev_subsystem_name_get, processor_handle, name, len); @@ -897,7 +897,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_vendor_name_get", "amdsmi_get_gpu_vendor_name"}, {"rsmi_dev_serial_number_get", "amdsmi_get_asic_info"}, {"rsmi_dev_subsystem_id_get", "amdsmi_get_gpu_subsystem_id"}, - {"rsmi_dev_subsystem_name_get", "amdsmi_dev_get_subsystem_name"}, + {"rsmi_dev_subsystem_name_get", "amdsmi_get_gpu_subsystem_name"}, {"rsmi_dev_drm_render_minor_get", "amdsmi_dev_get_drm_render_minor"}, {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_asic_info"}, {"rsmi_dev_unique_id_get", "amdsmi_get_board_info"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index c0b34de5ce..052a4cceb6 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -191,12 +191,12 @@ void TestIdInfoRead::Run(void) { err = amdsmi_get_gpu_subsystem_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_subsystem_name(processor_handles_[i], buffer, kBufferLen); + err = amdsmi_get_gpu_subsystem_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Subsystem name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_subsystem_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -204,7 +204,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_subsystem_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index bf7d8b7759..970eded965 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -266,7 +266,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_name_get amdsmi_dev_brand_get amdsmi_get_gpu_vram_vendor - amdsmi_dev_get_subsystem_name + amdsmi_get_gpu_subsystem_name amdsmi_dev_get_drm_render_minor amdsmi_get_gpu_vendor_name amdsmi_dev_get_pci_bandwidth From 3ef24c632399214549d6f05a64b8173dd7080133 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:13:41 -0500 Subject: [PATCH 17/95] Renamed API amdsmi_dev_get_drm_render_minor to amdsmi_get_gpu_drm_render_minor grep -rli 'amdsmi_dev_get_drm_render_minor' * | xargs -i@ sed -i 's/amdsmi_dev_get_drm_render_minor/amdsmi_get_gpu_drm_render_minor/g' @ Change-Id: Icf6a1ba28ee3ff7f1fa66bad5d600725aad0bfca [ROCm/amdsmi commit: ac1b857f24b22f826fd65dbfb5581ba8ac01487e] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 27ab70830d..fc44f7095a 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1447,7 +1447,7 @@ amdsmi_get_gpu_subsystem_name(amdsmi_processor_handle processor_handle, char *na * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle processor_handle, uint32_t *minor); +amdsmi_get_gpu_drm_render_minor(amdsmi_processor_handle processor_handle, uint32_t *minor); /** @} End IDQuer */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 58b320bcad..028f44339e 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2958,7 +2958,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_drm_render_minor +## amdsmi_get_gpu_drm_render_minor Description: Get the drm minor number associated with this device. Input parameters: @@ -2967,7 +2967,7 @@ Input parameters: Output: drm minor number -Exceptions that can be thrown by `amdsmi_dev_get_drm_render_minor` function: +Exceptions that can be thrown by `amdsmi_get_gpu_drm_render_minor` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2980,7 +2980,7 @@ try: print("No GPUs on machine") else: for device in devices: - render_minor = amdsmi_dev_get_drm_render_minor(device) + render_minor = amdsmi_get_gpu_drm_render_minor(device) print(render_minor) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 5bcd8b40b3..9010499fbd 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -160,7 +160,7 @@ from .amdsmi_interface import AmdSmiEventReader from .amdsmi_interface import amdsmi_get_gpu_vendor_name from .amdsmi_interface import amdsmi_get_gpu_id from .amdsmi_interface import amdsmi_get_gpu_vram_vendor -from .amdsmi_interface import amdsmi_dev_get_drm_render_minor +from .amdsmi_interface import amdsmi_get_gpu_drm_render_minor from .amdsmi_interface import amdsmi_get_gpu_subsystem_id from .amdsmi_interface import amdsmi_get_gpu_subsystem_name diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index a48d33a1e9..1c42b55a3c 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1121,7 +1121,7 @@ def amdsmi_get_gpu_vram_vendor(processor_handle: amdsmi_wrapper.amdsmi_processor return vram_vendor.value.decode("utf-8") -def amdsmi_dev_get_drm_render_minor(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_drm_render_minor(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 @@ -1129,7 +1129,7 @@ def amdsmi_dev_get_drm_render_minor(processor_handle: amdsmi_wrapper.amdsmi_proc minor = ctypes.c_uint32() _check_res( - amdsmi_wrapper.amdsmi_dev_get_drm_render_minor( + amdsmi_wrapper.amdsmi_get_gpu_drm_render_minor( processor_handle, ctypes.byref(minor) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 641a3984db..16f924dcf0 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1436,9 +1436,9 @@ amdsmi_get_gpu_subsystem_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER( amdsmi_get_gpu_subsystem_name = _libraries['libamd_smi.so'].amdsmi_get_gpu_subsystem_name amdsmi_get_gpu_subsystem_name.restype = amdsmi_status_t amdsmi_get_gpu_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] -amdsmi_dev_get_drm_render_minor = _libraries['libamd_smi.so'].amdsmi_dev_get_drm_render_minor -amdsmi_dev_get_drm_render_minor.restype = amdsmi_status_t -amdsmi_dev_get_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_drm_render_minor = _libraries['libamd_smi.so'].amdsmi_get_gpu_drm_render_minor +amdsmi_get_gpu_drm_render_minor.restype = amdsmi_status_t +amdsmi_get_gpu_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_get_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_bandwidth amdsmi_dev_get_pci_bandwidth.restype = amdsmi_status_t amdsmi_dev_get_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)] @@ -1852,7 +1852,7 @@ __all__ = \ 'amdsmi_dev_close_supported_func_iterator', 'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter', 'amdsmi_dev_destroy_counter', 'amdsmi_dev_get_busy_percent', - 'amdsmi_dev_get_drm_render_minor', 'amdsmi_dev_get_ecc_count', + '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_dev_get_fan_speed', 'amdsmi_dev_get_fan_speed_max', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index b7d25d891d..12f8f06f31 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -290,7 +290,7 @@ class Formatter: | """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_get_gpu_vendor_name ") + """ | | """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id ") + """ | | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_get_gpu_vram_vendor ") + """ | - | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor ") + """ | + | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_get_gpu_drm_render_minor ") + """ | | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_get_gpu_subsystem_id ") + """ | | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_get_gpu_subsystem_name ") + """ | | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_dev_get_pci_id ") + """ | @@ -731,7 +731,7 @@ commands = { 3: [smi_api.amdsmi_get_gpu_vram_vendor, { "device_identifier1": [None, True] }], - 4: [smi_api.amdsmi_dev_get_drm_render_minor, { + 4: [smi_api.amdsmi_get_gpu_drm_render_minor, { "device_identifier1": [None, True] }], 5: [smi_api.amdsmi_get_gpu_subsystem_id, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 91296046f2..cd5de4c13a 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -898,7 +898,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_serial_number_get", "amdsmi_get_asic_info"}, {"rsmi_dev_subsystem_id_get", "amdsmi_get_gpu_subsystem_id"}, {"rsmi_dev_subsystem_name_get", "amdsmi_get_gpu_subsystem_name"}, - {"rsmi_dev_drm_render_minor_get", "amdsmi_dev_get_drm_render_minor"}, + {"rsmi_dev_drm_render_minor_get", "amdsmi_get_gpu_drm_render_minor"}, {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_asic_info"}, {"rsmi_dev_unique_id_get", "amdsmi_get_board_info"}, {"rsmi_dev_pci_bandwidth_get", "amdsmi_dev_get_pci_bandwidth"}, @@ -1379,7 +1379,7 @@ amdsmi_status_t amdsmi_dev_get_energy_count(amdsmi_processor_handle processor_ha power, counter_resolution, timestamp); } -amdsmi_status_t amdsmi_dev_get_drm_render_minor( +amdsmi_status_t amdsmi_get_gpu_drm_render_minor( amdsmi_processor_handle processor_handle, uint32_t *minor) { return rsmi_wrapper(rsmi_dev_drm_render_minor_get, processor_handle, minor); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index 052a4cceb6..208cb21cc3 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -145,10 +145,10 @@ void TestIdInfoRead::Run(void) { } } - err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], &drm_render_minor); + err = amdsmi_get_gpu_drm_render_minor(processor_handles_[i], &drm_render_minor); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { // Verify api support checking functionality is working - err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_drm_render_minor(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -156,7 +156,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**DRM Render Minor: " << drm_render_minor << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_drm_render_minor(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } err = amdsmi_get_gpu_vendor_name(processor_handles_[i], buffer, kBufferLen); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 970eded965..99a392ff7b 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -267,7 +267,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_brand_get amdsmi_get_gpu_vram_vendor amdsmi_get_gpu_subsystem_name - amdsmi_dev_get_drm_render_minor + amdsmi_get_gpu_drm_render_minor amdsmi_get_gpu_vendor_name amdsmi_dev_get_pci_bandwidth amdsmi_dev_set_pci_bandwidth From 404b8229aca17ba21a03e571aba78e928dea2fd7 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:19:57 -0500 Subject: [PATCH 18/95] Renamed API amdsmi_get_driver_version to amdsmi_get_gpu_driver_version grep -rli 'amdsmi_get_driver_version' * | xargs -i@ sed -i 's/amdsmi_get_driver_version/amdsmi_get_gpu_driver_version/g' @ Change-Id: Ic1dfb17f7595210ec1fcbd5a936fd259e57e9638 [ROCm/amdsmi commit: 8c8f41f8932af70ac64a06fe9b54b28800906b36] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 19afc9a109..bc254acef9 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -320,9 +320,9 @@ int main() { // Get driver version char version[AMDSMI_MAX_DRIVER_VERSION_LENGTH]; int version_length = AMDSMI_MAX_DRIVER_VERSION_LENGTH; - ret = amdsmi_get_driver_version(processor_handles[j], &version_length, version); + ret = amdsmi_get_gpu_driver_version(processor_handles[j], &version_length, version); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_driver_version:\n"); + printf(" Output of amdsmi_get_gpu_driver_version:\n"); printf("\tDriver version: %s\n\n", version); // Get device uuid diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index fc44f7095a..85cbecb49b 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3608,7 +3608,7 @@ amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned in * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version); +amdsmi_get_gpu_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version); /** @} End swversion */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 028f44339e..d4615a8774 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -263,7 +263,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_driver_version +## amdsmi_get_gpu_driver_version Description: Returns the version string of the driver Input parameters: @@ -271,7 +271,7 @@ Input parameters: Output: Driver version string that is handling the device -Exceptions that can be thrown by `amdsmi_get_driver_version` function: +Exceptions that can be thrown by `amdsmi_get_gpu_driver_version` function: * `AmdSmiParameterException` * `AmdSmiLibraryException` @@ -279,7 +279,7 @@ Example: ```python try: device = amdsmi_get_processor_handles()[0] - print("Driver version: ", amdsmi_get_driver_version(device)) + print("Driver version: ", amdsmi_get_gpu_driver_version(device)) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 9010499fbd..36a032c9c2 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -34,7 +34,7 @@ from .amdsmi_interface import amdsmi_get_gpu_device_uuid from .amdsmi_interface import amdsmi_get_processor_handle_from_bdf # # SW Version Information -from .amdsmi_interface import amdsmi_get_driver_version +from .amdsmi_interface import amdsmi_get_gpu_driver_version # # ASIC and Bus Static Information from .amdsmi_interface import amdsmi_get_asic_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 1c42b55a3c..3fa5a0db56 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -940,7 +940,7 @@ def amdsmi_get_gpu_device_uuid(processor_handle: amdsmi_wrapper.amdsmi_processor return uuid.value.decode("utf-8") -def amdsmi_get_driver_version( +def amdsmi_get_gpu_driver_version( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -954,7 +954,7 @@ def amdsmi_get_driver_version( version = ctypes.create_string_buffer(_AMDSMI_MAX_DRIVER_VERSION_LENGTH) _check_res( - amdsmi_wrapper.amdsmi_get_driver_version( + amdsmi_wrapper.amdsmi_get_gpu_driver_version( processor_handle, ctypes.byref(length), version ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 16f924dcf0..804f327d76 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1670,9 +1670,9 @@ amdsmi_get_gpu_device_bdf.argtypes = [amdsmi_processor_handle, ctypes.POINTER(un amdsmi_get_gpu_device_uuid = _libraries['libamd_smi.so'].amdsmi_get_gpu_device_uuid amdsmi_get_gpu_device_uuid.restype = amdsmi_status_t amdsmi_get_gpu_device_uuid.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_char)] -amdsmi_get_driver_version = _libraries['libamd_smi.so'].amdsmi_get_driver_version -amdsmi_get_driver_version.restype = amdsmi_status_t -amdsmi_get_driver_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_char)] +amdsmi_get_gpu_driver_version = _libraries['libamd_smi.so'].amdsmi_get_gpu_driver_version +amdsmi_get_gpu_driver_version.restype = amdsmi_status_t +amdsmi_get_gpu_driver_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_char)] amdsmi_get_asic_info = _libraries['libamd_smi.so'].amdsmi_get_asic_info amdsmi_get_asic_info.restype = amdsmi_status_t amdsmi_get_asic_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_asic_info_t)] @@ -1901,7 +1901,7 @@ __all__ = \ 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', 'amdsmi_get_gpu_device_uuid', - 'amdsmi_get_driver_version', 'amdsmi_get_ecc_error_count', + 'amdsmi_get_gpu_driver_version', 'amdsmi_get_ecc_error_count', 'amdsmi_get_event_notification', 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index cd5de4c13a..fdbd9e0ce6 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1792,7 +1792,7 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amds } amdsmi_status_t -amdsmi_get_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version) { +amdsmi_get_gpu_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version) { AMDSMI_CHECK_INIT(); if (length == nullptr || version == nullptr) { From 0bd6f365bc8a01e4bf69d0f0495a70523afa23d3 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:22:16 -0500 Subject: [PATCH 19/95] Renamed API amdsmi_get_asic_info to amdsmi_get_gpu_asic_info grep -rli 'amdsmi_get_asic_info' * | xargs -i@ sed -i 's/amdsmi_get_asic_info/amdsmi_get_gpu_asic_info/g' @ Change-Id: I4586c7f8876eba7b8af33b5ea29afa8bacb85a9a [ROCm/amdsmi commit: 1f9074916f94f53cccf154e15363c32cd514d8f6] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/example/amd_smi_nodrm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 14 +++++++------- .../tests/amd_smi_test/functional/id_info_read.cc | 2 +- .../amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/sys_info_read.cc | 6 +++--- projects/amdsmi/tests/amd_smi_test/test_base.cc | 2 +- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index bc254acef9..3c30e59d9a 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -282,9 +282,9 @@ int main() { // Get ASIC info amdsmi_asic_info_t asic_info = {}; - ret = amdsmi_get_asic_info(processor_handles[j], &asic_info); + ret = amdsmi_get_gpu_asic_info(processor_handles[j], &asic_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_asic_info:\n"); + printf(" Output of amdsmi_get_gpu_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); printf("\tFamilyID: 0x%x\n", asic_info.family); printf("\tDeviceID: 0x%lx\n", asic_info.device_id); diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index df8de39a3c..6888ebaee9 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -127,9 +127,9 @@ int main() { bdf.function_number); amdsmi_asic_info_t asic_info = {}; - ret = amdsmi_get_asic_info(processor_handles[j], &asic_info); + ret = amdsmi_get_gpu_asic_info(processor_handles[j], &asic_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_asic_info:\n"); + printf(" Output of amdsmi_get_gpu_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); printf("\tFamilyID: 0x%x\n", asic_info.family); printf("\tDeviceID: 0x%lx\n", asic_info.device_id); diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 85cbecb49b..73b4935e0f 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3632,7 +3632,7 @@ amdsmi_get_gpu_driver_version(amdsmi_processor_handle processor_handle, int *len * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info); +amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info); /** * @brief Returns the board part number and board information for the requested device diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index d4615a8774..11889aa4b9 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -284,7 +284,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_asic_info +## amdsmi_get_gpu_asic_info Description: Returns asic information for the given GPU Input parameters: @@ -301,7 +301,7 @@ Field | Content `rev_id` | revision id `asic_serial` | asic serial -Exceptions that can be thrown by `amdsmi_get_asic_info` function: +Exceptions that can be thrown by `amdsmi_get_gpu_asic_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -314,7 +314,7 @@ try: print("No GPUs on machine") else: for device in devices: - asic_info = amdsmi_get_asic_info(device) + asic_info = amdsmi_get_gpu_asic_info(device) print(asic_info['market_name']) print(hex(asic_info['family'])) print(hex(asic_info['vendor_id'])) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 36a032c9c2..54f838305d 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -37,7 +37,7 @@ from .amdsmi_interface import amdsmi_get_processor_handle_from_bdf from .amdsmi_interface import amdsmi_get_gpu_driver_version # # ASIC and Bus Static Information -from .amdsmi_interface import amdsmi_get_asic_info +from .amdsmi_interface import amdsmi_get_gpu_asic_info from .amdsmi_interface import amdsmi_get_power_cap_info from .amdsmi_interface import amdsmi_get_caps_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 3fa5a0db56..cc98040e9d 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -581,7 +581,7 @@ def amdsmi_get_gpu_device_bdf(processor_handle: amdsmi_wrapper.amdsmi_processor_ return _format_bdf(bdf_info) -def amdsmi_get_asic_info( +def amdsmi_get_gpu_asic_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -591,7 +591,7 @@ def amdsmi_get_asic_info( asic_info = amdsmi_wrapper.amdsmi_asic_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_asic_info( + amdsmi_wrapper.amdsmi_get_gpu_asic_info( processor_handle, ctypes.byref(asic_info)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 804f327d76..f5214dd8d6 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1673,9 +1673,9 @@ amdsmi_get_gpu_device_uuid.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c amdsmi_get_gpu_driver_version = _libraries['libamd_smi.so'].amdsmi_get_gpu_driver_version amdsmi_get_gpu_driver_version.restype = amdsmi_status_t amdsmi_get_gpu_driver_version.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_char)] -amdsmi_get_asic_info = _libraries['libamd_smi.so'].amdsmi_get_asic_info -amdsmi_get_asic_info.restype = amdsmi_status_t -amdsmi_get_asic_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_asic_info_t)] +amdsmi_get_gpu_asic_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_asic_info +amdsmi_get_gpu_asic_info.restype = amdsmi_status_t +amdsmi_get_gpu_asic_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_asic_info_t)] amdsmi_get_board_info = _libraries['libamd_smi.so'].amdsmi_get_board_info amdsmi_get_board_info.restype = amdsmi_status_t amdsmi_get_board_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_board_info_t)] @@ -1893,7 +1893,7 @@ __all__ = \ 'amdsmi_frequencies_t', 'amdsmi_frequency_range_t', 'amdsmi_func_id_iter_handle_t', 'amdsmi_func_id_value_t', 'amdsmi_fw_block_t', 'amdsmi_fw_block_t__enumvalues', - 'amdsmi_fw_info_t', 'amdsmi_get_asic_info', + 'amdsmi_fw_info_t', 'amdsmi_get_gpu_asic_info', 'amdsmi_get_bad_page_info', 'amdsmi_get_board_info', 'amdsmi_get_caps_info', 'amdsmi_get_clock_measure', 'amdsmi_get_compute_process_gpus', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 12f8f06f31..e7e839893a 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -335,7 +335,7 @@ class Formatter: | """ + self.style.text("46 Get minmax_bandwidth_get. Api: amdsmi_get_minmax_bandwidth ") + """ | | """ + self.style.text("47 Get topo get link type. Api: amdsmi_topo_get_link_type ") + """ | | """ + self.style.text("48 Get is P2P accessible. Api: amdsmi_is_P2P_accessible ") + """ | - | """ + self.style.text("49 Get asic info. Api: amdsmi_get_asic_info ") + """ | + | """ + self.style.text("49 Get asic info. Api: amdsmi_get_gpu_asic_info ") + """ | | """ + self.style.text("50 Get processor_handles. Api: amdsmi_get_processor_handles ") + """ | | """ + self.style.text("51 Get event notification. Api: amdsmi_get_event_notification ") + """ | | """ + self.style.text("52 Init event notification. Api: amdsmi_init_event_notification ") + """ | @@ -871,7 +871,7 @@ commands = { "device_identifier1": [None, True], "device_identifier2": [None, True] }], - 49: [smi_api.amdsmi_get_asic_info, { + 49: [smi_api.amdsmi_get_gpu_asic_info, { "device_identifier1": [None, True] }], 50: [smi_api.amdsmi_get_processor_handles, {}], diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index fdbd9e0ce6..3baf78bec0 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -559,7 +559,7 @@ amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, } amdsmi_status_t -amdsmi_get_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info) { +amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info) { AMDSMI_CHECK_INIT(); @@ -890,16 +890,16 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, static const std::map rsmi_2_amdsmi = { {"rsmi_dev_vram_vendor_get", "amdsmi_get_gpu_vram_vendor"}, {"rsmi_dev_id_get", "amdsmi_get_gpu_id"}, - {"rsmi_dev_vendor_id_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_vendor_id_get", "amdsmi_get_gpu_asic_info"}, {"rsmi_dev_name_get", "amdsmi_get_board_info"}, {"rsmi_dev_sku_get", "amdsmi_get_board_info"}, - {"rsmi_dev_brand_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_brand_get", "amdsmi_get_gpu_asic_info"}, {"rsmi_dev_vendor_name_get", "amdsmi_get_gpu_vendor_name"}, - {"rsmi_dev_serial_number_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_serial_number_get", "amdsmi_get_gpu_asic_info"}, {"rsmi_dev_subsystem_id_get", "amdsmi_get_gpu_subsystem_id"}, {"rsmi_dev_subsystem_name_get", "amdsmi_get_gpu_subsystem_name"}, {"rsmi_dev_drm_render_minor_get", "amdsmi_get_gpu_drm_render_minor"}, - {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_gpu_asic_info"}, {"rsmi_dev_unique_id_get", "amdsmi_get_board_info"}, {"rsmi_dev_pci_bandwidth_get", "amdsmi_dev_get_pci_bandwidth"}, {"rsmi_dev_pci_id_get", "amdsmi_dev_get_pci_id"}, @@ -1832,7 +1832,7 @@ amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned in const uint8_t fcn = 0xff; std::string path = "/sys/class/drm/" + gpu_device->get_gpu_path() + "/device/uuid_info"; - status = amdsmi_get_asic_info(processor_handle, &asic_info); + status = amdsmi_get_gpu_asic_info(processor_handle, &asic_info); if (status != AMDSMI_STATUS_SUCCESS) { printf("Getting asic info failed. Return code: %d", status); return status; @@ -1923,7 +1923,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle processor_hand return AMDSMI_STATUS_API_FAILED; } - status = amdsmi_get_asic_info(processor_handle, &asic_info); + status = amdsmi_get_gpu_asic_info(processor_handle, &asic_info); if (status != AMDSMI_STATUS_SUCCESS) return status; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index 208cb21cc3..e94f5fa898 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -124,7 +124,7 @@ void TestIdInfoRead::Run(void) { // vendor_id, unique_id amdsmi_asic_info_t asci_info; - err = amdsmi_get_asic_info(processor_handles_[0], &asci_info); + err = amdsmi_get_gpu_asic_info(processor_handles_[0], &asci_info); CHK_ERR_ASRT(err) // device name, brand, serial_number diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 99a392ff7b..85d259dfe0 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -201,7 +201,7 @@ void TestMutualExclusion::Run(void) { // vendor_id, unique_id amdsmi_asic_info_t asci_info; - ret = amdsmi_get_asic_info(processor_handles_[0], &asci_info); + ret = amdsmi_get_gpu_asic_info(processor_handles_[0], &asci_info); CHECK_RET(ret, AMDSMI_STATUS_BUSY); // device name, brand, serial_number diff --git a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc index e28422a70a..bd52fba5ee 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc @@ -151,13 +151,13 @@ void TestSysInfoRead::Run(void) { // vendor_id, unique_id amdsmi_asic_info_t asci_info; - err = amdsmi_get_asic_info(processor_handles_[0], &asci_info); + err = amdsmi_get_gpu_asic_info(processor_handles_[0], &asci_info); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**amdsmi_dev_unique_id() is not supported" " on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_get_asic_info(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_asic_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { if (err == AMDSMI_STATUS_SUCCESS) { @@ -169,7 +169,7 @@ void TestSysInfoRead::Run(void) { */ } // Verify api support checking functionality is working - err = amdsmi_get_asic_info(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_asic_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } else { std::cout << "amdsmi_dev_unique_id_get() failed with error " << diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.cc b/projects/amdsmi/tests/amd_smi_test/test_base.cc index af3f6c6734..106e68436a 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.cc +++ b/projects/amdsmi/tests/amd_smi_test/test_base.cc @@ -179,7 +179,7 @@ void TestBase::PrintDeviceHeader(amdsmi_processor_handle dv_ind) { IF_VERB(STANDARD) { std::cout << "\t**Device name: " << board_info.product_name << std::endl; - err = amdsmi_get_asic_info(dv_ind, &info); + err = amdsmi_get_gpu_asic_info(dv_ind, &info); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Device Vendor ID: 0x" << std::hex << From e53fdb26ca3a344675158cf6b14fbad5e731dc05 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:24:40 -0500 Subject: [PATCH 20/95] Renamed API amdsmi_dev_get_pci_bandwidth to amdsmi_get_gpu_pci_bandwidth grep -rli 'amdsmi_dev_get_pci_bandwidth' * | xargs -i@ sed -i 's/amdsmi_dev_get_pci_bandwidth/amdsmi_get_gpu_pci_bandwidth/g' @ Change-Id: I43e5fc475f933b33770b6c2244232fca811c2036 [ROCm/amdsmi commit: 9b76d64944146a439e1472a3557c5bd8af298698] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/frequencies_read.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/pci_read_write.cc | 8 ++++---- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 73b4935e0f..d9b52fea68 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1474,7 +1474,7 @@ amdsmi_get_gpu_drm_render_minor(amdsmi_processor_handle processor_handle, uint32 * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth); +amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth); /** * @brief Get the unique PCI device identifier associated for a device diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 11889aa4b9..f239c8c32a 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1355,7 +1355,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_get_pci_bandwidth +## amdsmi_get_gpu_pci_bandwidth Description: Get the list of possible PCIe bandwidths that are available. Input parameters: @@ -1378,7 +1378,7 @@ Field | Content `current` | current `frequency` | list of frequency -Exceptions that can be thrown by `amdsmi_dev_get_pci_bandwidth` function: +Exceptions that can be thrown by `amdsmi_get_gpu_pci_bandwidth` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1391,7 +1391,7 @@ try: print("No GPUs on machine") else: for device in devices: - bandwidth = amdsmi_dev_get_pci_bandwidth(device) + bandwidth = amdsmi_get_gpu_pci_bandwidth(device) print(bandwidth) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 54f838305d..4fe89ab44d 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -138,7 +138,7 @@ from .amdsmi_interface import amdsmi_dev_reset_xgmi_error # # PCIE information from .amdsmi_interface import amdsmi_dev_get_pci_id -from .amdsmi_interface import amdsmi_dev_get_pci_bandwidth +from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_dev_get_pci_throughput from .amdsmi_interface import amdsmi_dev_get_pci_replay_counter from .amdsmi_interface import amdsmi_topo_get_numa_affinity diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index cc98040e9d..379701da12 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1742,7 +1742,7 @@ def _format_transfer_rate(transfer_rate): } -def amdsmi_dev_get_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_pci_bandwidth(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 @@ -1751,7 +1751,7 @@ def amdsmi_dev_get_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_process bandwidth = amdsmi_wrapper.amdsmi_pcie_bandwidth_t() _check_res( - amdsmi_wrapper.amdsmi_dev_get_pci_bandwidth( + amdsmi_wrapper.amdsmi_get_gpu_pci_bandwidth( processor_handle, ctypes.byref(bandwidth)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index f5214dd8d6..5df7aa4eb0 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1439,9 +1439,9 @@ amdsmi_get_gpu_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTE amdsmi_get_gpu_drm_render_minor = _libraries['libamd_smi.so'].amdsmi_get_gpu_drm_render_minor amdsmi_get_gpu_drm_render_minor.restype = amdsmi_status_t amdsmi_get_gpu_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] -amdsmi_dev_get_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_bandwidth -amdsmi_dev_get_pci_bandwidth.restype = amdsmi_status_t -amdsmi_dev_get_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)] +amdsmi_get_gpu_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_bandwidth +amdsmi_get_gpu_pci_bandwidth.restype = amdsmi_status_t +amdsmi_get_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)] amdsmi_dev_get_pci_id = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_id amdsmi_dev_get_pci_id.restype = amdsmi_status_t amdsmi_dev_get_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] @@ -1862,7 +1862,7 @@ __all__ = \ 'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', - 'amdsmi_dev_get_pci_bandwidth', 'amdsmi_dev_get_pci_id', + 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_dev_get_pci_id', 'amdsmi_dev_get_pci_replay_counter', 'amdsmi_dev_get_pci_throughput', 'amdsmi_dev_get_perf_level', 'amdsmi_dev_get_power_ave', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index e7e839893a..b129b8dd65 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -294,7 +294,7 @@ class Formatter: | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_get_gpu_subsystem_id ") + """ | | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_get_gpu_subsystem_name ") + """ | | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_dev_get_pci_id ") + """ | - | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_dev_get_pci_bandwidth ") + """ | + | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_get_gpu_pci_bandwidth ") + """ | | """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_dev_get_pci_throughput ") + """ | | """ + self.style.text("10 Get device pci replay counter. Api: amdsmi_dev_get_pci_replay_counter ") + """ | | """ + self.style.text("11 Get topo numa affinity. Api: amdsmi_topo_get_numa_affinity ") + """ | @@ -743,7 +743,7 @@ commands = { 7: [smi_api.amdsmi_dev_get_pci_id, { "device_identifier1": [None, True] }], - 8: [smi_api.amdsmi_dev_get_pci_bandwidth, { + 8: [smi_api.amdsmi_get_gpu_pci_bandwidth, { "device_identifier1": [None, True] }], 9: [smi_api.amdsmi_dev_get_pci_throughput, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 3baf78bec0..473d9842b3 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -901,7 +901,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_drm_render_minor_get", "amdsmi_get_gpu_drm_render_minor"}, {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_gpu_asic_info"}, {"rsmi_dev_unique_id_get", "amdsmi_get_board_info"}, - {"rsmi_dev_pci_bandwidth_get", "amdsmi_dev_get_pci_bandwidth"}, + {"rsmi_dev_pci_bandwidth_get", "amdsmi_get_gpu_pci_bandwidth"}, {"rsmi_dev_pci_id_get", "amdsmi_dev_get_pci_id"}, {"rsmi_dev_pci_throughput_get", "amdsmi_dev_get_pci_throughput"}, {"rsmi_dev_pci_replay_counter_get", " amdsmi_dev_get_pci_replay_counter"}, @@ -1195,7 +1195,7 @@ amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_ bw_bitmask); } -amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth) { return rsmi_wrapper(rsmi_dev_pci_bandwidth_get, processor_handle, reinterpret_cast(bandwidth)); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc index dd05912dc7..c93bcd89b5 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc @@ -147,12 +147,12 @@ void TestFrequenciesRead::Run(void) { freq_output(CLK_TYPE_DCEF, "Display Controller Engine Clock"); freq_output(CLK_TYPE_SOC, "SOC Clock"); - err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], &b); + err = amdsmi_get_gpu_pci_bandwidth(processor_handles_[i], &b); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Get PCIE Bandwidth: Not supported on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_pci_bandwidth(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) { std::cout << "\t**Get PCIE Bandwidth " @@ -164,7 +164,7 @@ void TestFrequenciesRead::Run(void) { std::cout << b.transfer_rate.num_supported << std::endl; print_frequencies(&b.transfer_rate, b.lanes); // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_pci_bandwidth(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 85d259dfe0..7a6c8c2bf4 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -269,7 +269,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_subsystem_name amdsmi_get_gpu_drm_render_minor amdsmi_get_gpu_vendor_name - amdsmi_dev_get_pci_bandwidth + amdsmi_get_gpu_pci_bandwidth amdsmi_dev_set_pci_bandwidth amdsmi_dev_get_pci_throughput amdsmi_dev_get_temp_metric diff --git a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc index 2811e1777e..42e407eec0 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc @@ -141,14 +141,14 @@ void TestPciReadWrite::Run(void) { std::cout << std::endl; } - ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw); + ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], &bw); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "TEST FAILURE: Current PCIe bandwidth is not detected. " "This is likely because it is not indicated in the pp_dpm_pcie sysfs " "file. Aborting test." << std::endl; // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr); + ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); return; @@ -163,7 +163,7 @@ void TestPciReadWrite::Run(void) { std::endl; } // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr); + ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); // First set the bitmask to all supported bandwidths @@ -185,7 +185,7 @@ void TestPciReadWrite::Run(void) { ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], freq_bitmask); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw); + ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], &bw); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { From 3c3dc0370448779c1dc944a40dfdf38d89cfe4ea Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:26:18 -0500 Subject: [PATCH 21/95] Renamed API amdsmi_get_board_info to amdsmi_get_gpu_board_info grep -rli 'amdsmi_get_board_info' * | xargs -i@ sed -i 's/amdsmi_get_board_info/amdsmi_get_gpu_board_info/g' @ Change-Id: Ia3fb361aaf5832813e7ce41bfb88fbbf1432020b [ROCm/amdsmi commit: 928b7e2a4d857c9dd67b70508f4c5357bffaa2ac] --- projects/amdsmi/README.md | 2 +- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/example/amd_smi_nodrm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 8 ++++---- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- projects/amdsmi/tests/amd_smi_test/test_base.cc | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/projects/amdsmi/README.md b/projects/amdsmi/README.md index 82614e3851..5f5c014a12 100755 --- a/projects/amdsmi/README.md +++ b/projects/amdsmi/README.md @@ -137,7 +137,7 @@ int main() { // Get device name amdsmi_board_info_t board_info; - ret = amdsmi_get_board_info(processor_handles[j], &board_info); + ret = amdsmi_get_gpu_board_info(processor_handles[j], &board_info); std::cout << "\tdevice " << j <<"\n\t\tName:" << board_info.product_name << std::endl; diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 3c30e59d9a..26ec97b7c8 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -623,9 +623,9 @@ int main() { // Get device name amdsmi_board_info_t board_info = {}; - ret = amdsmi_get_board_info(processor_handles[j], &board_info); + ret = amdsmi_get_gpu_board_info(processor_handles[j], &board_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_board_info:\n"); + printf(" Output of amdsmi_get_gpu_board_info:\n"); std::cout << "\tdevice [" << j << "]\n\t\tProduct name: " << board_info.product_name << "\n" diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 6888ebaee9..146d3ca94e 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -287,9 +287,9 @@ int main() { // Get device name amdsmi_board_info_t board_info = {}; - ret = amdsmi_get_board_info(processor_handles[j], &board_info); + ret = amdsmi_get_gpu_board_info(processor_handles[j], &board_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_board_info:\n"); + printf(" Output of amdsmi_get_gpu_board_info:\n"); std::cout << "\tdevice [" << j << "]\n\t\tProduct name: " << board_info.product_name << "\n" diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index d9b52fea68..1591f44999 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3645,7 +3645,7 @@ amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_i * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *info); +amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *info); /** * @brief Returns the power caps as currently configured in the diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index f239c8c32a..e09790751d 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -909,7 +909,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_board_info +## amdsmi_get_gpu_board_info Description: Returns board info for the given GPU Input parameters: @@ -924,7 +924,7 @@ Field | Description `product_serial` | Product serial `product_name` | Product name -Exceptions that can be thrown by `amdsmi_get_board_info` function: +Exceptions that can be thrown by `amdsmi_get_gpu_board_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -933,7 +933,7 @@ Example: ```python try: device = amdsmi_get_processor_handle_from_bdf("0000:23.00.0") - board_info = amdsmi_get_board_info(device) + board_info = amdsmi_get_gpu_board_info(device) print(board_info["serial_number"]) print(board_info["product_serial"]) print(board_info["product_name"]) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 4fe89ab44d..e4473f8918 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -66,7 +66,7 @@ from .amdsmi_interface import amdsmi_get_process_info from .amdsmi_interface import amdsmi_get_ecc_error_count # # Board Information -from .amdsmi_interface import amdsmi_get_board_info +from .amdsmi_interface import amdsmi_get_gpu_board_info # # Ras Information from .amdsmi_interface import amdsmi_get_ras_block_features_enabled diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 379701da12..ef561df363 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -800,7 +800,7 @@ def amdsmi_get_ecc_error_count( } -def amdsmi_get_board_info( +def amdsmi_get_gpu_board_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -810,7 +810,7 @@ def amdsmi_get_board_info( board_info = amdsmi_wrapper.amdsmi_board_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_board_info( + amdsmi_wrapper.amdsmi_get_gpu_board_info( processor_handle, ctypes.byref(board_info)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 5df7aa4eb0..9e586b48cf 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1676,9 +1676,9 @@ amdsmi_get_gpu_driver_version.argtypes = [amdsmi_processor_handle, ctypes.POINTE amdsmi_get_gpu_asic_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_asic_info amdsmi_get_gpu_asic_info.restype = amdsmi_status_t amdsmi_get_gpu_asic_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_asic_info_t)] -amdsmi_get_board_info = _libraries['libamd_smi.so'].amdsmi_get_board_info -amdsmi_get_board_info.restype = amdsmi_status_t -amdsmi_get_board_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_board_info_t)] +amdsmi_get_gpu_board_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_board_info +amdsmi_get_gpu_board_info.restype = amdsmi_status_t +amdsmi_get_gpu_board_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_board_info_t)] amdsmi_get_power_cap_info = _libraries['libamd_smi.so'].amdsmi_get_power_cap_info amdsmi_get_power_cap_info.restype = amdsmi_status_t amdsmi_get_power_cap_info.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_cap_info_t)] @@ -1894,7 +1894,7 @@ __all__ = \ 'amdsmi_func_id_iter_handle_t', 'amdsmi_func_id_value_t', 'amdsmi_fw_block_t', 'amdsmi_fw_block_t__enumvalues', 'amdsmi_fw_info_t', 'amdsmi_get_gpu_asic_info', - 'amdsmi_get_bad_page_info', 'amdsmi_get_board_info', + 'amdsmi_get_bad_page_info', 'amdsmi_get_gpu_board_info', 'amdsmi_get_caps_info', 'amdsmi_get_clock_measure', 'amdsmi_get_compute_process_gpus', 'amdsmi_get_compute_process_info', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 473d9842b3..210af54902 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -286,7 +286,7 @@ amdsmi_get_gpu_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *board_info) { +amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *board_info) { AMDSMI_CHECK_INIT(); @@ -891,8 +891,8 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_vram_vendor_get", "amdsmi_get_gpu_vram_vendor"}, {"rsmi_dev_id_get", "amdsmi_get_gpu_id"}, {"rsmi_dev_vendor_id_get", "amdsmi_get_gpu_asic_info"}, - {"rsmi_dev_name_get", "amdsmi_get_board_info"}, - {"rsmi_dev_sku_get", "amdsmi_get_board_info"}, + {"rsmi_dev_name_get", "amdsmi_get_gpu_board_info"}, + {"rsmi_dev_sku_get", "amdsmi_get_gpu_board_info"}, {"rsmi_dev_brand_get", "amdsmi_get_gpu_asic_info"}, {"rsmi_dev_vendor_name_get", "amdsmi_get_gpu_vendor_name"}, {"rsmi_dev_serial_number_get", "amdsmi_get_gpu_asic_info"}, @@ -900,7 +900,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_subsystem_name_get", "amdsmi_get_gpu_subsystem_name"}, {"rsmi_dev_drm_render_minor_get", "amdsmi_get_gpu_drm_render_minor"}, {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_gpu_asic_info"}, - {"rsmi_dev_unique_id_get", "amdsmi_get_board_info"}, + {"rsmi_dev_unique_id_get", "amdsmi_get_gpu_board_info"}, {"rsmi_dev_pci_bandwidth_get", "amdsmi_get_gpu_pci_bandwidth"}, {"rsmi_dev_pci_id_get", "amdsmi_dev_get_pci_id"}, {"rsmi_dev_pci_throughput_get", "amdsmi_dev_get_pci_throughput"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index e94f5fa898..4f5c849f36 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -129,7 +129,7 @@ void TestIdInfoRead::Run(void) { // device name, brand, serial_number amdsmi_board_info_t board_info; - err = amdsmi_get_board_info(processor_handles_[0], &board_info); + err = amdsmi_get_gpu_board_info(processor_handles_[0], &board_info); CHK_ERR_ASRT(err) err = amdsmi_get_gpu_vram_vendor(processor_handles_[i], buffer, kBufferLen); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 7a6c8c2bf4..417f5aa699 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -206,7 +206,7 @@ void TestMutualExclusion::Run(void) { // device name, brand, serial_number amdsmi_board_info_t board_info; - ret = amdsmi_get_board_info(processor_handles_[0], &board_info); + ret = amdsmi_get_gpu_board_info(processor_handles_[0], &board_info); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_vendor_name(processor_handles_[0], dmy_str, 10); diff --git a/projects/amdsmi/tests/amd_smi_test/test_base.cc b/projects/amdsmi/tests/amd_smi_test/test_base.cc index 106e68436a..b83f6a7a96 100644 --- a/projects/amdsmi/tests/amd_smi_test/test_base.cc +++ b/projects/amdsmi/tests/amd_smi_test/test_base.cc @@ -174,7 +174,7 @@ void TestBase::PrintDeviceHeader(amdsmi_processor_handle dv_ind) { } amdsmi_board_info_t board_info; - err = amdsmi_get_board_info(dv_ind, &board_info); + err = amdsmi_get_gpu_board_info(dv_ind, &board_info); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Device name: " << board_info.product_name << std::endl; From 6bd013ba58d776cbfdc83521cb1094d6ff46416c Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:32:09 -0500 Subject: [PATCH 22/95] Renamed API amdsmi_dev_get_pci_id to amdsmi_get_gpu_pci_id grep -rli 'amdsmi_dev_get_pci_id' * | xargs -i@ sed -i 's/amdsmi_dev_get_pci_id/amdsmi_get_gpu_pci_id/g' @ Change-Id: If5454038cf582bdf3c657f466d0f6eb1dd3c14e0 [ROCm/amdsmi commit: 55ddbdc67e395666291b5b21dad902d9f75e2c83] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../amdsmi/tests/amd_smi_test/functional/sys_info_read.cc | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 1591f44999..9ff32cef99 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1303,7 +1303,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr * @p id. This ID is an identification of the type of device, so calling this * function for different devices will give the same value if they are kind * of device. Consequently, this function should not be used to distinguish - * one device from another. amdsmi_dev_get_pci_id() should be used to get a + * one device from another. amdsmi_get_gpu_pci_id() should be used to get a * unique identifier. * * @param[in] processor_handle a device handle @@ -1508,7 +1508,7 @@ amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pc * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid); +amdsmi_status_t amdsmi_get_gpu_pci_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid); /** * @brief Get the NUMA node associated with a device diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index e09790751d..518d9547ab 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1313,7 +1313,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_get_pci_id +## amdsmi_get_gpu_pci_id Description: Get the unique PCI device identifier associated for a device Input parameters: @@ -1335,7 +1335,7 @@ BDFID = ((DOMAIN & 0xffffffff) << 32) | ((BUS & 0xff) << 8) | | Function | [ 2: 0] | -Exceptions that can be thrown by `amdsmi_dev_get_pci_id` function: +Exceptions that can be thrown by `amdsmi_get_gpu_pci_id` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1348,7 +1348,7 @@ try: print("No GPUs on machine") else: for device in devices: - bdfid = amdsmi_dev_get_pci_id(device) + bdfid = amdsmi_get_gpu_pci_id(device) print(bdfid) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index e4473f8918..8e4912704e 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -137,7 +137,7 @@ from .amdsmi_interface import amdsmi_dev_xgmi_error_status from .amdsmi_interface import amdsmi_dev_reset_xgmi_error # # PCIE information -from .amdsmi_interface import amdsmi_dev_get_pci_id +from .amdsmi_interface import amdsmi_get_gpu_pci_id from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_dev_get_pci_throughput from .amdsmi_interface import amdsmi_dev_get_pci_replay_counter diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ef561df363..e946952956 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1626,7 +1626,7 @@ def amdsmi_dev_open_supported_func_iterator( return obj_handle -def amdsmi_dev_get_pci_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_pci_id(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 @@ -1634,7 +1634,7 @@ def amdsmi_dev_get_pci_id(processor_handle: amdsmi_wrapper.amdsmi_processor_hand bdfid = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_pci_id( + amdsmi_wrapper.amdsmi_get_gpu_pci_id( processor_handle, ctypes.byref(bdfid)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9e586b48cf..81fa19df0d 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1442,9 +1442,9 @@ amdsmi_get_gpu_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POIN amdsmi_get_gpu_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_bandwidth amdsmi_get_gpu_pci_bandwidth.restype = amdsmi_status_t amdsmi_get_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)] -amdsmi_dev_get_pci_id = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_id -amdsmi_dev_get_pci_id.restype = amdsmi_status_t -amdsmi_dev_get_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_pci_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_id +amdsmi_get_gpu_pci_id.restype = amdsmi_status_t +amdsmi_get_gpu_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_topo_get_numa_affinity = _libraries['libamd_smi.so'].amdsmi_topo_get_numa_affinity amdsmi_topo_get_numa_affinity.restype = amdsmi_status_t amdsmi_topo_get_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] @@ -1862,7 +1862,7 @@ __all__ = \ 'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', - 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_dev_get_pci_id', + 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', 'amdsmi_dev_get_pci_replay_counter', 'amdsmi_dev_get_pci_throughput', 'amdsmi_dev_get_perf_level', 'amdsmi_dev_get_power_ave', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index b129b8dd65..a63e37e210 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -293,7 +293,7 @@ class Formatter: | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_get_gpu_drm_render_minor ") + """ | | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_get_gpu_subsystem_id ") + """ | | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_get_gpu_subsystem_name ") + """ | - | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_dev_get_pci_id ") + """ | + | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_get_gpu_pci_id ") + """ | | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_get_gpu_pci_bandwidth ") + """ | | """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_dev_get_pci_throughput ") + """ | | """ + self.style.text("10 Get device pci replay counter. Api: amdsmi_dev_get_pci_replay_counter ") + """ | @@ -740,7 +740,7 @@ commands = { 6: [smi_api.amdsmi_get_gpu_subsystem_name, { "device_identifier1": [None, True] }], - 7: [smi_api.amdsmi_dev_get_pci_id, { + 7: [smi_api.amdsmi_get_gpu_pci_id, { "device_identifier1": [None, True] }], 8: [smi_api.amdsmi_get_gpu_pci_bandwidth, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 210af54902..001ad5fbcb 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -902,7 +902,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_gpu_asic_info"}, {"rsmi_dev_unique_id_get", "amdsmi_get_gpu_board_info"}, {"rsmi_dev_pci_bandwidth_get", "amdsmi_get_gpu_pci_bandwidth"}, - {"rsmi_dev_pci_id_get", "amdsmi_dev_get_pci_id"}, + {"rsmi_dev_pci_id_get", "amdsmi_get_gpu_pci_id"}, {"rsmi_dev_pci_throughput_get", "amdsmi_dev_get_pci_throughput"}, {"rsmi_dev_pci_replay_counter_get", " amdsmi_dev_get_pci_replay_counter"}, {"rsmi_dev_pci_bandwidth_set", " amdsmi_dev_set_pci_bandwidth"}, @@ -1385,7 +1385,7 @@ amdsmi_status_t amdsmi_get_gpu_drm_render_minor( minor); } -amdsmi_status_t amdsmi_dev_get_pci_id( +amdsmi_status_t amdsmi_get_gpu_pci_id( amdsmi_processor_handle processor_handle, uint64_t *bdfid) { return rsmi_wrapper(rsmi_dev_pci_id_get, processor_handle, bdfid); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index 4f5c849f36..5b1cb1d635 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -231,7 +231,7 @@ void TestIdInfoRead::Run(void) { ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64); + err = amdsmi_get_gpu_pci_id(processor_handles_[i], &val_ui64); // Don't check for AMDSMI_STATUS_NOT_SUPPORTED since this should always be // supported. It is not based on a sysfs file. CHK_ERR_ASRT(err) @@ -240,7 +240,7 @@ void TestIdInfoRead::Run(void) { std::cout << " (" << std::dec << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_pci_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 417f5aa699..395d0d6a8d 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -215,7 +215,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_subsystem_id(processor_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_id(processor_handles_[0], &dmy_ui64); + ret = amdsmi_get_gpu_pci_id(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc index bd52fba5ee..405abc5a41 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc @@ -128,14 +128,14 @@ void TestSysInfoRead::Run(void) { } } - err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64); + err = amdsmi_get_gpu_pci_id(processor_handles_[i], &val_ui64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**PCI ID (BDFID): 0x" << std::hex << val_ui64; std::cout << " (" << std::dec << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_pci_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); err = amdsmi_topo_get_numa_affinity(processor_handles_[i], &val_ui32); From 52c0195b866ac4c84d0629388a283b975896259c Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:36:54 -0500 Subject: [PATCH 23/95] Renamed API amdsmi_topo_get_numa_affinity to amdsmi_get_gpu_topo_numa_affinity grep -rli 'amdsmi_topo_get_numa_affinity' * | xargs -i@ sed -i 's/amdsmi_topo_get_numa_affinity/amdsmi_get_gpu_topo_numa_affinity/g' @ Change-Id: If24a64e9e508bbd728570da5c3e69df5b802b59a [ROCm/amdsmi commit: 83720266dd8e6c3ac15f8e7541ad288cf336eaaf] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/sys_info_read.cc | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 9ff32cef99..9a5fe6d59b 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1529,7 +1529,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_id(amdsmi_processor_handle processor_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle processor_handle, uint32_t *numa_node); +amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity(amdsmi_processor_handle processor_handle, uint32_t *numa_node); /** * @brief Get PCIe traffic information diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 518d9547ab..8b38b2dbcd 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1461,7 +1461,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_topo_get_numa_affinity +## amdsmi_get_gpu_topo_numa_affinity Description: Get the NUMA node associated with a device @@ -1471,7 +1471,7 @@ Input parameters: Output: NUMA node value -Exceptions that can be thrown by `amdsmi_topo_get_numa_affinity` function: +Exceptions that can be thrown by `amdsmi_get_gpu_topo_numa_affinity` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1484,7 +1484,7 @@ try: print("No GPUs on machine") else: for device in devices: - numa_node = amdsmi_topo_get_numa_affinity(device) + numa_node = amdsmi_get_gpu_topo_numa_affinity(device) print(numa_node) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 8e4912704e..0bb86cc980 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -141,7 +141,7 @@ from .amdsmi_interface import amdsmi_get_gpu_pci_id from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_dev_get_pci_throughput from .amdsmi_interface import amdsmi_dev_get_pci_replay_counter -from .amdsmi_interface import amdsmi_topo_get_numa_affinity +from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity # # Power information from .amdsmi_interface import amdsmi_dev_get_power_ave diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index e946952956..ccf7174171 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1801,7 +1801,7 @@ def amdsmi_dev_get_pci_replay_counter(processor_handle: amdsmi_wrapper.amdsmi_pr return counter.value -def amdsmi_topo_get_numa_affinity(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_topo_numa_affinity(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 @@ -1810,7 +1810,7 @@ def amdsmi_topo_get_numa_affinity(processor_handle: amdsmi_wrapper.amdsmi_proces numa_node = ctypes.c_uint32() _check_res( - amdsmi_wrapper.amdsmi_topo_get_numa_affinity( + amdsmi_wrapper.amdsmi_get_gpu_topo_numa_affinity( processor_handle, ctypes.byref(numa_node)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 81fa19df0d..8376a7a542 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1445,9 +1445,9 @@ amdsmi_get_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER amdsmi_get_gpu_pci_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_id amdsmi_get_gpu_pci_id.restype = amdsmi_status_t amdsmi_get_gpu_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_topo_get_numa_affinity = _libraries['libamd_smi.so'].amdsmi_topo_get_numa_affinity -amdsmi_topo_get_numa_affinity.restype = amdsmi_status_t -amdsmi_topo_get_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_topo_numa_affinity = _libraries['libamd_smi.so'].amdsmi_get_gpu_topo_numa_affinity +amdsmi_get_gpu_topo_numa_affinity.restype = amdsmi_status_t +amdsmi_get_gpu_topo_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_get_pci_throughput = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_throughput amdsmi_dev_get_pci_throughput.restype = amdsmi_status_t amdsmi_dev_get_pci_throughput.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] @@ -1942,7 +1942,7 @@ __all__ = \ 'amdsmi_temperature_type_t', 'amdsmi_temperature_type_t__enumvalues', 'amdsmi_topo_get_link_type', 'amdsmi_topo_get_link_weight', - 'amdsmi_topo_get_numa_affinity', + 'amdsmi_get_gpu_topo_numa_affinity', 'amdsmi_topo_get_numa_node_number', 'amdsmi_utilization_counter_t', 'amdsmi_vbios_info_t', 'amdsmi_version_t', 'amdsmi_voltage_metric_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index a63e37e210..c4007aa76b 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -297,7 +297,7 @@ class Formatter: | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_get_gpu_pci_bandwidth ") + """ | | """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_dev_get_pci_throughput ") + """ | | """ + self.style.text("10 Get device pci replay counter. Api: amdsmi_dev_get_pci_replay_counter ") + """ | - | """ + self.style.text("11 Get topo numa affinity. Api: amdsmi_topo_get_numa_affinity ") + """ | + | """ + 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("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 ") + """ | @@ -752,7 +752,7 @@ commands = { 10: [smi_api. amdsmi_dev_get_pci_replay_counter, { "device_identifier1": [None, True] }], - 11: [smi_api.amdsmi_topo_get_numa_affinity, { + 11: [smi_api.amdsmi_get_gpu_topo_numa_affinity, { "device_identifier1": [None, True] }], 12: [amdsmi_tool_dev_power_ave_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 001ad5fbcb..fb41d71d2a 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -928,7 +928,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_dev_get_memory_reserved_pages"}, - {"rsmi_topo_numa_affinity_get", "amdsmi_topo_get_numa_affinity"}, + {"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"}, {"rsmi_dev_gpu_metrics_info_get", " amdsmi_dev_get_gpu_metrics_info"}, {"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"}, {"rsmi_dev_memory_total_get", "amdsmi_dev_get_memory_total"}, @@ -1391,7 +1391,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_id( bdfid); } -amdsmi_status_t amdsmi_topo_get_numa_affinity( +amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity( amdsmi_processor_handle processor_handle, uint32_t *numa_node) { return rsmi_wrapper(rsmi_topo_numa_affinity_get, processor_handle, numa_node); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc index 405abc5a41..3fa5867fc6 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc @@ -138,14 +138,14 @@ void TestSysInfoRead::Run(void) { err = amdsmi_get_gpu_pci_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_topo_get_numa_affinity(processor_handles_[i], &val_ui32); + err = amdsmi_get_gpu_topo_numa_affinity(processor_handles_[i], &val_ui32); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**NUMA NODE: 0x" << std::hex << val_ui32; std::cout << " (" << std::dec << val_ui32 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_topo_get_numa_affinity(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_topo_numa_affinity(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); From 642986764b8bb89d57f94081330ef6624a46caef Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:39:10 -0500 Subject: [PATCH 24/95] Renamed API amdsmi_dev_get_pci_throughput to amdsmi_get_gpu_pci_throughput grep -rli 'amdsmi_dev_get_pci_throughput' * | xargs -i@ sed -i 's/amdsmi_dev_get_pci_throughput/amdsmi_get_gpu_pci_throughput/g' @ Change-Id: Id6dbd3591d59954622237770e15320583b63dbe0 [ROCm/amdsmi commit: 931099683b98fb281c7e9dc8ac205b6b44820b8a] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- .../tests/amd_smi_test/functional/pci_read_write.cc | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 9a5fe6d59b..99dabc3bae 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1553,7 +1553,7 @@ amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity(amdsmi_processor_handle proces * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle processor_handle, uint64_t *sent, +amdsmi_status_t amdsmi_get_gpu_pci_throughput(amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 8b38b2dbcd..e825bba770 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1397,7 +1397,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_pci_throughput +## amdsmi_get_gpu_pci_throughput Description: Get PCIe traffic information Input parameters: @@ -1412,7 +1412,7 @@ Field | Content `received` | the number of bytes received `max_pkt_sz` | maximum packet size -Exceptions that can be thrown by `amdsmi_dev_get_pci_throughput` function: +Exceptions that can be thrown by `amdsmi_get_gpu_pci_throughput` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1425,7 +1425,7 @@ try: print("No GPUs on machine") else: for device in devices: - pci = amdsmi_dev_get_pci_throughput(device) + pci = amdsmi_get_gpu_pci_throughput(device) print(pci) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 0bb86cc980..123d16c1a7 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -139,7 +139,7 @@ from .amdsmi_interface import amdsmi_dev_reset_xgmi_error # # PCIE information from .amdsmi_interface import amdsmi_get_gpu_pci_id from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth -from .amdsmi_interface import amdsmi_dev_get_pci_throughput +from .amdsmi_interface import amdsmi_get_gpu_pci_throughput from .amdsmi_interface import amdsmi_dev_get_pci_replay_counter from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ccf7174171..3fc1dd33aa 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1763,7 +1763,7 @@ def amdsmi_get_gpu_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_process } -def amdsmi_dev_get_pci_throughput(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_pci_throughput(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 @@ -1774,7 +1774,7 @@ def amdsmi_dev_get_pci_throughput(processor_handle: amdsmi_wrapper.amdsmi_proces max_pkt_sz = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_pci_throughput(processor_handle, ctypes.byref( + amdsmi_wrapper.amdsmi_get_gpu_pci_throughput(processor_handle, ctypes.byref( sent), ctypes.byref(received), ctypes.byref(max_pkt_sz)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 8376a7a542..1e0e282d71 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1448,9 +1448,9 @@ amdsmi_get_gpu_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes amdsmi_get_gpu_topo_numa_affinity = _libraries['libamd_smi.so'].amdsmi_get_gpu_topo_numa_affinity amdsmi_get_gpu_topo_numa_affinity.restype = amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] -amdsmi_dev_get_pci_throughput = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_throughput -amdsmi_dev_get_pci_throughput.restype = amdsmi_status_t -amdsmi_dev_get_pci_throughput.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_pci_throughput = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_throughput +amdsmi_get_gpu_pci_throughput.restype = amdsmi_status_t +amdsmi_get_gpu_pci_throughput.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_pci_replay_counter = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_replay_counter amdsmi_dev_get_pci_replay_counter.restype = amdsmi_status_t amdsmi_dev_get_pci_replay_counter.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] @@ -1864,7 +1864,7 @@ __all__ = \ 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', 'amdsmi_dev_get_pci_replay_counter', - 'amdsmi_dev_get_pci_throughput', 'amdsmi_dev_get_perf_level', + 'amdsmi_get_gpu_pci_throughput', 'amdsmi_dev_get_perf_level', 'amdsmi_dev_get_power_ave', 'amdsmi_dev_get_power_profile_presets', 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index c4007aa76b..1be7241e5a 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -295,7 +295,7 @@ class Formatter: | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_get_gpu_subsystem_name ") + """ | | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_get_gpu_pci_id ") + """ | | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_get_gpu_pci_bandwidth ") + """ | - | """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_dev_get_pci_throughput ") + """ | + | """ + 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_dev_get_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 ") + """ | @@ -746,7 +746,7 @@ commands = { 8: [smi_api.amdsmi_get_gpu_pci_bandwidth, { "device_identifier1": [None, True] }], - 9: [smi_api.amdsmi_dev_get_pci_throughput, { + 9: [smi_api.amdsmi_get_gpu_pci_throughput, { "device_identifier1": [None, True] }], 10: [smi_api. amdsmi_dev_get_pci_replay_counter, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index fb41d71d2a..4e2ffd9902 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -903,7 +903,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_unique_id_get", "amdsmi_get_gpu_board_info"}, {"rsmi_dev_pci_bandwidth_get", "amdsmi_get_gpu_pci_bandwidth"}, {"rsmi_dev_pci_id_get", "amdsmi_get_gpu_pci_id"}, - {"rsmi_dev_pci_throughput_get", "amdsmi_dev_get_pci_throughput"}, + {"rsmi_dev_pci_throughput_get", "amdsmi_get_gpu_pci_throughput"}, {"rsmi_dev_pci_replay_counter_get", " amdsmi_dev_get_pci_replay_counter"}, {"rsmi_dev_pci_bandwidth_set", " amdsmi_dev_set_pci_bandwidth"}, {"rsmi_dev_power_profile_set", " amdsmi_dev_set_power_profile"}, @@ -1295,7 +1295,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter( return rsmi_wrapper(rsmi_dev_pci_replay_counter_get, processor_handle, counter); } -amdsmi_status_t amdsmi_dev_get_pci_throughput( +amdsmi_status_t amdsmi_get_gpu_pci_throughput( amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz) { return rsmi_wrapper(rsmi_dev_pci_throughput_get, processor_handle, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 395d0d6a8d..cc1a5309d9 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -217,7 +217,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_pci_id(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); + ret = amdsmi_get_gpu_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -271,7 +271,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_vendor_name amdsmi_get_gpu_pci_bandwidth amdsmi_dev_set_pci_bandwidth - amdsmi_dev_get_pci_throughput + amdsmi_get_gpu_pci_throughput amdsmi_dev_get_temp_metric amdsmi_dev_get_volt_metric amdsmi_dev_get_fan_speed diff --git a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc index 42e407eec0..16f7122a53 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc @@ -120,7 +120,7 @@ void TestPciReadWrite::Run(void) { ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); } - ret = amdsmi_dev_get_pci_throughput(processor_handles_[dv_ind], &sent, &received, &max_pkt_sz); + ret = amdsmi_get_gpu_pci_throughput(processor_handles_[dv_ind], &sent, &received, &max_pkt_sz); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "TEST FAILURE: Current PCIe throughput is not detected. " "This is likely because it is not indicated in the pcie_bw sysfs " From a3c4c55c33c68a5781d7b50e954f69c9ade647d9 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:41:03 -0500 Subject: [PATCH 25/95] Renamed API amdsmi_dev_get_pci_replay_counter to amdsmi_get_gpu_pci_replay_counter grep -rli 'amdsmi_dev_get_pci_replay_counter' * | xargs -i@ sed -i 's/amdsmi_dev_get_pci_replay_counter/amdsmi_get_gpu_pci_replay_counter/g' @ Change-Id: Ic6ad26e35cb6cf73f87a71d39abf38d3afac4be4 [ROCm/amdsmi commit: d8e22b9687d61881a4ca247cd0a783341992c7a2] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- .../tests/amd_smi_test/functional/pci_read_write.cc | 8 ++++---- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 99dabc3bae..1f8ec35353 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1575,7 +1575,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_throughput(amdsmi_processor_handle processor_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_pci_replay_counter(amdsmi_processor_handle processor_handle, uint64_t *counter); /** @} End PCIeQuer */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index e825bba770..0bc49c36e5 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1431,7 +1431,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_pci_replay_counter +## amdsmi_get_gpu_pci_replay_counter Description: Get PCIe replay counter @@ -1442,7 +1442,7 @@ Input parameters: Output: counter value The sum of the NAK's received and generated by the GPU -Exceptions that can be thrown by ` amdsmi_dev_get_pci_replay_counter` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_pci_replay_counter` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1455,7 +1455,7 @@ try: print("No GPUs on machine") else: for device in devices: - counter = amdsmi_dev_get_pci_replay_counter(device) + counter = amdsmi_get_gpu_pci_replay_counter(device) print(counter) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 123d16c1a7..1fc05d6f84 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -140,7 +140,7 @@ from .amdsmi_interface import amdsmi_dev_reset_xgmi_error from .amdsmi_interface import amdsmi_get_gpu_pci_id from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_get_gpu_pci_throughput -from .amdsmi_interface import amdsmi_dev_get_pci_replay_counter +from .amdsmi_interface import amdsmi_get_gpu_pci_replay_counter from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity # # Power information diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 3fc1dd33aa..eadcf2d229 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1785,7 +1785,7 @@ def amdsmi_get_gpu_pci_throughput(processor_handle: amdsmi_wrapper.amdsmi_proces } -def amdsmi_dev_get_pci_replay_counter(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_pci_replay_counter(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 @@ -1794,7 +1794,7 @@ def amdsmi_dev_get_pci_replay_counter(processor_handle: amdsmi_wrapper.amdsmi_pr counter = ctypes.c_uint64() _check_res( - amdsmi_wrapper. amdsmi_dev_get_pci_replay_counter( + amdsmi_wrapper. amdsmi_get_gpu_pci_replay_counter( processor_handle, ctypes.byref(counter)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 1e0e282d71..da0b2fd063 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1451,9 +1451,9 @@ amdsmi_get_gpu_topo_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.PO amdsmi_get_gpu_pci_throughput = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_throughput amdsmi_get_gpu_pci_throughput.restype = amdsmi_status_t amdsmi_get_gpu_pci_throughput.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] -amdsmi_dev_get_pci_replay_counter = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_replay_counter -amdsmi_dev_get_pci_replay_counter.restype = amdsmi_status_t -amdsmi_dev_get_pci_replay_counter.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_pci_replay_counter = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_replay_counter +amdsmi_get_gpu_pci_replay_counter.restype = amdsmi_status_t +amdsmi_get_gpu_pci_replay_counter.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_set_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_dev_set_pci_bandwidth amdsmi_dev_set_pci_bandwidth.restype = amdsmi_status_t amdsmi_dev_set_pci_bandwidth.argtypes = [amdsmi_processor_handle, uint64_t] @@ -1863,7 +1863,7 @@ __all__ = \ 'amdsmi_dev_get_od_volt_curve_regions', 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', - 'amdsmi_dev_get_pci_replay_counter', + 'amdsmi_get_gpu_pci_replay_counter', 'amdsmi_get_gpu_pci_throughput', 'amdsmi_dev_get_perf_level', 'amdsmi_dev_get_power_ave', 'amdsmi_dev_get_power_profile_presets', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 1be7241e5a..7319b987b1 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -296,7 +296,7 @@ class Formatter: | """ + self.style.text(" 7 Get device pci id. Api: amdsmi_get_gpu_pci_id ") + """ | | """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_get_gpu_pci_bandwidth ") + """ | | """ + 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_dev_get_pci_replay_counter ") + """ | + | """ + 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("13 Get device energy count. Api: amdsmi_dev_get_energy_count ") + """ | @@ -749,7 +749,7 @@ commands = { 9: [smi_api.amdsmi_get_gpu_pci_throughput, { "device_identifier1": [None, True] }], - 10: [smi_api. amdsmi_dev_get_pci_replay_counter, { + 10: [smi_api. amdsmi_get_gpu_pci_replay_counter, { "device_identifier1": [None, True] }], 11: [smi_api.amdsmi_get_gpu_topo_numa_affinity, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 4e2ffd9902..597a89d82d 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -904,7 +904,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_pci_bandwidth_get", "amdsmi_get_gpu_pci_bandwidth"}, {"rsmi_dev_pci_id_get", "amdsmi_get_gpu_pci_id"}, {"rsmi_dev_pci_throughput_get", "amdsmi_get_gpu_pci_throughput"}, - {"rsmi_dev_pci_replay_counter_get", " amdsmi_dev_get_pci_replay_counter"}, + {"rsmi_dev_pci_replay_counter_get", " amdsmi_get_gpu_pci_replay_counter"}, {"rsmi_dev_pci_bandwidth_set", " amdsmi_dev_set_pci_bandwidth"}, {"rsmi_dev_power_profile_set", " amdsmi_dev_set_power_profile"}, {"rsmi_dev_memory_busy_percent_get", "amdsmi_dev_get_memory_busy_percent"}, @@ -1290,7 +1290,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level( amdsmi_processor_handle processor_handle, uint32_t od) { return rsmi_wrapper(rsmi_dev_overdrive_level_set, processor_handle, od); } -amdsmi_status_t amdsmi_dev_get_pci_replay_counter( +amdsmi_status_t amdsmi_get_gpu_pci_replay_counter( amdsmi_processor_handle processor_handle, uint64_t *counter) { return rsmi_wrapper(rsmi_dev_pci_replay_counter_get, processor_handle, counter); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index cc1a5309d9..a001b77e2d 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -219,7 +219,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[0], &dmy_ui64); + ret = amdsmi_get_gpu_pci_replay_counter(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -295,7 +295,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_get_busy_percent amdsmi_dev_vbios_version_get amdsmi_dev_serial_number_get - amdsmi_dev_get_pci_replay_counter + amdsmi_get_gpu_pci_replay_counter amdsmi_dev_unique_id_get amdsmi_dev_create_counter amdsmi_counter_get_available_counters diff --git a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc index 16f7122a53..4ec684b790 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc @@ -100,15 +100,15 @@ void TestPciReadWrite::Run(void) { for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], &u64int); + ret = amdsmi_get_gpu_pci_replay_counter(processor_handles_[dv_ind], &u64int); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << - "\t** amdsmi_dev_get_pci_replay_counter() is not supported" + "\t** amdsmi_get_gpu_pci_replay_counter() is not supported" " on this machine" << std::endl; // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr); + ret = amdsmi_get_gpu_pci_replay_counter(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(ret) @@ -116,7 +116,7 @@ void TestPciReadWrite::Run(void) { std::cout << "\tPCIe Replay Counter: " << u64int << std::endl; } // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr); + ret = amdsmi_get_gpu_pci_replay_counter(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); } From a8d932a9bb9b7f6950aeda421593cefb7f51659c Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:43:32 -0500 Subject: [PATCH 26/95] Renamed API amdsmi_dev_set_pci_bandwidth to amdsmi_set_gpu_pci_bandwidth grep -rli 'amdsmi_dev_set_pci_bandwidth' * | xargs -i@ sed -i 's/amdsmi_dev_set_pci_bandwidth/amdsmi_set_gpu_pci_bandwidth/g' @ Change-Id: Id4312cfe5fddb63c42c4c6ca0a9a1d94b83f7164 [ROCm/amdsmi commit: 24c0005e15da4728cf938584cd33014134cc1cc6] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- .../tests/amd_smi_test/functional/pci_read_write.cc | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 1f8ec35353..2b76e70218 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1615,7 +1615,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_replay_counter(amdsmi_processor_handle proce * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask); +amdsmi_status_t amdsmi_set_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask); /** @} End PCIeCont */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 0bc49c36e5..3339b38eef 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1196,7 +1196,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_pci_bandwidth +## amdsmi_set_gpu_pci_bandwidth Description: Control the set of allowed PCIe bandwidths that can be used Input parameters: @@ -1206,7 +1206,7 @@ to be enabled (1) and disabled (0) Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_pci_bandwidth` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_pci_bandwidth` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1219,7 +1219,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_pci_bandwidth(device, 0) + amdsmi_set_gpu_pci_bandwidth(device, 0) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 1fc05d6f84..43f3844ff8 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -79,7 +79,7 @@ from .amdsmi_interface import amdsmi_next_func_iter from .amdsmi_interface import amdsmi_get_func_iter_value # # Unsupported Functions In Virtual Environment -from .amdsmi_interface import amdsmi_dev_set_pci_bandwidth +from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_dev_set_power_cap from .amdsmi_interface import amdsmi_dev_set_power_profile from .amdsmi_interface import amdsmi_dev_set_clk_range diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index eadcf2d229..33e8f9c795 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1716,7 +1716,7 @@ def amdsmi_get_func_iter_value( } -def amdsmi_dev_set_pci_bandwidth( +def amdsmi_set_gpu_pci_bandwidth( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, bitmask: int ) -> None: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1728,7 +1728,7 @@ def amdsmi_dev_set_pci_bandwidth( raise AmdSmiParameterException(bitmask, int) _check_res( - amdsmi_wrapper. amdsmi_dev_set_pci_bandwidth( + amdsmi_wrapper. amdsmi_set_gpu_pci_bandwidth( processor_handle, ctypes.c_uint64(bitmask) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index da0b2fd063..9d3831a447 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1454,9 +1454,9 @@ amdsmi_get_gpu_pci_throughput.argtypes = [amdsmi_processor_handle, ctypes.POINTE amdsmi_get_gpu_pci_replay_counter = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_replay_counter amdsmi_get_gpu_pci_replay_counter.restype = amdsmi_status_t amdsmi_get_gpu_pci_replay_counter.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_dev_set_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_dev_set_pci_bandwidth -amdsmi_dev_set_pci_bandwidth.restype = amdsmi_status_t -amdsmi_dev_set_pci_bandwidth.argtypes = [amdsmi_processor_handle, uint64_t] +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)] @@ -1879,7 +1879,7 @@ __all__ = \ 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', 'amdsmi_dev_set_overdrive_level', 'amdsmi_dev_set_overdrive_level_v1', - 'amdsmi_dev_set_pci_bandwidth', 'amdsmi_dev_set_perf_level', + 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_dev_set_perf_level', 'amdsmi_dev_set_perf_level_v1', 'amdsmi_dev_set_power_cap', 'amdsmi_dev_set_power_profile', 'amdsmi_dev_xgmi_error_status', 'amdsmi_processor_handle', 'amdsmi_engine_usage_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 7319b987b1..16bbd483b8 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -358,7 +358,7 @@ class Formatter: | """ + self.style.text("69 Set dev od volt info. Api: amdsmi_dev_set_od_volt_info ") + """| | """ + self.style.text("70 Set dev overdrive level. Api: amdsmi_dev_set_overdrive_level ") + """ | | """ + self.style.text("71 Set v1 dev overdrive level. Api: amdsmi_dev_set_overdrive_level_v1 ") + """ | - | """ + self.style.text("72 Set dev pci bandwidth. Api: amdsmi_dev_set_pci_bandwidth ") + """ | + | """ + self.style.text("72 Set dev pci bandwidth. Api: amdsmi_set_gpu_pci_bandwidth ") + """ | | """ + self.style.text("73 Set dev perf level. Api: amdsmi_dev_set_perf_level ") + """ | | """ + self.style.text("74 Set dev perf level v1. Api: amdsmi_dev_set_perf_level_v1 ") + """ | | """ + self.style.text("75 Set dev power cap. Api: amdsmi_dev_set_power_cap ") + """ | @@ -486,7 +486,7 @@ def amdsmi_tool_dev_overdrive_level_set_v1(dev, dic): def amdsmi_tool_dev_pci_bandwidth_set(dev, dic): bitmask = dic["bitmask"] - return smi_api. amdsmi_dev_set_pci_bandwidth(dev, bitmask) + return smi_api. amdsmi_set_gpu_pci_bandwidth(dev, bitmask) def amdsmi_tool_dev_gpu_clk_freq_get(dev): diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 597a89d82d..7785b640ff 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -905,7 +905,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_pci_id_get", "amdsmi_get_gpu_pci_id"}, {"rsmi_dev_pci_throughput_get", "amdsmi_get_gpu_pci_throughput"}, {"rsmi_dev_pci_replay_counter_get", " amdsmi_get_gpu_pci_replay_counter"}, - {"rsmi_dev_pci_bandwidth_set", " amdsmi_dev_set_pci_bandwidth"}, + {"rsmi_dev_pci_bandwidth_set", " amdsmi_set_gpu_pci_bandwidth"}, {"rsmi_dev_power_profile_set", " amdsmi_dev_set_power_profile"}, {"rsmi_dev_memory_busy_percent_get", "amdsmi_dev_get_memory_busy_percent"}, {"rsmi_dev_busy_percent_get", "amdsmi_dev_get_busy_percent"}, @@ -1189,7 +1189,7 @@ amdsmi_status_t static_cast(perf_lvl)); } -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask) { return rsmi_wrapper(rsmi_dev_pci_bandwidth_set, processor_handle, bw_bitmask); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index a001b77e2d..ecea990b48 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -221,7 +221,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_pci_replay_counter(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[0], 0); + ret = amdsmi_set_gpu_pci_bandwidth(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_fan_rpms(processor_handles_[0], dmy_ui32, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -270,7 +270,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_drm_render_minor amdsmi_get_gpu_vendor_name amdsmi_get_gpu_pci_bandwidth - amdsmi_dev_set_pci_bandwidth + amdsmi_set_gpu_pci_bandwidth amdsmi_get_gpu_pci_throughput amdsmi_dev_get_temp_metric amdsmi_dev_get_volt_metric diff --git a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc index 4ec684b790..ffc0b26b66 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc @@ -182,7 +182,7 @@ void TestPciReadWrite::Run(void) { std::cout << "\tSetting bandwidth mask to " << "0b" << freq_bm_str << " ..." << std::endl; } - ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], freq_bitmask); + ret = amdsmi_set_gpu_pci_bandwidth(processor_handles_[dv_ind], freq_bitmask); CHK_ERR_ASRT(ret) ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], &bw); @@ -193,7 +193,7 @@ void TestPciReadWrite::Run(void) { std::endl; std::cout << "\tResetting mask to all bandwidths." << std::endl; } - ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], 0xFFFFFFFF); + ret = amdsmi_set_gpu_pci_bandwidth(processor_handles_[dv_ind], 0xFFFFFFFF); CHK_ERR_ASRT(ret) ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); From 72e7af819824a847606193aa1b0953a6cf9cb9bd Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:45:11 -0500 Subject: [PATCH 27/95] Renamed API amdsmi_get_vbios_info to amdsmi_get_gpu_vbios_info grep -rli 'amdsmi_get_vbios_info' * | xargs -i@ sed -i 's/amdsmi_get_vbios_info/amdsmi_get_gpu_vbios_info/g' @ Change-Id: I90249704db3d77eca6b09c33ef3f2cec5eda77a2 [ROCm/amdsmi commit: 508d2612d349c2cfea86cb449f7ededd958d1821] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/example/amd_smi_nodrm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/sys_info_read.cc | 6 +++--- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 26ec97b7c8..469f5f5a1f 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -294,9 +294,9 @@ int main() { // Get VBIOS info amdsmi_vbios_info_t vbios_info = {}; - ret = amdsmi_get_vbios_info(processor_handles[j], &vbios_info); + ret = amdsmi_get_gpu_vbios_info(processor_handles[j], &vbios_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_vbios_info:\n"); + printf(" Output of amdsmi_get_gpu_vbios_info:\n"); printf("\tVBios Name: %s\n", vbios_info.name); printf("\tBuild Date: %s\n", vbios_info.build_date); printf("\tPart Number: %s\n", vbios_info.part_number); diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 146d3ca94e..cdd3db9c54 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -139,9 +139,9 @@ int main() { // Get VBIOS info amdsmi_vbios_info_t vbios_info = {}; - ret = amdsmi_get_vbios_info(processor_handles[j], &vbios_info); + ret = amdsmi_get_gpu_vbios_info(processor_handles[j], &vbios_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_vbios_info:\n"); + printf(" Output of amdsmi_get_gpu_vbios_info:\n"); printf("\tVBios Name: %s\n", vbios_info.name); printf("\tBuild Date: %s\n", vbios_info.build_date); printf("\tPart Number: %s\n", vbios_info.part_number); diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 2b76e70218..bdf8c89d4e 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3721,7 +3721,7 @@ amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *i * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info); +amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info); /** @} End fwinfo */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 3339b38eef..d293bd3bec 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -405,7 +405,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_vbios_info +## amdsmi_get_gpu_vbios_info Description: Returns the static information for the VBIOS on the device. Input parameters: @@ -421,7 +421,7 @@ Field | Description `part_number` | vbios part number `vbios_version_string` | vbios version string -Exceptions that can be thrown by `amdsmi_get_vbios_info` function: +Exceptions that can be thrown by `amdsmi_get_gpu_vbios_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -434,7 +434,7 @@ try: print("No GPUs on machine") else: for device in devices: - vbios_info = amdsmi_get_vbios_info(device) + vbios_info = amdsmi_get_gpu_vbios_info(device) print(vbios_info['name']) print(vbios_info['vbios_version']) print(vbios_info['build_date']) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 43f3844ff8..499ecf0d22 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -42,7 +42,7 @@ from .amdsmi_interface import amdsmi_get_power_cap_info from .amdsmi_interface import amdsmi_get_caps_info # # Microcode and VBIOS Information -from .amdsmi_interface import amdsmi_get_vbios_info +from .amdsmi_interface import amdsmi_get_gpu_vbios_info from .amdsmi_interface import amdsmi_get_fw_info # # GPU Monitoring diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 33e8f9c795..0eab315797 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -653,7 +653,7 @@ def amdsmi_get_caps_info( } -def amdsmi_get_vbios_info( +def amdsmi_get_gpu_vbios_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -663,7 +663,7 @@ def amdsmi_get_vbios_info( vbios_info = amdsmi_wrapper.amdsmi_vbios_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_vbios_info( + amdsmi_wrapper.amdsmi_get_gpu_vbios_info( processor_handle, ctypes.byref(vbios_info)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9d3831a447..9504053978 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1691,9 +1691,9 @@ amdsmi_get_caps_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_ amdsmi_get_fw_info = _libraries['libamd_smi.so'].amdsmi_get_fw_info amdsmi_get_fw_info.restype = amdsmi_status_t amdsmi_get_fw_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_fw_info_t)] -amdsmi_get_vbios_info = _libraries['libamd_smi.so'].amdsmi_get_vbios_info -amdsmi_get_vbios_info.restype = amdsmi_status_t -amdsmi_get_vbios_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vbios_info_t)] +amdsmi_get_gpu_vbios_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_vbios_info +amdsmi_get_gpu_vbios_info.restype = amdsmi_status_t +amdsmi_get_gpu_vbios_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vbios_info_t)] amdsmi_get_gpu_activity = _libraries['libamd_smi.so'].amdsmi_get_gpu_activity amdsmi_get_gpu_activity.restype = amdsmi_status_t amdsmi_get_gpu_activity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_engine_usage_t)] @@ -1911,7 +1911,7 @@ __all__ = \ 'amdsmi_get_ras_block_features_enabled', 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', 'amdsmi_get_target_frequency_range', - 'amdsmi_get_utilization_count', 'amdsmi_get_vbios_info', + 'amdsmi_get_utilization_count', 'amdsmi_get_gpu_vbios_info', 'amdsmi_get_version', 'amdsmi_get_version_str', 'amdsmi_get_vram_usage', 'amdsmi_get_xgmi_info', 'amdsmi_gpu_block_t', 'amdsmi_gpu_block_t__enumvalues', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 16bbd483b8..30a5dd0a72 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -344,7 +344,7 @@ class Formatter: | """ + self.style.text("55 Init. Api: amdsmi_init ") + """ | | """ + self.style.text("56 Shut down. Api: amdsmi_shut_down ") + """ | | """ + self.style.text("57 Get fw info. Api: amdsmi_get_fw_info ") + """ | - | """ + self.style.text("58 Get vbios info. Api: amdsmi_get_vbios_info ") + """ | + | """ + self.style.text("58 Get vbios info. Api: amdsmi_get_gpu_vbios_info ") + """ | | """ + self.style.text("59 Get counter available counters. Api: amdsmi_counter_get_available_counters ") + """ | | """ + self.style.text("60 Get counter control. Api: amdsmi_control_counter ") + """ | | """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter ") + """ | @@ -893,7 +893,7 @@ commands = { 57: [smi_api.amdsmi_get_fw_info, { "device_identifier1": [None, True] }], - 58: [smi_api.amdsmi_get_vbios_info, { + 58: [smi_api.amdsmi_get_gpu_vbios_info, { "device_identifier1": [None, True] }], 59: [amdsmi_tool_counter_available_counters_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 7785b640ff..b5f4bf2ad3 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -917,7 +917,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_perf_level_get", "amdsmi_dev_get_perf_level"}, {"rsmi_perf_determinism_mode_set", "amdsmi_set_perf_determinism_mode"}, {"rsmi_dev_overdrive_level_set", " amdsmi_dev_set_overdrive_level"}, - {"rsmi_dev_vbios_version_get", "amdsmi_get_vbios_info"}, + {"rsmi_dev_vbios_version_get", "amdsmi_get_gpu_vbios_info"}, {"rsmi_dev_od_volt_info_get", " amdsmi_dev_get_od_volt_info"}, {"rsmi_dev_od_volt_info_set", " amdsmi_dev_set_od_volt_info"}, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, @@ -1422,7 +1422,7 @@ amdsmi_status_t amdsmi_get_version_str(amdsmi_sw_component_t component, } amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info) { +amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc index 3fa5867fc6..b7d3c12dfc 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc @@ -103,7 +103,7 @@ void TestSysInfoRead::Run(void) { PrintDeviceHeader(processor_handles_[i]); amdsmi_vbios_info_t info; - err = amdsmi_get_vbios_info(processor_handles_[i], &info); + err = amdsmi_get_gpu_vbios_info(processor_handles_[i], &info); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_FILE_ERROR) { @@ -112,11 +112,11 @@ void TestSysInfoRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_get_vbios_info(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_vbios_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { // Verify api support checking functionality is working - err = amdsmi_get_vbios_info(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_vbios_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); CHK_ERR_ASRT(err) From 9807a774bbaac255035be93aa9845684d6db68a2 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:47:11 -0500 Subject: [PATCH 28/95] Renamed API amdsmi_get_vram_usage to amdsmi_get_gpu_vram_usage grep -rli 'amdsmi_get_vram_usage' * | xargs -i@ sed -i 's/amdsmi_get_vram_usage/amdsmi_get_gpu_vram_usage/g' @ Change-Id: Ieac19b7783e5ea0bc2654bd8398d64d4a937be42 [ROCm/amdsmi commit: cc1a9d45220781b54df05b60c809843ccaf08241] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/example/amd_smi_nodrm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 469f5f5a1f..41a50bbe89 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -645,9 +645,9 @@ int main() { // Get frame buffer amdsmi_vram_info_t vram_usage = {}; - ret = amdsmi_get_vram_usage(processor_handles[j], &vram_usage); + ret = amdsmi_get_gpu_vram_usage(processor_handles[j], &vram_usage); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_vram_usage:\n"); + printf(" Output of amdsmi_get_gpu_vram_usage:\n"); std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used << "/" << vram_usage.vram_total << "\n\n"; diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index cdd3db9c54..596539a383 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -309,9 +309,9 @@ int main() { // Get frame buffer amdsmi_vram_info_t vram_usage = {}; - ret = amdsmi_get_vram_usage(processor_handles[j], &vram_usage); + ret = amdsmi_get_gpu_vram_usage(processor_handles[j], &vram_usage); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_vram_usage:\n"); + printf(" Output of amdsmi_get_gpu_vram_usage:\n"); std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used << "/" << vram_usage.vram_total << "\n\n"; diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index bdf8c89d4e..e42aeda8ef 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3786,7 +3786,7 @@ amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_ty * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info); +amdsmi_get_gpu_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info); /** @} End gpumon */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index d293bd3bec..d11dfbb0a3 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -547,7 +547,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_vram_usage +## amdsmi_get_gpu_vram_usage Description: Returns total VRAM and VRAM in use Input parameters: @@ -560,7 +560,7 @@ Field | Description `vram_total` | VRAM total `vram_used`| VRAM currently in use -Exceptions that can be thrown by `amdsmi_get_vram_usage` function: +Exceptions that can be thrown by `amdsmi_get_gpu_vram_usage` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -573,7 +573,7 @@ try: print("No GPUs on machine") else: for device in devices: - vram_usage = amdsmi_get_vram_usage(device) + vram_usage = amdsmi_get_gpu_vram_usage(device) print(vram_usage['vram_used']) print(vram_usage['vram_total']) except AmdSmiException as e: diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 499ecf0d22..73ae3b2075 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -47,7 +47,7 @@ from .amdsmi_interface import amdsmi_get_fw_info # # GPU Monitoring from .amdsmi_interface import amdsmi_get_gpu_activity -from .amdsmi_interface import amdsmi_get_vram_usage +from .amdsmi_interface import amdsmi_get_gpu_vram_usage from .amdsmi_interface import amdsmi_get_power_measure from .amdsmi_interface import amdsmi_get_clock_measure diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 0eab315797..393c552a8d 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1005,7 +1005,7 @@ def amdsmi_get_fw_info( } -def amdsmi_get_vram_usage( +def amdsmi_get_gpu_vram_usage( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1015,7 +1015,7 @@ def amdsmi_get_vram_usage( vram_info = amdsmi_wrapper.amdsmi_vram_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_vram_usage( + amdsmi_wrapper.amdsmi_get_gpu_vram_usage( processor_handle, ctypes.byref(vram_info)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9504053978..6727177884 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1703,9 +1703,9 @@ amdsmi_get_power_measure.argtypes = [amdsmi_processor_handle, ctypes.POINTER(str amdsmi_get_clock_measure = _libraries['libamd_smi.so'].amdsmi_get_clock_measure amdsmi_get_clock_measure.restype = amdsmi_status_t amdsmi_get_clock_measure.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_clk_measure_t)] -amdsmi_get_vram_usage = _libraries['libamd_smi.so'].amdsmi_get_vram_usage -amdsmi_get_vram_usage.restype = amdsmi_status_t -amdsmi_get_vram_usage.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vram_info_t)] +amdsmi_get_gpu_vram_usage = _libraries['libamd_smi.so'].amdsmi_get_gpu_vram_usage +amdsmi_get_gpu_vram_usage.restype = amdsmi_status_t +amdsmi_get_gpu_vram_usage.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vram_info_t)] amdsmi_get_target_frequency_range = _libraries['libamd_smi.so'].amdsmi_get_target_frequency_range amdsmi_get_target_frequency_range.restype = amdsmi_status_t amdsmi_get_target_frequency_range.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequency_range_t)] @@ -1913,7 +1913,7 @@ __all__ = \ 'amdsmi_get_target_frequency_range', 'amdsmi_get_utilization_count', 'amdsmi_get_gpu_vbios_info', 'amdsmi_get_version', 'amdsmi_get_version_str', - 'amdsmi_get_vram_usage', 'amdsmi_get_xgmi_info', + 'amdsmi_get_gpu_vram_usage', 'amdsmi_get_xgmi_info', 'amdsmi_gpu_block_t', 'amdsmi_gpu_block_t__enumvalues', 'amdsmi_gpu_caps_t', 'amdsmi_gpu_metrics_t', 'amdsmi_init', 'amdsmi_init_event_notification', 'amdsmi_init_flags_t', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index b5f4bf2ad3..8fe38255af 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -346,7 +346,7 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle processor_ha return amdsmi_status; } -amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *vram_info) { AMDSMI_CHECK_INIT(); From db8f437298b6d5743e5922dc5b84e81dfc16782c Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:57:37 -0500 Subject: [PATCH 29/95] Renamed API amdsmi_dev_get_power_ave to amdsmi_get_power_ave grep -rli 'amdsmi_dev_get_power_ave' * | xargs -i@ sed -i 's/amdsmi_dev_get_power_ave/amdsmi_get_power_ave/g' @ Change-Id: Ie10de251d1e7b884b6233af05b37ff7b56075d4b [ROCm/amdsmi commit: 394a1b4d67184d194e16c266ec1be703ab9d0424] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../amdsmi/tests/amd_smi_test/functional/power_read.cc | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e42aeda8ef..dcd36ae585 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/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/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index d11dfbb0a3..5e9bf52792 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/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/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 73ae3b2075..3c3e2bd2e5 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/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/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 393c552a8d..cebb56292d 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/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/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 6727177884..1474a3d326 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/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/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 30a5dd0a72..e2bf4fab3c 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/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/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 8fe38255af..ae9ad5204c 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/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/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index ecea990b48..53cb2b34b3 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/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/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc index bad4ab6f1f..3246025939 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc +++ b/projects/amdsmi/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); } } From 2c8a473c52185c36a0f5fce62f89c2d55a92b144 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:59:27 -0500 Subject: [PATCH 30/95] Renamed API amdsmi_dev_get_energy_count to amdsmi_get_energy_count grep -rli 'amdsmi_dev_get_energy_count' * | xargs -i@ sed -i 's/amdsmi_dev_get_energy_count/amdsmi_get_energy_count/g' @ Change-Id: Ifba096376069da3b82d0de3e031cc2adb9cc2f7f [ROCm/amdsmi commit: 258a21790b0c92bb3de4206635011e2390c35ac3] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/metrics_counter_read.cc | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) 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 From 66ee0ae0c6156f5ce2e6100a2c0bfa81e1b52904 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:02:08 -0500 Subject: [PATCH 31/95] Renamed API amdsmi_dev_set_power_cap to amdsmi_set_power_cap grep -rli 'amdsmi_dev_set_power_cap' * | xargs -i@ sed -i 's/amdsmi_dev_set_power_cap/amdsmi_set_power_cap/g' @ Change-Id: I226f90f0fce12ea4f832a2ea46c3dc60f6e9fe23 [ROCm/amdsmi commit: 757765a1e33d5338170bc62d3c22d022e20bc323] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/power_cap_read_write.cc | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index b5e69e69a1..5b354ca56b 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1705,7 +1705,7 @@ amdsmi_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *powe * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap); + amdsmi_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap); /** * @brief Set the power performance profile diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index c35d77fe8c..3d8572867e 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1223,7 +1223,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_power_cap +## amdsmi_set_power_cap Description: Set the power cap value Input parameters: @@ -1234,7 +1234,7 @@ device has more than one sensor, it could be greater than 0 Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_power_cap` function: +Exceptions that can be thrown by ` amdsmi_set_power_cap` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1248,7 +1248,7 @@ try: else: for device in devices: power_cap = 250 * 1000000 - amdsmi_dev_set_power_cap(device, 0, power_cap) + amdsmi_set_power_cap(device, 0, power_cap) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index a600c50e80..8139c3af04 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -80,7 +80,7 @@ from .amdsmi_interface import amdsmi_get_func_iter_value # # Unsupported Functions In Virtual Environment from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth -from .amdsmi_interface import amdsmi_dev_set_power_cap +from .amdsmi_interface import amdsmi_set_power_cap from .amdsmi_interface import amdsmi_dev_set_power_profile from .amdsmi_interface import amdsmi_dev_set_clk_range from .amdsmi_interface import amdsmi_dev_set_od_clk_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 7ed7b88e9c..91e2f635ec 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1817,7 +1817,7 @@ def amdsmi_get_gpu_topo_numa_affinity(processor_handle: amdsmi_wrapper.amdsmi_pr return numa_node.value -def amdsmi_dev_set_power_cap( +def amdsmi_set_power_cap( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_ind: int, cap: int ) -> None: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1832,7 +1832,7 @@ def amdsmi_dev_set_power_cap( raise AmdSmiParameterException(cap, int) _check_res( - amdsmi_wrapper. amdsmi_dev_set_power_cap( + amdsmi_wrapper. amdsmi_set_power_cap( processor_handle, ctypes.c_uint32(sensor_ind), ctypes.c_uint64(cap) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index aad9c29fa6..97b5eedad9 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1463,9 +1463,9 @@ amdsmi_get_power_ave.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINT 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] +amdsmi_set_power_cap = _libraries['libamd_smi.so'].amdsmi_set_power_cap +amdsmi_set_power_cap.restype = amdsmi_status_t +amdsmi_set_power_cap.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] amdsmi_dev_set_power_profile = _libraries['libamd_smi.so'].amdsmi_dev_set_power_profile amdsmi_dev_set_power_profile.restype = amdsmi_status_t amdsmi_dev_set_power_profile.argtypes = [amdsmi_processor_handle, uint32_t, amdsmi_power_profile_preset_masks_t] @@ -1880,7 +1880,7 @@ __all__ = \ 'amdsmi_dev_set_overdrive_level', 'amdsmi_dev_set_overdrive_level_v1', 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_dev_set_perf_level', - 'amdsmi_dev_set_perf_level_v1', 'amdsmi_dev_set_power_cap', + 'amdsmi_dev_set_perf_level_v1', 'amdsmi_set_power_cap', 'amdsmi_dev_set_power_profile', 'amdsmi_dev_xgmi_error_status', 'amdsmi_processor_handle', 'amdsmi_engine_usage_t', 'amdsmi_error_count_t', 'amdsmi_event_group_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 2e976eb059..a8b5ad09aa 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -361,7 +361,7 @@ class Formatter: | """ + self.style.text("72 Set dev pci bandwidth. Api: amdsmi_set_gpu_pci_bandwidth ") + """ | | """ + self.style.text("73 Set dev perf level. Api: amdsmi_dev_set_perf_level ") + """ | | """ + self.style.text("74 Set dev perf level v1. Api: amdsmi_dev_set_perf_level_v1 ") + """ | - | """ + self.style.text("75 Set dev power cap. Api: amdsmi_dev_set_power_cap ") + """ | + | """ + self.style.text("75 Set dev power cap. Api: amdsmi_set_power_cap ") + """ | | """ + self.style.text("76 Set dev power profile. Api: amdsmi_dev_set_power_profile ") + """ | | """ + self.style.text("77 Close dev supported func iterator. Api: amdsmi_dev_close_supported_func_iterator ") + """ | | """ + self.style.text("78 Pen dev supported func iterator. Api: amdsmi_dev_open_supported_func_iterator ") + """ | @@ -694,7 +694,7 @@ def amdsmi_tool_dev_perf_level_set_v1(dev): def amdsmi_tool_dev_power_cap_set(dev, dic): sensor_ind = dic["sensor_ind"] cap = dic["cap"] - return smi_api. amdsmi_dev_set_power_cap(dev, sensor_ind, cap) + return smi_api. amdsmi_set_power_cap(dev, sensor_ind, cap) def amdsmi_tool_dev_power_profile_set(dev, dic): result = {} diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index dfae1cb993..1a01dd51cd 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -942,7 +942,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"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"}, - {"rsmi_dev_power_cap_set", " amdsmi_dev_set_power_cap"}, + {"rsmi_dev_power_cap_set", " amdsmi_set_power_cap"}, {"rsmi_dev_fan_rpms_get", "amdsmi_dev_get_fan_rpms"}, {"rsmi_dev_fan_speed_get", "amdsmi_dev_get_fan_speed"}, {"rsmi_dev_fan_speed_max_get", "amdsmi_dev_get_fan_speed_max"}, @@ -1124,7 +1124,7 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, } amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_processor_handle processor_handle, + amdsmi_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap) { return rsmi_wrapper(rsmi_dev_power_cap_set, processor_handle, sensor_ind, cap); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 53cb2b34b3..41affaf052 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -286,7 +286,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_power_ave amdsmi_dev_power_cap_get amdsmi_dev_power_cap_range_get - amdsmi_dev_set_power_cap + amdsmi_set_power_cap amdsmi_dev_get_power_profile_presets amdsmi_dev_set_power_profile amdsmi_dev_get_memory_total diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc index f26a736d6a..e0b05abe42 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc @@ -121,7 +121,7 @@ void TestPowerCapReadWrite::Run(void) { std::cout << "Setting new cap to " << new_cap << "..." << std::endl; } start = clock(); - ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, new_cap); + ret = amdsmi_set_power_cap(processor_handles_[dv_ind], 0, new_cap); end = clock(); cpu_time_used = ((double) (end - start)) * 1000000UL / CLOCKS_PER_SEC; @@ -139,7 +139,7 @@ void TestPowerCapReadWrite::Run(void) { std::cout << "Resetting cap to " << orig << "..." << std::endl; } - ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, orig); + ret = amdsmi_set_power_cap(processor_handles_[dv_ind], 0, orig); CHK_ERR_ASRT(ret) ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); From 8b81aaf6208428f4c507a2caedb8d3e427ba32f8 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:04:42 -0500 Subject: [PATCH 32/95] Renamed API amdsmi_dev_set_power_profile to amdsmi_set_gpu_power_profile grep -rli 'amdsmi_dev_set_power_profile' * | xargs -i@ sed -i 's/amdsmi_dev_set_power_profile/amdsmi_set_gpu_power_profile/g' @ Change-Id: I10d7ee19fd86c11bbb7deafefb37df92e78aa2a3 [ROCm/amdsmi commit: dec22a9b4481293852b08c9cd689f50055ede865] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/power_read_write.cc | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 5b354ca56b..50e2f2ed79 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1725,7 +1725,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, + amdsmi_set_gpu_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile); /** @} End PowerCont*/ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 3d8572867e..a68bb98e09 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1252,7 +1252,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_power_profile +## amdsmi_set_gpu_power_profile Description: Set the power profile Input parameters: @@ -1263,7 +1263,7 @@ the desired new power profile Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_power_profile` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_power_profile` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1277,7 +1277,7 @@ try: else: for device in devices: profile = ... - amdsmi_dev_set_power_profile(device, 0, profile) + amdsmi_set_gpu_power_profile(device, 0, profile) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 8139c3af04..37c4fd3a26 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -81,7 +81,7 @@ from .amdsmi_interface import amdsmi_get_func_iter_value # # Unsupported Functions In Virtual Environment from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_set_power_cap -from .amdsmi_interface import amdsmi_dev_set_power_profile +from .amdsmi_interface import amdsmi_set_gpu_power_profile from .amdsmi_interface import amdsmi_dev_set_clk_range from .amdsmi_interface import amdsmi_dev_set_od_clk_info from .amdsmi_interface import amdsmi_dev_set_od_volt_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 91e2f635ec..63b4cbc669 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1854,7 +1854,7 @@ def amdsmi_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_handl return power.value -def amdsmi_dev_set_power_profile( +def amdsmi_set_gpu_power_profile( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, reserved: int, profile: AmdSmiPowerProfilePresetMasks, @@ -1871,7 +1871,7 @@ def amdsmi_dev_set_power_profile( raise AmdSmiParameterException(profile, AmdSmiPowerProfilePresetMasks) _check_res( - amdsmi_wrapper. amdsmi_dev_set_power_profile( + amdsmi_wrapper. amdsmi_set_gpu_power_profile( processor_handle, ctypes.c_uint32(reserved), profile ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 97b5eedad9..b004560b19 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1466,9 +1466,9 @@ amdsmi_get_energy_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctyp amdsmi_set_power_cap = _libraries['libamd_smi.so'].amdsmi_set_power_cap amdsmi_set_power_cap.restype = amdsmi_status_t amdsmi_set_power_cap.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] -amdsmi_dev_set_power_profile = _libraries['libamd_smi.so'].amdsmi_dev_set_power_profile -amdsmi_dev_set_power_profile.restype = amdsmi_status_t -amdsmi_dev_set_power_profile.argtypes = [amdsmi_processor_handle, uint32_t, amdsmi_power_profile_preset_masks_t] +amdsmi_set_gpu_power_profile = _libraries['libamd_smi.so'].amdsmi_set_gpu_power_profile +amdsmi_set_gpu_power_profile.restype = amdsmi_status_t +amdsmi_set_gpu_power_profile.argtypes = [amdsmi_processor_handle, uint32_t, amdsmi_power_profile_preset_masks_t] amdsmi_dev_get_memory_total = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_total amdsmi_dev_get_memory_total.restype = amdsmi_status_t amdsmi_dev_get_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] @@ -1881,7 +1881,7 @@ __all__ = \ 'amdsmi_dev_set_overdrive_level_v1', 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_dev_set_perf_level', 'amdsmi_dev_set_perf_level_v1', 'amdsmi_set_power_cap', - 'amdsmi_dev_set_power_profile', 'amdsmi_dev_xgmi_error_status', + 'amdsmi_set_gpu_power_profile', 'amdsmi_dev_xgmi_error_status', 'amdsmi_processor_handle', 'amdsmi_engine_usage_t', 'amdsmi_error_count_t', 'amdsmi_event_group_t', 'amdsmi_event_group_t__enumvalues', 'amdsmi_event_handle_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index a8b5ad09aa..6d27efedea 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -362,7 +362,7 @@ class Formatter: | """ + self.style.text("73 Set dev perf level. Api: amdsmi_dev_set_perf_level ") + """ | | """ + self.style.text("74 Set dev perf level v1. Api: amdsmi_dev_set_perf_level_v1 ") + """ | | """ + self.style.text("75 Set dev power cap. Api: amdsmi_set_power_cap ") + """ | - | """ + self.style.text("76 Set dev power profile. Api: amdsmi_dev_set_power_profile ") + """ | + | """ + self.style.text("76 Set dev power profile. Api: amdsmi_set_gpu_power_profile ") + """ | | """ + self.style.text("77 Close dev supported func iterator. Api: amdsmi_dev_close_supported_func_iterator ") + """ | | """ + self.style.text("78 Pen dev supported func iterator. Api: amdsmi_dev_open_supported_func_iterator ") + """ | | """ + self.style.text("79 Get func iter next. Api: amdsmi_next_func_iter ") + """ | @@ -701,7 +701,7 @@ def amdsmi_tool_dev_power_profile_set(dev, dic): reserved = dic["reserved"] for power_profile_preset_maks in smi_api.AmdSmiPowerProfilePresetMasks: try: - value = smi_api. amdsmi_dev_set_power_profile(dev, reserved, power_profile_preset_maks) + value = smi_api. amdsmi_set_gpu_power_profile(dev, reserved, power_profile_preset_maks) result.update({power_profile_preset_maks.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(power_profile_preset_maks.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 1a01dd51cd..970e7d8766 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -906,7 +906,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_pci_throughput_get", "amdsmi_get_gpu_pci_throughput"}, {"rsmi_dev_pci_replay_counter_get", " amdsmi_get_gpu_pci_replay_counter"}, {"rsmi_dev_pci_bandwidth_set", " amdsmi_set_gpu_pci_bandwidth"}, - {"rsmi_dev_power_profile_set", " amdsmi_dev_set_power_profile"}, + {"rsmi_dev_power_profile_set", " amdsmi_set_gpu_power_profile"}, {"rsmi_dev_memory_busy_percent_get", "amdsmi_dev_get_memory_busy_percent"}, {"rsmi_dev_busy_percent_get", "amdsmi_dev_get_busy_percent"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_dev_get_memory_reserved_pages"}, @@ -1160,7 +1160,7 @@ amdsmi_status_t amdsmi_set_perf_determinism_mode( } amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_processor_handle processor_handle, + amdsmi_set_gpu_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile) { return rsmi_wrapper(rsmi_dev_power_profile_set, processor_handle, reserved, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 41affaf052..6ae35f3746 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -288,7 +288,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_power_cap_range_get amdsmi_set_power_cap amdsmi_dev_get_power_profile_presets - amdsmi_dev_set_power_profile + amdsmi_set_gpu_power_profile amdsmi_dev_get_memory_total amdsmi_dev_get_memory_usage amdsmi_dev_get_memory_busy_percent diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc index c6325dedd1..0cba5c0b83 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc @@ -172,7 +172,7 @@ void TestPowerReadWrite::Run(void) { return; } - ret = amdsmi_dev_set_power_profile(processor_handles_[dv_ind], 0, new_prof); + ret = amdsmi_set_gpu_power_profile(processor_handles_[dv_ind], 0, new_prof); CHK_ERR_ASRT(ret) amdsmi_dev_perf_level_t pfl; From 4a662552fb392238fadef8c26afee21169a6a3fd Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:06:58 -0500 Subject: [PATCH 33/95] Renamed API amdsmi_dev_get_memory_total to amdsmi_get_gpu_memory_total grep -rli 'amdsmi_dev_get_memory_total' * | xargs -i@ sed -i 's/amdsmi_dev_get_memory_total/amdsmi_get_gpu_memory_total/g' @ Change-Id: I06dc20f4bf783c0ee824a6d4b4f7162166c598cb [ROCm/amdsmi commit: cdad242947ca36f870da3e8e68f1612bd440cbb2] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/mem_util_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 50e2f2ed79..894c4e1baf 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1758,7 +1758,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, +amdsmi_get_gpu_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index a68bb98e09..e1c06890e7 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1558,7 +1558,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_get_memory_total +## amdsmi_get_gpu_memory_total Description: Get the total amount of memory that exists @@ -1569,7 +1569,7 @@ Input parameters: Output: total amount of memory -Exceptions that can be thrown by `amdsmi_dev_get_memory_total` function: +Exceptions that can be thrown by `amdsmi_get_gpu_memory_total` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1582,7 +1582,7 @@ try: print("No GPUs on machine") else: for device in devices: - memory = amdsmi_dev_get_memory_total(device) + memory = amdsmi_get_gpu_memory_total(device) print(memory) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 37c4fd3a26..f16524d9bb 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -148,7 +148,7 @@ from .amdsmi_interface import amdsmi_get_power_ave from .amdsmi_interface import amdsmi_get_energy_count # # Memory information -from .amdsmi_interface import amdsmi_dev_get_memory_total +from .amdsmi_interface import amdsmi_get_gpu_memory_total from .amdsmi_interface import amdsmi_dev_get_memory_usage from .amdsmi_interface import amdsmi_dev_get_memory_busy_percent from .amdsmi_interface import amdsmi_dev_get_memory_reserved_pages diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 63b4cbc669..ef4a449ea0 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1929,7 +1929,7 @@ def amdsmi_dev_set_clk_range( ) -def amdsmi_dev_get_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): +def amdsmi_get_gpu_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( processor_handle, amdsmi_wrapper.amdsmi_processor_handle @@ -1943,7 +1943,7 @@ def amdsmi_dev_get_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processo total = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_memory_total( + amdsmi_wrapper.amdsmi_get_gpu_memory_total( processor_handle, mem_type, ctypes.byref(total)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index b004560b19..f0c245e641 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1469,9 +1469,9 @@ amdsmi_set_power_cap.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] amdsmi_set_gpu_power_profile = _libraries['libamd_smi.so'].amdsmi_set_gpu_power_profile amdsmi_set_gpu_power_profile.restype = amdsmi_status_t amdsmi_set_gpu_power_profile.argtypes = [amdsmi_processor_handle, uint32_t, amdsmi_power_profile_preset_masks_t] -amdsmi_dev_get_memory_total = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_total -amdsmi_dev_get_memory_total.restype = amdsmi_status_t -amdsmi_dev_get_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_memory_total = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_total +amdsmi_get_gpu_memory_total.restype = amdsmi_status_t +amdsmi_get_gpu_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_memory_usage = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_usage amdsmi_dev_get_memory_usage.restype = amdsmi_status_t amdsmi_dev_get_memory_usage.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] @@ -1859,7 +1859,7 @@ __all__ = \ 'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info', 'amdsmi_get_gpu_id', 'amdsmi_dev_get_memory_busy_percent', 'amdsmi_dev_get_memory_reserved_pages', - 'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage', + 'amdsmi_get_gpu_memory_total', 'amdsmi_dev_get_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 6d27efedea..93e6eb1cff 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -300,7 +300,7 @@ class Formatter: | """ + 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_get_energy_count ") + """ | - | """ + self.style.text("14 Get device memory total. Api: amdsmi_dev_get_memory_total ") + """ | + | """ + self.style.text("14 Get device memory total. Api: amdsmi_get_gpu_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 ") + """ | | """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_dev_get_memory_reserved_pages ") + """ | @@ -383,7 +383,7 @@ def amdsmi_tool_dev_memory_total_get(dev): result = {} for memory_type in smi_api.AmdSmiMemoryType: try: - value = smi_api.amdsmi_dev_get_memory_total(dev, memory_type) + value = smi_api.amdsmi_get_gpu_memory_total(dev, memory_type) result.update({memory_type.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(memory_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 970e7d8766..c305078208 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -931,7 +931,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"}, {"rsmi_dev_gpu_metrics_info_get", " amdsmi_dev_get_gpu_metrics_info"}, {"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"}, - {"rsmi_dev_memory_total_get", "amdsmi_dev_get_memory_total"}, + {"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"}, {"rsmi_dev_memory_usage_get", "amdsmi_dev_get_memory_usage"}, {"rsmi_dev_gpu_clk_freq_get", " amdsmi_dev_get_gpu_clk_freq"}, {"rsmi_dev_gpu_clk_freq_set", " amdsmi_dev_set_clk_freq"}, @@ -1269,7 +1269,7 @@ amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle, num_pages, reinterpret_cast(records)); } -amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total) { return rsmi_wrapper(rsmi_dev_memory_total_get, processor_handle, static_cast(mem_type), total); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc index 3f12b77c94..07b83a20ab 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc @@ -131,9 +131,9 @@ void TestMemUtilRead::Run(void) { #endif for (uint32_t mem_type = AMDSMI_MEM_TYPE_FIRST; mem_type <= AMDSMI_MEM_TYPE_LAST; ++mem_type) { - err = amdsmi_dev_get_memory_total(processor_handles_[i], + err = amdsmi_get_gpu_memory_total(processor_handles_[i], static_cast(mem_type), &total); - err_chk("amdsmi_dev_get_memory_total()"); + err_chk("amdsmi_get_gpu_memory_total()"); if (err != AMDSMI_STATUS_SUCCESS) { return; } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 6ae35f3746..3c27b88a3c 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -289,7 +289,7 @@ void TestMutualExclusion::Run(void) { amdsmi_set_power_cap amdsmi_dev_get_power_profile_presets amdsmi_set_gpu_power_profile - amdsmi_dev_get_memory_total + amdsmi_get_gpu_memory_total amdsmi_dev_get_memory_usage amdsmi_dev_get_memory_busy_percent amdsmi_dev_get_busy_percent From cd92afe97ee94cdd3fad42d028aaf331ab6bef22 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:08:29 -0500 Subject: [PATCH 34/95] Renamed API amdsmi_dev_get_memory_usage to amdsmi_get_gpu_memory_usage grep -rli 'amdsmi_dev_get_memory_usage' * | xargs -i@ sed -i 's/amdsmi_dev_get_memory_usage/amdsmi_get_gpu_memory_usage/g' @ Change-Id: I04f44c7d7c06490d25f136c77ba545c3010a2e18 [ROCm/amdsmi commit: 84613dcf1d2042036f8745dbdcbbba04bfd4fcef] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/mem_util_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 894c4e1baf..d1459792bf 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1782,7 +1782,7 @@ amdsmi_get_gpu_memory_total(amdsmi_processor_handle processor_handle, amdsmi_mem * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, +amdsmi_get_gpu_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index e1c06890e7..cf897ca39c 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1627,7 +1627,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_get_memory_usage +## amdsmi_get_gpu_memory_usage Description: Get the current memory usage @@ -1638,7 +1638,7 @@ Input parameters: Output: the amount of memory currently being used -Exceptions that can be thrown by `amdsmi_dev_get_memory_usage` function: +Exceptions that can be thrown by `amdsmi_get_gpu_memory_usage` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1651,7 +1651,7 @@ try: print("No GPUs on machine") else: for device in devices: - memory = amdsmi_dev_get_memory_usage(device) + memory = amdsmi_get_gpu_memory_usage(device) print(memory) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index f16524d9bb..f9771902cf 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -149,7 +149,7 @@ from .amdsmi_interface import amdsmi_get_energy_count # # Memory information from .amdsmi_interface import amdsmi_get_gpu_memory_total -from .amdsmi_interface import amdsmi_dev_get_memory_usage +from .amdsmi_interface import amdsmi_get_gpu_memory_usage from .amdsmi_interface import amdsmi_dev_get_memory_busy_percent from .amdsmi_interface import amdsmi_dev_get_memory_reserved_pages diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ef4a449ea0..ff5b799e24 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1977,7 +1977,7 @@ def amdsmi_dev_set_od_clk_info( ) -def amdsmi_dev_get_memory_usage(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): +def amdsmi_get_gpu_memory_usage(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( processor_handle, amdsmi_wrapper.amdsmi_processor_handle @@ -1991,7 +1991,7 @@ def amdsmi_dev_get_memory_usage(processor_handle: amdsmi_wrapper.amdsmi_processo used = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_memory_usage( + amdsmi_wrapper.amdsmi_get_gpu_memory_usage( processor_handle, mem_type, ctypes.byref(used)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index f0c245e641..290e036a13 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1472,9 +1472,9 @@ amdsmi_set_gpu_power_profile.argtypes = [amdsmi_processor_handle, uint32_t, amds amdsmi_get_gpu_memory_total = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_total amdsmi_get_gpu_memory_total.restype = amdsmi_status_t amdsmi_get_gpu_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_dev_get_memory_usage = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_usage -amdsmi_dev_get_memory_usage.restype = amdsmi_status_t -amdsmi_dev_get_memory_usage.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_memory_usage = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_usage +amdsmi_get_gpu_memory_usage.restype = amdsmi_status_t +amdsmi_get_gpu_memory_usage.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_get_bad_page_info = _libraries['libamd_smi.so'].amdsmi_get_bad_page_info amdsmi_get_bad_page_info.restype = amdsmi_status_t amdsmi_get_bad_page_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] @@ -1859,7 +1859,7 @@ __all__ = \ 'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info', 'amdsmi_get_gpu_id', 'amdsmi_dev_get_memory_busy_percent', 'amdsmi_dev_get_memory_reserved_pages', - 'amdsmi_get_gpu_memory_total', 'amdsmi_dev_get_memory_usage', + 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 93e6eb1cff..dbf44aa392 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -301,7 +301,7 @@ class Formatter: | """ + self.style.text("12 Get device power ave. Api: amdsmi_get_power_ave ") + """ | | """ + self.style.text("13 Get device energy count. Api: amdsmi_get_energy_count ") + """ | | """ + self.style.text("14 Get device memory total. Api: amdsmi_get_gpu_memory_total ") + """ | - | """ + self.style.text("15 Get device memory usage. Api: amdsmi_dev_get_memory_usage ") + """ | + | """ + self.style.text("15 Get device memory usage. Api: amdsmi_get_gpu_memory_usage ") + """ | | """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_dev_get_memory_busy_percent ") + """ | | """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_dev_get_memory_reserved_pages ") + """ | | """ + self.style.text("18 Get device fan rpms. Api: amdsmi_dev_get_fan_rpms ") + """ | @@ -394,7 +394,7 @@ def amdsmi_tool_dev_memory_usage_get(dev): result = {} for memory_type in smi_api.AmdSmiMemoryType: try: - value = smi_api.amdsmi_dev_get_memory_usage(dev, memory_type) + value = smi_api.amdsmi_get_gpu_memory_usage(dev, memory_type) result.update({memory_type.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(memory_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index c305078208..ea0c932974 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -932,7 +932,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_gpu_metrics_info_get", " amdsmi_dev_get_gpu_metrics_info"}, {"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"}, {"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"}, - {"rsmi_dev_memory_usage_get", "amdsmi_dev_get_memory_usage"}, + {"rsmi_dev_memory_usage_get", "amdsmi_get_gpu_memory_usage"}, {"rsmi_dev_gpu_clk_freq_get", " amdsmi_dev_get_gpu_clk_freq"}, {"rsmi_dev_gpu_clk_freq_set", " amdsmi_dev_set_clk_freq"}, {"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"}, @@ -1274,7 +1274,7 @@ amdsmi_status_t amdsmi_get_gpu_memory_total(amdsmi_processor_handle processor_ha return rsmi_wrapper(rsmi_dev_memory_total_get, processor_handle, static_cast(mem_type), total); } -amdsmi_status_t amdsmi_dev_get_memory_usage(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used) { return rsmi_wrapper(rsmi_dev_memory_usage_get, processor_handle, static_cast(mem_type), used); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc index 07b83a20ab..9e7e242b22 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc @@ -138,9 +138,9 @@ void TestMemUtilRead::Run(void) { return; } - err = amdsmi_dev_get_memory_usage(processor_handles_[i], + err = amdsmi_get_gpu_memory_usage(processor_handles_[i], static_cast(mem_type), &usage); - err_chk("amdsmi_dev_get_memory_usage()"); + err_chk("amdsmi_get_gpu_memory_usage()"); if (err != AMDSMI_STATUS_SUCCESS) { return; } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 3c27b88a3c..4de73fd8a4 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -290,7 +290,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_get_power_profile_presets amdsmi_set_gpu_power_profile amdsmi_get_gpu_memory_total - amdsmi_dev_get_memory_usage + amdsmi_get_gpu_memory_usage amdsmi_dev_get_memory_busy_percent amdsmi_dev_get_busy_percent amdsmi_dev_vbios_version_get From 2dbe69b5678d244591faa0f00cbdac676d990f47 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:10:14 -0500 Subject: [PATCH 35/95] Renamed API amdsmi_dev_get_memory_busy_percent to amdsmi_get_gpu_memory_busy_percent grep -rli 'amdsmi_dev_get_memory_busy_percent' * | xargs -i@ sed -i 's/amdsmi_dev_get_memory_busy_percent/amdsmi_get_gpu_memory_busy_percent/g' @ Change-Id: I379d8a31074635cd086c1bb0d0e231d3b352725c [ROCm/amdsmi commit: ed45afc51241df996cadc6f071ce16eacad1efef] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/mem_util_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index d1459792bf..95d01d032a 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1845,7 +1845,7 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); +amdsmi_get_gpu_memory_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); /** * @brief Get information about reserved ("retired") memory pages diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index cf897ca39c..24b05246fb 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1688,7 +1688,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_get_memory_busy_percent +## amdsmi_get_gpu_memory_busy_percent Description: Get percentage of time any device memory is being used @@ -1698,7 +1698,7 @@ Input parameters: Output: percentage of time that any device memory is being used for the specified device. -Exceptions that can be thrown by `amdsmi_dev_get_memory_busy_percent` function: +Exceptions that can be thrown by `amdsmi_get_gpu_memory_busy_percent` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1711,7 +1711,7 @@ try: print("No GPUs on machine") else: for device in devices: - busy_percent = amdsmi_dev_get_memory_busy_percent(device) + busy_percent = amdsmi_get_gpu_memory_busy_percent(device) print(busy_percent) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index f9771902cf..e4f3c162f4 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -150,7 +150,7 @@ from .amdsmi_interface import amdsmi_get_energy_count # # Memory information from .amdsmi_interface import amdsmi_get_gpu_memory_total from .amdsmi_interface import amdsmi_get_gpu_memory_usage -from .amdsmi_interface import amdsmi_dev_get_memory_busy_percent +from .amdsmi_interface import amdsmi_get_gpu_memory_busy_percent from .amdsmi_interface import amdsmi_dev_get_memory_reserved_pages # # Events diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ff5b799e24..4d0d3352b2 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2028,7 +2028,7 @@ def amdsmi_dev_set_od_volt_info( ) -def amdsmi_dev_get_memory_busy_percent(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_memory_busy_percent(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 @@ -2037,7 +2037,7 @@ def amdsmi_dev_get_memory_busy_percent(processor_handle: amdsmi_wrapper.amdsmi_p busy_percent = ctypes.c_uint32() _check_res( - amdsmi_wrapper.amdsmi_dev_get_memory_busy_percent( + amdsmi_wrapper.amdsmi_get_gpu_memory_busy_percent( processor_handle, ctypes.byref(busy_percent)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 290e036a13..14c02e3c79 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1481,9 +1481,9 @@ amdsmi_get_bad_page_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(cty amdsmi_get_ras_block_features_enabled = _libraries['libamd_smi.so'].amdsmi_get_ras_block_features_enabled amdsmi_get_ras_block_features_enabled.restype = amdsmi_status_t amdsmi_get_ras_block_features_enabled.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] -amdsmi_dev_get_memory_busy_percent = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_busy_percent -amdsmi_dev_get_memory_busy_percent.restype = amdsmi_status_t -amdsmi_dev_get_memory_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_memory_busy_percent = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_busy_percent +amdsmi_get_gpu_memory_busy_percent.restype = amdsmi_status_t +amdsmi_get_gpu_memory_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_get_memory_reserved_pages = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_reserved_pages amdsmi_dev_get_memory_reserved_pages.restype = amdsmi_status_t amdsmi_dev_get_memory_reserved_pages.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] @@ -1857,7 +1857,7 @@ __all__ = \ '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', + 'amdsmi_get_gpu_id', 'amdsmi_get_gpu_memory_busy_percent', 'amdsmi_dev_get_memory_reserved_pages', 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index dbf44aa392..9bbe72ea47 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -302,7 +302,7 @@ class Formatter: | """ + self.style.text("13 Get device energy count. Api: amdsmi_get_energy_count ") + """ | | """ + self.style.text("14 Get device memory total. Api: amdsmi_get_gpu_memory_total ") + """ | | """ + self.style.text("15 Get device memory usage. Api: amdsmi_get_gpu_memory_usage ") + """ | - | """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_dev_get_memory_busy_percent ") + """ | + | """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_get_gpu_memory_busy_percent ") + """ | | """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_dev_get_memory_reserved_pages ") + """ | | """ + self.style.text("18 Get device fan rpms. Api: amdsmi_dev_get_fan_rpms ") + """ | | """ + self.style.text("19 Get device fan speed. Api: amdsmi_dev_get_fan_speed ") + """ | @@ -768,7 +768,7 @@ commands = { 15: [amdsmi_tool_dev_memory_usage_get, { "device_identifier1": [None, True] }], - 16: [smi_api.amdsmi_dev_get_memory_busy_percent, { + 16: [smi_api.amdsmi_get_gpu_memory_busy_percent, { "device_identifier1": [None, True] }], 17: [smi_api.amdsmi_dev_get_memory_reserved_pages, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index ea0c932974..af4f37d410 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -907,7 +907,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_pci_replay_counter_get", " amdsmi_get_gpu_pci_replay_counter"}, {"rsmi_dev_pci_bandwidth_set", " amdsmi_set_gpu_pci_bandwidth"}, {"rsmi_dev_power_profile_set", " amdsmi_set_gpu_power_profile"}, - {"rsmi_dev_memory_busy_percent_get", "amdsmi_dev_get_memory_busy_percent"}, + {"rsmi_dev_memory_busy_percent_get", "amdsmi_get_gpu_memory_busy_percent"}, {"rsmi_dev_busy_percent_get", "amdsmi_dev_get_busy_percent"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_dev_get_memory_reserved_pages"}, {"rsmi_dev_overdrive_level_get", "amdsmi_dev_get_overdrive_level"}, @@ -1366,7 +1366,7 @@ amdsmi_status_t amdsmi_get_utilization_count(amdsmi_processor_handle processor_h reinterpret_cast(utilization_counters), count, timestamp); } -amdsmi_status_t amdsmi_dev_get_memory_busy_percent( +amdsmi_status_t amdsmi_get_gpu_memory_busy_percent( amdsmi_processor_handle processor_handle, uint32_t *busy_percent) { return rsmi_wrapper(rsmi_dev_memory_busy_percent_get, processor_handle, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc index 9e7e242b22..1a5701f1d8 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mem_util_read.cc @@ -119,8 +119,8 @@ void TestMemUtilRead::Run(void) { PrintDeviceHeader(processor_handles_[i]); #if 0 - err = amdsmi_dev_get_memory_busy_percent(i, &mem_busy_percent); - err_chk("amdsmi_dev_get_memory_busy_percent()"); + err = amdsmi_get_gpu_memory_busy_percent(i, &mem_busy_percent); + err_chk("amdsmi_get_gpu_memory_busy_percent()"); if (err != AMDSMI_STATUS_SUCCESS) { return; } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 4de73fd8a4..fbdd7a36b8 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -291,7 +291,7 @@ void TestMutualExclusion::Run(void) { amdsmi_set_gpu_power_profile amdsmi_get_gpu_memory_total amdsmi_get_gpu_memory_usage - amdsmi_dev_get_memory_busy_percent + amdsmi_get_gpu_memory_busy_percent amdsmi_dev_get_busy_percent amdsmi_dev_vbios_version_get amdsmi_dev_serial_number_get From 346827849848d11db12671dac2f6323e314fe5c1 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:11:53 -0500 Subject: [PATCH 36/95] Renamed API amdsmi_dev_get_memory_reserved_pages to amdsmi_get_gpu_memory_reserved_pages grep -rli 'amdsmi_dev_get_memory_reserved_pages' * | xargs -i@ sed -i 's/amdsmi_dev_get_memory_reserved_pages/amdsmi_get_gpu_memory_reserved_pages/g' @ Change-Id: I1b17fe4540f39c820b9e3e8102440cc91a27ee16 [ROCm/amdsmi commit: a248959ad9093bdd0eeafd7ffacb1bc2640ae1e5] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 6 +++--- .../tests/amd_smi_test/functional/mem_page_info_read.cc | 8 ++++---- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 95d01d032a..8da0f7d383 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1878,7 +1878,7 @@ amdsmi_get_gpu_memory_busy_percent(amdsmi_processor_handle processor_handle, uin * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, +amdsmi_get_gpu_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records); /** @} End MemQuer */ diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index e4f3c162f4..1d6f5f0e4c 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -151,7 +151,7 @@ from .amdsmi_interface import amdsmi_get_energy_count from .amdsmi_interface import amdsmi_get_gpu_memory_total from .amdsmi_interface import amdsmi_get_gpu_memory_usage from .amdsmi_interface import amdsmi_get_gpu_memory_busy_percent -from .amdsmi_interface import amdsmi_dev_get_memory_reserved_pages +from .amdsmi_interface import amdsmi_get_gpu_memory_reserved_pages # # Events from .amdsmi_interface import AmdSmiEventReader diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 4d0d3352b2..6563eb14e4 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2631,7 +2631,7 @@ def amdsmi_dev_reset_xgmi_error( _check_res(amdsmi_wrapper.amdsmi_dev_reset_xgmi_error(processor_handle)) -def amdsmi_dev_get_memory_reserved_pages( +def amdsmi_get_gpu_memory_reserved_pages( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2643,7 +2643,7 @@ def amdsmi_dev_get_memory_reserved_pages( retired_page_record = ctypes.POINTER( amdsmi_wrapper.amdsmi_retired_page_record_t)() _check_res( - amdsmi_wrapper.amdsmi_dev_get_memory_reserved_pages( + amdsmi_wrapper.amdsmi_get_gpu_memory_reserved_pages( processor_handle, ctypes.byref(num_pages), retired_page_record ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 14c02e3c79..abf73dc4c8 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1484,9 +1484,9 @@ amdsmi_get_ras_block_features_enabled.argtypes = [amdsmi_processor_handle, amdsm amdsmi_get_gpu_memory_busy_percent = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_busy_percent amdsmi_get_gpu_memory_busy_percent.restype = amdsmi_status_t amdsmi_get_gpu_memory_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] -amdsmi_dev_get_memory_reserved_pages = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_reserved_pages -amdsmi_dev_get_memory_reserved_pages.restype = amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] +amdsmi_get_gpu_memory_reserved_pages = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_reserved_pages +amdsmi_get_gpu_memory_reserved_pages.restype = amdsmi_status_t +amdsmi_get_gpu_memory_reserved_pages.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] amdsmi_dev_get_fan_rpms = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_rpms amdsmi_dev_get_fan_rpms.restype = amdsmi_status_t amdsmi_dev_get_fan_rpms.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] @@ -1858,7 +1858,7 @@ __all__ = \ '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_get_gpu_memory_busy_percent', - 'amdsmi_dev_get_memory_reserved_pages', + 'amdsmi_get_gpu_memory_reserved_pages', 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 9bbe72ea47..3d0a1867e2 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -303,7 +303,7 @@ class Formatter: | """ + self.style.text("14 Get device memory total. Api: amdsmi_get_gpu_memory_total ") + """ | | """ + self.style.text("15 Get device memory usage. Api: amdsmi_get_gpu_memory_usage ") + """ | | """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_get_gpu_memory_busy_percent ") + """ | - | """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_dev_get_memory_reserved_pages ") + """ | + | """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_get_gpu_memory_reserved_pages ") + """ | | """ + self.style.text("18 Get device fan rpms. Api: amdsmi_dev_get_fan_rpms ") + """ | | """ + self.style.text("19 Get device fan speed. Api: amdsmi_dev_get_fan_speed ") + """ | | """ + self.style.text("20 Get device fan speed max. Api: amdsmi_dev_get_fan_speed_max ") + """ | @@ -771,7 +771,7 @@ commands = { 16: [smi_api.amdsmi_get_gpu_memory_busy_percent, { "device_identifier1": [None, True] }], - 17: [smi_api.amdsmi_dev_get_memory_reserved_pages, { + 17: [smi_api.amdsmi_get_gpu_memory_reserved_pages, { "device_identifier1": [None, True] }], 18: [amdsmi_tool_dev_fan_rpms_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index af4f37d410..a5b92e12a0 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -909,7 +909,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_power_profile_set", " amdsmi_set_gpu_power_profile"}, {"rsmi_dev_memory_busy_percent_get", "amdsmi_get_gpu_memory_busy_percent"}, {"rsmi_dev_busy_percent_get", "amdsmi_dev_get_busy_percent"}, - {"rsmi_dev_memory_reserved_pages_get", "amdsmi_dev_get_memory_reserved_pages"}, + {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_dev_overdrive_level_get", "amdsmi_dev_get_overdrive_level"}, {"rsmi_dev_power_profile_presets_get", " amdsmi_dev_get_power_profile_presets"}, {"rsmi_dev_perf_level_set", " amdsmi_dev_set_perf_level"}, @@ -927,7 +927,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_counter_create", "amdsmi_dev_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, - {"rsmi_dev_memory_reserved_pages_get", "amdsmi_dev_get_memory_reserved_pages"}, + {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"}, {"rsmi_dev_gpu_metrics_info_get", " amdsmi_dev_get_gpu_metrics_info"}, {"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"}, @@ -1262,7 +1262,7 @@ amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle processor_handl static_cast(clk_type), freq_bitmask); } amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle, +amdsmi_get_gpu_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records) { return rsmi_wrapper(rsmi_dev_memory_reserved_pages_get, processor_handle, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc index 7a9f5d9626..d706f83722 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mem_page_info_read.cc @@ -96,7 +96,7 @@ void TestMemPageInfoRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, nullptr); + err = amdsmi_get_gpu_memory_reserved_pages(processor_handles_[i], &num_pages, nullptr); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << @@ -104,7 +104,7 @@ void TestMemPageInfoRead::Run(void) { << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); + err = amdsmi_get_gpu_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); continue; @@ -115,7 +115,7 @@ void TestMemPageInfoRead::Run(void) { std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); + err = amdsmi_get_gpu_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -124,7 +124,7 @@ void TestMemPageInfoRead::Run(void) { assert(records != nullptr); - err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, records); + err = amdsmi_get_gpu_memory_reserved_pages(processor_handles_[i], &num_pages, records); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Getting Memory Page Retirement Status not " "supported for this device" << std::endl; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index fbdd7a36b8..72291de3c2 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -300,7 +300,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_create_counter amdsmi_counter_get_available_counters amdsmi_dev_counter_group_supported - amdsmi_dev_get_memory_reserved_pages + amdsmi_get_gpu_memory_reserved_pages amdsmi_dev_xgmi_error_status amdsmi_dev_reset_xgmi_error amdsmi_dev_xgmi_hive_id_get From c5f250fc2d2645650da1f140eccc6512a6c7af03 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:13:46 -0500 Subject: [PATCH 37/95] Renamed API amdsmi_dev_get_fan_rpms to amdsmi_get_gpu_fan_rpms grep -rli 'amdsmi_dev_get_fan_rpms' * | xargs -i@ sed -i 's/amdsmi_dev_get_fan_rpms/amdsmi_get_gpu_fan_rpms/g' @ Change-Id: Iaedac65cba608c3661dbf80399b236c7aa33dac1 [ROCm/amdsmi commit: 825b12a43744eb638cf51999dc366598eac05aba] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 8da0f7d383..68bdde7b86 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1911,7 +1911,7 @@ amdsmi_get_gpu_memory_reserved_pages(amdsmi_processor_handle processor_handle, u * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, +amdsmi_status_t amdsmi_get_gpu_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 24b05246fb..11797fa9c7 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1746,7 +1746,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_fan_rpms +## amdsmi_get_gpu_fan_rpms Description: Get the fan speed in RPMs of the device with the specified device handle and 0-based sensor index. @@ -1757,7 +1757,7 @@ more than one sensor, it could be greater than 0. Output: Fan speed in rpms as integer -Exceptions that can be thrown by `amdsmi_dev_get_fan_rpms` function: +Exceptions that can be thrown by `amdsmi_get_gpu_fan_rpms` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1770,7 +1770,7 @@ try: print("No GPUs on machine") else: for device in devices: - fan_rpm = amdsmi_dev_get_fan_rpms(device, 0) + fan_rpm = amdsmi_get_gpu_fan_rpms(device, 0) print(fan_rpm) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 1d6f5f0e4c..88b9655733 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -97,7 +97,7 @@ from .amdsmi_interface import amdsmi_dev_set_overdrive_level_v1 from .amdsmi_interface import amdsmi_dev_set_overdrive_level # # Physical State Queries -from .amdsmi_interface import amdsmi_dev_get_fan_rpms +from .amdsmi_interface import amdsmi_get_gpu_fan_rpms from .amdsmi_interface import amdsmi_dev_get_fan_speed from .amdsmi_interface import amdsmi_dev_get_fan_speed_max from .amdsmi_interface import amdsmi_dev_get_temp_metric diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 6563eb14e4..92a9c2ec0a 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2060,7 +2060,7 @@ def amdsmi_dev_set_perf_level_v1( processor_handle, perf_lvl)) -def amdsmi_dev_get_fan_rpms( +def amdsmi_get_gpu_fan_rpms( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2071,7 +2071,7 @@ def amdsmi_dev_get_fan_rpms( raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_int64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_fan_rpms( + amdsmi_wrapper.amdsmi_get_gpu_fan_rpms( processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index abf73dc4c8..9443b13adf 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1487,9 +1487,9 @@ amdsmi_get_gpu_memory_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.P amdsmi_get_gpu_memory_reserved_pages = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_reserved_pages amdsmi_get_gpu_memory_reserved_pages.restype = amdsmi_status_t amdsmi_get_gpu_memory_reserved_pages.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] -amdsmi_dev_get_fan_rpms = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_rpms -amdsmi_dev_get_fan_rpms.restype = amdsmi_status_t -amdsmi_dev_get_fan_rpms.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_get_gpu_fan_rpms = _libraries['libamd_smi.so'].amdsmi_get_gpu_fan_rpms +amdsmi_get_gpu_fan_rpms.restype = amdsmi_status_t +amdsmi_get_gpu_fan_rpms.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] amdsmi_dev_get_fan_speed = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_speed amdsmi_dev_get_fan_speed.restype = amdsmi_status_t amdsmi_dev_get_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] @@ -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_get_energy_count', 'amdsmi_dev_get_fan_rpms', + 'amdsmi_get_energy_count', 'amdsmi_get_gpu_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_get_gpu_memory_busy_percent', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 3d0a1867e2..40580a126d 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -304,7 +304,7 @@ class Formatter: | """ + self.style.text("15 Get device memory usage. Api: amdsmi_get_gpu_memory_usage ") + """ | | """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_get_gpu_memory_busy_percent ") + """ | | """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_get_gpu_memory_reserved_pages ") + """ | - | """ + self.style.text("18 Get device fan rpms. Api: amdsmi_dev_get_fan_rpms ") + """ | + | """ + self.style.text("18 Get device fan rpms. Api: amdsmi_get_gpu_fan_rpms ") + """ | | """ + self.style.text("19 Get device fan speed. Api: amdsmi_dev_get_fan_speed ") + """ | | """ + self.style.text("20 Get device fan speed max. Api: amdsmi_dev_get_fan_speed_max ") + """ | | """ + self.style.text("21 Get device temp metric. Api: amdsmi_dev_get_temp_metric ") + """ | @@ -403,7 +403,7 @@ def amdsmi_tool_dev_memory_usage_get(dev): def amdsmi_tool_dev_fan_rpms_get(dev, dic): sensor_idx = dic["sensor_idx"] - return smi_api.amdsmi_dev_get_fan_rpms(dev, sensor_idx) + return smi_api.amdsmi_get_gpu_fan_rpms(dev, sensor_idx) def amdsmi_tool_dev_fan_speed_get(dev, dic): sensor_idx = dic["sensor_idx"] diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index a5b92e12a0..c958666cb9 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -478,7 +478,7 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed) { return rsmi_wrapper(rsmi_dev_fan_rpms_get, processor_handle, sensor_ind, speed); @@ -943,7 +943,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_power_cap_default_get", "amdsmi_get_power_cap_info"}, {"rsmi_dev_power_cap_range_get", "amdsmi_get_power_cap_info"}, {"rsmi_dev_power_cap_set", " amdsmi_set_power_cap"}, - {"rsmi_dev_fan_rpms_get", "amdsmi_dev_get_fan_rpms"}, + {"rsmi_dev_fan_rpms_get", "amdsmi_get_gpu_fan_rpms"}, {"rsmi_dev_fan_speed_get", "amdsmi_dev_get_fan_speed"}, {"rsmi_dev_fan_speed_max_get", "amdsmi_dev_get_fan_speed_max"}, {"rsmi_dev_temp_metric_get", " amdsmi_dev_get_temp_metric"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc index d8fb52265f..965957cbed 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc @@ -130,14 +130,14 @@ void TestFanRead::Run(void) { IF_VERB(STANDARD) { std::cout << "\t**Current fan RPMs: "; } - err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, &val_i64); + err = amdsmi_get_gpu_fan_rpms(processor_handles_[i], 0, &val_i64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << val_i64 << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, nullptr); + err = amdsmi_get_gpu_fan_rpms(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 72291de3c2..0196e15ddb 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -223,7 +223,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_set_gpu_pci_bandwidth(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_rpms(processor_handles_[0], dmy_ui32, &dmy_i64); + ret = amdsmi_get_gpu_fan_rpms(processor_handles_[0], dmy_ui32, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_fan_speed(processor_handles_[0], 0, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -275,7 +275,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_get_temp_metric amdsmi_dev_get_volt_metric amdsmi_dev_get_fan_speed - amdsmi_dev_get_fan_rpms + amdsmi_get_gpu_fan_rpms amdsmi_dev_reset_fan amdsmi_dev_set_fan_speed amdsmi_dev_get_fan_speed_max From 1ad0c6af8fb28bcd168c688a95af4c345ab34c51 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:15:36 -0500 Subject: [PATCH 38/95] Renamed APIs 1) amdsmi_dev_get_fan_speed to amdsmi_get_gpu_fan_speed 2) amdsmi_dev_get_fan_speed_max to amdsmi_get_gpu_fan_speed_max grep -rli 'amdsmi_dev_get_fan_speed' * | xargs -i@ sed -i 's/amdsmi_dev_get_fan_speed/amdsmi_get_gpu_fan_speed/g' @ Change-Id: I74e93885fe3335bbde8294e3b0863256bb044fcb [ROCm/amdsmi commit: 3b62d7629f355cdb53a65013b7e4c92259a49924] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/README.md | 12 ++++++------ projects/amdsmi/py-interface/__init__.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_interface.py | 8 ++++---- projects/amdsmi/py-interface/amdsmi_wrapper.py | 14 +++++++------- projects/amdsmi/py-interface/rocm_smi_tool.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 8 ++++---- .../tests/amd_smi_test/functional/fan_read.cc | 8 ++++---- .../amd_smi_test/functional/fan_read_write.cc | 8 ++++---- .../amd_smi_test/functional/mutual_exclusion.cc | 8 ++++---- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 68bdde7b86..72232ff2aa 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1937,7 +1937,7 @@ amdsmi_status_t amdsmi_get_gpu_fan_rpms(amdsmi_processor_handle processor_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed); /** @@ -1961,7 +1961,7 @@ amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle processor_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_fan_speed_max(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *max_speed); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 11797fa9c7..7a90c971db 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1775,7 +1775,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_fan_speed +## amdsmi_get_gpu_fan_speed Description: Get the fan speed for the specified device as a value relative to AMDSMI_MAX_FAN_SPEED @@ -1786,7 +1786,7 @@ more than one sensor, it could be greater than 0. Output: Fan speed in relative to MAX -Exceptions that can be thrown by `amdsmi_dev_get_fan_speed` function: +Exceptions that can be thrown by `amdsmi_get_gpu_fan_speed` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1799,12 +1799,12 @@ try: print("No GPUs on machine") else: for device in devices: - fan_speed = amdsmi_dev_get_fan_speed(device, 0) + fan_speed = amdsmi_get_gpu_fan_speed(device, 0) print(fan_speed) except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_fan_speed_max +## amdsmi_get_gpu_fan_speed_max Description: Get the max fan speed of the device with provided device handle Input parameters: @@ -1814,7 +1814,7 @@ more than one sensor, it could be greater than 0. Output: Max fan speed as integer -Exceptions that can be thrown by `amdsmi_dev_get_fan_speed_max` function: +Exceptions that can be thrown by `amdsmi_get_gpu_fan_speed_max` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1827,7 +1827,7 @@ try: print("No GPUs on machine") else: for device in devices: - max_fan_speed = amdsmi_dev_get_fan_speed_max(device, 0) + max_fan_speed = amdsmi_get_gpu_fan_speed_max(device, 0) print(max_fan_speed) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 88b9655733..580695a3cc 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -98,8 +98,8 @@ from .amdsmi_interface import amdsmi_dev_set_overdrive_level # # Physical State Queries from .amdsmi_interface import amdsmi_get_gpu_fan_rpms -from .amdsmi_interface import amdsmi_dev_get_fan_speed -from .amdsmi_interface import amdsmi_dev_get_fan_speed_max +from .amdsmi_interface import amdsmi_get_gpu_fan_speed +from .amdsmi_interface import amdsmi_get_gpu_fan_speed_max from .amdsmi_interface import amdsmi_dev_get_temp_metric from .amdsmi_interface import amdsmi_dev_get_volt_metric diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 92a9c2ec0a..f61e5f4a76 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2079,7 +2079,7 @@ def amdsmi_get_gpu_fan_rpms( return fan_speed.value -def amdsmi_dev_get_fan_speed( +def amdsmi_get_gpu_fan_speed( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2090,7 +2090,7 @@ def amdsmi_dev_get_fan_speed( raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_int64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_fan_speed( + amdsmi_wrapper.amdsmi_get_gpu_fan_speed( processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) @@ -2098,7 +2098,7 @@ def amdsmi_dev_get_fan_speed( return fan_speed.value -def amdsmi_dev_get_fan_speed_max( +def amdsmi_get_gpu_fan_speed_max( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2109,7 +2109,7 @@ def amdsmi_dev_get_fan_speed_max( raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_fan_speed_max( + amdsmi_wrapper.amdsmi_get_gpu_fan_speed_max( processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9443b13adf..7df1150671 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1490,12 +1490,12 @@ amdsmi_get_gpu_memory_reserved_pages.argtypes = [amdsmi_processor_handle, ctypes amdsmi_get_gpu_fan_rpms = _libraries['libamd_smi.so'].amdsmi_get_gpu_fan_rpms amdsmi_get_gpu_fan_rpms.restype = amdsmi_status_t amdsmi_get_gpu_fan_rpms.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] -amdsmi_dev_get_fan_speed = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_speed -amdsmi_dev_get_fan_speed.restype = amdsmi_status_t -amdsmi_dev_get_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] -amdsmi_dev_get_fan_speed_max = _libraries['libamd_smi.so'].amdsmi_dev_get_fan_speed_max -amdsmi_dev_get_fan_speed_max.restype = amdsmi_status_t -amdsmi_dev_get_fan_speed_max.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_fan_speed = _libraries['libamd_smi.so'].amdsmi_get_gpu_fan_speed +amdsmi_get_gpu_fan_speed.restype = amdsmi_status_t +amdsmi_get_gpu_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_get_gpu_fan_speed_max = _libraries['libamd_smi.so'].amdsmi_get_gpu_fan_speed_max +amdsmi_get_gpu_fan_speed_max.restype = amdsmi_status_t +amdsmi_get_gpu_fan_speed_max.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_temp_metric = _libraries['libamd_smi.so'].amdsmi_dev_get_temp_metric amdsmi_dev_get_temp_metric.restype = amdsmi_status_t amdsmi_dev_get_temp_metric.argtypes = [amdsmi_processor_handle, amdsmi_temperature_type_t, amdsmi_temperature_metric_t, ctypes.POINTER(ctypes.c_int64)] @@ -1855,7 +1855,7 @@ __all__ = \ 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_ecc_count', 'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', - 'amdsmi_dev_get_fan_speed', 'amdsmi_dev_get_fan_speed_max', + 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', 'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info', 'amdsmi_get_gpu_id', 'amdsmi_get_gpu_memory_busy_percent', 'amdsmi_get_gpu_memory_reserved_pages', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 40580a126d..49a62dd4e6 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -305,8 +305,8 @@ class Formatter: | """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_get_gpu_memory_busy_percent ") + """ | | """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_get_gpu_memory_reserved_pages ") + """ | | """ + self.style.text("18 Get device fan rpms. Api: amdsmi_get_gpu_fan_rpms ") + """ | - | """ + self.style.text("19 Get device fan speed. Api: amdsmi_dev_get_fan_speed ") + """ | - | """ + self.style.text("20 Get device fan speed max. Api: amdsmi_dev_get_fan_speed_max ") + """ | + | """ + self.style.text("19 Get device fan speed. Api: amdsmi_get_gpu_fan_speed ") + """ | + | """ + self.style.text("20 Get device fan speed max. Api: amdsmi_get_gpu_fan_speed_max ") + """ | | """ + self.style.text("21 Get device temp metric. Api: amdsmi_dev_get_temp_metric ") + """ | | """ + self.style.text("22 Get device volt metric. Api: amdsmi_dev_get_volt_metric ") + """ | | """ + self.style.text("23 Get device busy percent. Api: amdsmi_dev_get_busy_percent ") + """ | @@ -407,11 +407,11 @@ def amdsmi_tool_dev_fan_rpms_get(dev, dic): def amdsmi_tool_dev_fan_speed_get(dev, dic): sensor_idx = dic["sensor_idx"] - return smi_api.amdsmi_dev_get_fan_speed(dev, sensor_idx) + return smi_api.amdsmi_get_gpu_fan_speed(dev, sensor_idx) def amdsmi_tool_dev_fan_speed_max_get(dev, dic): sensor_idx = dic["sensor_idx"] - return smi_api.amdsmi_dev_get_fan_speed_max(dev, sensor_idx) + return smi_api.amdsmi_get_gpu_fan_speed_max(dev, sensor_idx) def amdsmi_tool_dev_temp_metric_get(dev): result = {} diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index c958666cb9..7585c9be5b 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -484,13 +484,13 @@ amdsmi_status_t amdsmi_get_gpu_fan_rpms(amdsmi_processor_handle processor_handle speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed) { return rsmi_wrapper(rsmi_dev_fan_speed_get, processor_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_fan_speed_max(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *max_speed) { return rsmi_wrapper(rsmi_dev_fan_speed_max_get, processor_handle, sensor_ind, max_speed); @@ -944,8 +944,8 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_power_cap_range_get", "amdsmi_get_power_cap_info"}, {"rsmi_dev_power_cap_set", " amdsmi_set_power_cap"}, {"rsmi_dev_fan_rpms_get", "amdsmi_get_gpu_fan_rpms"}, - {"rsmi_dev_fan_speed_get", "amdsmi_dev_get_fan_speed"}, - {"rsmi_dev_fan_speed_max_get", "amdsmi_dev_get_fan_speed_max"}, + {"rsmi_dev_fan_speed_get", "amdsmi_get_gpu_fan_speed"}, + {"rsmi_dev_fan_speed_max_get", "amdsmi_get_gpu_fan_speed_max"}, {"rsmi_dev_temp_metric_get", " amdsmi_dev_get_temp_metric"}, {"rsmi_dev_fan_reset", "amdsmi_dev_reset_fan"}, {"rsmi_dev_fan_speed_set", "amdsmi_dev_set_fan_speed"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc index 965957cbed..5829567ec7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/fan_read.cc @@ -101,7 +101,7 @@ void TestFanRead::Run(void) { IF_VERB(STANDARD) { std::cout << "\t**Current Fan Speed: "; } - err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, &val_i64); + err = amdsmi_get_gpu_fan_speed(processor_handles_[i], 0, &val_i64); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**" << ": " << @@ -114,17 +114,17 @@ void TestFanRead::Run(void) { // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, nullptr); + err = amdsmi_get_gpu_fan_speed(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, &val_ui64); + err = amdsmi_get_gpu_fan_speed_max(processor_handles_[i], 0, &val_ui64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << val_i64/static_cast(val_ui64)*100; std::cout << "% ("<< val_i64 << "/" << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, nullptr); + err = amdsmi_get_gpu_fan_speed_max(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc index a62b8d40ed..19d504657d 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc @@ -100,7 +100,7 @@ void TestFanReadWrite::Run(void) { for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &orig_speed); + ret = amdsmi_get_gpu_fan_speed(processor_handles_[dv_ind], 0, &orig_speed); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**" << ": " << @@ -120,7 +120,7 @@ void TestFanReadWrite::Run(void) { return; } - ret = amdsmi_dev_get_fan_speed_max(processor_handles_[dv_ind], 0, &max_speed); + ret = amdsmi_get_gpu_fan_speed_max(processor_handles_[dv_ind], 0, &max_speed); CHK_ERR_ASRT(ret) new_speed = 1.1 * orig_speed; @@ -141,7 +141,7 @@ void TestFanReadWrite::Run(void) { sleep(4); - ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); + ret = amdsmi_get_gpu_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -168,7 +168,7 @@ void TestFanReadWrite::Run(void) { sleep(3); - ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); + ret = amdsmi_get_gpu_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 0196e15ddb..37227f4b0f 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -225,9 +225,9 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_fan_rpms(processor_handles_[0], dmy_ui32, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_speed(processor_handles_[0], 0, &dmy_i64); + ret = amdsmi_get_gpu_fan_speed(processor_handles_[0], 0, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_speed_max(processor_handles_[0], 0, &dmy_ui64); + ret = amdsmi_get_gpu_fan_speed_max(processor_handles_[0], 0, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_temp_metric(processor_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -274,11 +274,11 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_pci_throughput amdsmi_dev_get_temp_metric amdsmi_dev_get_volt_metric - amdsmi_dev_get_fan_speed + amdsmi_get_gpu_fan_speed amdsmi_get_gpu_fan_rpms amdsmi_dev_reset_fan amdsmi_dev_set_fan_speed - amdsmi_dev_get_fan_speed_max + amdsmi_get_gpu_fan_speed_max amdsmi_dev_get_od_volt_info amdsmi_dev_get_gpu_metrics_info amdsmi_dev_get_od_volt_curve_regions From da14f8b791fe37b4595400c54e597d829140b08b Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:23:10 -0500 Subject: [PATCH 39/95] Renamed API amdsmi_dev_get_temp_metric to amdsmi_get_temp_metric grep -rli 'amdsmi_dev_get_temp_metric' * | xargs -i@ sed -i 's/amdsmi_dev_get_temp_metric/amdsmi_get_temp_metric/g' @ Change-Id: I4a342f9d1c5183afdeac67506fef73e895911283 [ROCm/amdsmi commit: d3289258b45bd60a829da8e31241e8ddbf764690] --- projects/amdsmi/README.md | 2 +- projects/amdsmi/example/amd_smi_drm_example.cc | 14 +++++++------- projects/amdsmi/example/amd_smi_nodrm_example.cc | 8 ++++---- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- .../tests/amd_smi_test/functional/temp_read.cc | 6 +++--- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/projects/amdsmi/README.md b/projects/amdsmi/README.md index 5f5c014a12..44d103ae5d 100755 --- a/projects/amdsmi/README.md +++ b/projects/amdsmi/README.md @@ -143,7 +143,7 @@ int main() { // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); std::cout << "\t\tTemperature: " << val_i64 << "C" << std::endl; } diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 41a50bbe89..53d8fe5165 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -394,15 +394,15 @@ int main() { // Get VRAM temperature limit int64_t temperature = 0; - ret = amdsmi_dev_get_temp_metric( + ret = amdsmi_get_temp_metric( processor_handles[j], TEMPERATURE_TYPE_VRAM, AMDSMI_TEMP_CRITICAL, &temperature); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_dev_get_temp_metric:\n"); + printf(" Output of amdsmi_get_temp_metric:\n"); printf("\tGPU VRAM temp limit: %ld\n", temperature); // Get GFX temperature limit - ret = amdsmi_dev_get_temp_metric( + ret = amdsmi_get_temp_metric( processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CRITICAL, &temperature); CHK_AMDSMI_RET(ret) @@ -416,13 +416,13 @@ int main() { TEMPERATURE_TYPE_EDGE, TEMPERATURE_TYPE_JUNCTION, TEMPERATURE_TYPE_VRAM, TEMPERATURE_TYPE_PLX}; for (const auto &temp_type : temp_types) { - ret = amdsmi_dev_get_temp_metric( + ret = amdsmi_get_temp_metric( processor_handles[j], temp_type, AMDSMI_TEMP_CURRENT, &temp_measurements[(int)(temp_type)]); CHK_AMDSMI_RET(ret) } - printf(" Output of amdsmi_dev_get_temp_metric:\n"); + printf(" Output of amdsmi_get_temp_metric:\n"); printf("\tGPU Edge temp measurement: %ld\n", temp_measurements[TEMPERATURE_TYPE_EDGE]); printf("\tGPU Junction temp measurement: %ld\n", @@ -636,10 +636,10 @@ int main() { // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_dev_get_temp_metric:\n"); + printf(" Output of amdsmi_get_temp_metric:\n"); std::cout << "\t\tTemperature: " << val_i64 << "C" << "\n\n"; diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 596539a383..e5d86648c0 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -226,13 +226,13 @@ int main() { TEMPERATURE_TYPE_EDGE, TEMPERATURE_TYPE_JUNCTION, TEMPERATURE_TYPE_VRAM, TEMPERATURE_TYPE_PLX}; for (const auto &temp_type : temp_types) { - ret = amdsmi_dev_get_temp_metric( + ret = amdsmi_get_temp_metric( processor_handles[j], temp_type, AMDSMI_TEMP_CURRENT, &temp_measurements[(int)(temp_type)]); CHK_AMDSMI_RET(ret) } - printf(" Output of amdsmi_dev_get_temp_metric:\n"); + printf(" Output of amdsmi_get_temp_metric:\n"); printf("\tGPU Edge temp measurement: %ld\n", temp_measurements[TEMPERATURE_TYPE_EDGE]); printf("\tGPU Junction temp measurement: %ld\n", @@ -300,10 +300,10 @@ int main() { // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_dev_get_temp_metric:\n"); + printf(" Output of amdsmi_get_temp_metric:\n"); std::cout << "\t\tTemperature: " << val_i64 << "C" << "\n\n"; diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 72232ff2aa..bb801880a1 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1990,7 +1990,7 @@ amdsmi_status_t amdsmi_get_gpu_fan_speed_max(amdsmi_processor_handle processor_h * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature); @@ -3244,14 +3244,14 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * * Some functions have several variations ("variants") where some variants are * supported and others are not. For example, on a given device, - * :: amdsmi_dev_get_temp_metric may support some types of temperature metrics + * :: amdsmi_get_temp_metric may support some types of temperature metrics * (e.g., ::AMDSMI_TEMP_CRITICAL_HYST), but not others * (e.g., ::AMDSMI_TEMP_EMERGENCY). * * In addition to a top level of variant support for a function, a function * may have varying support for monitors/sensors. These are considered * "sub-variants" in functions described in this section. Continuing the - * :: amdsmi_dev_get_temp_metric example, if variant + * :: amdsmi_get_temp_metric example, if variant * ::AMDSMI_TEMP_CRITICAL_HYST is supported, perhaps * only the sub-variant sensors ::AMDSMI_TEMP_TYPE_EDGE * and ::AMDSMI_TEMP_TYPE_EDGE are supported, but not diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 7a90c971db..e93208dbbb 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1832,7 +1832,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_temp_metric +## amdsmi_get_temp_metric Description: Get the temperature metric value for the specified metric, from the specified temperature sensor on the specified device @@ -1843,7 +1843,7 @@ Input parameters: Output: Temperature as integer in millidegrees Celcius -Exceptions that can be thrown by ` amdsmi_dev_get_temp_metric` function: +Exceptions that can be thrown by ` amdsmi_get_temp_metric` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1856,7 +1856,7 @@ try: print("No GPUs on machine") else: for device in devices: - temp_metric = amdsmi_dev_get_temp_metric(device, AmdSmiTemperatureType.EDGE, + temp_metric = amdsmi_get_temp_metric(device, AmdSmiTemperatureType.EDGE, AmdSmiTemperatureMetric.CURRENT) print(temp_metric) except AmdSmiException as e: diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 580695a3cc..e48fb44f11 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -100,7 +100,7 @@ from .amdsmi_interface import amdsmi_dev_set_overdrive_level from .amdsmi_interface import amdsmi_get_gpu_fan_rpms from .amdsmi_interface import amdsmi_get_gpu_fan_speed from .amdsmi_interface import amdsmi_get_gpu_fan_speed_max -from .amdsmi_interface import amdsmi_dev_get_temp_metric +from .amdsmi_interface import amdsmi_get_temp_metric from .amdsmi_interface import amdsmi_dev_get_volt_metric # # Clock, Power and Performance Query diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index f61e5f4a76..ead001ac77 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2117,7 +2117,7 @@ def amdsmi_get_gpu_fan_speed_max( return fan_speed.value -def amdsmi_dev_get_temp_metric( +def amdsmi_get_temp_metric( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiTemperatureType, metric: AmdSmiTemperatureMetric, @@ -2133,7 +2133,7 @@ def amdsmi_dev_get_temp_metric( temp_value = ctypes.c_int64() _check_res( - amdsmi_wrapper. amdsmi_dev_get_temp_metric( + amdsmi_wrapper. amdsmi_get_temp_metric( processor_handle, sensor_type, metric, ctypes.byref(temp_value) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 7df1150671..2f230d0f83 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1496,9 +1496,9 @@ amdsmi_get_gpu_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.P amdsmi_get_gpu_fan_speed_max = _libraries['libamd_smi.so'].amdsmi_get_gpu_fan_speed_max amdsmi_get_gpu_fan_speed_max.restype = amdsmi_status_t amdsmi_get_gpu_fan_speed_max.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_dev_get_temp_metric = _libraries['libamd_smi.so'].amdsmi_dev_get_temp_metric -amdsmi_dev_get_temp_metric.restype = amdsmi_status_t -amdsmi_dev_get_temp_metric.argtypes = [amdsmi_processor_handle, amdsmi_temperature_type_t, amdsmi_temperature_metric_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_get_temp_metric = _libraries['libamd_smi.so'].amdsmi_get_temp_metric +amdsmi_get_temp_metric.restype = amdsmi_status_t +amdsmi_get_temp_metric.argtypes = [amdsmi_processor_handle, amdsmi_temperature_type_t, amdsmi_temperature_metric_t, ctypes.POINTER(ctypes.c_int64)] amdsmi_dev_get_volt_metric = _libraries['libamd_smi.so'].amdsmi_dev_get_volt_metric amdsmi_dev_get_volt_metric.restype = amdsmi_status_t amdsmi_dev_get_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)] @@ -1868,7 +1868,7 @@ __all__ = \ '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', + 'amdsmi_get_temp_metric', 'amdsmi_get_gpu_vendor_name', 'amdsmi_dev_get_volt_metric', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_dev_open_supported_func_iterator', 'amdsmi_dev_open_supported_variant_iterator', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 49a62dd4e6..9c13158f41 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -307,7 +307,7 @@ class Formatter: | """ + self.style.text("18 Get device fan rpms. Api: amdsmi_get_gpu_fan_rpms ") + """ | | """ + self.style.text("19 Get device fan speed. Api: amdsmi_get_gpu_fan_speed ") + """ | | """ + self.style.text("20 Get device fan speed max. Api: amdsmi_get_gpu_fan_speed_max ") + """ | - | """ + self.style.text("21 Get device temp metric. Api: amdsmi_dev_get_temp_metric ") + """ | + | """ + self.style.text("21 Get device temp metric. Api: amdsmi_get_temp_metric ") + """ | | """ + self.style.text("22 Get device volt metric. Api: amdsmi_dev_get_volt_metric ") + """ | | """ + self.style.text("23 Get device busy percent. Api: amdsmi_dev_get_busy_percent ") + """ | | """ + self.style.text("24 Get utilization count. Api: amdsmi_get_utilization_count ") + """ | @@ -418,7 +418,7 @@ def amdsmi_tool_dev_temp_metric_get(dev): for temperature_type in smi_api.AmdSmiTemperatureType: for temperature_metric in smi_api.AmdSmiTemperatureMetric: try: - value = smi_api. amdsmi_dev_get_temp_metric(dev, temperature_type, temperature_metric) + value = smi_api. amdsmi_get_temp_metric(dev, temperature_type, temperature_metric) result.update({"AmdSmiTemperatureType: " + temperature_type.name + ", AmdSmiTemperatureMetric: " + temperature_metric.name: value}) except smi_api.AmdSmiException as e: print("{},{}:\t{}".format(temperature_type.name, temperature_metric.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 7585c9be5b..c7f31dcaca 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -319,7 +319,7 @@ amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_hand return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature) { @@ -946,7 +946,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_fan_rpms_get", "amdsmi_get_gpu_fan_rpms"}, {"rsmi_dev_fan_speed_get", "amdsmi_get_gpu_fan_speed"}, {"rsmi_dev_fan_speed_max_get", "amdsmi_get_gpu_fan_speed_max"}, - {"rsmi_dev_temp_metric_get", " amdsmi_dev_get_temp_metric"}, + {"rsmi_dev_temp_metric_get", " amdsmi_get_temp_metric"}, {"rsmi_dev_fan_reset", "amdsmi_dev_reset_fan"}, {"rsmi_dev_fan_speed_set", "amdsmi_dev_set_fan_speed"}, {"rsmi_dev_volt_metric_get", " amdsmi_dev_get_volt_metric"} diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 37227f4b0f..3d8685b369 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -229,7 +229,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_fan_speed_max(processor_handles_[0], 0, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_temp_metric(processor_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); + ret = amdsmi_get_temp_metric(processor_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_reset_fan(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -272,7 +272,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_pci_bandwidth amdsmi_set_gpu_pci_bandwidth amdsmi_get_gpu_pci_throughput - amdsmi_dev_get_temp_metric + amdsmi_get_temp_metric amdsmi_dev_get_volt_metric amdsmi_get_gpu_fan_speed amdsmi_get_gpu_fan_rpms diff --git a/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc index de32dc0c54..e9c337ac1b 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/temp_read.cc @@ -114,7 +114,7 @@ void TestTempRead::Run(void) { auto print_temp_metric = [&](amdsmi_temperature_metric_t met, std::string label) { - err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, &val_i64); + err = amdsmi_get_temp_metric(processor_handles_[i], static_cast(type), met, &val_i64); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -124,7 +124,7 @@ void TestTempRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); + err = amdsmi_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); return; } else { @@ -132,7 +132,7 @@ void TestTempRead::Run(void) { } } // Verify api support checking functionality is working - err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); + err = amdsmi_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { From f33edadf51ab92dacf2abb26546a46891140e81d Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:25:12 -0500 Subject: [PATCH 40/95] Renamed API amdsmi_dev_get_volt_metric to amdsmi_get_gpu_volt_metric grep -rli 'amdsmi_dev_get_volt_metric' * | xargs -i@ sed -i 's/amdsmi_dev_get_volt_metric/amdsmi_get_gpu_volt_metric/g' @ Change-Id: Icd34fa435d067815d83b61e84b70b1d78105f8b6 [ROCm/amdsmi commit: 1358f3cfd08e974d584014356f16cec38def0f25] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../amdsmi/tests/amd_smi_test/functional/volt_read.cc | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index bb801880a1..7545628a4c 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2020,7 +2020,7 @@ amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage); diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index e93208dbbb..ecbd179fa5 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1862,7 +1862,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_volt_metric +## amdsmi_get_gpu_volt_metric Description: Get the voltage metric value for the specified metric, from the specified voltage sensor on the specified device @@ -1873,7 +1873,7 @@ Input parameters: Output: Voltage as integer in millivolts -Exceptions that can be thrown by ` amdsmi_dev_get_volt_metric` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_volt_metric` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1886,7 +1886,7 @@ try: print("No GPUs on machine") else: for device in devices: - voltage = amdsmi_dev_get_volt_metric(device, AmdSmiVoltageType.VDDGFX, + voltage = amdsmi_get_gpu_volt_metric(device, AmdSmiVoltageType.VDDGFX, AmdSmiVoltageMetric.AVERAGE) print(voltage) except AmdSmiException as e: diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index e48fb44f11..a90ab8bce3 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -101,7 +101,7 @@ from .amdsmi_interface import amdsmi_get_gpu_fan_rpms from .amdsmi_interface import amdsmi_get_gpu_fan_speed from .amdsmi_interface import amdsmi_get_gpu_fan_speed_max from .amdsmi_interface import amdsmi_get_temp_metric -from .amdsmi_interface import amdsmi_dev_get_volt_metric +from .amdsmi_interface import amdsmi_get_gpu_volt_metric # # Clock, Power and Performance Query from .amdsmi_interface import amdsmi_dev_get_busy_percent diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ead001ac77..95e947e350 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2141,7 +2141,7 @@ def amdsmi_get_temp_metric( return temp_value.value -def amdsmi_dev_get_volt_metric( +def amdsmi_get_gpu_volt_metric( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiVoltageType, metric: AmdSmiVoltageMetric, @@ -2157,7 +2157,7 @@ def amdsmi_dev_get_volt_metric( voltage = ctypes.c_int64() _check_res( - amdsmi_wrapper. amdsmi_dev_get_volt_metric( + amdsmi_wrapper. amdsmi_get_gpu_volt_metric( processor_handle, sensor_type, metric, ctypes.byref(voltage) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 2f230d0f83..9504e70307 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1499,9 +1499,9 @@ amdsmi_get_gpu_fan_speed_max.argtypes = [amdsmi_processor_handle, uint32_t, ctyp amdsmi_get_temp_metric = _libraries['libamd_smi.so'].amdsmi_get_temp_metric amdsmi_get_temp_metric.restype = amdsmi_status_t amdsmi_get_temp_metric.argtypes = [amdsmi_processor_handle, amdsmi_temperature_type_t, amdsmi_temperature_metric_t, ctypes.POINTER(ctypes.c_int64)] -amdsmi_dev_get_volt_metric = _libraries['libamd_smi.so'].amdsmi_dev_get_volt_metric -amdsmi_dev_get_volt_metric.restype = amdsmi_status_t -amdsmi_dev_get_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)] +amdsmi_get_gpu_volt_metric = _libraries['libamd_smi.so'].amdsmi_get_gpu_volt_metric +amdsmi_get_gpu_volt_metric.restype = amdsmi_status_t +amdsmi_get_gpu_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)] amdsmi_dev_reset_fan = _libraries['libamd_smi.so'].amdsmi_dev_reset_fan amdsmi_dev_reset_fan.restype = amdsmi_status_t amdsmi_dev_reset_fan.argtypes = [amdsmi_processor_handle, uint32_t] @@ -1869,7 +1869,7 @@ __all__ = \ 'amdsmi_dev_get_power_profile_presets', 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', 'amdsmi_get_temp_metric', 'amdsmi_get_gpu_vendor_name', - 'amdsmi_dev_get_volt_metric', 'amdsmi_get_gpu_vram_vendor', + 'amdsmi_get_gpu_volt_metric', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_dev_open_supported_func_iterator', 'amdsmi_dev_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 9c13158f41..7ae216f3a4 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -308,7 +308,7 @@ class Formatter: | """ + self.style.text("19 Get device fan speed. Api: amdsmi_get_gpu_fan_speed ") + """ | | """ + self.style.text("20 Get device fan speed max. Api: amdsmi_get_gpu_fan_speed_max ") + """ | | """ + self.style.text("21 Get device temp metric. Api: amdsmi_get_temp_metric ") + """ | - | """ + self.style.text("22 Get device volt metric. Api: amdsmi_dev_get_volt_metric ") + """ | + | """ + self.style.text("22 Get device volt metric. Api: amdsmi_get_gpu_volt_metric ") + """ | | """ + self.style.text("23 Get device busy percent. Api: amdsmi_dev_get_busy_percent ") + """ | | """ + self.style.text("24 Get utilization count. Api: amdsmi_get_utilization_count ") + """ | | """ + self.style.text("25 Get device perf level. Api: amdsmi_dev_get_perf_level ") + """ | @@ -430,7 +430,7 @@ def amdsmi_tool_dev_volt_metric_get(dev): for voltage_type in smi_api.AmdSmiVoltageType: for voltage_metric in smi_api.AmdSmiVoltageMetric: try: - value = smi_api. amdsmi_dev_get_volt_metric(dev, voltage_type, voltage_metric) + value = smi_api. amdsmi_get_gpu_volt_metric(dev, voltage_type, voltage_metric) result.update({"AmdSmiVoltageType: " + voltage_type.name + ", AmdSmiVoltageMetric: " + voltage_metric.name: value}) except smi_api.AmdSmiException as e: print("{},{}:\t{}".format(voltage_type.name, voltage_metric.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index c7f31dcaca..aa8c43f67b 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -949,7 +949,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_temp_metric_get", " amdsmi_get_temp_metric"}, {"rsmi_dev_fan_reset", "amdsmi_dev_reset_fan"}, {"rsmi_dev_fan_speed_set", "amdsmi_dev_set_fan_speed"}, - {"rsmi_dev_volt_metric_get", " amdsmi_dev_get_volt_metric"} + {"rsmi_dev_volt_metric_get", " amdsmi_get_gpu_volt_metric"} }; auto rocm_func_handle = @@ -1315,7 +1315,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions( num_regions, reinterpret_cast(buffer)); } -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage) { return rsmi_wrapper(rsmi_dev_volt_metric_get, processor_handle, @@ -1720,7 +1720,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_ int64_t voltage_read = 0; - status = amdsmi_dev_get_volt_metric(processor_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read); + status = amdsmi_get_gpu_volt_metric(processor_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read); if (status != AMDSMI_STATUS_SUCCESS) { return status; } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 3d8685b369..5ec19e9c77 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -273,7 +273,7 @@ void TestMutualExclusion::Run(void) { amdsmi_set_gpu_pci_bandwidth amdsmi_get_gpu_pci_throughput amdsmi_get_temp_metric - amdsmi_dev_get_volt_metric + amdsmi_get_gpu_volt_metric amdsmi_get_gpu_fan_speed amdsmi_get_gpu_fan_rpms amdsmi_dev_reset_fan diff --git a/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc index 6dc1f507e8..62a0c2b6b4 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/volt_read.cc @@ -104,7 +104,7 @@ void TestVoltRead::Run(void) { auto print_volt_metric = [&](amdsmi_voltage_metric_t met, std::string label) { - err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, &val_i64); + err = amdsmi_get_gpu_volt_metric(processor_handles_[i], type, met, &val_i64); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -113,7 +113,7 @@ void TestVoltRead::Run(void) { "Not supported on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr); + err = amdsmi_get_gpu_volt_metric(processor_handles_[i], type, met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); return; } @@ -122,7 +122,7 @@ void TestVoltRead::Run(void) { } } // Verify api support checking functionality is working - err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr); + err = amdsmi_get_gpu_volt_metric(processor_handles_[i], type, met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { From 745c0850249d7b1293aaeb426078164be4bafde4 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:27:40 -0500 Subject: [PATCH 41/95] Renamed API amdsmi_dev_reset_fan to amdsmi_reset_gpu_fan grep -rli 'amdsmi_dev_reset_fan' * | xargs -i@ sed -i 's/amdsmi_dev_reset_fan/amdsmi_reset_gpu_fan/g' @ Change-Id: Ic9d2ed404b4ed2d6973286e6f76b732199c1b687 [ROCm/amdsmi commit: 7c82c5ec791502054664708dce8d6f8e357a11d3] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/fan_read_write.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 7545628a4c..58b3a49536 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2044,7 +2044,7 @@ amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_ha * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind); +amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind); /** * @brief Set the fan speed for the specified device with the provided speed, diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index ecbd179fa5..9454a45940 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2518,7 +2518,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_reset_fan +## amdsmi_reset_gpu_fan Description: Reset the fan to automatic driver control Input parameters: @@ -2527,7 +2527,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_reset_fan` function: +Exceptions that can be thrown by `amdsmi_reset_gpu_fan` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2540,7 +2540,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_reset_fan(device, 0) + amdsmi_reset_gpu_fan(device, 0) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index a90ab8bce3..a4019392af 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -91,7 +91,7 @@ from .amdsmi_interface import amdsmi_dev_get_power_profile_presets from .amdsmi_interface import amdsmi_dev_reset_gpu from .amdsmi_interface import amdsmi_set_perf_determinism_mode from .amdsmi_interface import amdsmi_dev_set_fan_speed -from .amdsmi_interface import amdsmi_dev_reset_fan +from .amdsmi_interface import amdsmi_reset_gpu_fan from .amdsmi_interface import amdsmi_dev_set_clk_freq from .amdsmi_interface import amdsmi_dev_set_overdrive_level_v1 from .amdsmi_interface import amdsmi_dev_set_overdrive_level diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 95e947e350..3cf531e380 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1539,7 +1539,7 @@ def amdsmi_dev_set_fan_speed( ) -def amdsmi_dev_reset_fan( +def amdsmi_reset_gpu_fan( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1550,7 +1550,7 @@ def amdsmi_dev_reset_fan( raise AmdSmiParameterException(sensor_idx, int) sensor_idx = ctypes.c_uint32(sensor_idx) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_fan(processor_handle, sensor_idx)) + _check_res(amdsmi_wrapper.amdsmi_reset_gpu_fan(processor_handle, sensor_idx)) def amdsmi_dev_set_clk_freq( diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9504e70307..3d46b55057 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1502,9 +1502,9 @@ amdsmi_get_temp_metric.argtypes = [amdsmi_processor_handle, amdsmi_temperature_t amdsmi_get_gpu_volt_metric = _libraries['libamd_smi.so'].amdsmi_get_gpu_volt_metric amdsmi_get_gpu_volt_metric.restype = amdsmi_status_t amdsmi_get_gpu_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)] -amdsmi_dev_reset_fan = _libraries['libamd_smi.so'].amdsmi_dev_reset_fan -amdsmi_dev_reset_fan.restype = amdsmi_status_t -amdsmi_dev_reset_fan.argtypes = [amdsmi_processor_handle, uint32_t] +amdsmi_reset_gpu_fan = _libraries['libamd_smi.so'].amdsmi_reset_gpu_fan +amdsmi_reset_gpu_fan.restype = amdsmi_status_t +amdsmi_reset_gpu_fan.argtypes = [amdsmi_processor_handle, uint32_t] amdsmi_dev_set_fan_speed = _libraries['libamd_smi.so'].amdsmi_dev_set_fan_speed amdsmi_dev_set_fan_speed.restype = amdsmi_status_t amdsmi_dev_set_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] @@ -1873,7 +1873,7 @@ __all__ = \ 'amdsmi_dev_open_supported_func_iterator', 'amdsmi_dev_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', - 'amdsmi_dev_reset_fan', 'amdsmi_dev_reset_gpu', + 'amdsmi_reset_gpu_fan', 'amdsmi_dev_reset_gpu', 'amdsmi_dev_reset_xgmi_error', 'amdsmi_dev_set_clk_freq', 'amdsmi_dev_set_clk_range', 'amdsmi_dev_set_fan_speed', 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 7ae216f3a4..7f59a32f73 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -350,7 +350,7 @@ class Formatter: | """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter ") + """ | | """ + self.style.text("62 Set dev clk range. Api: amdsmi_dev_set_clk_range ") + """ | | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_dev_counter_group_supported ") + """ | - | """ + self.style.text("64 Reset dev fan. Api: amdsmi_dev_reset_fan ") + """ | + | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_dev_set_fan_speed ") + """ | | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_dev_set_clk_freq ") + """ | | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_dev_reset_gpu ") + """ | @@ -469,7 +469,7 @@ def amdsmi_tool_version_str_get(): def amdsmi_tool_dev_fan_reset(dev, dic): sensor_idx = dic["sensor_idx"] - return smi_api.amdsmi_dev_reset_fan(dev, sensor_idx) + return smi_api.amdsmi_reset_gpu_fan(dev, sensor_idx) def amdsmi_tool_dev_fan_speed_set(dev, dic): sensor_idx = dic["sensor_idx"] diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index aa8c43f67b..6f606e757c 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -496,7 +496,7 @@ amdsmi_status_t amdsmi_get_gpu_fan_speed_max(amdsmi_processor_handle processor_h sensor_ind, max_speed); } -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind) { return rsmi_wrapper(rsmi_dev_fan_reset, processor_handle, sensor_ind); } @@ -947,7 +947,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_fan_speed_get", "amdsmi_get_gpu_fan_speed"}, {"rsmi_dev_fan_speed_max_get", "amdsmi_get_gpu_fan_speed_max"}, {"rsmi_dev_temp_metric_get", " amdsmi_get_temp_metric"}, - {"rsmi_dev_fan_reset", "amdsmi_dev_reset_fan"}, + {"rsmi_dev_fan_reset", "amdsmi_reset_gpu_fan"}, {"rsmi_dev_fan_speed_set", "amdsmi_dev_set_fan_speed"}, {"rsmi_dev_volt_metric_get", " amdsmi_get_gpu_volt_metric"} }; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc index 19d504657d..ff901e8d37 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc @@ -163,7 +163,7 @@ void TestFanReadWrite::Run(void) { std::cout << "Resetting fan control to auto..." << std::endl; } - ret = amdsmi_dev_reset_fan(processor_handles_[dv_ind], 0); + ret = amdsmi_reset_gpu_fan(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) sleep(3); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 5ec19e9c77..5977b36e09 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -231,7 +231,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_temp_metric(processor_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_reset_fan(processor_handles_[0], 0); + ret = amdsmi_reset_gpu_fan(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_set_fan_speed(processor_handles_[0], dmy_ui32, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -276,7 +276,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_volt_metric amdsmi_get_gpu_fan_speed amdsmi_get_gpu_fan_rpms - amdsmi_dev_reset_fan + amdsmi_reset_gpu_fan amdsmi_dev_set_fan_speed amdsmi_get_gpu_fan_speed_max amdsmi_dev_get_od_volt_info From bea333594123fbd06a5641532f9003ea7cfad78d Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:29:08 -0500 Subject: [PATCH 42/95] Renamed API amdsmi_dev_set_fan_speed to amdsmi_set_gpu_fan_speed grep -rli 'amdsmi_dev_set_fan_speed' * | xargs -i@ sed -i 's/amdsmi_dev_set_fan_speed/amdsmi_set_gpu_fan_speed/g' @ Change-Id: I27a321a0e1182b4cc94d18cff5245df67c4fee31 [ROCm/amdsmi commit: 8d7b6ee5d148922cf7e89e94ebbb65ae170b71c1] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/fan_read_write.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 58b3a49536..e30e3d0d43 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2066,7 +2066,7 @@ amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, u * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_gpu_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t speed); /** @} End PhysCont */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 9454a45940..9bd56d763f 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2490,7 +2490,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_fan_speed +## amdsmi_set_gpu_fan_speed Description: Set the fan speed for the specified device with the provided speed, in RPMs @@ -2501,7 +2501,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_set_fan_speed` function: +Exceptions that can be thrown by `amdsmi_set_gpu_fan_speed` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2514,7 +2514,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_fan_speed(device, 0, 1333) + amdsmi_set_gpu_fan_speed(device, 0, 1333) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index a4019392af..f7d8131327 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -90,7 +90,7 @@ from .amdsmi_interface import amdsmi_dev_set_perf_level from .amdsmi_interface import amdsmi_dev_get_power_profile_presets from .amdsmi_interface import amdsmi_dev_reset_gpu from .amdsmi_interface import amdsmi_set_perf_determinism_mode -from .amdsmi_interface import amdsmi_dev_set_fan_speed +from .amdsmi_interface import amdsmi_set_gpu_fan_speed from .amdsmi_interface import amdsmi_reset_gpu_fan from .amdsmi_interface import amdsmi_dev_set_clk_freq from .amdsmi_interface import amdsmi_dev_set_overdrive_level_v1 diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 3cf531e380..00519adf55 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1519,7 +1519,7 @@ def amdsmi_set_perf_determinism_mode( ) -def amdsmi_dev_set_fan_speed( +def amdsmi_set_gpu_fan_speed( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int, fan_speed: int ): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1534,7 +1534,7 @@ def amdsmi_dev_set_fan_speed( fan_speed = ctypes.c_uint64(fan_speed) _check_res( - amdsmi_wrapper.amdsmi_dev_set_fan_speed( + amdsmi_wrapper.amdsmi_set_gpu_fan_speed( processor_handle, sensor_idx, fan_speed) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 3d46b55057..b500b24353 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1505,9 +1505,9 @@ amdsmi_get_gpu_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_t amdsmi_reset_gpu_fan = _libraries['libamd_smi.so'].amdsmi_reset_gpu_fan amdsmi_reset_gpu_fan.restype = amdsmi_status_t amdsmi_reset_gpu_fan.argtypes = [amdsmi_processor_handle, uint32_t] -amdsmi_dev_set_fan_speed = _libraries['libamd_smi.so'].amdsmi_dev_set_fan_speed -amdsmi_dev_set_fan_speed.restype = amdsmi_status_t -amdsmi_dev_set_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] +amdsmi_set_gpu_fan_speed = _libraries['libamd_smi.so'].amdsmi_set_gpu_fan_speed +amdsmi_set_gpu_fan_speed.restype = amdsmi_status_t +amdsmi_set_gpu_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] amdsmi_dev_get_busy_percent = _libraries['libamd_smi.so'].amdsmi_dev_get_busy_percent amdsmi_dev_get_busy_percent.restype = amdsmi_status_t amdsmi_dev_get_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] @@ -1875,7 +1875,7 @@ __all__ = \ 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', 'amdsmi_reset_gpu_fan', 'amdsmi_dev_reset_gpu', 'amdsmi_dev_reset_xgmi_error', 'amdsmi_dev_set_clk_freq', - 'amdsmi_dev_set_clk_range', 'amdsmi_dev_set_fan_speed', + 'amdsmi_dev_set_clk_range', 'amdsmi_set_gpu_fan_speed', 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', 'amdsmi_dev_set_overdrive_level', 'amdsmi_dev_set_overdrive_level_v1', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 7f59a32f73..17b18db529 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -351,7 +351,7 @@ class Formatter: | """ + self.style.text("62 Set dev clk range. Api: amdsmi_dev_set_clk_range ") + """ | | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_dev_counter_group_supported ") + """ | | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | - | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_dev_set_fan_speed ") + """ | + | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_set_gpu_fan_speed ") + """ | | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_dev_set_clk_freq ") + """ | | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_dev_reset_gpu ") + """ | | """ + self.style.text("68 Set dev od clk info. Api: amdsmi_dev_set_od_clk_info ") + """ | @@ -474,7 +474,7 @@ def amdsmi_tool_dev_fan_reset(dev, dic): def amdsmi_tool_dev_fan_speed_set(dev, dic): sensor_idx = dic["sensor_idx"] fan_speed = dic["fan_speed"] - return smi_api.amdsmi_dev_set_fan_speed(dev, sensor_idx, fan_speed) + return smi_api.amdsmi_set_gpu_fan_speed(dev, sensor_idx, fan_speed) def amdsmi_tool_dev_overdrive_level_set(dev, dic): overdrive_value = dic["overdrive_value"] diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 6f606e757c..1ea5ff7788 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -501,7 +501,7 @@ amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, return rsmi_wrapper(rsmi_dev_fan_reset, processor_handle, sensor_ind); } -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_gpu_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t speed) { return rsmi_wrapper(rsmi_dev_fan_speed_set, processor_handle, sensor_ind, speed); @@ -948,7 +948,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_fan_speed_max_get", "amdsmi_get_gpu_fan_speed_max"}, {"rsmi_dev_temp_metric_get", " amdsmi_get_temp_metric"}, {"rsmi_dev_fan_reset", "amdsmi_reset_gpu_fan"}, - {"rsmi_dev_fan_speed_set", "amdsmi_dev_set_fan_speed"}, + {"rsmi_dev_fan_speed_set", "amdsmi_set_gpu_fan_speed"}, {"rsmi_dev_volt_metric_get", " amdsmi_get_gpu_volt_metric"} }; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc index ff901e8d37..1ca1313f8d 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/fan_read_write.cc @@ -136,7 +136,7 @@ void TestFanReadWrite::Run(void) { std::cout << "Setting fan speed to " << new_speed << std::endl; } - ret = amdsmi_dev_set_fan_speed(processor_handles_[dv_ind], 0, new_speed); + ret = amdsmi_set_gpu_fan_speed(processor_handles_[dv_ind], 0, new_speed); CHK_ERR_ASRT(ret) sleep(4); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 5977b36e09..1f00f4e6e6 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -233,7 +233,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_reset_gpu_fan(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_fan_speed(processor_handles_[0], dmy_ui32, 0); + ret = amdsmi_set_gpu_fan_speed(processor_handles_[0], dmy_ui32, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_perf_level(processor_handles_[0], &dmy_perf_lvl); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -277,7 +277,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_fan_speed amdsmi_get_gpu_fan_rpms amdsmi_reset_gpu_fan - amdsmi_dev_set_fan_speed + amdsmi_set_gpu_fan_speed amdsmi_get_gpu_fan_speed_max amdsmi_dev_get_od_volt_info amdsmi_dev_get_gpu_metrics_info From 5198a6f68b68b936ee2fbb0dbe6375a68e118e68 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:30:34 -0500 Subject: [PATCH 43/95] Renamed API amdsmi_dev_get_busy_percent to amdsmi_get_busy_percent grep -rli 'amdsmi_dev_get_busy_percent' * | xargs -i@ sed -i 's/amdsmi_dev_get_busy_percent/amdsmi_get_busy_percent/g' @ Change-Id: I02ff8f86d2e7a6c38e7f56d40a07b27e90835152 [ROCm/amdsmi commit: 575856eeee75b1dd4002bb22c388f4a331b15128] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e30e3d0d43..8ecec991ae 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2098,7 +2098,7 @@ amdsmi_status_t amdsmi_set_gpu_fan_speed(amdsmi_processor_handle processor_handl * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); +amdsmi_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); /** * @brief Get coarse grain utilization counter of the specified device diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 9bd56d763f..fc9d08a9ea 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1892,7 +1892,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_busy_percent +## amdsmi_get_busy_percent Description: Get percentage of time device is busy doing any processing Input parameters: @@ -1900,7 +1900,7 @@ Input parameters: Output: How busy the device is (as percentage of time) -Exceptions that can be thrown by `amdsmi_dev_get_busy_percent` function: +Exceptions that can be thrown by `amdsmi_get_busy_percent` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1913,7 +1913,7 @@ try: print("No GPUs on machine") else: for device in devices: - busy = amdsmi_dev_get_busy_percent(dev) + busy = amdsmi_get_busy_percent(dev) print(busy) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index f7d8131327..d82e4fa6f1 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -104,7 +104,7 @@ from .amdsmi_interface import amdsmi_get_temp_metric from .amdsmi_interface import amdsmi_get_gpu_volt_metric # # Clock, Power and Performance Query -from .amdsmi_interface import amdsmi_dev_get_busy_percent +from .amdsmi_interface import amdsmi_get_busy_percent from .amdsmi_interface import amdsmi_get_utilization_count from .amdsmi_interface import amdsmi_dev_get_perf_level from .amdsmi_interface import amdsmi_set_perf_determinism_mode diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 00519adf55..1b4fca79e4 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2165,7 +2165,7 @@ def amdsmi_get_gpu_volt_metric( return voltage.value -def amdsmi_dev_get_busy_percent( +def amdsmi_get_busy_percent( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2175,7 +2175,7 @@ def amdsmi_dev_get_busy_percent( busy_percent = ctypes.c_uint32() _check_res( - amdsmi_wrapper.amdsmi_dev_get_busy_percent( + amdsmi_wrapper.amdsmi_get_busy_percent( processor_handle, ctypes.byref(busy_percent) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index b500b24353..ff48c25e66 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1508,9 +1508,9 @@ amdsmi_reset_gpu_fan.argtypes = [amdsmi_processor_handle, uint32_t] amdsmi_set_gpu_fan_speed = _libraries['libamd_smi.so'].amdsmi_set_gpu_fan_speed amdsmi_set_gpu_fan_speed.restype = amdsmi_status_t amdsmi_set_gpu_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t] -amdsmi_dev_get_busy_percent = _libraries['libamd_smi.so'].amdsmi_dev_get_busy_percent -amdsmi_dev_get_busy_percent.restype = amdsmi_status_t -amdsmi_dev_get_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_busy_percent = _libraries['libamd_smi.so'].amdsmi_get_busy_percent +amdsmi_get_busy_percent.restype = amdsmi_status_t +amdsmi_get_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_get_utilization_count = _libraries['libamd_smi.so'].amdsmi_get_utilization_count amdsmi_get_utilization_count.restype = amdsmi_status_t amdsmi_get_utilization_count.argtypes = [amdsmi_processor_handle, struct_c__SA_amdsmi_utilization_counter_t * 0, uint32_t, ctypes.POINTER(ctypes.c_uint64)] @@ -1851,7 +1851,7 @@ __all__ = \ 'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t', 'amdsmi_dev_close_supported_func_iterator', 'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter', - 'amdsmi_dev_destroy_counter', 'amdsmi_dev_get_busy_percent', + 'amdsmi_dev_destroy_counter', 'amdsmi_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_get_energy_count', 'amdsmi_get_gpu_fan_rpms', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 17b18db529..a5ae279dfe 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -309,7 +309,7 @@ class Formatter: | """ + self.style.text("20 Get device fan speed max. Api: amdsmi_get_gpu_fan_speed_max ") + """ | | """ + self.style.text("21 Get device temp metric. Api: amdsmi_get_temp_metric ") + """ | | """ + self.style.text("22 Get device volt metric. Api: amdsmi_get_gpu_volt_metric ") + """ | - | """ + self.style.text("23 Get device busy percent. Api: amdsmi_dev_get_busy_percent ") + """ | + | """ + self.style.text("23 Get device busy percent. Api: amdsmi_get_busy_percent ") + """ | | """ + self.style.text("24 Get utilization count. Api: amdsmi_get_utilization_count ") + """ | | """ + self.style.text("25 Get device perf level. Api: amdsmi_dev_get_perf_level ") + """ | | """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_perf_determinism_mode ") + """ | @@ -792,7 +792,7 @@ commands = { 22: [amdsmi_tool_dev_volt_metric_get, { "device_identifier1": [None, True], }], - 23: [smi_api.amdsmi_dev_get_busy_percent, { + 23: [smi_api.amdsmi_get_busy_percent, { "device_identifier1": [None, True] }], 24: [amdsmi_tool_utilization_count_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 1ea5ff7788..202b54b2d5 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -908,7 +908,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_pci_bandwidth_set", " amdsmi_set_gpu_pci_bandwidth"}, {"rsmi_dev_power_profile_set", " amdsmi_set_gpu_power_profile"}, {"rsmi_dev_memory_busy_percent_get", "amdsmi_get_gpu_memory_busy_percent"}, - {"rsmi_dev_busy_percent_get", "amdsmi_dev_get_busy_percent"}, + {"rsmi_dev_busy_percent_get", "amdsmi_get_busy_percent"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_dev_overdrive_level_get", "amdsmi_dev_get_overdrive_level"}, {"rsmi_dev_power_profile_presets_get", " amdsmi_dev_get_power_profile_presets"}, @@ -1040,7 +1040,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle processor_han } amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_processor_handle processor_handle, +amdsmi_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc index 2ad6058ba9..636b0cec88 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/gpu_busy_read.cc @@ -99,7 +99,7 @@ void TestGPUBusyRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_busy_percent(processor_handles_[i], &val_ui32); + err = amdsmi_get_busy_percent(processor_handles_[i], &val_ui32); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_FILE_ERROR) { IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 1f00f4e6e6..17bcc667a2 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -292,7 +292,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_memory_total amdsmi_get_gpu_memory_usage amdsmi_get_gpu_memory_busy_percent - amdsmi_dev_get_busy_percent + amdsmi_get_busy_percent amdsmi_dev_vbios_version_get amdsmi_dev_serial_number_get amdsmi_get_gpu_pci_replay_counter From 611450052c57956f4ebd200f6522849f4465d7de Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:41:13 -0500 Subject: [PATCH 44/95] Renamed API amdsmi_dev_get_perf_level to amdsmi_get_gpu_perf_level grep -rli 'amdsmi_dev_get_perf_level' * | xargs -i@ sed -i 's/amdsmi_dev_get_perf_level/amdsmi_get_gpu_perf_level/g' @ Change-Id: I03ba35c943cf4e6182c910cc90c5f979b6dc13ee [ROCm/amdsmi commit: 3ce4fa3eece9f1f340ac1f3b870a66156f9d11bf] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/perf_determinism.cc | 4 ++-- .../tests/amd_smi_test/functional/perf_level_read.cc | 4 ++-- .../amd_smi_test/functional/perf_level_read_write.cc | 6 +++--- .../tests/amd_smi_test/functional/power_read_write.cc | 4 ++-- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 8ecec991ae..01caddfe2b 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2176,7 +2176,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle processor_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t *perf); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index fc9d08a9ea..a57384ccfe 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1959,7 +1959,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_perf_level +## amdsmi_get_gpu_perf_level Description: Get the performance level of the device with provided device handle Input parameters: @@ -1967,7 +1967,7 @@ Input parameters: Output: Performance level as enum value of dev_perf_level_t -Exceptions that can be thrown by `amdsmi_dev_get_perf_level` function: +Exceptions that can be thrown by `amdsmi_get_gpu_perf_level` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1980,7 +1980,7 @@ try: print("No GPUs on machine") else: for device in devices: - perf_level = amdsmi_dev_get_perf_level(dev) + perf_level = amdsmi_get_gpu_perf_level(dev) print(perf_level) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index d82e4fa6f1..3a0db953ea 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -106,7 +106,7 @@ from .amdsmi_interface import amdsmi_get_gpu_volt_metric # # Clock, Power and Performance Query from .amdsmi_interface import amdsmi_get_busy_percent from .amdsmi_interface import amdsmi_get_utilization_count -from .amdsmi_interface import amdsmi_dev_get_perf_level +from .amdsmi_interface import amdsmi_get_gpu_perf_level from .amdsmi_interface import amdsmi_set_perf_determinism_mode from .amdsmi_interface import amdsmi_dev_get_overdrive_level from .amdsmi_interface import amdsmi_dev_get_gpu_clk_freq diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 1b4fca79e4..9d3d677d34 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2229,7 +2229,7 @@ def amdsmi_get_utilization_count( return result -def amdsmi_dev_get_perf_level( +def amdsmi_get_gpu_perf_level( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2240,7 +2240,7 @@ def amdsmi_dev_get_perf_level( perf = amdsmi_wrapper.amdsmi_dev_perf_level_t() _check_res( - amdsmi_wrapper.amdsmi_dev_get_perf_level( + amdsmi_wrapper.amdsmi_get_gpu_perf_level( processor_handle, ctypes.byref(perf)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index ff48c25e66..14afd9dc80 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1520,9 +1520,9 @@ amdsmi_get_pcie_link_status.argtypes = [amdsmi_processor_handle, ctypes.POINTER( amdsmi_get_pcie_link_caps = _libraries['libamd_smi.so'].amdsmi_get_pcie_link_caps amdsmi_get_pcie_link_caps.restype = amdsmi_status_t amdsmi_get_pcie_link_caps.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_info_t)] -amdsmi_dev_get_perf_level = _libraries['libamd_smi.so'].amdsmi_dev_get_perf_level -amdsmi_dev_get_perf_level.restype = amdsmi_status_t -amdsmi_dev_get_perf_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_dev_perf_level_t)] +amdsmi_get_gpu_perf_level = _libraries['libamd_smi.so'].amdsmi_get_gpu_perf_level +amdsmi_get_gpu_perf_level.restype = amdsmi_status_t +amdsmi_get_gpu_perf_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_dev_perf_level_t)] amdsmi_set_perf_determinism_mode = _libraries['libamd_smi.so'].amdsmi_set_perf_determinism_mode amdsmi_set_perf_determinism_mode.restype = amdsmi_status_t amdsmi_set_perf_determinism_mode.argtypes = [amdsmi_processor_handle, uint64_t] @@ -1864,7 +1864,7 @@ __all__ = \ 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', '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_get_gpu_pci_throughput', 'amdsmi_get_gpu_perf_level', 'amdsmi_get_power_ave', 'amdsmi_dev_get_power_profile_presets', 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index a5ae279dfe..849e27b05b 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -311,7 +311,7 @@ class Formatter: | """ + self.style.text("22 Get device volt metric. Api: amdsmi_get_gpu_volt_metric ") + """ | | """ + self.style.text("23 Get device busy percent. Api: amdsmi_get_busy_percent ") + """ | | """ + self.style.text("24 Get utilization count. Api: amdsmi_get_utilization_count ") + """ | - | """ + self.style.text("25 Get device perf level. Api: amdsmi_dev_get_perf_level ") + """ | + | """ + self.style.text("25 Get device perf level. Api: amdsmi_get_gpu_perf_level ") + """ | | """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_perf_determinism_mode ") + """ | | """ + self.style.text("27 Get device overdrive level. Api: amdsmi_dev_get_overdrive_level ") + """ | | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_dev_get_gpu_clk_freq ") + """ | @@ -798,7 +798,7 @@ commands = { 24: [amdsmi_tool_utilization_count_get, { "device_identifier1": [None, True], }], - 25: [smi_api.amdsmi_dev_get_perf_level, { + 25: [smi_api.amdsmi_get_gpu_perf_level, { "device_identifier1": [None, True] }], 26: [amdsmi_tool_perf_determinism_mode_set, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 202b54b2d5..a2f9206f86 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -914,7 +914,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_power_profile_presets_get", " amdsmi_dev_get_power_profile_presets"}, {"rsmi_dev_perf_level_set", " amdsmi_dev_set_perf_level"}, {"rsmi_dev_perf_level_set_v1", " amdsmi_dev_set_perf_level_v1"}, - {"rsmi_dev_perf_level_get", "amdsmi_dev_get_perf_level"}, + {"rsmi_dev_perf_level_get", "amdsmi_get_gpu_perf_level"}, {"rsmi_perf_determinism_mode_set", "amdsmi_set_perf_determinism_mode"}, {"rsmi_dev_overdrive_level_set", " amdsmi_dev_set_overdrive_level"}, {"rsmi_dev_vbios_version_get", "amdsmi_get_gpu_vbios_info"}, @@ -1166,7 +1166,7 @@ amdsmi_status_t reserved, static_cast(profile)); } -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t *perf) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 17bcc667a2..790359641a 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -235,7 +235,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_set_gpu_fan_speed(processor_handles_[0], dmy_ui32, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_perf_level(processor_handles_[0], &dmy_perf_lvl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[0], &dmy_perf_lvl); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_overdrive_level(processor_handles_[0], &dmy_ui32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc index 77c45ae5ca..7c51d8e889 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc @@ -121,7 +121,7 @@ void TestPerfDeterminism::Run(void) { } return; } else { - ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << @@ -132,7 +132,7 @@ void TestPerfDeterminism::Run(void) { std::cout << "\t**Resetting performance determinism" << std::endl; err = amdsmi_dev_set_perf_level(processor_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);; CHK_ERR_ASRT(err) - ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc index 0b27f421c7..bb8d996120 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read.cc @@ -98,14 +98,14 @@ void TestPerfLevelRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); + err = amdsmi_get_gpu_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Performance Level:" << std::dec << (uint32_t)pfl << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_perf_level(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_perf_level(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc index 71ff372b89..c95727392c 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc @@ -101,7 +101,7 @@ void TestPerfLevelReadWrite::Run(void) { for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &orig_pfl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &orig_pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -127,7 +127,7 @@ void TestPerfLevelReadWrite::Run(void) { << " returned AMDSMI_STATUS_NOT_SUPPORTED" << std::endl; } else { CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << @@ -141,7 +141,7 @@ void TestPerfLevelReadWrite::Run(void) { } ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], orig_pfl); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc index 0cba5c0b83..6337ec5c45 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc @@ -176,7 +176,7 @@ void TestPowerReadWrite::Run(void) { CHK_ERR_ASRT(ret) amdsmi_dev_perf_level_t pfl; - ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_MANUAL); @@ -188,7 +188,7 @@ void TestPowerReadWrite::Run(void) { ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); + ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_AUTO); From b4ee3a5be9df16743b3dcfec58661a395a3c6107 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 08:43:44 -0500 Subject: [PATCH 45/95] Renamed API amdsmi_set_perf_determinism_mode to amdsmi_set_gpu_perf_determinism_mode grep -rli 'amdsmi_set_perf_determinism_mode' * | xargs -i@ sed -i 's/amdsmi_set_perf_determinism_mode/amdsmi_set_gpu_perf_determinism_mode/g' @ Change-Id: I81b3a9738d3063d49ee2ed09a4223ee174d8d904 [ROCm/amdsmi commit: 0d5be2949b65010657da319ff8caa991e5c9b680] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_interface.py | 8 ++++---- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/perf_determinism.cc | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 01caddfe2b..5255b4a112 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2197,7 +2197,7 @@ amdsmi_status_t amdsmi_get_gpu_perf_level(amdsmi_processor_handle processor_hand * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_set_perf_determinism_mode(amdsmi_processor_handle processor_handle, uint64_t clkvalue); +amdsmi_set_gpu_perf_determinism_mode(amdsmi_processor_handle processor_handle, uint64_t clkvalue); /** * @brief Get the overdrive percent associated with the device with provided diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index a57384ccfe..80e27fe3cc 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1985,7 +1985,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_set_perf_determinism_mode +## amdsmi_set_gpu_perf_determinism_mode Description: Enter performance determinism mode with provided device handle Input parameters: @@ -1994,7 +1994,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_set_perf_determinism_mode` function: +Exceptions that can be thrown by `amdsmi_set_gpu_perf_determinism_mode` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2007,7 +2007,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_set_perf_determinism_mode(device, 1333) + amdsmi_set_gpu_perf_determinism_mode(device, 1333) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 3a0db953ea..9a40aaae44 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -89,7 +89,7 @@ from .amdsmi_interface import amdsmi_dev_set_perf_level_v1 from .amdsmi_interface import amdsmi_dev_set_perf_level from .amdsmi_interface import amdsmi_dev_get_power_profile_presets from .amdsmi_interface import amdsmi_dev_reset_gpu -from .amdsmi_interface import amdsmi_set_perf_determinism_mode +from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_set_gpu_fan_speed from .amdsmi_interface import amdsmi_reset_gpu_fan from .amdsmi_interface import amdsmi_dev_set_clk_freq @@ -107,7 +107,7 @@ from .amdsmi_interface import amdsmi_get_gpu_volt_metric from .amdsmi_interface import amdsmi_get_busy_percent from .amdsmi_interface import amdsmi_get_utilization_count from .amdsmi_interface import amdsmi_get_gpu_perf_level -from .amdsmi_interface import amdsmi_set_perf_determinism_mode +from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_dev_get_overdrive_level from .amdsmi_interface import amdsmi_dev_get_gpu_clk_freq from .amdsmi_interface import amdsmi_dev_get_od_volt_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 9d3d677d34..a4e842686b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1502,7 +1502,7 @@ def amdsmi_dev_reset_gpu(processor_handle: amdsmi_wrapper.amdsmi_processor_handl _check_res(amdsmi_wrapper.amdsmi_dev_reset_gpu(processor_handle)) -def amdsmi_set_perf_determinism_mode( +def amdsmi_set_gpu_perf_determinism_mode( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_value: int ): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1514,7 +1514,7 @@ def amdsmi_set_perf_determinism_mode( clock_value = ctypes.c_uint64(clock_value) _check_res( - amdsmi_wrapper.amdsmi_set_perf_determinism_mode( + amdsmi_wrapper.amdsmi_set_gpu_perf_determinism_mode( processor_handle, clock_value) ) @@ -2253,7 +2253,7 @@ def amdsmi_get_gpu_perf_level( return result -def amdsmi_set_perf_determinism_mode( +def amdsmi_set_gpu_perf_determinism_mode( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clkvalue: int ) -> None: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2263,7 +2263,7 @@ def amdsmi_set_perf_determinism_mode( if not isinstance(clkvalue, int): raise AmdSmiParameterException(clkvalue, int) - _check_res(amdsmi_wrapper.amdsmi_set_perf_determinism_mode( + _check_res(amdsmi_wrapper.amdsmi_set_gpu_perf_determinism_mode( processor_handle, clkvalue)) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 14afd9dc80..767115f986 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1523,9 +1523,9 @@ amdsmi_get_pcie_link_caps.argtypes = [amdsmi_processor_handle, ctypes.POINTER(st amdsmi_get_gpu_perf_level = _libraries['libamd_smi.so'].amdsmi_get_gpu_perf_level amdsmi_get_gpu_perf_level.restype = amdsmi_status_t amdsmi_get_gpu_perf_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_dev_perf_level_t)] -amdsmi_set_perf_determinism_mode = _libraries['libamd_smi.so'].amdsmi_set_perf_determinism_mode -amdsmi_set_perf_determinism_mode.restype = amdsmi_status_t -amdsmi_set_perf_determinism_mode.argtypes = [amdsmi_processor_handle, uint64_t] +amdsmi_set_gpu_perf_determinism_mode = _libraries['libamd_smi.so'].amdsmi_set_gpu_perf_determinism_mode +amdsmi_set_gpu_perf_determinism_mode.restype = amdsmi_status_t +amdsmi_set_gpu_perf_determinism_mode.argtypes = [amdsmi_processor_handle, uint64_t] amdsmi_dev_get_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_get_overdrive_level amdsmi_dev_get_overdrive_level.restype = amdsmi_status_t amdsmi_dev_get_overdrive_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] @@ -1933,7 +1933,7 @@ __all__ = \ 'amdsmi_ras_err_state_t__enumvalues', 'amdsmi_read_counter', 'amdsmi_retired_page_record_t', 'amdsmi_set_event_notification_mask', - 'amdsmi_set_perf_determinism_mode', 'amdsmi_shut_down', + 'amdsmi_set_gpu_perf_determinism_mode', 'amdsmi_shut_down', 'amdsmi_socket_handle', 'amdsmi_status_string', 'amdsmi_status_t', 'amdsmi_status_t__enumvalues', 'amdsmi_stop_event_notification', 'amdsmi_sw_component_t', 'amdsmi_sw_component_t__enumvalues', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 849e27b05b..a8a41d66b1 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -312,7 +312,7 @@ class Formatter: | """ + self.style.text("23 Get device busy percent. Api: amdsmi_get_busy_percent ") + """ | | """ + self.style.text("24 Get utilization count. Api: amdsmi_get_utilization_count ") + """ | | """ + self.style.text("25 Get device perf level. Api: amdsmi_get_gpu_perf_level ") + """ | - | """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_perf_determinism_mode ") + """ | + | """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_gpu_perf_determinism_mode ") + """ | | """ + self.style.text("27 Get device overdrive level. Api: amdsmi_dev_get_overdrive_level ") + """ | | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_dev_get_gpu_clk_freq ") + """ | | """ + self.style.text("29 Get device od volt. Api: amdsmi_dev_get_od_volt_info ") + """ | @@ -450,7 +450,7 @@ def amdsmi_tool_utilization_count_get(dev): def amdsmi_tool_perf_determinism_mode_set(dev, dic): clock_value = dic["clock_value"] - return smi_api.amdsmi_set_perf_determinism_mode(dev, clock_value) + return smi_api.amdsmi_set_gpu_perf_determinism_mode(dev, clock_value) def amdsmi_tool_dev_power_profile_presets_get(dev, dic): sensor_idx = dic["sensor_idx"] diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index a2f9206f86..f8ec8b18c2 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -915,7 +915,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_perf_level_set", " amdsmi_dev_set_perf_level"}, {"rsmi_dev_perf_level_set_v1", " amdsmi_dev_set_perf_level_v1"}, {"rsmi_dev_perf_level_get", "amdsmi_get_gpu_perf_level"}, - {"rsmi_perf_determinism_mode_set", "amdsmi_set_perf_determinism_mode"}, + {"rsmi_perf_determinism_mode_set", "amdsmi_set_gpu_perf_determinism_mode"}, {"rsmi_dev_overdrive_level_set", " amdsmi_dev_set_overdrive_level"}, {"rsmi_dev_vbios_version_get", "amdsmi_get_gpu_vbios_info"}, {"rsmi_dev_od_volt_info_get", " amdsmi_dev_get_od_volt_info"}, @@ -1153,7 +1153,7 @@ amdsmi_status_t reinterpret_cast(status)); } -amdsmi_status_t amdsmi_set_perf_determinism_mode( +amdsmi_status_t amdsmi_set_gpu_perf_determinism_mode( amdsmi_processor_handle processor_handle, uint64_t clkvalue) { return rsmi_wrapper(rsmi_perf_determinism_mode_set, processor_handle, clkvalue); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc index 7c51d8e889..6769b0151f 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc @@ -114,7 +114,7 @@ void TestPerfDeterminism::Run(void) { clkvalue = (odv.curr_sclk_range.lower_bound/1000000) + 50; } - err = amdsmi_set_perf_determinism_mode(processor_handles_[i], clkvalue); + err = amdsmi_set_gpu_perf_determinism_mode(processor_handles_[i], clkvalue); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**Not supported on this machine" << std::endl; From 3600a7d27a29f176d12ae635b9215a35317a589b Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sun, 26 Feb 2023 20:49:38 -0500 Subject: [PATCH 46/95] Renamed from device handle to processor handle In comments device handle wording is changed to processor handle Change-Id: Ia88556ee45bc8f510ebae7a9544e53296cc77385 [ROCm/amdsmi commit: 76eca7892b4de3348019bfbb2da89fa8ad47aef0] --- projects/amdsmi/include/amd_smi/amdsmi.h | 364 +++++++++++------------ 1 file changed, 182 insertions(+), 182 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 5255b4a112..2ff71574e8 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1141,7 +1141,7 @@ typedef union { * @details This function initializes the library and the internal data structures, * including those corresponding to sources of information that SMI provides. * - * The @p init_flags decides which type of device + * The @p init_flags decides which type of processor * can be discovered by ::amdsmi_get_socket_handles(). AMDSMI_INIT_AMD_GPUS returns * sockets with AMD GPUS, and AMDSMI_INIT_AMD_GPUS | AMDSMI_INIT_AMD_CPUS returns * sockets with either AMD GPUS or CPUS. @@ -1179,8 +1179,8 @@ amdsmi_status_t amdsmi_shut_down(void); * @details Depends on what flag is passed to ::amdsmi_init. AMDSMI_INIT_AMD_GPUS * returns sockets with AMD GPUS, and AMDSMI_INIT_AMD_GPUS | AMDSMI_INIT_AMD_CPUS returns * sockets with either AMD GPUS or CPUS. - * The socket handles can be used to query the device handles in that socket, which - * will be used in other APIs to get device detail information or telemtries. + * The socket handles can be used to query the processor handles in that socket, which + * will be used in other APIs to get processor detail information or telemtries. * * @param[in,out] socket_count As input, the value passed * through this parameter is the number of ::amdsmi_socket_handle that @@ -1221,49 +1221,49 @@ amdsmi_status_t amdsmi_get_socket_info( char *name, size_t len); /** - * @brief Get the list of the device handles associated to a socket. + * @brief Get the list of the processor handles associated to a socket. * - * @details This function retrieves the device handles of a socket. The - * @p socket_handle must be provided for the device. A socket may have mulitple different - * type devices: An APU on a socket have both CPUs and GPUs. + * @details This function retrieves the processor handles of a socket. The + * @p socket_handle must be provided for the processor. A socket may have mulitple different + * type processors: An APU on a socket have both CPUs and GPUs. * Currently, only AMD GPUs are supported. * - * The number of device count is returned through @p device_count - * if @p processor_handles is NULL. Then the number of @p device_count can be pass - * as input to retrieval all devices on the socket to @p processor_handles. + * The number of processor count is returned through @p processor_count + * if @p processor_handles is NULL. Then the number of @p processor_count can be pass + * as input to retrieval all processors on the socket to @p processor_handles. * * @param[in] socket_handle The socket to query * - * @param[in,out] device_count As input, the value passed + * @param[in,out] processor_count As input, the value passed * through this parameter is the number of ::amdsmi_processor_handle's that * may be safely written to the memory pointed to by @p processor_handles. This is the - * limit on how many device handles will be written to @p processor_handles. On return, @p - * device_count will contain the number of device handles written to @p processor_handles, - * or the number of device handles that could have been written if enough memory had been + * limit on how many processor handles will be written to @p processor_handles. On return, @p + * processor_count will contain the number of processor handles written to @p processor_handles, + * or the number of processor handles that could have been written if enough memory had been * provided. - * If @p processor_handles is NULL, as output, @p device_count will contain - * how many devices are available to read for the socket. + * If @p processor_handles is NULL, as output, @p processor_count will contain + * how many processors are available to read for the socket. * * @param[in,out] processor_handles A pointer to a block of memory to which the * ::amdsmi_processor_handle values will be written. This value may be NULL. - * In this case, this function can be used to query how many devices are + * In this case, this function can be used to query how many processors are * available to read. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, - uint32_t *device_count, + uint32_t *processor_count, amdsmi_processor_handle* processor_handles); /** - * @brief Get the device type of the processor_handle + * @brief Get the processor type of the processor_handle * - * @details This function retrieves the device type. A processor_handle must be provided - * for that device. + * @details This function retrieves the processor type. A processor_handle must be provided + * for that processor. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * - * @param[out] processor_type a pointer to processor_type_t to which the device type + * @param[out] processor_type a pointer to processor_type_t to which the processor type * will be written. If this parameter is nullptr, this function will return * ::AMDSMI_STATUS_INVAL. * @@ -1273,14 +1273,14 @@ amdsmi_status_t amdsmi_get_processor_type(amdsmi_processor_handle processor_hand processor_type_t* processor_type); /** - * @brief Get device handle with the matching bdf. + * @brief Get processor handle with the matching bdf. * * @details Given bdf info @p bdf, this function will get - * the device handle with the matching bdf. + * the processor handle with the matching bdf. * - * @param[in] bdf The bdf to match with corresponding device handle. + * @param[in] bdf The bdf to match with corresponding processor handle. * - * @param[out] processor_handle device handle with the matching bdf. + * @param[out] processor_handle processor handle with the matching bdf. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ @@ -1298,7 +1298,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr * @brief Get the device id associated with the device with provided device * handler. * - * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p id, + * @details Given a processor handle @p processor_handle and a pointer to a uint32_t @p id, * this function will write the device id value to the uint64_t pointed to by * @p id. This ID is an identification of the type of device, so calling this * function for different devices will give the same value if they are kind @@ -1306,7 +1306,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr * one device from another. amdsmi_get_gpu_pci_id() should be used to get a * unique identifier. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] id a pointer to uint64_t to which the device id will be * written @@ -1322,7 +1322,7 @@ amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint /** * @brief Get the name string for a give vendor ID * - * @details Given a device handle @p processor_handle, a pointer to a caller provided + * @details Given a processor handle @p processor_handle, a pointer to a caller provided * char buffer @p name, and a length of this buffer @p len, this function will * write the name of the vendor (up to @p len characters) buffer @p name. The * @p id may be a device vendor or subsystem vendor ID. @@ -1333,7 +1333,7 @@ amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint * as a string. Updating the system name files can be accompplished with * "sudo update-pciids". * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] name a pointer to a caller provided char buffer to which the * name will be written @@ -1356,7 +1356,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_han /** * @brief Get the vram vendor string of a device. * - * @details This function retrieves the vram vendor name given a device handle + * @details This function retrieves the vram vendor name given a processor handle * @p processor_handle, a pointer to a caller provided * char buffer @p brand, and a length of this buffer @p len, this function * will write the vram vendor of the device (up to @p len characters) to the @@ -1366,7 +1366,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_han * contained within amdsmi_get_gpu_vram_vendor, then this function will return * the string 'unknown' instead of the vram vendor. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] brand a pointer to a caller provided char buffer to which the * vram vendor will be written @@ -1380,13 +1380,13 @@ amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_han /** * @brief Get the subsystem device id associated with the device with - * provided device handle. + * provided processor handle. * - * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p id, + * @details Given a processor handle @p processor_handle and a pointer to a uint32_t @p id, * this function will write the subsystem device id value to the uint64_t * pointed to by @p id. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] id a pointer to uint64_t to which the subsystem device id * will be written @@ -1402,7 +1402,7 @@ amdsmi_status_t amdsmi_get_gpu_subsystem_id(amdsmi_processor_handle processor_ha /** * @brief Get the name string for the device subsytem * - * @details Given a device handle @p processor_handle, a pointer to a caller provided + * @details Given a processor handle @p processor_handle, a pointer to a caller provided * char buffer @p name, and a length of this buffer @p len, this function * will write the name of the device subsystem (up to @p len characters) * to the buffer @p name. @@ -1413,7 +1413,7 @@ amdsmi_status_t amdsmi_get_gpu_subsystem_id(amdsmi_processor_handle processor_ha * ID as a string. Updating the system name files can be accompplished with * "sudo update-pciids". * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] name a pointer to a caller provided char buffer to which the * name will be written @@ -1436,10 +1436,10 @@ amdsmi_get_gpu_subsystem_name(amdsmi_processor_handle processor_handle, char *na /** * @brief Get the drm minor number associated with this device * - * @details Given a device handle @p processor_handle, find its render device file + * @details Given a processor handle @p processor_handle, find its render device file * /dev/dri/renderDN where N corresponds to its minor number. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] minor a pointer to a uint32_t into which minor number will * be copied @@ -1460,12 +1460,12 @@ amdsmi_get_gpu_drm_render_minor(amdsmi_processor_handle processor_handle, uint32 /** * @brief Get the list of possible PCIe bandwidths that are available. * - * @details Given a device handle @p processor_handle and a pointer to a to an + * @details Given a processor handle @p processor_handle and a pointer to a to an * ::amdsmi_pcie_bandwidth_t structure @p bandwidth, this function will fill in * @p bandwidth with the possible T/s values and associated number of lanes, * and indication of the current selection. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] bandwidth a pointer to a caller provided * ::amdsmi_pcie_bandwidth_t structure to which the frequency information will be @@ -1479,7 +1479,7 @@ amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pc /** * @brief Get the unique PCI device identifier associated for a device * - * @details Give a device handle @p processor_handle and a pointer to a uint64_t @p + * @details Give a processor handle @p processor_handle and a pointer to a uint64_t @p * bdfid, this function will write the Bus/Device/Function PCI identifier * (BDFID) associated with device @p processor_handle to the value pointed to by * @p bdfid. @@ -1497,7 +1497,7 @@ amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pc * | Device | [ 7: 3] | * | Function | [ 2: 0] | * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] bdfid a pointer to uint64_t to which the device bdfid value * will be written @@ -1513,12 +1513,12 @@ amdsmi_status_t amdsmi_get_gpu_pci_id(amdsmi_processor_handle processor_handle, /** * @brief Get the NUMA node associated with a device * - * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p + * @details Given a processor handle @p processor_handle and a pointer to a uint32_t @p * numa_node, this function will retrieve the NUMA node value associated * with device @p processor_handle and store the value at location pointed to by * @p numa_node. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] numa_node pointer to location where NUMA node value will * be written. @@ -1534,13 +1534,13 @@ amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity(amdsmi_processor_handle proces /** * @brief Get PCIe traffic information * - * @details Give a device handle @p processor_handle and pointers to a uint64_t's, @p + * @details Give a processor handle @p processor_handle and pointers to a uint64_t's, @p * sent, @p received and @p max_pkt_sz, this function will write the number * of bytes sent and received in 1 second to @p sent and @p received, * respectively. The maximum possible packet size will be written to * @p max_pkt_sz. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] sent a pointer to uint64_t to which the number of bytes sent * will be written in 1 second. If pointer is NULL, it will be ignored. @@ -1559,12 +1559,12 @@ amdsmi_status_t amdsmi_get_gpu_pci_throughput(amdsmi_processor_handle processor_ /** * @brief Get PCIe replay counter * - * @details Given a device handle @p processor_handle and a pointer to a uint64_t @p + * @details Given a processor handle @p processor_handle and a pointer to a uint64_t @p * counter, this function will write the sum of the number of NAK's received * by the GPU and the NAK's generated by the GPU to memory pointed to by @p * counter. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] counter a pointer to uint64_t to which the sum of the NAK's * received and generated by the GPU is written @@ -1589,7 +1589,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_replay_counter(amdsmi_processor_handle proce /** * @brief Control the set of allowed PCIe bandwidths that can be used. * - * @details Given a device handle @p processor_handle and a 64 bit bitmask @p bw_bitmask, + * @details Given a processor handle @p processor_handle and a 64 bit bitmask @p bw_bitmask, * this function will limit the set of allowable bandwidths. If a bit in @p * bw_bitmask has a value of 1, then the frequency (as ordered in an * ::amdsmi_frequencies_t returned by :: amdsmi_dev_get_gpu_clk_freq()) corresponding @@ -1606,7 +1606,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_replay_counter(amdsmi_processor_handle proce * * @note This function requires root access * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] bw_bitmask A bitmask indicating the indices of the * bandwidths that are to be enabled (1) and disabled (0). Only the lowest @@ -1626,16 +1626,16 @@ amdsmi_status_t amdsmi_set_gpu_pci_bandwidth(amdsmi_processor_handle processor_ */ /** - * @brief Get the average power consumption of a device + * @brief Get the average power consumption of a processor * * @details This function will write the current average power consumption * (in microwatts) to the uint64_t pointed to by @p power, for the given - * device handle @p processor_handle and a pointer to a uint64_t @p power + * processor handle @p processor_handle and a pointer to a uint64_t @p power * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. - * If a device has more than one sensor, it could be greater than 0. + * If a processor has more than one sensor, it could be greater than 0. * * @param[in,out] power a pointer to uint64_t to which the average power * consumption will be written @@ -1650,17 +1650,17 @@ amdsmi_status_t 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 - * device handle. + * @brief Get the energy accumulator counter of the processor with provided + * processor handle. * - * @details Given a device handle @p processor_handle, a pointer to a uint64_t + * @details Given a processor handle @p processor_handle, a pointer to a uint64_t * @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_get_power_ave() is an average of a short time. This function * accumulates all energy consumed. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * @param[in,out] counter_resolution resolution of the counter @p power in * micro Joules * @@ -1694,10 +1694,10 @@ amdsmi_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *powe * @p cap must be between the minimum and maximum power cap values set by the * system, which can be obtained from ::amdsmi_dev_power_cap_range_get. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. - * If a device has more than one sensor, it could be greater than 0. + * If a processor has more than one sensor, it could be greater than 0. * * @param[in] cap a uint64_t that indicates the desired power cap, in * microwatts @@ -1711,11 +1711,11 @@ amdsmi_status_t * @brief Set the power performance profile * * @details This function will attempt to set the current profile to the provided - * profile, given a device handle @p processor_handle and a @p profile. The provided + * profile, given a processor handle @p processor_handle and a @p profile. The provided * profile must be one of the currently supported profiles, as indicated by a * call to :: amdsmi_dev_get_power_profile_presets() * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] reserved Not currently used. Set to 0. * @@ -1739,11 +1739,11 @@ amdsmi_status_t /** * @brief Get the total amount of memory that exists * - * @details Given a device handle @p processor_handle, a type of memory @p mem_type, and + * @details Given a processor handle @p processor_handle, a type of memory @p mem_type, and * a pointer to a uint64_t @p total, this function will write the total amount * of @p mem_type memory that exists to the location pointed to by @p total. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] mem_type The type of memory for which the total amount will be * found @@ -1767,7 +1767,7 @@ amdsmi_get_gpu_memory_total(amdsmi_processor_handle processor_handle, amdsmi_mem * @details This function will write the amount of @p mem_type memory that * that is currently being used to the location pointed to by @p used. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] mem_type The type of memory for which the amount being used will * be found @@ -1792,7 +1792,7 @@ amdsmi_get_gpu_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_mem * @details This call will query the device @p processor_handle for the * number of bad pages (written to @p num_pages address). The results are * written to address held by the @p info pointer. - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * @param[out] num_pages Number of bad page records. * @param[out] info The results will be written to the * amdsmi_retired_page_record_t pointer. @@ -1805,7 +1805,7 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num /** * @brief Returns if RAS features are enabled or disabled for given block * - * @details Given a device handle @p processor_handle, this function queries the + * @details Given a processor handle @p processor_handle, this function queries the * state of RAS features for a specific block @p block. Result will be written * to address held by pointer @p state. * @@ -1829,11 +1829,11 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, /** * @brief Get percentage of time any device memory is being used * - * @details Given a device handle @p processor_handle, this function returns the + * @details Given a processor handle @p processor_handle, this function returns the * percentage of time that any device memory is being used for the specified * device. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] busy_percent a pointer to the uint32_t to which the busy * percent will be written @@ -1850,13 +1850,13 @@ amdsmi_get_gpu_memory_busy_percent(amdsmi_processor_handle processor_handle, uin /** * @brief Get information about reserved ("retired") memory pages * - * @details Given a device handle @p processor_handle, this function returns retired page - * information @p records corresponding to the device with the provided device + * @details Given a processor handle @p processor_handle, this function returns retired page + * information @p records corresponding to the device with the provided processor * handle @p processor_handle. The number of retired page records is returned through @p * num_pages. @p records may be NULL on input. In this case, the number of * records available for retrieval will be returned through @p num_pages. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] num_pages a pointer to a uint32. As input, the value passed * through this parameter is the number of ::amdsmi_retired_page_record_t's that @@ -1890,14 +1890,14 @@ amdsmi_get_gpu_memory_reserved_pages(amdsmi_processor_handle processor_handle, u */ /** - * @brief Get the fan speed in RPMs of the device with the specified device + * @brief Get the fan speed in RPMs of the device with the specified processor * handle and 0-based sensor index. * - * @details Given a device handle @p processor_handle and a pointer to a uint32_t + * @details Given a processor handle @p processor_handle and a pointer to a uint32_t * @p speed, this function will write the current fan speed in RPMs to the * uint32_t pointed to by @p speed * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1918,12 +1918,12 @@ amdsmi_status_t amdsmi_get_gpu_fan_rpms(amdsmi_processor_handle processor_handle * @brief Get the fan speed for the specified device as a value relative to * ::AMDSMI_MAX_FAN_SPEED * - * @details Given a device handle @p processor_handle and a pointer to a uint32_t + * @details Given a processor handle @p processor_handle and a pointer to a uint32_t * @p speed, this function will write the current fan speed (a value * between 0 and the maximum fan speed, ::AMDSMI_MAX_FAN_SPEED) to the uint32_t * pointed to by @p speed * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1941,13 +1941,13 @@ amdsmi_status_t amdsmi_get_gpu_fan_speed(amdsmi_processor_handle processor_handl uint32_t sensor_ind, int64_t *speed); /** - * @brief Get the max. fan speed of the device with provided device handle. + * @brief Get the max. fan speed of the device with provided processor handle. * - * @details Given a device handle @p processor_handle and a pointer to a uint32_t + * @details Given a processor handle @p processor_handle and a pointer to a uint32_t * @p max_speed, this function will write the maximum fan speed possible to * the uint32_t pointed to by @p max_speed * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1968,12 +1968,12 @@ amdsmi_status_t amdsmi_get_gpu_fan_speed_max(amdsmi_processor_handle processor_h * @brief Get the temperature metric value for the specified metric, from the * specified temperature sensor on the specified device. * - * @details Given a device handle @p processor_handle, a sensor type @p sensor_type, a + * @details Given a processor handle @p processor_handle, a sensor type @p sensor_type, a * ::amdsmi_temperature_metric_t @p metric and a pointer to an int64_t @p * temperature, this function will write the value of the metric indicated by * @p metric and @p sensor_type to the memory location @p temperature. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_type part of device from which temperature should be * obtained. This should come from the enum ::amdsmi_temperature_type_t @@ -1998,12 +1998,12 @@ amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle * @brief Get the voltage metric value for the specified metric, from the * specified voltage sensor on the specified device. * - * @details Given a device handle @p processor_handle, a sensor type @p sensor_type, a + * @details Given a processor handle @p processor_handle, a sensor type @p sensor_type, a * ::amdsmi_voltage_metric_t @p metric and a pointer to an int64_t @p * voltage, this function will write the value of the metric indicated by * @p metric and @p sensor_type to the memory location @p voltage. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_type part of device from which voltage should be * obtained. This should come from the enum ::amdsmi_voltage_type_t @@ -2037,7 +2037,7 @@ amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_ha * * @details This function returns control of the fan to the system * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -2050,14 +2050,14 @@ amdsmi_status_t amdsmi_reset_gpu_fan(amdsmi_processor_handle processor_handle, u * @brief Set the fan speed for the specified device with the provided speed, * in RPMs. * - * @details Given a device handle @p processor_handle and a integer value indicating + * @details Given a processor handle @p processor_handle and a integer value indicating * speed @p speed, this function will attempt to set the fan speed to @p speed. * An error will be returned if the specified speed is outside the allowable * range for the device. The maximum value is 255 and the minimum is 0. * * @note This function requires root access * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -2081,12 +2081,12 @@ amdsmi_status_t amdsmi_set_gpu_fan_speed(amdsmi_processor_handle processor_handl /** * @brief Get percentage of time device is busy doing any processing * - * @details Given a device handle @p processor_handle, this function returns the + * @details Given a processor handle @p processor_handle, this function returns the * percentage of time that the specified device is busy. The device is * considered busy if any one or more of its sub-blocks are working, and idle * if none of the sub-blocks are working. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] busy_percent a pointer to the uint32_t to which the busy * percent will be written @@ -2103,14 +2103,14 @@ amdsmi_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy /** * @brief Get coarse grain utilization counter of the specified device * - * @details Given a device handle @p processor_handle, the array of the utilization counters, + * @details Given a processor handle @p processor_handle, the array of the utilization counters, * the size of the array, this function returns the coarse grain utilization counters * and timestamp. * The counter is the accumulated percentages. Every milliseconds the firmware calculates * % busy count and then accumulates that value in the counter. This provides minimally * invasive coarse grain GPU usage information. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] utilization_counters Multiple utilization counters can be retreived with a single * call. The caller must allocate enough space to the utilization_counters array. The caller also @@ -2131,12 +2131,12 @@ amdsmi_get_utilization_count(amdsmi_processor_handle processor_handle, uint64_t *timestamp); /** - * @brief Get current PCIE info of the device with provided device handle. + * @brief Get current PCIE info of the device with provided processor handle. * - * @details Given a device handle @p processor_handle, this function returns PCIE info of the + * @details Given a processor handle @p processor_handle, this function returns PCIE info of the * given device. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[out] info amdsmi_pcie_info_t struct which will hold all the extracted PCIE info data. * @@ -2145,12 +2145,12 @@ amdsmi_get_utilization_count(amdsmi_processor_handle processor_handle, amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info); /** - * @brief Get max PCIe capabilities of the device with provided device handle. + * @brief Get max PCIe capabilities of the device with provided processor handle. * - * @details Given a device handle @p processor_handle, this function returns PCIe caps info of the + * @details Given a processor handle @p processor_handle, this function returns PCIe caps info of the * given device. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[out] info amdsmi_pcie_info_t struct which will hold all the extracted PCIe caps data. * @@ -2162,10 +2162,10 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle processor_hand * @brief Get the performance level of the device * * @details This function will write the ::amdsmi_dev_perf_level_t to the uint32_t - * pointed to by @p perf, for a given device handle @p processor_handle and a pointer + * pointed to by @p perf, for a given processor handle @p processor_handle and a pointer * to a uint32_t @p perf. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] perf a pointer to ::amdsmi_dev_perf_level_t to which the * performance level will be written @@ -2180,9 +2180,9 @@ amdsmi_status_t amdsmi_get_gpu_perf_level(amdsmi_processor_handle processor_hand amdsmi_dev_perf_level_t *perf); /** - * @brief Enter performance determinism mode with provided device handle. + * @brief Enter performance determinism mode with provided processor handle. * - * @details Given a device handle @p processor_handle and @p clkvalue this function + * @details Given a processor handle @p processor_handle and @p clkvalue this function * will enable performance determinism mode, which enforces a GFXCLK frequency * SoftMax limit per GPU set by the user. This prevents the GFXCLK PLL from * stretching when running the same workload on different GPUS, making @@ -2190,7 +2190,7 @@ amdsmi_status_t amdsmi_get_gpu_perf_level(amdsmi_processor_handle processor_hand * level ::amdsmi_dev_perf_level_t of the device being * ::AMDSMI_DEV_PERF_LEVEL_DETERMINISM. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] clkvalue Softmax value for GFXCLK in MHz. * @@ -2201,13 +2201,13 @@ amdsmi_set_gpu_perf_determinism_mode(amdsmi_processor_handle processor_handle, u /** * @brief Get the overdrive percent associated with the device with provided - * device handle. + * processor handle. * - * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p od, + * @details Given a processor handle @p processor_handle and a pointer to a uint32_t @p od, * this function will write the overdrive percentage to the uint32_t pointed * to by @p od * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] od a pointer to uint32_t to which the overdrive percentage * will be written @@ -2225,12 +2225,12 @@ amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle processor * @brief Get the list of possible system clock speeds of device for a * specified clock type. * - * @details Given a device handle @p processor_handle, a clock type @p clk_type, and a + * @details Given a processor handle @p processor_handle, a clock type @p clk_type, and a * pointer to a to an ::amdsmi_frequencies_t structure @p f, this function will * fill in @p f with the possible clock speeds, and indication of the current * clock speed selection. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] clk_type the type of clock for which the frequency is desired * @@ -2244,11 +2244,11 @@ amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_h amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f); /** - * @brief Reset the gpu associated with the device with provided device handle + * @brief Reset the gpu associated with the device with provided processor handle * - * @details Given a device handle @p processor_handle, this function will reset the GPU + * @details Given a processor handle @p processor_handle, this function will reset the GPU * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ @@ -2257,11 +2257,11 @@ amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle processor_handle); /** * @brief This function retrieves the voltage/frequency curve information * - * @details Given a device handle @p processor_handle and a pointer to a + * @details Given a processor handle @p processor_handle and a pointer to a * ::amdsmi_od_volt_freq_data_t structure @p odv, this function will populate @p * odv. See ::amdsmi_od_volt_freq_data_t for more details. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] odv a pointer to an ::amdsmi_od_volt_freq_data_t structure * If this parameter is nullptr, this function will return @@ -2277,11 +2277,11 @@ amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_h /** * @brief This function retrieves the gpu metrics information * - * @details Given a device handle @p processor_handle and a pointer to a + * @details Given a processor handle @p processor_handle and a pointer to a * ::amdsmi_gpu_metrics_t structure @p pgpu_metrics, this function will populate * @p pgpu_metrics. See ::amdsmi_gpu_metrics_t for more details. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] pgpu_metrics a pointer to an ::amdsmi_gpu_metrics_t structure * If this parameter is nullptr, this function will return @@ -2297,11 +2297,11 @@ amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle process /** * @brief This function sets the clock range information * - * @details Given a device handle @p processor_handle, a minimum clock value @p minclkvalue, + * @details Given a processor handle @p processor_handle, a minimum clock value @p minclkvalue, * a maximum clock value @p maxclkvalue and a clock type @p clkType this function * will set the sclk|mclk range * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] minclkvalue value to apply to the clock range. Frequency values * are in MHz. @@ -2320,11 +2320,11 @@ amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle processor_handl /** * @brief This function sets the clock frequency information * - * @details Given a device handle @p processor_handle, a frequency level @p level, + * @details Given a processor handle @p processor_handle, a frequency level @p level, * a clock value @p clkvalue and a clock type @p clkType this function * will set the sclk|mclk range * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] level AMDSMI_FREQ_IND_MIN|AMDSMI_FREQ_IND_MAX to set the * minimum (0) or maximum (1) speed. @@ -2343,10 +2343,10 @@ amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle processor_ha /** * @brief This function sets 1 of the 3 voltage curve points. * - * @details Given a device handle @p processor_handle, a voltage point @p vpoint + * @details Given a processor handle @p processor_handle, a voltage point @p vpoint * and a voltage value @p voltvalue this function will set voltage curve point * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] vpoint voltage point [0|1|2] on the voltage curve * @@ -2365,7 +2365,7 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_h * @brief This function will retrieve the current valid regions in the * frequency/voltage space. * - * @details Given a device handle @p processor_handle, a pointer to an unsigned integer + * @details Given a processor handle @p processor_handle, a pointer to an unsigned integer * @p num_regions and a buffer of ::amdsmi_freq_volt_region_t structures, @p * buffer, this function will populate @p buffer with the current * frequency-volt space regions. The caller should assign @p buffer to memory @@ -2376,7 +2376,7 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_h * The number of regions to expect this function provide (@p num_regions) can * be obtained by calling :: amdsmi_dev_get_od_volt_info(). * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] num_regions As input, this is the number of * ::amdsmi_freq_volt_region_t structures that can be written to @p buffer. As @@ -2403,7 +2403,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle pr * @brief Get the list of available preset power profiles and an indication of * which profile is currently active. * - * @details Given a device handle @p processor_handle and a pointer to a + * @details Given a processor handle @p processor_handle and a pointer to a * ::amdsmi_power_profile_status_t @p status, this function will set the bits of * the ::amdsmi_power_profile_status_t.available_profiles bit field of @p status to * 1 if the profile corresponding to the respective @@ -2416,7 +2416,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle pr * ::amdsmi_power_profile_status_t.current will be set to the * ::amdsmi_power_profile_preset_masks_t of the profile that is currently active. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -2445,18 +2445,18 @@ amdsmi_status_t /** * @brief Set the PowerPlay performance level associated with the device with - * provided device handle with the provided value. + * provided processor handle with the provided value. * * @deprecated :: amdsmi_dev_set_perf_level_v1() is preferred, with an * interface that more closely matches the rest of the amd_smi API. * - * @details Given a device handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p + * @details Given a processor handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p * perf_level, this function will set the PowerPlay performance level for the * device to the value @p perf_lvl. * * @note This function requires root access * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] perf_lvl the value to which the performance level should be set * @@ -2467,15 +2467,15 @@ amdsmi_status_t /** * @brief Set the PowerPlay performance level associated with the device with - * provided device handle with the provided value. + * provided processor handle with the provided value. * - * @details Given a device handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p + * @details Given a processor handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p * perf_level, this function will set the PowerPlay performance level for the * device to the value @p perf_lvl. * * @note This function requires root access * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] perf_lvl the value to which the performance level should be set * @@ -2486,13 +2486,13 @@ amdsmi_status_t /** * @brief Set the overdrive percent associated with the device with provided - * device handle with the provided value. See details for WARNING. + * processor handle with the provided value. See details for WARNING. * * @deprecated This function is deprecated. :: amdsmi_dev_set_overdrive_level_v1 * has the same functionaltiy, with an interface that more closely * matches the rest of the amd_smi API. * - * @details Given a device handle @p processor_handle and an overdrive level @p od, + * @details Given a processor handle @p processor_handle and an overdrive level @p od, * this function will set the overdrive level for the device to the value * @p od. The overdrive level is an integer value between 0 and 20, inclusive, * which represents the overdrive percentage; e.g., a value of 5 specifies @@ -2517,7 +2517,7 @@ amdsmi_status_t * WARRANTY AND MAY NOT BE COVERED BY YOUR BOARD OR SYSTEM MANUFACTURER'S * WARRANTY. Please use this utility with caution. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] od the value to which the overdrive level should be set * @@ -2527,9 +2527,9 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle processo /** * @brief Set the overdrive percent associated with the device with provided - * device handle with the provided value. See details for WARNING. + * processor handle with the provided value. See details for WARNING. * - * @details Given a device handle @p processor_handle and an overdrive level @p od, + * @details Given a processor handle @p processor_handle and an overdrive level @p od, * this function will set the overdrive level for the device to the value * @p od. The overdrive level is an integer value between 0 and 20, inclusive, * which represents the overdrive percentage; e.g., a value of 5 specifies @@ -2556,7 +2556,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle processo * * @note This function requires root access * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] od the value to which the overdrive level should be set * @@ -2568,7 +2568,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle proce * @brief Control the set of allowed frequencies that can be used for the * specified clock. * - * @details Given a device handle @p processor_handle, a clock type @p clk_type, and a + * @details Given a processor handle @p processor_handle, a clock type @p clk_type, and a * 64 bit bitmask @p freq_bitmask, this function will limit the set of * allowable frequencies. If a bit in @p freq_bitmask has a value of 1, then * the frequency (as ordered in an ::amdsmi_frequencies_t returned by @@ -2585,7 +2585,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle proce * * @note This function requires root access * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] clk_type the type of clock for which the set of frequencies * will be modified @@ -2661,12 +2661,12 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, /** * @brief Retrieve the error counts for a GPU block * - * @details Given a device handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and a + * @details Given a processor handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and a * pointer to an ::amdsmi_error_count_t @p ec, this function will write the error * count values for the GPU block indicated by @p block to memory pointed to by * @p ec. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] block The block for which error counts should be retrieved * @@ -2685,7 +2685,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_hand /** * @brief Retrieve the enabled ECC bit-mask * - * @details Given a device handle @p processor_handle, and a pointer to a uint64_t @p + * @details Given a processor handle @p processor_handle, and a pointer to a uint64_t @p * enabled_mask, this function will write bits to memory pointed to by * @p enabled_blocks. Upon a successful call, @p enabled_blocks can then be * AND'd with elements of the ::amdsmi_gpu_block_t ennumeration to determine if @@ -2695,7 +2695,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_hand * but there may not be kernel support for reading error counters for that * block. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] enabled_blocks A pointer to a uint64_t to which the enabled * blocks bits will be written. @@ -2712,12 +2712,12 @@ amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle processor_ha /** * @brief Retrieve the ECC status for a GPU block * - * @details Given a device handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and + * @details Given a processor handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and * a pointer to an ::amdsmi_ras_err_state_t @p state, this function will write * the current state for the GPU block indicated by @p block to memory pointed * to by @p state. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] block The block for which error counts should be retrieved * @@ -2856,11 +2856,11 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); /** * @brief Tell if an event group is supported by a given device * - * @details Given a device handle @p processor_handle and an event group specifier @p + * @details Given a processor handle @p processor_handle and an event group specifier @p * group, tell if @p group type events are supported by the device associated * with @p processor_handle * - * @param[in] processor_handle device handle of device being queried + * @param[in] processor_handle processor handle of device being queried * * @param[in] group ::amdsmi_event_group_t identifier of group for which support * is being queried @@ -2874,14 +2874,14 @@ amdsmi_dev_counter_group_supported(amdsmi_processor_handle processor_handle, amd * @brief Create a performance counter object * * @details Create a performance counter object of type @p type for the device - * with a device handle of @p processor_handle, and write a handle to the object to the + * with a processor handle of @p processor_handle, and write a handle to the object to the * memory location pointed to by @p evnt_handle. @p evnt_handle can be used * with other performance event operations. The handle should be deallocated * with ::amdsmi_dev_destroy_counter() when no longer needed. * * @note This function requires root access * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] type the ::amdsmi_event_type_t of performance event to create * @@ -2956,12 +2956,12 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, /** * @brief Get the number of currently available counters * - * @details Given a device handle @p processor_handle, a performance event group @p grp, + * @details Given a processor handle @p processor_handle, a performance event group @p grp, * and a pointer to a uint32_t @p available, this function will write the * number of @p grp type counters that are available on the device with handle * @p processor_handle to the memory that @p available points to. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in] grp an event device group * @@ -3076,12 +3076,12 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, /** * @brief Retrieve the XGMI error status for a device * - * @details Given a device handle @p processor_handle, and a pointer to an + * @details Given a processor handle @p processor_handle, and a pointer to an * ::amdsmi_xgmi_status_t @p status, this function will write the current XGMI * error state ::amdsmi_xgmi_status_t for the device @p processor_handle to the memory * pointed to by @p status. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] status A pointer to an ::amdsmi_xgmi_status_t to which the * XGMI error state should be written @@ -3098,11 +3098,11 @@ amdsmi_dev_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xg /** * @brief Reset the XGMI error status for a device * - * @details Given a device handle @p processor_handle, this function will reset the + * @details Given a processor handle @p processor_handle, this function will reset the * current XGMI error state ::amdsmi_xgmi_status_t for the device @p processor_handle to * amdsmi_xgmi_status_t::AMDSMI_XGMI_STATUS_NO_ERRORS * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ @@ -3120,12 +3120,12 @@ amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle processor_handle); /** * @brief Retrieve the NUMA CPU node number for a device * - * @details Given a device handle @p processor_handle, and a pointer to an + * @details Given a processor handle @p processor_handle, and a pointer to an * uint32_t @p numa_node, this function will write the * node number of NUMA CPU for the device @p processor_handle to the memory * pointed to by @p numa_node. * - * @param[in] processor_handle a device handle + * @param[in] processor_handle a processor handle * * @param[in,out] numa_node A pointer to an uint32_t to which the * numa node number should be written. @@ -3138,15 +3138,15 @@ amdsmi_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint3 /** * @brief Retrieve the weight for a connection between 2 GPUs * - * @details Given a source device handle @p processor_handle_src and - * a destination device handle @p processor_handle_dst, and a pointer to an + * @details Given a source processor handle @p processor_handle_src and + * a destination processor handle @p processor_handle_dst, and a pointer to an * uint64_t @p weight, this function will write the * weight for the connection between the device @p processor_handle_src * and @p processor_handle_dst to the memory pointed to by @p weight. * - * @param[in] processor_handle_src the source device handle + * @param[in] processor_handle_src the source processor handle * - * @param[in] processor_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination processor handle * * @param[in,out] weight A pointer to an uint64_t to which the * weight for the connection should be written. @@ -3160,15 +3160,15 @@ amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi /** * @brief Retreive minimal and maximal io link bandwidth between 2 GPUs * - * @details Given a source device handle @p processor_handle_src and - * a destination device handle @p processor_handle_dst, pointer to an + * @details Given a source processor handle @p processor_handle_src and + * a destination processor handle @p processor_handle_dst, pointer to an * uint64_t @p min_bandwidth, and a pointer to uint64_t @p max_bandiwidth, * this function will write theoretical minimal and maximal bandwidth limits. * API works if src and dst are connected via xgmi and have 1 hop distance. * - * @param[in] processor_handle_src the source device handle + * @param[in] processor_handle_src the source processor handle * - * @param[in] processor_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination processor handle * * @param[in,out] min_bandwidth A pointer to an uint64_t to which the * minimal bandwidth for the connection should be written. @@ -3185,16 +3185,16 @@ amdsmi_status_t /** * @brief Retrieve the hops and the connection type between 2 GPUs * - * @details Given a source device handle @p processor_handle_src and - * a destination device handle @p processor_handle_dst, and a pointer to an + * @details Given a source processor handle @p processor_handle_src and + * a destination processor handle @p processor_handle_dst, and a pointer to an * uint64_t @p hops and a pointer to an AMDSMI_IO_LINK_TYPE @p type, * this function will write the number of hops and the connection type * between the device @p processor_handle_src and @p processor_handle_dst to the memory * pointed to by @p hops and @p type. * - * @param[in] processor_handle_src the source device handle + * @param[in] processor_handle_src the source processor handle * - * @param[in] processor_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination processor handle * * @param[in,out] hops A pointer to an uint64_t to which the * hops for the connection should be written. @@ -3212,15 +3212,15 @@ amdsmi_topo_get_link_type(amdsmi_processor_handle processor_handle_src, /** * @brief Return P2P availability status between 2 GPUs * - * @details Given a source device handle @p processor_handle_src and - * a destination device handle @p processor_handle_dst, and a pointer to a + * @details Given a source processor handle @p processor_handle_src and + * a destination processor handle @p processor_handle_dst, and a pointer to a * bool @p accessible, this function will write the P2P connection status * between the device @p processor_handle_src and @p processor_handle_dst to the memory * pointed to by @p accessible. * - * @param[in] processor_handle_src the source device handle + * @param[in] processor_handle_src the source processor handle * - * @param[in] processor_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination processor handle * * @param[in,out] accessible A pointer to a bool to which the status for * the P2P connection availablity should be written. @@ -3279,7 +3279,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * amdsmi_status_t err; * amdsmi_processor_handle device; * - * // Get the device handle via amdsmi_get_processor_handles() + * // Get the processor handle via amdsmi_get_processor_handles() * // ... ... * * std::cout << "Supported AMDSMI Functions:" << std::endl; * @@ -3347,7 +3347,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr /** * @brief Get a function name iterator of supported AMDSMI functions for a device * - * @details Given a device handle @p processor_handle, this function will write a function + * @details Given a processor handle @p processor_handle, this function will write a function * iterator handle to the caller-provided memory pointed to by @p handle. This * handle can be used to iterate through all the supported functions. * @@ -3357,7 +3357,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * ::amdsmi_dev_open_supported_func_iterator does not depend on hardware or * driver support and should always be supported. * - * @param[in] processor_handle a device handle of device for which support information is + * @param[in] processor_handle a processor handle of device for which support information is * requested * * @param[in,out] handle A pointer to caller-provided memory to which the @@ -3465,7 +3465,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, * may open files which will remain open until ::amdsmi_stop_event_notification() * is called. * - * @param processor_handle a device handle corresponding to the device on which to + * @param processor_handle a processor handle corresponding to the device on which to * listen for events * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail @@ -3476,12 +3476,12 @@ amdsmi_init_event_notification(amdsmi_processor_handle processor_handle); /** * @brief Specify which events to collect for a device * - * @details Given a device handle @p processor_handle and a @p mask consisting of + * @details Given a processor handle @p processor_handle and a @p mask consisting of * elements of ::amdsmi_evt_notification_type_t OR'd together, this function * will listen for the events specified in @p mask on the device * corresponding to @p processor_handle. * - * @param processor_handle a device handle corresponding to the device on which to + * @param processor_handle a processor handle corresponding to the device on which to * listen for events * * @param mask Bitmask generated by OR'ing 1 or more elements of @@ -3546,11 +3546,11 @@ amdsmi_status_t * notification for a GPU * * @details Any resources used by event notification for the GPU with - * device handle @p processor_handle will be free with this + * processor handle @p processor_handle will be free with this * function. This includes freeing any memory and closing file handles. This * should be called for every call to ::amdsmi_init_event_notification() * - * @param[in] processor_handle The device handle of the GPU for which event + * @param[in] processor_handle The processor handle of the GPU for which event * notification resources will be free * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail From 68665655d47498e4d22852fcc49b43ce0a7cb7cb Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sun, 26 Feb 2023 20:54:22 -0500 Subject: [PATCH 47/95] Renamed API amdsmi_dev_get_gpu_clk_freq It is renamed to amdsmi_get_clk_freq grep -rli 'amdsmi_dev_get_gpu_clk_freq' * | xargs -i@ sed -i 's/amdsmi_dev_get_gpu_clk_freq/amdsmi_get_clk_freq/g' @ Change-Id: Ia12dd1282ab501f17667cf9f1f9b7284c2648198 [ROCm/amdsmi commit: 56aa8059f8e44463a0caf1aed98e9c53b4e14f86] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/frequencies_read.cc | 6 +++--- .../amd_smi_test/functional/frequencies_read_write.cc | 8 ++++---- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 2ff71574e8..11c5230de4 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1592,7 +1592,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_replay_counter(amdsmi_processor_handle proce * @details Given a processor handle @p processor_handle and a 64 bit bitmask @p bw_bitmask, * this function will limit the set of allowable bandwidths. If a bit in @p * bw_bitmask has a value of 1, then the frequency (as ordered in an - * ::amdsmi_frequencies_t returned by :: amdsmi_dev_get_gpu_clk_freq()) corresponding + * ::amdsmi_frequencies_t returned by :: amdsmi_get_clk_freq()) corresponding * to that bit index will be allowed. * * This function will change the performance level to @@ -2240,7 +2240,7 @@ amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle processor * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f); /** @@ -2572,7 +2572,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle proce * 64 bit bitmask @p freq_bitmask, this function will limit the set of * allowable frequencies. If a bit in @p freq_bitmask has a value of 1, then * the frequency (as ordered in an ::amdsmi_frequencies_t returned by - * amdsmi_dev_get_gpu_clk_freq()) corresponding to that bit index will be + * amdsmi_get_clk_freq()) corresponding to that bit index will be * allowed. * * This function will change the performance level to diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 80e27fe3cc..3ab27093bb 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2038,7 +2038,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_gpu_clk_freq +## amdsmi_get_clk_freq Description: Get the list of possible system clock speeds of device for a specified clock type @@ -2054,7 +2054,7 @@ Field | Description `current`| The current frequency index `frequency`| List of frequencies, only the first num_supported frequencies are valid -Exceptions that can be thrown by ` amdsmi_dev_get_gpu_clk_freq` function: +Exceptions that can be thrown by ` amdsmi_get_clk_freq` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2067,7 +2067,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_get_gpu_clk_freq(device, AmdSmiClkType.SYS) + amdsmi_get_clk_freq(device, AmdSmiClkType.SYS) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 9a40aaae44..3d3c3e73e7 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -109,7 +109,7 @@ from .amdsmi_interface import amdsmi_get_utilization_count from .amdsmi_interface import amdsmi_get_gpu_perf_level from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_dev_get_overdrive_level -from .amdsmi_interface import amdsmi_dev_get_gpu_clk_freq +from .amdsmi_interface import amdsmi_get_clk_freq from .amdsmi_interface import amdsmi_dev_get_od_volt_info from .amdsmi_interface import amdsmi_dev_get_gpu_metrics_info from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index a4e842686b..650cd660bc 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2285,7 +2285,7 @@ def amdsmi_dev_get_overdrive_level( return od_level.value -def amdsmi_dev_get_gpu_clk_freq( +def amdsmi_get_clk_freq( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2297,7 +2297,7 @@ def amdsmi_dev_get_gpu_clk_freq( freq = amdsmi_wrapper.amdsmi_frequencies_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_gpu_clk_freq( + amdsmi_wrapper. amdsmi_get_clk_freq( processor_handle, clk_type, ctypes.byref(freq) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 767115f986..d1e1a09c42 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1529,9 +1529,9 @@ amdsmi_set_gpu_perf_determinism_mode.argtypes = [amdsmi_processor_handle, uint64 amdsmi_dev_get_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_get_overdrive_level amdsmi_dev_get_overdrive_level.restype = amdsmi_status_t amdsmi_dev_get_overdrive_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] -amdsmi_dev_get_gpu_clk_freq = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_clk_freq -amdsmi_dev_get_gpu_clk_freq.restype = amdsmi_status_t -amdsmi_dev_get_gpu_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)] +amdsmi_get_clk_freq = _libraries['libamd_smi.so'].amdsmi_get_clk_freq +amdsmi_get_clk_freq.restype = amdsmi_status_t +amdsmi_get_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)] amdsmi_dev_reset_gpu = _libraries['libamd_smi.so'].amdsmi_dev_reset_gpu amdsmi_dev_reset_gpu.restype = amdsmi_status_t amdsmi_dev_reset_gpu.argtypes = [amdsmi_processor_handle] @@ -1856,7 +1856,7 @@ __all__ = \ 'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', - 'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info', + 'amdsmi_get_clk_freq', 'amdsmi_dev_get_gpu_metrics_info', 'amdsmi_get_gpu_id', 'amdsmi_get_gpu_memory_busy_percent', 'amdsmi_get_gpu_memory_reserved_pages', 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index a8a41d66b1..4681501516 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -314,7 +314,7 @@ class Formatter: | """ + self.style.text("25 Get device perf level. Api: amdsmi_get_gpu_perf_level ") + """ | | """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_gpu_perf_determinism_mode ") + """ | | """ + self.style.text("27 Get device overdrive level. Api: amdsmi_dev_get_overdrive_level ") + """ | - | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_dev_get_gpu_clk_freq ") + """ | + | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_get_clk_freq ") + """ | | """ + self.style.text("29 Get device od volt. Api: amdsmi_dev_get_od_volt_info ") + """ | | """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_dev_get_gpu_metrics_info ") + """ | | """ + self.style.text("31 Get device od volt curve regions. Api: amdsmi_dev_get_od_volt_curve_regions ") + """ | @@ -493,7 +493,7 @@ def amdsmi_tool_dev_gpu_clk_freq_get(dev): result = {} for clock_type in smi_api.AmdSmiClkType: try: - value = smi_api. amdsmi_dev_get_gpu_clk_freq(dev, clock_type) + value = smi_api. amdsmi_get_clk_freq(dev, clock_type) result.update({clock_type.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(clock_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index f8ec8b18c2..ec3c88f36c 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -933,7 +933,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"}, {"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"}, {"rsmi_dev_memory_usage_get", "amdsmi_get_gpu_memory_usage"}, - {"rsmi_dev_gpu_clk_freq_get", " amdsmi_dev_get_gpu_clk_freq"}, + {"rsmi_dev_gpu_clk_freq_get", " amdsmi_get_clk_freq"}, {"rsmi_dev_gpu_clk_freq_set", " amdsmi_dev_set_clk_freq"}, {"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"}, {"rsmi_dev_ecc_count_get", " amdsmi_dev_get_ecc_count"}, @@ -1202,7 +1202,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_h } // TODO(bliu): other frequencies in amdsmi_clk_type_t -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc index c93bcd89b5..0cb51149e5 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read.cc @@ -116,12 +116,12 @@ void TestFrequenciesRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { auto freq_output = [&](amdsmi_clk_type_t t, const char *name) { - err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, &f); + err = amdsmi_get_clk_freq(processor_handles_[i], t, &f); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Get " << name << ": Not supported on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr); + err = amdsmi_get_clk_freq(processor_handles_[i], t, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) { std::cout << "\t**Get " << name << @@ -133,7 +133,7 @@ void TestFrequenciesRead::Run(void) { std::cout << f.num_supported << std::endl; print_frequencies(&f); // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr); + err = amdsmi_get_clk_freq(processor_handles_[i], t, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc index af7b3cb36b..6c76163a56 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc @@ -113,7 +113,7 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << amdsmi_clk << std::endl; if (amdsmi_clk == CLK_TYPE_PCIE) return false; - ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); + ret = amdsmi_get_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); std::cout << ret << std::endl; if (ret == AMDSMI_STATUS_NOT_SUPPORTED || @@ -166,7 +166,7 @@ void TestFrequenciesReadWrite::Run(void) { return; } CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); + ret = amdsmi_get_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); if (ret != AMDSMI_STATUS_SUCCESS) { return; } @@ -194,7 +194,7 @@ void TestFrequenciesReadWrite::Run(void) { freq_write(); CHK_ERR_ASRT(ret) #if 0 - ret = amdsmi_dev_get_gpu_clk_freq(dv_ind, amdsmi_clk, &f); + ret = amdsmi_get_clk_freq(dv_ind, amdsmi_clk, &f); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -218,7 +218,7 @@ void TestFrequenciesReadWrite::Run(void) { ret = amdsmi_dev_set_clk_freq(dv_ind, amdsmi_clk, freq_bitmask); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_gpu_clk_freq(dv_ind, amdsmi_clk, &f); + ret = amdsmi_get_clk_freq(dv_ind, amdsmi_clk, &f); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 790359641a..496d279d83 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -239,7 +239,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_overdrive_level(processor_handles_[0], &dmy_ui32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs); + ret = amdsmi_get_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_od_volt_info(processor_handles_[0], &dmy_od_volt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); From 9ceda84ee09c382982c72e4157ffcaf80b699861 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sun, 26 Feb 2023 20:57:22 -0500 Subject: [PATCH 48/95] Renamed API amdsmi_dev_set_clk_range It is renamed to amdsmi_set_gpu_clk_range grep -rli 'amdsmi_dev_set_clk_range' * | xargs -i@ sed -i 's/amdsmi_dev_set_clk_range/amdsmi_set_gpu_clk_range/g' @ Change-Id: Iebb8d702ad9e9bf1720b8f116e45c4de668a0360 [ROCm/amdsmi commit: 9aabaa0baf5f6290a04475b02d3f139279223633] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 11c5230de4..0a1a1852ed 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2313,7 +2313,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle process * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, +amdsmi_status_t amdsmi_set_gpu_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType); diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 3ab27093bb..8ec23e1da9 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1283,7 +1283,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_set_clk_range +## amdsmi_set_gpu_clk_range Description: This function sets the clock range information Input parameters: @@ -1294,7 +1294,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_set_clk_range` function: +Exceptions that can be thrown by `amdsmi_set_gpu_clk_range` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1307,7 +1307,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_clk_range(device, 0, 1000, AmdSmiClkType.AMDSMI_CLK_TYPE_SYS) + amdsmi_set_gpu_clk_range(device, 0, 1000, AmdSmiClkType.AMDSMI_CLK_TYPE_SYS) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 3d3c3e73e7..3162f11f4a 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -82,7 +82,7 @@ from .amdsmi_interface import amdsmi_get_func_iter_value from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_set_power_cap from .amdsmi_interface import amdsmi_set_gpu_power_profile -from .amdsmi_interface import amdsmi_dev_set_clk_range +from .amdsmi_interface import amdsmi_set_gpu_clk_range from .amdsmi_interface import amdsmi_dev_set_od_clk_info from .amdsmi_interface import amdsmi_dev_set_od_volt_info from .amdsmi_interface import amdsmi_dev_set_perf_level_v1 diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 650cd660bc..a0f17dab85 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1899,7 +1899,7 @@ def amdsmi_get_energy_count(processor_handle: amdsmi_wrapper.amdsmi_processor_ha } -def amdsmi_dev_set_clk_range( +def amdsmi_set_gpu_clk_range( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, min_clk_value: int, max_clk_value: int, @@ -1920,7 +1920,7 @@ def amdsmi_dev_set_clk_range( raise AmdSmiParameterException(clk_type, AmdSmiClkType) _check_res( - amdsmi_wrapper.amdsmi_dev_set_clk_range( + amdsmi_wrapper.amdsmi_set_gpu_clk_range( processor_handle, ctypes.c_uint64(min_clk_value), ctypes.c_uint64(max_clk_value), diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index d1e1a09c42..20c522a83e 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1541,9 +1541,9 @@ amdsmi_dev_get_od_volt_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER( amdsmi_dev_get_gpu_metrics_info = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_metrics_info amdsmi_dev_get_gpu_metrics_info.restype = amdsmi_status_t amdsmi_dev_get_gpu_metrics_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_metrics_t)] -amdsmi_dev_set_clk_range = _libraries['libamd_smi.so'].amdsmi_dev_set_clk_range -amdsmi_dev_set_clk_range.restype = amdsmi_status_t -amdsmi_dev_set_clk_range.argtypes = [amdsmi_processor_handle, uint64_t, uint64_t, amdsmi_clk_type_t] +amdsmi_set_gpu_clk_range = _libraries['libamd_smi.so'].amdsmi_set_gpu_clk_range +amdsmi_set_gpu_clk_range.restype = amdsmi_status_t +amdsmi_set_gpu_clk_range.argtypes = [amdsmi_processor_handle, uint64_t, uint64_t, amdsmi_clk_type_t] amdsmi_dev_set_od_clk_info = _libraries['libamd_smi.so'].amdsmi_dev_set_od_clk_info amdsmi_dev_set_od_clk_info.restype = amdsmi_status_t amdsmi_dev_set_od_clk_info.argtypes = [amdsmi_processor_handle, amdsmi_freq_ind_t, uint64_t, amdsmi_clk_type_t] @@ -1875,7 +1875,7 @@ __all__ = \ 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', 'amdsmi_reset_gpu_fan', 'amdsmi_dev_reset_gpu', 'amdsmi_dev_reset_xgmi_error', 'amdsmi_dev_set_clk_freq', - 'amdsmi_dev_set_clk_range', 'amdsmi_set_gpu_fan_speed', + 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', 'amdsmi_dev_set_overdrive_level', 'amdsmi_dev_set_overdrive_level_v1', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 4681501516..b38b7c341b 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -348,7 +348,7 @@ class Formatter: | """ + self.style.text("59 Get counter available counters. Api: amdsmi_counter_get_available_counters ") + """ | | """ + self.style.text("60 Get counter control. Api: amdsmi_control_counter ") + """ | | """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter ") + """ | - | """ + self.style.text("62 Set dev clk range. Api: amdsmi_dev_set_clk_range ") + """ | + | """ + self.style.text("62 Set dev clk range. Api: amdsmi_set_gpu_clk_range ") + """ | | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_dev_counter_group_supported ") + """ | | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_set_gpu_fan_speed ") + """ | @@ -620,7 +620,7 @@ def amdsmi_tool_dev_clk_range_set(dev, dic): max_clk = dic["max_clk"] for clock_type in smi_api.AmdSmiClkType: try: - value = smi_api.amdsmi_dev_set_clk_range(dev, min_clk, max_clk, clock_type) + value = smi_api.amdsmi_set_gpu_clk_range(dev, min_clk, max_clk, clock_type) result.update({clock_type.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(clock_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index ec3c88f36c..2e31c2930e 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1338,7 +1338,7 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_h vpoint, clkvalue, voltvalue); } -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_gpu_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType) { From 46b21f99d54a9dbd617a48588d02dfbee7171604 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sun, 26 Feb 2023 20:59:06 -0500 Subject: [PATCH 49/95] Renamed API amdsmi_dev_set_perf_level amdsmi_dev_set_perf_level -> amdsmi_set_gpu_perf_level amdsmi_dev_set_perf_level_v1 -> amdsmi_set_gpu_perf_level_v1 grep -rli 'amdsmi_dev_set_perf_level' * | xargs -i@ sed -i 's/amdsmi_dev_set_perf_level/amdsmi_set_gpu_perf_level/g' @ Change-Id: Ib37766938c9a808d971a49a24979ada8919a329e [ROCm/amdsmi commit: 40a1904ef97ed0fd6457a3806db4b248c1c55070] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 12 ++++++------ projects/amdsmi/py-interface/__init__.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_interface.py | 8 ++++---- projects/amdsmi/py-interface/amdsmi_wrapper.py | 16 ++++++++-------- projects/amdsmi/py-interface/rocm_smi_tool.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 8 ++++---- .../functional/frequencies_read_write.cc | 4 ++-- .../amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../amd_smi_test/functional/pci_read_write.cc | 2 +- .../amd_smi_test/functional/perf_determinism.cc | 2 +- .../functional/perf_level_read_write.cc | 4 ++-- .../amd_smi_test/functional/power_read_write.cc | 2 +- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 0a1a1852ed..8b6ead384c 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2447,7 +2447,7 @@ amdsmi_status_t * @brief Set the PowerPlay performance level associated with the device with * provided processor handle with the provided value. * - * @deprecated :: amdsmi_dev_set_perf_level_v1() is preferred, with an + * @deprecated :: amdsmi_set_gpu_perf_level_v1() is preferred, with an * interface that more closely matches the rest of the amd_smi API. * * @details Given a processor handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p @@ -2463,7 +2463,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_set_gpu_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the PowerPlay performance level associated with the device with @@ -2482,7 +2482,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_set_gpu_perf_level_v1(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the overdrive percent associated with the device with provided diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 8ec23e1da9..f8f1c8cfaf 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1719,7 +1719,7 @@ except AmdSmiException as e: -## amdsmi_dev_set_perf_level_v1 +## amdsmi_set_gpu_perf_level_v1 Description: Set the PowerPlay performance level associated with the device with provided device handle with the provided value @@ -1729,7 +1729,7 @@ Input parameters: Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_perf_level_v1` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_perf_level_v1` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1742,7 +1742,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_perf_level_v1(device, AmdSmiDevPerfLevel.AMDSMI_DEV_PERF_LEVEL_HIGH) + amdsmi_set_gpu_perf_level_v1(device, AmdSmiDevPerfLevel.AMDSMI_DEV_PERF_LEVEL_HIGH) except AmdSmiException as e: print(e) ``` @@ -2405,7 +2405,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_perf_level +## amdsmi_set_gpu_perf_level Description: Set a desired performance level for given device Input parameters: @@ -2414,7 +2414,7 @@ Input parameters: Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_perf_level` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_perf_level` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2427,7 +2427,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_perf_level(device, AmdSmiDevPerfLevel.STABLE_PEAK) + amdsmi_set_gpu_perf_level(device, AmdSmiDevPerfLevel.STABLE_PEAK) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 3162f11f4a..50a790a324 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -85,8 +85,8 @@ from .amdsmi_interface import amdsmi_set_gpu_power_profile from .amdsmi_interface import amdsmi_set_gpu_clk_range from .amdsmi_interface import amdsmi_dev_set_od_clk_info from .amdsmi_interface import amdsmi_dev_set_od_volt_info -from .amdsmi_interface import amdsmi_dev_set_perf_level_v1 -from .amdsmi_interface import amdsmi_dev_set_perf_level +from .amdsmi_interface import amdsmi_set_gpu_perf_level_v1 +from .amdsmi_interface import amdsmi_set_gpu_perf_level from .amdsmi_interface import amdsmi_dev_get_power_profile_presets from .amdsmi_interface import amdsmi_dev_reset_gpu from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index a0f17dab85..31e7a28839 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1452,7 +1452,7 @@ def amdsmi_counter_get_available_counters( return available.value -def amdsmi_dev_set_perf_level( +def amdsmi_set_gpu_perf_level( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_level: AmdSmiDevPerfLevel, ): @@ -1463,7 +1463,7 @@ def amdsmi_dev_set_perf_level( if not isinstance(perf_level, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_level, AmdSmiDevPerfLevel) - _check_res(amdsmi_wrapper. amdsmi_dev_set_perf_level( + _check_res(amdsmi_wrapper. amdsmi_set_gpu_perf_level( processor_handle, perf_level)) @@ -2044,7 +2044,7 @@ def amdsmi_get_gpu_memory_busy_percent(processor_handle: amdsmi_wrapper.amdsmi_p return busy_percent.value -def amdsmi_dev_set_perf_level_v1( +def amdsmi_set_gpu_perf_level_v1( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_lvl: AmdSmiDevPerfLevel, ) -> None: @@ -2056,7 +2056,7 @@ def amdsmi_dev_set_perf_level_v1( if not isinstance(perf_lvl, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_lvl, AmdSmiDevPerfLevel) - _check_res(amdsmi_wrapper. amdsmi_dev_set_perf_level_v1( + _check_res(amdsmi_wrapper. amdsmi_set_gpu_perf_level_v1( processor_handle, perf_lvl)) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 20c522a83e..4bee6e3b1b 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1556,12 +1556,12 @@ amdsmi_dev_get_od_volt_curve_regions.argtypes = [amdsmi_processor_handle, ctypes amdsmi_dev_get_power_profile_presets = _libraries['libamd_smi.so'].amdsmi_dev_get_power_profile_presets amdsmi_dev_get_power_profile_presets.restype = amdsmi_status_t amdsmi_dev_get_power_profile_presets.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_profile_status_t)] -amdsmi_dev_set_perf_level = _libraries['libamd_smi.so'].amdsmi_dev_set_perf_level -amdsmi_dev_set_perf_level.restype = amdsmi_status_t -amdsmi_dev_set_perf_level.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] -amdsmi_dev_set_perf_level_v1 = _libraries['libamd_smi.so'].amdsmi_dev_set_perf_level_v1 -amdsmi_dev_set_perf_level_v1.restype = amdsmi_status_t -amdsmi_dev_set_perf_level_v1.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] +amdsmi_set_gpu_perf_level = _libraries['libamd_smi.so'].amdsmi_set_gpu_perf_level +amdsmi_set_gpu_perf_level.restype = amdsmi_status_t +amdsmi_set_gpu_perf_level.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] +amdsmi_set_gpu_perf_level_v1 = _libraries['libamd_smi.so'].amdsmi_set_gpu_perf_level_v1 +amdsmi_set_gpu_perf_level_v1.restype = amdsmi_status_t +amdsmi_set_gpu_perf_level_v1.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] amdsmi_dev_set_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_set_overdrive_level amdsmi_dev_set_overdrive_level.restype = amdsmi_status_t amdsmi_dev_set_overdrive_level.argtypes = [amdsmi_processor_handle, uint32_t] @@ -1879,8 +1879,8 @@ __all__ = \ 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', 'amdsmi_dev_set_overdrive_level', 'amdsmi_dev_set_overdrive_level_v1', - 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_dev_set_perf_level', - 'amdsmi_dev_set_perf_level_v1', 'amdsmi_set_power_cap', + 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_set_gpu_perf_level', + 'amdsmi_set_gpu_perf_level_v1', 'amdsmi_set_power_cap', 'amdsmi_set_gpu_power_profile', 'amdsmi_dev_xgmi_error_status', 'amdsmi_processor_handle', 'amdsmi_engine_usage_t', 'amdsmi_error_count_t', 'amdsmi_event_group_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index b38b7c341b..fe70228d76 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -359,8 +359,8 @@ class Formatter: | """ + self.style.text("70 Set dev overdrive level. Api: amdsmi_dev_set_overdrive_level ") + """ | | """ + self.style.text("71 Set v1 dev overdrive level. Api: amdsmi_dev_set_overdrive_level_v1 ") + """ | | """ + self.style.text("72 Set dev pci bandwidth. Api: amdsmi_set_gpu_pci_bandwidth ") + """ | - | """ + self.style.text("73 Set dev perf level. Api: amdsmi_dev_set_perf_level ") + """ | - | """ + self.style.text("74 Set dev perf level v1. Api: amdsmi_dev_set_perf_level_v1 ") + """ | + | """ + self.style.text("73 Set dev perf level. Api: amdsmi_set_gpu_perf_level ") + """ | + | """ + self.style.text("74 Set dev perf level v1. Api: amdsmi_set_gpu_perf_level_v1 ") + """ | | """ + self.style.text("75 Set dev power cap. Api: amdsmi_set_power_cap ") + """ | | """ + self.style.text("76 Set dev power profile. Api: amdsmi_set_gpu_power_profile ") + """ | | """ + self.style.text("77 Close dev supported func iterator. Api: amdsmi_dev_close_supported_func_iterator ") + """ | @@ -673,7 +673,7 @@ def amdsmi_tool_dev_perf_level_set(dev): result = {} for dev_perf_level in smi_api.AmdSmiDevPerfLevel: try: - value = smi_api. amdsmi_dev_set_perf_level(dev, dev_perf_level) + value = smi_api. amdsmi_set_gpu_perf_level(dev, dev_perf_level) result.update({dev_perf_level.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(dev_perf_level.name, e)) @@ -684,7 +684,7 @@ def amdsmi_tool_dev_perf_level_set_v1(dev): result = {} for dev_perf_level in smi_api.AmdSmiDevPerfLevel: try: - value = smi_api. amdsmi_dev_set_perf_level_v1(dev, dev_perf_level) + value = smi_api. amdsmi_set_gpu_perf_level_v1(dev, dev_perf_level) result.update({dev_perf_level.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(dev_perf_level.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 2e31c2930e..2ee4defd5a 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -912,8 +912,8 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_dev_overdrive_level_get", "amdsmi_dev_get_overdrive_level"}, {"rsmi_dev_power_profile_presets_get", " amdsmi_dev_get_power_profile_presets"}, - {"rsmi_dev_perf_level_set", " amdsmi_dev_set_perf_level"}, - {"rsmi_dev_perf_level_set_v1", " amdsmi_dev_set_perf_level_v1"}, + {"rsmi_dev_perf_level_set", " amdsmi_set_gpu_perf_level"}, + {"rsmi_dev_perf_level_set_v1", " amdsmi_set_gpu_perf_level_v1"}, {"rsmi_dev_perf_level_get", "amdsmi_get_gpu_perf_level"}, {"rsmi_perf_determinism_mode_set", "amdsmi_set_gpu_perf_determinism_mode"}, {"rsmi_dev_overdrive_level_set", " amdsmi_dev_set_overdrive_level"}, @@ -1176,14 +1176,14 @@ amdsmi_status_t amdsmi_get_gpu_perf_level(amdsmi_processor_handle processor_hand reinterpret_cast(perf)); } amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_processor_handle processor_handle, + amdsmi_set_gpu_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl) { return rsmi_wrapper(rsmi_dev_perf_level_set, processor_handle, static_cast(perf_lvl)); } amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle processor_handle, + amdsmi_set_gpu_perf_level_v1(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl) { return rsmi_wrapper(rsmi_dev_perf_level_set_v1, processor_handle, static_cast(perf_lvl)); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc index 6c76163a56..b093426c14 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc @@ -180,7 +180,7 @@ void TestFrequenciesReadWrite::Run(void) { return; } - ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_set_gpu_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); if (ret != AMDSMI_STATUS_SUCCESS) { return; } @@ -228,7 +228,7 @@ void TestFrequenciesReadWrite::Run(void) { ret = amdsmi_dev_set_clk_freq(dv_ind, amdsmi_clk, 0xFFFFFFFF); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_set_perf_level(dv_ind, AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_set_gpu_perf_level(dv_ind, AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) #endif } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 496d279d83..dca78d3bfd 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -258,7 +258,7 @@ void TestMutualExclusion::Run(void) { /* Other functions holding device mutexes. Listed for reference. amdsmi_dev_sku_get - amdsmi_dev_set_perf_level_v1 + amdsmi_set_gpu_perf_level_v1 amdsmi_dev_set_od_clk_info amdsmi_dev_set_od_volt_info amdsmi_dev_firmware_version_get diff --git a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc index ffc0b26b66..f08b8e4c17 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/pci_read_write.cc @@ -196,7 +196,7 @@ void TestPciReadWrite::Run(void) { ret = amdsmi_set_gpu_pci_bandwidth(processor_handles_[dv_ind], 0xFFFFFFFF); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_set_gpu_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc index 6769b0151f..6f0f470563 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc @@ -130,7 +130,7 @@ void TestPerfDeterminism::Run(void) { } std::cout << "\t**Resetting performance determinism" << std::endl; - err = amdsmi_dev_set_perf_level(processor_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);; + err = amdsmi_set_gpu_perf_level(processor_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);; CHK_ERR_ASRT(err) ret = amdsmi_get_gpu_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(ret) diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc index c95727392c..121e7b5a90 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc @@ -120,7 +120,7 @@ void TestPerfLevelReadWrite::Run(void) { GetPerfLevelStr(static_cast(pfl_i)) << " ..." << std::endl; } - ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], + ret = amdsmi_set_gpu_perf_level(processor_handles_[dv_ind], static_cast(pfl_i)); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**" << GetPerfLevelStr(static_cast(pfl_i)) @@ -139,7 +139,7 @@ void TestPerfLevelReadWrite::Run(void) { std::cout << "Reset Perf level to " << GetPerfLevelStr(orig_pfl) << " ..." << std::endl; } - ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], orig_pfl); + ret = amdsmi_set_gpu_perf_level(processor_handles_[dv_ind], orig_pfl); CHK_ERR_ASRT(ret) ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc index 6337ec5c45..735b468e44 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc @@ -185,7 +185,7 @@ void TestPowerReadWrite::Run(void) { ASSERT_EQ(status.current, new_prof); - ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_set_gpu_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &pfl); From c4282e78476bbe20e12158531b8fc789b3b26363 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sun, 26 Feb 2023 21:01:44 -0500 Subject: [PATCH 50/95] Renamed API amdsmi_dev_set_clk_freq It is changed to amdsmi_set_clk_freq grep -rli 'amdsmi_dev_set_clk_freq' * | xargs -i@ sed -i 's/amdsmi_dev_set_clk_freq/amdsmi_set_clk_freq/g' @ Change-Id: I4cb623791c4570d144b4bf88e9c5f2ee5943527e [ROCm/amdsmi commit: b9b495e48621445c370a42a0d41a88309b2863a0] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amd_smi_test/functional/frequencies_read_write.cc | 8 ++++---- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 8b6ead384c..4832f52d8b 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2596,7 +2596,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle proce * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask); /** @} End PerfCont */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index f8f1c8cfaf..b78ffcd176 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2544,7 +2544,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_clk_freq +## amdsmi_set_clk_freq Description: Control the set of allowed frequencies that can be used for the specified clock @@ -2558,7 +2558,7 @@ bits of this mask are relevant. Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_clk_freq` function: +Exceptions that can be thrown by ` amdsmi_set_clk_freq` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2572,7 +2572,7 @@ try: else: for device in devices: freq_bitmask = 0 - amdsmi_dev_set_clk_freq(device, AmdSmiClkType.GFX, freq_bitmask) + amdsmi_set_clk_freq(device, AmdSmiClkType.GFX, freq_bitmask) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 50a790a324..f1490380bf 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -92,7 +92,7 @@ from .amdsmi_interface import amdsmi_dev_reset_gpu from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_set_gpu_fan_speed from .amdsmi_interface import amdsmi_reset_gpu_fan -from .amdsmi_interface import amdsmi_dev_set_clk_freq +from .amdsmi_interface import amdsmi_set_clk_freq from .amdsmi_interface import amdsmi_dev_set_overdrive_level_v1 from .amdsmi_interface import amdsmi_dev_set_overdrive_level diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 31e7a28839..278b44a7a4 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1553,7 +1553,7 @@ def amdsmi_reset_gpu_fan( _check_res(amdsmi_wrapper.amdsmi_reset_gpu_fan(processor_handle, sensor_idx)) -def amdsmi_dev_set_clk_freq( +def amdsmi_set_clk_freq( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType, freq_bitmask: int, @@ -1568,7 +1568,7 @@ def amdsmi_dev_set_clk_freq( raise AmdSmiParameterException(freq_bitmask, int) freq_bitmask = ctypes.c_uint64(freq_bitmask) _check_res( - amdsmi_wrapper. amdsmi_dev_set_clk_freq( + amdsmi_wrapper. amdsmi_set_clk_freq( processor_handle, clk_type, freq_bitmask ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 4bee6e3b1b..a433f72487 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1568,9 +1568,9 @@ amdsmi_dev_set_overdrive_level.argtypes = [amdsmi_processor_handle, uint32_t] amdsmi_dev_set_overdrive_level_v1 = _libraries['libamd_smi.so'].amdsmi_dev_set_overdrive_level_v1 amdsmi_dev_set_overdrive_level_v1.restype = amdsmi_status_t amdsmi_dev_set_overdrive_level_v1.argtypes = [amdsmi_processor_handle, uint32_t] -amdsmi_dev_set_clk_freq = _libraries['libamd_smi.so'].amdsmi_dev_set_clk_freq -amdsmi_dev_set_clk_freq.restype = amdsmi_status_t -amdsmi_dev_set_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, uint64_t] +amdsmi_set_clk_freq = _libraries['libamd_smi.so'].amdsmi_set_clk_freq +amdsmi_set_clk_freq.restype = amdsmi_status_t +amdsmi_set_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, uint64_t] amdsmi_get_version = _libraries['libamd_smi.so'].amdsmi_get_version amdsmi_get_version.restype = amdsmi_status_t amdsmi_get_version.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_version_t)] @@ -1874,7 +1874,7 @@ __all__ = \ 'amdsmi_dev_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', 'amdsmi_reset_gpu_fan', 'amdsmi_dev_reset_gpu', - 'amdsmi_dev_reset_xgmi_error', 'amdsmi_dev_set_clk_freq', + 'amdsmi_dev_reset_xgmi_error', 'amdsmi_set_clk_freq', 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', 'amdsmi_dev_set_overdrive_level', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index fe70228d76..d00cf3b1a6 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -352,7 +352,7 @@ class Formatter: | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_dev_counter_group_supported ") + """ | | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_set_gpu_fan_speed ") + """ | - | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_dev_set_clk_freq ") + """ | + | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_set_clk_freq ") + """ | | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_dev_reset_gpu ") + """ | | """ + self.style.text("68 Set dev od clk info. Api: amdsmi_dev_set_od_clk_info ") + """ | | """ + self.style.text("69 Set dev od volt info. Api: amdsmi_dev_set_od_volt_info ") + """| @@ -643,7 +643,7 @@ def amdsmi_tool_dev_gpu_clk_freq_set(dev, dic): freq_bitmask = dic["freq_bitmask"] for clock_type in smi_api.AmdSmiClkType: try: - value = smi_api. amdsmi_dev_set_clk_freq(dev, clock_type, freq_bitmask) + value = smi_api. amdsmi_set_clk_freq(dev, clock_type, freq_bitmask) result.update({clock_type.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(clock_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 2ee4defd5a..024691637e 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -934,7 +934,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"}, {"rsmi_dev_memory_usage_get", "amdsmi_get_gpu_memory_usage"}, {"rsmi_dev_gpu_clk_freq_get", " amdsmi_get_clk_freq"}, - {"rsmi_dev_gpu_clk_freq_set", " amdsmi_dev_set_clk_freq"}, + {"rsmi_dev_gpu_clk_freq_set", " amdsmi_set_clk_freq"}, {"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"}, @@ -1246,7 +1246,7 @@ amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_handle, reinterpret_cast(f)); } -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc index b093426c14..778f6a4446 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/frequencies_read_write.cc @@ -151,7 +151,7 @@ void TestFrequenciesReadWrite::Run(void) { FreqEnumToStr(amdsmi_clk) << " to 0b" << freq_bm_str << " ..." << std::endl; } - ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, freq_bitmask); + ret = amdsmi_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, freq_bitmask); //Certain ASICs does not allow to set particular clocks. If set function for a clock returns //permission error despite root access, manually set ret value to success and return if (ret == AMDSMI_STATUS_NO_PERM && geteuid() == 0) { @@ -175,7 +175,7 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << "Frequency is now index " << f.current << std::endl; std::cout << "Resetting mask to all frequencies." << std::endl; } - ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF); + ret = amdsmi_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF); if (ret != AMDSMI_STATUS_SUCCESS) { return; } @@ -215,7 +215,7 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << "Setting frequency mask for clock " << amdsmi_clk << " to 0b" << freq_bm_str << " ..." << std::endl; } - ret = amdsmi_dev_set_clk_freq(dv_ind, amdsmi_clk, freq_bitmask); + ret = amdsmi_set_clk_freq(dv_ind, amdsmi_clk, freq_bitmask); CHK_ERR_ASRT(ret) ret = amdsmi_get_clk_freq(dv_ind, amdsmi_clk, &f); @@ -225,7 +225,7 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << "Frequency is now index " << f.current << std::endl; std::cout << "Resetting mask to all frequencies." << std::endl; } - ret = amdsmi_dev_set_clk_freq(dv_ind, amdsmi_clk, 0xFFFFFFFF); + ret = amdsmi_set_clk_freq(dv_ind, amdsmi_clk, 0xFFFFFFFF); CHK_ERR_ASRT(ret) ret = amdsmi_set_gpu_perf_level(dv_ind, AMDSMI_DEV_PERF_LEVEL_AUTO); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index dca78d3bfd..5eddc93e6f 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -247,7 +247,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_set_overdrive_level_v1(processor_handles_[0], dmy_i32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0); + ret = amdsmi_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); From 3abd39f245f42cd2dc30660ae60efdace177e067 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 00:56:31 -0500 Subject: [PATCH 51/95] Renamed API amdsmi_dev_reset_gpu to amdsmi_reset_gpu grep -rli 'amdsmi_dev_reset_gpu' * | xargs -i@ sed -i 's/amdsmi_dev_reset_gpu/amdsmi_reset_gpu/g' @ Change-Id: Iebd03bc710fed1a75f262726ab33cd1a42d641a7 [ROCm/amdsmi commit: 98f87d9633b4489da0026cdaa4576d9c5a59ba1c] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 4832f52d8b..e1fbfd8f6e 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2252,7 +2252,7 @@ amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle processor_handle); +amdsmi_status_t amdsmi_reset_gpu(amdsmi_processor_handle processor_handle); /** * @brief This function retrieves the voltage/frequency curve information diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index b78ffcd176..fc2b0a44b5 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2465,7 +2465,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_reset_gpu +## amdsmi_reset_gpu Description: Reset the gpu associated with the device with provided device handle Input parameters: @@ -2473,7 +2473,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_reset_gpu` function: +Exceptions that can be thrown by `amdsmi_reset_gpu` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2486,7 +2486,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_reset_gpu(device) + amdsmi_reset_gpu(device) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index f1490380bf..1950ffafcf 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -88,7 +88,7 @@ from .amdsmi_interface import amdsmi_dev_set_od_volt_info from .amdsmi_interface import amdsmi_set_gpu_perf_level_v1 from .amdsmi_interface import amdsmi_set_gpu_perf_level from .amdsmi_interface import amdsmi_dev_get_power_profile_presets -from .amdsmi_interface import amdsmi_dev_reset_gpu +from .amdsmi_interface import amdsmi_reset_gpu from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_set_gpu_fan_speed from .amdsmi_interface import amdsmi_reset_gpu_fan diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 278b44a7a4..52317f99de 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1493,13 +1493,13 @@ def amdsmi_dev_get_power_profile_presets( } -def amdsmi_dev_reset_gpu(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_reset_gpu(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 ) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_gpu(processor_handle)) + _check_res(amdsmi_wrapper.amdsmi_reset_gpu(processor_handle)) def amdsmi_set_gpu_perf_determinism_mode( diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index a433f72487..b558cd11b4 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1532,9 +1532,9 @@ amdsmi_dev_get_overdrive_level.argtypes = [amdsmi_processor_handle, ctypes.POINT amdsmi_get_clk_freq = _libraries['libamd_smi.so'].amdsmi_get_clk_freq amdsmi_get_clk_freq.restype = amdsmi_status_t amdsmi_get_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)] -amdsmi_dev_reset_gpu = _libraries['libamd_smi.so'].amdsmi_dev_reset_gpu -amdsmi_dev_reset_gpu.restype = amdsmi_status_t -amdsmi_dev_reset_gpu.argtypes = [amdsmi_processor_handle] +amdsmi_reset_gpu = _libraries['libamd_smi.so'].amdsmi_reset_gpu +amdsmi_reset_gpu.restype = amdsmi_status_t +amdsmi_reset_gpu.argtypes = [amdsmi_processor_handle] amdsmi_dev_get_od_volt_info = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_info amdsmi_dev_get_od_volt_info.restype = amdsmi_status_t amdsmi_dev_get_od_volt_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_od_volt_freq_data_t)] @@ -1873,7 +1873,7 @@ __all__ = \ 'amdsmi_dev_open_supported_func_iterator', 'amdsmi_dev_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', - 'amdsmi_reset_gpu_fan', 'amdsmi_dev_reset_gpu', + 'amdsmi_reset_gpu_fan', 'amdsmi_reset_gpu', 'amdsmi_dev_reset_xgmi_error', 'amdsmi_set_clk_freq', 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index d00cf3b1a6..151bad01b4 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -353,7 +353,7 @@ class Formatter: | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_set_gpu_fan_speed ") + """ | | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_set_clk_freq ") + """ | - | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_dev_reset_gpu ") + """ | + | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_reset_gpu ") + """ | | """ + self.style.text("68 Set dev od clk info. Api: amdsmi_dev_set_od_clk_info ") + """ | | """ + self.style.text("69 Set dev od volt info. Api: amdsmi_dev_set_od_volt_info ") + """| | """ + self.style.text("70 Set dev overdrive level. Api: amdsmi_dev_set_overdrive_level ") + """ | @@ -926,7 +926,7 @@ commands = { "device_identifier1": [None, True], "freq_bitmask": [int, True] }], - 67: [smi_api.amdsmi_dev_reset_gpu, { + 67: [smi_api.amdsmi_reset_gpu, { "device_identifier1": [None, True] }], 68: [amdsmi_tool_dev_od_clk_info_set, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 024691637e..4636c06424 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -930,7 +930,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"}, {"rsmi_dev_gpu_metrics_info_get", " amdsmi_dev_get_gpu_metrics_info"}, - {"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"}, + {"rsmi_dev_gpu_reset", "amdsmi_reset_gpu"}, {"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"}, {"rsmi_dev_memory_usage_get", "amdsmi_get_gpu_memory_usage"}, {"rsmi_dev_gpu_clk_freq_get", " amdsmi_get_clk_freq"}, @@ -1354,7 +1354,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1( od); } -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle processor_handle) { +amdsmi_status_t amdsmi_reset_gpu(amdsmi_processor_handle processor_handle) { return rsmi_wrapper(rsmi_dev_gpu_reset, processor_handle); } From 75a1305080803aa62add484b9d430a2dc9fa11f6 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:01:17 -0500 Subject: [PATCH 52/95] Renamed API amdsmi_dev_get_gpu_metrics_info to amdsmi_get_gpu_metrics_info grep -rli 'amdsmi_dev_get_gpu_metrics_info' * | xargs -i@ sed -i 's/amdsmi_dev_get_gpu_metrics_info/amdsmi_get_gpu_metrics_info/g' @ Change-Id: Ic4d8095fcfc5f2f5419211bb7155a6bd7116ed29 [ROCm/amdsmi commit: f95a63f21692fc38da9a6fea10afc62dd54b73cf] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- .../amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 18 +++++++++--------- .../functional/gpu_metrics_read.cc | 4 ++-- .../functional/mutual_exclusion.cc | 2 +- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e1fbfd8f6e..d6146adb46 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2291,7 +2291,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_h * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_metrics_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_metrics_t *pgpu_metrics); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index fc2b0a44b5..72f3b45f1a 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2106,7 +2106,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_gpu_metrics_info +## amdsmi_get_gpu_metrics_info Description: This function retrieves the gpu metrics information Input parameters: @@ -2151,7 +2151,7 @@ Field | Description `mem_actvity_acc` | mem activity acc `temperature_hbm` | hbm temperature -Exceptions that can be thrown by ` amdsmi_dev_get_gpu_metrics_info` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_metrics_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2164,7 +2164,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_get_gpu_metrics_info(dev) + amdsmi_get_gpu_metrics_info(dev) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 1950ffafcf..3e8626c28f 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -111,7 +111,7 @@ from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_dev_get_overdrive_level from .amdsmi_interface import amdsmi_get_clk_freq from .amdsmi_interface import amdsmi_dev_get_od_volt_info -from .amdsmi_interface import amdsmi_dev_get_gpu_metrics_info +from .amdsmi_interface import amdsmi_get_gpu_metrics_info from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions from .amdsmi_interface import amdsmi_dev_get_power_profile_presets diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 52317f99de..12363de08c 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2346,7 +2346,7 @@ def amdsmi_dev_get_od_volt_info( } -def amdsmi_dev_get_gpu_metrics_info( +def amdsmi_get_gpu_metrics_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2356,7 +2356,7 @@ def amdsmi_dev_get_gpu_metrics_info( gpu_metrics = amdsmi_wrapper.amdsmi_gpu_metrics_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_gpu_metrics_info( + amdsmi_wrapper. amdsmi_get_gpu_metrics_info( processor_handle, ctypes.byref(gpu_metrics) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index b558cd11b4..43757b11f8 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1538,9 +1538,9 @@ amdsmi_reset_gpu.argtypes = [amdsmi_processor_handle] amdsmi_dev_get_od_volt_info = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_info amdsmi_dev_get_od_volt_info.restype = amdsmi_status_t amdsmi_dev_get_od_volt_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_od_volt_freq_data_t)] -amdsmi_dev_get_gpu_metrics_info = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_metrics_info -amdsmi_dev_get_gpu_metrics_info.restype = amdsmi_status_t -amdsmi_dev_get_gpu_metrics_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_metrics_t)] +amdsmi_get_gpu_metrics_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_metrics_info +amdsmi_get_gpu_metrics_info.restype = amdsmi_status_t +amdsmi_get_gpu_metrics_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_metrics_t)] amdsmi_set_gpu_clk_range = _libraries['libamd_smi.so'].amdsmi_set_gpu_clk_range amdsmi_set_gpu_clk_range.restype = amdsmi_status_t amdsmi_set_gpu_clk_range.argtypes = [amdsmi_processor_handle, uint64_t, uint64_t, amdsmi_clk_type_t] @@ -1856,7 +1856,7 @@ __all__ = \ 'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', - 'amdsmi_get_clk_freq', 'amdsmi_dev_get_gpu_metrics_info', + 'amdsmi_get_clk_freq', 'amdsmi_get_gpu_metrics_info', 'amdsmi_get_gpu_id', 'amdsmi_get_gpu_memory_busy_percent', 'amdsmi_get_gpu_memory_reserved_pages', 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 151bad01b4..5ccc0a6ae5 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -316,7 +316,7 @@ class Formatter: | """ + self.style.text("27 Get device overdrive level. Api: amdsmi_dev_get_overdrive_level ") + """ | | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_get_clk_freq ") + """ | | """ + self.style.text("29 Get device od volt. Api: amdsmi_dev_get_od_volt_info ") + """ | - | """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_dev_get_gpu_metrics_info ") + """ | + | """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_get_gpu_metrics_info ") + """ | | """ + self.style.text("31 Get device od volt curve regions. Api: amdsmi_dev_get_od_volt_curve_regions ") + """ | | """ + self.style.text("32 Get device power profile presets. Api: amdsmi_dev_get_power_profile_presets ") + """ | | """ + self.style.text("33 Get the build version. Api: amdsmi_get_version ") + """ | @@ -814,7 +814,7 @@ commands = { 29: [smi_api. amdsmi_dev_get_od_volt_info, { "device_identifier1": [None, True] }], - 30: [smi_api. amdsmi_dev_get_gpu_metrics_info, { + 30: [smi_api. amdsmi_get_gpu_metrics_info, { "device_identifier1": [None, True] }], 31: [amdsmi_tool_dev_od_volt_curve_regions_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 4636c06424..a1fd6550ab 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -332,7 +332,7 @@ amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle // Get the PLX temperature from the gpu_metrics if (sensor_type == TEMPERATURE_TYPE_PLX) { amdsmi_gpu_metrics_t metric_info; - auto r_status = amdsmi_dev_get_gpu_metrics_info( + auto r_status = amdsmi_get_gpu_metrics_info( processor_handle, &metric_info); if (r_status != AMDSMI_STATUS_SUCCESS) return r_status; @@ -929,7 +929,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"}, - {"rsmi_dev_gpu_metrics_info_get", " amdsmi_dev_get_gpu_metrics_info"}, + {"rsmi_dev_gpu_metrics_info_get", " amdsmi_get_gpu_metrics_info"}, {"rsmi_dev_gpu_reset", "amdsmi_reset_gpu"}, {"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"}, {"rsmi_dev_memory_usage_get", "amdsmi_get_gpu_memory_usage"}, @@ -1049,7 +1049,7 @@ amdsmi_get_busy_percent(amdsmi_processor_handle processor_handle, return rsmi_wrapper(rsmi_dev_busy_percent_get, processor_handle, busy_percent); } -amdsmi_status_t amdsmi_dev_get_gpu_metrics_info( +amdsmi_status_t amdsmi_get_gpu_metrics_info( amdsmi_processor_handle processor_handle, amdsmi_gpu_metrics_t *pgpu_metrics) { AMDSMI_CHECK_INIT(); @@ -1215,7 +1215,7 @@ amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_handle, clk_type == CLK_TYPE_DCLK0 || clk_type == CLK_TYPE_DCLK1 ) { amdsmi_gpu_metrics_t metric_info; - auto r_status = amdsmi_dev_get_gpu_metrics_info( + auto r_status = amdsmi_get_gpu_metrics_info( processor_handle, &metric_info); if (r_status != AMDSMI_STATUS_SUCCESS) return r_status; @@ -1480,7 +1480,7 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_ if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); + status = amdsmi_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1510,7 +1510,7 @@ amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_ty return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); + status = amdsmi_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1713,7 +1713,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_ amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); + status = amdsmi_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1757,7 +1757,7 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amds amdsmi_status_t status; int min = 0, max = 0; - status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); + status = amdsmi_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1866,7 +1866,7 @@ amdsmi_get_pcie_link_status(amdsmi_processor_handle processor_handle, amdsmi_pci } amdsmi_status_t status = AMDSMI_STATUS_SUCCESS; amdsmi_gpu_metrics_t metric_info = {}; - status = amdsmi_dev_get_gpu_metrics_info( + status = amdsmi_get_gpu_metrics_info( processor_handle, &metric_info); if (status != AMDSMI_STATUS_SUCCESS) return status; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc index 0f485ff910..4bfadfca10 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/gpu_metrics_read.cc @@ -103,7 +103,7 @@ void TestGpuMetricsRead::Run(void) { std::cout << "\t**GPU METRICS:\n"; } amdsmi_gpu_metrics_t smu; - err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], &smu); + err = amdsmi_get_gpu_metrics_info(processor_handles_[i], &smu); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -188,7 +188,7 @@ void TestGpuMetricsRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_metrics_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 5eddc93e6f..62feb84d1a 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -280,7 +280,7 @@ void TestMutualExclusion::Run(void) { amdsmi_set_gpu_fan_speed amdsmi_get_gpu_fan_speed_max amdsmi_dev_get_od_volt_info - amdsmi_dev_get_gpu_metrics_info + amdsmi_get_gpu_metrics_info amdsmi_dev_get_od_volt_curve_regions amdsmi_dev_power_max_get amdsmi_get_power_ave From 971ff06772760445b868f91ac49524fbacf87ff3 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:04:25 -0500 Subject: [PATCH 53/95] Renamed API amdsmi_dev_get_power_profile_presets to amdsmi_get_gpu_power_profile_presets grep -rli 'amdsmi_dev_get_power_profile_presets' * | xargs -i@ sed -i 's/amdsmi_dev_get_power_profile_presets/amdsmi_get_gpu_power_profile_presets/g' @ Change-Id: Iff3d22517a4c5ece5efe4738618f74946cf600bd [ROCm/amdsmi commit: 64e8d81af43f3be20739a101c6987609d5249ac9] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 12 ++++++------ projects/amdsmi/py-interface/__init__.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_interface.py | 8 ++++---- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../amd_smi_test/functional/power_read_write.cc | 8 ++++---- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index d6146adb46..54cde8f430 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -693,7 +693,7 @@ typedef enum { /** * @brief Pre-set Profile Selections. These bitmasks can be AND'd with the * ::amdsmi_power_profile_status_t.available_profiles returned from - * :: amdsmi_dev_get_power_profile_presets to determine which power profiles + * :: amdsmi_get_gpu_power_profile_presets to determine which power profiles * are supported by the system. */ typedef enum { @@ -1713,7 +1713,7 @@ amdsmi_status_t * @details This function will attempt to set the current profile to the provided * profile, given a processor handle @p processor_handle and a @p profile. The provided * profile must be one of the currently supported profiles, as indicated by a - * call to :: amdsmi_dev_get_power_profile_presets() + * call to :: amdsmi_get_gpu_power_profile_presets() * * @param[in] processor_handle a processor handle * @@ -2431,7 +2431,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle pr * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, + amdsmi_get_gpu_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status); /** @} End PerfQuer */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 72f3b45f1a..c405ab47af 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2200,7 +2200,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_power_profile_presets +## amdsmi_get_gpu_power_profile_presets Description: Get the list of available preset power profiles and an indication of which profile is currently active @@ -2216,7 +2216,7 @@ Field | Description `current`| Which power profile is currently active `num_profiles`| How many power profiles are available -Exceptions that can be thrown by ` amdsmi_dev_get_power_profile_presets` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_power_profile_presets` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2229,7 +2229,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_get_power_profile_presets(device, 0) + amdsmi_get_gpu_power_profile_presets(device, 0) except AmdSmiException as e: print(e) ``` @@ -2431,7 +2431,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_power_profile_presets +## amdsmi_get_gpu_power_profile_presets Description: Get the list of available preset power profiles and an indication of which profile is currently active. @@ -2447,7 +2447,7 @@ Field | Description `current`| Which power profile is currently active `num_profiles`| How many power profiles are available -Exceptions that can be thrown by ` amdsmi_dev_get_power_profile_presets` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_power_profile_presets` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2460,7 +2460,7 @@ try: print("No GPUs on machine") else: for device in devices: - status = amdsmi_dev_get_power_profile_presets(device, 0) + status = amdsmi_get_gpu_power_profile_presets(device, 0) print(status) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 3e8626c28f..d46b4bd25f 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -87,7 +87,7 @@ from .amdsmi_interface import amdsmi_dev_set_od_clk_info from .amdsmi_interface import amdsmi_dev_set_od_volt_info from .amdsmi_interface import amdsmi_set_gpu_perf_level_v1 from .amdsmi_interface import amdsmi_set_gpu_perf_level -from .amdsmi_interface import amdsmi_dev_get_power_profile_presets +from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets from .amdsmi_interface import amdsmi_reset_gpu from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_set_gpu_fan_speed @@ -113,7 +113,7 @@ from .amdsmi_interface import amdsmi_get_clk_freq from .amdsmi_interface import amdsmi_dev_get_od_volt_info from .amdsmi_interface import amdsmi_get_gpu_metrics_info from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions -from .amdsmi_interface import amdsmi_dev_get_power_profile_presets +from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters from .amdsmi_interface import amdsmi_dev_counter_group_supported diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 12363de08c..bef6e8801b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1467,7 +1467,7 @@ def amdsmi_set_gpu_perf_level( processor_handle, perf_level)) -def amdsmi_dev_get_power_profile_presets( +def amdsmi_get_gpu_power_profile_presets( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1481,7 +1481,7 @@ def amdsmi_dev_get_power_profile_presets( status = amdsmi_wrapper.amdsmi_power_profile_status_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_power_profile_presets( + amdsmi_wrapper. amdsmi_get_gpu_power_profile_presets( processor_handle, sensor_idx, ctypes.byref(status) ) ) @@ -2438,7 +2438,7 @@ def amdsmi_dev_get_od_volt_curve_regions( return result -def amdsmi_dev_get_power_profile_presets( +def amdsmi_get_gpu_power_profile_presets( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2450,7 +2450,7 @@ def amdsmi_dev_get_power_profile_presets( status = amdsmi_wrapper.amdsmi_power_profile_status_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_power_profile_presets( + amdsmi_wrapper. amdsmi_get_gpu_power_profile_presets( processor_handle, sensor_idx, ctypes.byref(status) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 43757b11f8..9c0247a7fd 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1553,9 +1553,9 @@ amdsmi_dev_set_od_volt_info.argtypes = [amdsmi_processor_handle, uint32_t, uint6 amdsmi_dev_get_od_volt_curve_regions = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_curve_regions amdsmi_dev_get_od_volt_curve_regions.restype = amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_freq_volt_region_t)] -amdsmi_dev_get_power_profile_presets = _libraries['libamd_smi.so'].amdsmi_dev_get_power_profile_presets -amdsmi_dev_get_power_profile_presets.restype = amdsmi_status_t -amdsmi_dev_get_power_profile_presets.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_profile_status_t)] +amdsmi_get_gpu_power_profile_presets = _libraries['libamd_smi.so'].amdsmi_get_gpu_power_profile_presets +amdsmi_get_gpu_power_profile_presets.restype = amdsmi_status_t +amdsmi_get_gpu_power_profile_presets.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_profile_status_t)] amdsmi_set_gpu_perf_level = _libraries['libamd_smi.so'].amdsmi_set_gpu_perf_level amdsmi_set_gpu_perf_level.restype = amdsmi_status_t amdsmi_set_gpu_perf_level.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] @@ -1866,7 +1866,7 @@ __all__ = \ 'amdsmi_get_gpu_pci_replay_counter', 'amdsmi_get_gpu_pci_throughput', 'amdsmi_get_gpu_perf_level', 'amdsmi_get_power_ave', - 'amdsmi_dev_get_power_profile_presets', + 'amdsmi_get_gpu_power_profile_presets', 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', 'amdsmi_get_temp_metric', 'amdsmi_get_gpu_vendor_name', 'amdsmi_get_gpu_volt_metric', 'amdsmi_get_gpu_vram_vendor', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 5ccc0a6ae5..a2e7c17077 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -318,7 +318,7 @@ class Formatter: | """ + self.style.text("29 Get device od volt. Api: amdsmi_dev_get_od_volt_info ") + """ | | """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_get_gpu_metrics_info ") + """ | | """ + self.style.text("31 Get device od volt curve regions. Api: amdsmi_dev_get_od_volt_curve_regions ") + """ | - | """ + self.style.text("32 Get device power profile presets. Api: amdsmi_dev_get_power_profile_presets ") + """ | + | """ + self.style.text("32 Get device power profile presets. Api: amdsmi_get_gpu_power_profile_presets ") + """ | | """ + self.style.text("33 Get the build version. Api: amdsmi_get_version ") + """ | | """ + self.style.text("34 Get version string. Api: amdsmi_get_version_str ") + """ | | """ + self.style.text("35 Get device ecc counter. Api: amdsmi_dev_get_ecc_count ") + """ | @@ -454,7 +454,7 @@ def amdsmi_tool_perf_determinism_mode_set(dev, dic): def amdsmi_tool_dev_power_profile_presets_get(dev, dic): sensor_idx = dic["sensor_idx"] - return smi_api. amdsmi_dev_get_power_profile_presets(dev, sensor_idx) + return smi_api. amdsmi_get_gpu_power_profile_presets(dev, sensor_idx) def amdsmi_tool_version_str_get(): result = {} diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index a1fd6550ab..132b70796e 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -911,7 +911,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_busy_percent_get", "amdsmi_get_busy_percent"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_dev_overdrive_level_get", "amdsmi_dev_get_overdrive_level"}, - {"rsmi_dev_power_profile_presets_get", " amdsmi_dev_get_power_profile_presets"}, + {"rsmi_dev_power_profile_presets_get", " amdsmi_get_gpu_power_profile_presets"}, {"rsmi_dev_perf_level_set", " amdsmi_set_gpu_perf_level"}, {"rsmi_dev_perf_level_set_v1", " amdsmi_set_gpu_perf_level_v1"}, {"rsmi_dev_perf_level_get", "amdsmi_get_gpu_perf_level"}, @@ -1141,7 +1141,7 @@ amdsmi_get_power_ave(amdsmi_processor_handle processor_handle, sensor_ind, power); } amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle processor_handle, + amdsmi_get_gpu_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 62feb84d1a..31965fb834 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -287,7 +287,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_power_cap_get amdsmi_dev_power_cap_range_get amdsmi_set_power_cap - amdsmi_dev_get_power_profile_presets + amdsmi_get_gpu_power_profile_presets amdsmi_set_gpu_power_profile amdsmi_get_gpu_memory_total amdsmi_get_gpu_memory_usage diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc index 735b468e44..f341c7c069 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_read_write.cc @@ -122,7 +122,7 @@ void TestPowerReadWrite::Run(void) { for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); + ret = amdsmi_get_gpu_power_profile_presets(processor_handles_[dv_ind], 0, &status); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "The power profile presets settings is not supported. " << std::endl; @@ -131,7 +131,7 @@ void TestPowerReadWrite::Run(void) { CHK_ERR_ASRT(ret) // Verify api support checking functionality is working - ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, nullptr); + ret = amdsmi_get_gpu_power_profile_presets(processor_handles_[dv_ind], 0, nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { @@ -180,7 +180,7 @@ void TestPowerReadWrite::Run(void) { CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_MANUAL); - ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); + ret = amdsmi_get_gpu_power_profile_presets(processor_handles_[dv_ind], 0, &status); CHK_ERR_ASRT(ret) ASSERT_EQ(status.current, new_prof); @@ -192,7 +192,7 @@ void TestPowerReadWrite::Run(void) { CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_AUTO); - ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); + ret = amdsmi_get_gpu_power_profile_presets(processor_handles_[dv_ind], 0, &status); CHK_ERR_ASRT(ret) ASSERT_EQ(status.current, orig_profile); From 6729efd3a5d524708069b4a17de63efea9e00586 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:10:06 -0500 Subject: [PATCH 54/95] Renamed API amdsmi_get_target_frequency_range to amdsmi_get_gpu_target_frequency_range grep -rli 'amdsmi_get_target_frequency_range' * | xargs -i@ sed -i 's/amdsmi_get_target_frequency_range/amdsmi_get_gpu_target_frequency_range/g' @ Change-Id: Ife4c533ded5d7743238502fe1789f34fd0edf9b8 [ROCm/amdsmi commit: 849e43451ddf68c4b8a54301ef8f5396437d8fcd] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 10 +++++----- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 53d8fe5165..999d4b32b8 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -500,10 +500,10 @@ int main() { // Get frequency ranges amdsmi_frequency_range_t freq_ranges = {}; - ret = amdsmi_get_target_frequency_range( + ret = amdsmi_get_gpu_target_frequency_range( processor_handles[j], CLK_TYPE_GFX, &freq_ranges); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_target_frequency_range:\n"); + printf(" Output of amdsmi_get_gpu_target_frequency_range:\n"); printf("\tSupported min freq: %lu\n", freq_ranges.supported_freq_range.lower_bound); printf("\tSupported max freq: %lu\n", diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 54cde8f430..6ac7f42b91 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3810,7 +3810,7 @@ amdsmi_get_gpu_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); +amdsmi_get_gpu_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); /** @} End powermon */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index c405ab47af..a0b3b13439 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -739,7 +739,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_target_frequency_range +## amdsmi_get_gpu_target_frequency_range Description: Returns the supported frequency target range for the given GPU `Note: Not Supported` @@ -772,7 +772,7 @@ Field | Description `current_upper_bound` | Maximal value of target current frequency in MHz `current_lower_bound` | Minimal value of target current frequency in MHz -Exceptions that can be thrown by `amdsmi_get_target_frequency_range` function: +Exceptions that can be thrown by `amdsmi_get_gpu_target_frequency_range` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -786,21 +786,21 @@ try: else: for device in devices: print("=============== GFX DOMAIN ================") - freq_range = amdsmi_get_target_frequency_range(device, + freq_range = amdsmi_get_gpu_target_frequency_range(device, AmdSmiClkType.GFX) print(freq_range['supported_upper_bound']) print(freq_range['supported_lower_bound']) print(freq_range['current_upper_bound']) print(freq_range['current_lower_bound']) print("=============== MEM DOMAIN ================") - freq_range = amdsmi_get_target_frequency_range(device, + freq_range = amdsmi_get_gpu_target_frequency_range(device, AmdSmiClkType.MEM) print(freq_range['supported_upper_bound']) print(freq_range['supported_lower_bound']) print(freq_range['current_upper_bound']) print(freq_range['current_lower_bound']) print("=============== VCLK0 DOMAIN ================") - freq_range = amdsmi_get_target_frequency_range(device, + freq_range = amdsmi_get_gpu_target_frequency_range(device, AmdSmiClkType.VCLK0) print(freq_range['supported_upper_bound']) print(freq_range['supported_lower_bound']) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index d46b4bd25f..c7e05b2797 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -56,7 +56,7 @@ from .amdsmi_interface import amdsmi_get_pcie_link_caps from .amdsmi_interface import amdsmi_get_bad_page_info # # Power Management -from .amdsmi_interface import amdsmi_get_target_frequency_range +from .amdsmi_interface import amdsmi_get_gpu_target_frequency_range # # Process Information from .amdsmi_interface import amdsmi_get_process_list diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index bef6e8801b..7d20b44153 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -751,7 +751,7 @@ def amdsmi_get_bad_page_info( return table_records -def amdsmi_get_target_frequency_range( +def amdsmi_get_gpu_target_frequency_range( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: @@ -764,7 +764,7 @@ def amdsmi_get_target_frequency_range( freq_range = amdsmi_wrapper.amdsmi_frequency_range_t() _check_res( - amdsmi_wrapper.amdsmi_get_target_frequency_range( + amdsmi_wrapper.amdsmi_get_gpu_target_frequency_range( processor_handle, amdsmi_wrapper.amdsmi_clk_type_t(clock_type), ctypes.byref(freq_range), diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9c0247a7fd..e63c793c19 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1706,9 +1706,9 @@ amdsmi_get_clock_measure.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, amdsmi_get_gpu_vram_usage = _libraries['libamd_smi.so'].amdsmi_get_gpu_vram_usage amdsmi_get_gpu_vram_usage.restype = amdsmi_status_t amdsmi_get_gpu_vram_usage.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vram_info_t)] -amdsmi_get_target_frequency_range = _libraries['libamd_smi.so'].amdsmi_get_target_frequency_range -amdsmi_get_target_frequency_range.restype = amdsmi_status_t -amdsmi_get_target_frequency_range.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequency_range_t)] +amdsmi_get_gpu_target_frequency_range = _libraries['libamd_smi.so'].amdsmi_get_gpu_target_frequency_range +amdsmi_get_gpu_target_frequency_range.restype = amdsmi_status_t +amdsmi_get_gpu_target_frequency_range.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequency_range_t)] amdsmi_get_process_list = _libraries['libamd_smi.so'].amdsmi_get_process_list amdsmi_get_process_list.restype = amdsmi_status_t amdsmi_get_process_list.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] @@ -1910,7 +1910,7 @@ __all__ = \ 'amdsmi_get_process_list', 'amdsmi_get_ras_block_features_enabled', 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', - 'amdsmi_get_target_frequency_range', + 'amdsmi_get_gpu_target_frequency_range', 'amdsmi_get_utilization_count', 'amdsmi_get_gpu_vbios_info', 'amdsmi_get_version', 'amdsmi_get_version_str', 'amdsmi_get_gpu_vram_usage', 'amdsmi_get_xgmi_info', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 132b70796e..02041b516e 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1741,7 +1741,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_ } amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { +amdsmi_get_gpu_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { AMDSMI_CHECK_INIT(); if (range == nullptr || clk_type > CLK_TYPE__MAX) { From 457415dea63454296d73a8eb035c60e09aa24a95 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:14:03 -0500 Subject: [PATCH 55/95] Renamed API amdsmi_get_ras_block_features_enabled to amdsmi_get_gpu_ras_block_features_enabled grep -rli 'amdsmi_get_ras_block_features_enabled' * | xargs -i@ sed -i 's/amdsmi_get_ras_block_features_enabled/amdsmi_get_gpu_ras_block_features_enabled/g' @ Change-Id: I23d6c6145465f6a3f28a48717b2343a816ff5c9b [ROCm/amdsmi commit: 51d91b90711203eb2ec885ac98016681cc2d9cce] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 999d4b32b8..8f52d7d832 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -442,11 +442,11 @@ int main() { "ENABLED"}; amdsmi_ras_err_state_t state = {}; int index = 0; - printf(" Output of amdsmi_get_ras_block_features_enabled:\n"); + printf(" Output of amdsmi_get_gpu_ras_block_features_enabled:\n"); for (auto block = AMDSMI_GPU_BLOCK_FIRST; block <= AMDSMI_GPU_BLOCK_LAST; block = (amdsmi_gpu_block_t)(block * 2)) { - ret = amdsmi_get_ras_block_features_enabled(processor_handles[j], block, + ret = amdsmi_get_gpu_ras_block_features_enabled(processor_handles[j], block, &state); CHK_AMDSMI_RET(ret) printf("\tBlock: %s\n", block_names[index]); diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 6ac7f42b91..522d5c196a 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1823,7 +1823,7 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, +amdsmi_get_gpu_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index a0b3b13439..a5e0767564 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -941,7 +941,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_ras_block_features_enabled +## amdsmi_get_gpu_ras_block_features_enabled Description: Returns status of each RAS block for the given GPU Input parameters: @@ -955,7 +955,7 @@ Field | Description `block` | RAS block `status` | RAS block status -Exceptions that can be thrown by `amdsmi_get_ras_block_features_enabled` function: +Exceptions that can be thrown by `amdsmi_get_gpu_ras_block_features_enabled` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -968,7 +968,7 @@ try: print("No GPUs on machine") else: for device in devices: - ras_block_features = amdsmi_get_ras_block_features_enabled(device) + ras_block_features = amdsmi_get_gpu_ras_block_features_enabled(device) print(ras_block_features) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index c7e05b2797..5f8862d19e 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -69,7 +69,7 @@ from .amdsmi_interface import amdsmi_get_ecc_error_count from .amdsmi_interface import amdsmi_get_gpu_board_info # # Ras Information -from .amdsmi_interface import amdsmi_get_ras_block_features_enabled +from .amdsmi_interface import amdsmi_get_gpu_ras_block_features_enabled # # Supported Function Checks from .amdsmi_interface import amdsmi_dev_open_supported_func_iterator diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 7d20b44153..69d4f8153b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -821,7 +821,7 @@ def amdsmi_get_gpu_board_info( } -def amdsmi_get_ras_block_features_enabled( +def amdsmi_get_gpu_ras_block_features_enabled( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -837,7 +837,7 @@ def amdsmi_get_ras_block_features_enabled( if gpu_block.name == "LAST": gpu_block.name = "FUSE" _check_res( - amdsmi_wrapper.amdsmi_get_ras_block_features_enabled( + amdsmi_wrapper.amdsmi_get_gpu_ras_block_features_enabled( processor_handle, amdsmi_wrapper.amdsmi_gpu_block_t(gpu_block.value), ctypes.byref(ras_state), diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index e63c793c19..6d7efbea17 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1478,9 +1478,9 @@ amdsmi_get_gpu_memory_usage.argtypes = [amdsmi_processor_handle, amdsmi_memory_t amdsmi_get_bad_page_info = _libraries['libamd_smi.so'].amdsmi_get_bad_page_info amdsmi_get_bad_page_info.restype = amdsmi_status_t amdsmi_get_bad_page_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] -amdsmi_get_ras_block_features_enabled = _libraries['libamd_smi.so'].amdsmi_get_ras_block_features_enabled -amdsmi_get_ras_block_features_enabled.restype = amdsmi_status_t -amdsmi_get_ras_block_features_enabled.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] +amdsmi_get_gpu_ras_block_features_enabled = _libraries['libamd_smi.so'].amdsmi_get_gpu_ras_block_features_enabled +amdsmi_get_gpu_ras_block_features_enabled.restype = amdsmi_status_t +amdsmi_get_gpu_ras_block_features_enabled.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] amdsmi_get_gpu_memory_busy_percent = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_busy_percent amdsmi_get_gpu_memory_busy_percent.restype = amdsmi_status_t amdsmi_get_gpu_memory_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] @@ -1908,7 +1908,7 @@ __all__ = \ 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_cap_info', 'amdsmi_get_power_measure', 'amdsmi_get_process_info', 'amdsmi_get_process_list', - 'amdsmi_get_ras_block_features_enabled', + 'amdsmi_get_gpu_ras_block_features_enabled', 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', 'amdsmi_get_gpu_target_frequency_range', 'amdsmi_get_utilization_count', 'amdsmi_get_gpu_vbios_info', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 02041b516e..56e4e90eb2 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1547,7 +1547,7 @@ amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_ty } amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { +amdsmi_get_gpu_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); if (state == nullptr || block > AMDSMI_GPU_BLOCK_LAST) { From e0f8b19de97cf1fc9ff1496cb3f76ba5fd85c559 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:18:07 -0500 Subject: [PATCH 56/95] Renamed API amdsmi_get_bad_page_info to amdsmi_get_gpu_bad_page_info grep -rli 'amdsmi_get_bad_page_info' * | xargs -i@ sed -i 's/amdsmi_get_bad_page_info/amdsmi_get_gpu_bad_page_info/g' @ Change-Id: I59e2478804b2eea42691377ec280e61022a39a8e [ROCm/amdsmi commit: 2170f8e72b8a193a65965c5b1b21a0f1607f266c] --- projects/amdsmi/example/amd_smi_drm_example.cc | 6 +++--- projects/amdsmi/example/amd_smi_nodrm_example.cc | 6 +++--- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 8f52d7d832..4dd523f821 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -459,15 +459,15 @@ int main() { char bad_page_status_names[3][15] = {"RESERVED", "PENDING", "UNRESERVABLE"}; uint32_t num_pages = 0; - ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, + ret = amdsmi_get_gpu_bad_page_info(processor_handles[j], &num_pages, nullptr); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_bad_page_info:\n"); + printf(" Output of amdsmi_get_gpu_bad_page_info:\n"); if (!num_pages) { printf("\tNo bad pages found.\n"); } else { std::vector bad_page_info(num_pages); - ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, + ret = amdsmi_get_gpu_bad_page_info(processor_handles[j], &num_pages, bad_page_info.data()); CHK_AMDSMI_RET(ret) for (uint32_t page_it = 0; page_it < num_pages; page_it += 1) { diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index e5d86648c0..22fbfc4dae 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -246,15 +246,15 @@ int main() { char bad_page_status_names[3][15] = {"RESERVED", "PENDING", "UNRESERVABLE"}; uint32_t num_pages = 0; - ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, + ret = amdsmi_get_gpu_bad_page_info(processor_handles[j], &num_pages, nullptr); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_bad_page_info:\n"); + printf(" Output of amdsmi_get_gpu_bad_page_info:\n"); if (!num_pages) { printf("\tNo bad pages found.\n"); } else { std::vector bad_page_info(num_pages); - ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, + ret = amdsmi_get_gpu_bad_page_info(processor_handles[j], &num_pages, bad_page_info.data()); CHK_AMDSMI_RET(ret) for (uint32_t page_it = 0; page_it < num_pages; page_it += 1) { diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 522d5c196a..b24b1b2683 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1800,7 +1800,7 @@ amdsmi_get_gpu_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_mem * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); +amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); /** * @brief Returns if RAS features are enabled or disabled for given block diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index a5e0767564..3867aebcea 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -698,7 +698,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_bad_page_info +## amdsmi_get_gpu_bad_page_info Description: Returns bad page info for the given GPU Input parameters: @@ -713,7 +713,7 @@ Field | Description `page_size` | Size of bad page `status` | Status of bad page -Exceptions that can be thrown by `amdsmi_get_bad_page_info` function: +Exceptions that can be thrown by `amdsmi_get_gpu_bad_page_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -726,7 +726,7 @@ try: print("No GPUs on machine") else: for device in devices: - bad_page_info = amdsmi_get_bad_page_info(device) + bad_page_info = amdsmi_get_gpu_bad_page_info(device) if not len(bad_page_info): print("No bad pages found") continue diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 5f8862d19e..b1fb20d1ef 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -53,7 +53,7 @@ from .amdsmi_interface import amdsmi_get_clock_measure from .amdsmi_interface import amdsmi_get_pcie_link_status from .amdsmi_interface import amdsmi_get_pcie_link_caps -from .amdsmi_interface import amdsmi_get_bad_page_info +from .amdsmi_interface import amdsmi_get_gpu_bad_page_info # # Power Management from .amdsmi_interface import amdsmi_get_gpu_target_frequency_range diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 69d4f8153b..cb1b8a7d1b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -726,7 +726,7 @@ def amdsmi_get_clock_measure( } -def amdsmi_get_bad_page_info( +def amdsmi_get_gpu_bad_page_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -738,7 +738,7 @@ def amdsmi_get_bad_page_info( retired_page_record = ctypes.POINTER( amdsmi_wrapper.amdsmi_retired_page_record_t)() _check_res( - amdsmi_wrapper.amdsmi_get_bad_page_info( + amdsmi_wrapper.amdsmi_get_gpu_bad_page_info( processor_handle, ctypes.byref(num_pages), retired_page_record ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 6d7efbea17..c7cec32ee1 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1475,9 +1475,9 @@ amdsmi_get_gpu_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_t amdsmi_get_gpu_memory_usage = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_usage amdsmi_get_gpu_memory_usage.restype = amdsmi_status_t amdsmi_get_gpu_memory_usage.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_get_bad_page_info = _libraries['libamd_smi.so'].amdsmi_get_bad_page_info -amdsmi_get_bad_page_info.restype = amdsmi_status_t -amdsmi_get_bad_page_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] +amdsmi_get_gpu_bad_page_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_bad_page_info +amdsmi_get_gpu_bad_page_info.restype = amdsmi_status_t +amdsmi_get_gpu_bad_page_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_retired_page_record_t)] amdsmi_get_gpu_ras_block_features_enabled = _libraries['libamd_smi.so'].amdsmi_get_gpu_ras_block_features_enabled amdsmi_get_gpu_ras_block_features_enabled.restype = amdsmi_status_t amdsmi_get_gpu_ras_block_features_enabled.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] @@ -1894,7 +1894,7 @@ __all__ = \ 'amdsmi_func_id_iter_handle_t', 'amdsmi_func_id_value_t', 'amdsmi_fw_block_t', 'amdsmi_fw_block_t__enumvalues', 'amdsmi_fw_info_t', 'amdsmi_get_gpu_asic_info', - 'amdsmi_get_bad_page_info', 'amdsmi_get_gpu_board_info', + 'amdsmi_get_gpu_bad_page_info', 'amdsmi_get_gpu_board_info', 'amdsmi_get_caps_info', 'amdsmi_get_clock_measure', 'amdsmi_get_compute_process_gpus', 'amdsmi_get_compute_process_info', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 56e4e90eb2..7f8d103ea8 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1571,7 +1571,7 @@ amdsmi_get_gpu_ras_block_features_enabled(amdsmi_processor_handle processor_hand } amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { +amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { AMDSMI_CHECK_INIT(); if (num_pages == nullptr) { From 5302a45b29c3a0f52abb9e4fc4a1e743609cc996 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:20:42 -0500 Subject: [PATCH 57/95] Renamed API amdsmi_get_ecc_error_count to amdsmi_get_gpu_ecc_error_count grep -rli 'amdsmi_get_ecc_error_count' * | xargs -i@ sed -i 's/amdsmi_get_ecc_error_count/amdsmi_get_gpu_ecc_error_count/g' @ Change-Id: I8b7b80278ac47d394f98718d41da5d5a1b833f9c [ROCm/amdsmi commit: b683eedab2224d1e213f4d9a322809713c20a10d] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/example/amd_smi_nodrm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 4dd523f821..9bc756a7ea 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -484,9 +484,9 @@ int main() { // Get ECC error counts amdsmi_error_count_t err_cnt_info = {}; - ret = amdsmi_get_ecc_error_count(processor_handles[j], &err_cnt_info); + ret = amdsmi_get_gpu_ecc_error_count(processor_handles[j], &err_cnt_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_ecc_error_count:\n"); + printf(" Output of amdsmi_get_gpu_ecc_error_count:\n"); printf("\tCorrectable errors: %lu\n", err_cnt_info.correctable_count); printf("\tUncorrectable errors: %lu\n\n", err_cnt_info.uncorrectable_count); diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 22fbfc4dae..6a8325f7b1 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -271,9 +271,9 @@ int main() { // Get ECC error counts amdsmi_error_count_t err_cnt_info = {}; - ret = amdsmi_get_ecc_error_count(processor_handles[j], &err_cnt_info); + ret = amdsmi_get_gpu_ecc_error_count(processor_handles[j], &err_cnt_info); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_ecc_error_count:\n"); + printf(" Output of amdsmi_get_gpu_ecc_error_count:\n"); printf("\tCorrectable errors: %lu\n", err_cnt_info.correctable_count); printf("\tUncorrectable errors: %lu\n\n", err_cnt_info.uncorrectable_count); diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index b24b1b2683..e38d06c4e6 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3878,7 +3878,7 @@ amdsmi_get_process_info(amdsmi_processor_handle processor_handle, amdsmi_process * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec); +amdsmi_get_gpu_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec); /** @} End eccinfo */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 3867aebcea..6537f9ef1d 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -875,7 +875,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_ecc_error_count +## amdsmi_get_gpu_ecc_error_count Description: Returns the ECC error count for the given GPU Input parameters: @@ -889,7 +889,7 @@ Field | Description `correctable_count`| Correctable ECC error count `uncorrectable_count`| Uncorrectable ECC error count -Exceptions that can be thrown by `amdsmi_get_ecc_error_count` function: +Exceptions that can be thrown by `amdsmi_get_gpu_ecc_error_count` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -902,7 +902,7 @@ try: print("No GPUs on machine") else: for device in devices: - ecc_error_count = amdsmi_get_ecc_error_count(device) + ecc_error_count = amdsmi_get_gpu_ecc_error_count(device) print(ecc_error_count["correctable_count"]) print(ecc_error_count["uncorrectable_count"]) except AmdSmiException as e: diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index b1fb20d1ef..2db2cf0d66 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -63,7 +63,7 @@ from .amdsmi_interface import amdsmi_get_process_list from .amdsmi_interface import amdsmi_get_process_info # # ECC Error Information -from .amdsmi_interface import amdsmi_get_ecc_error_count +from .amdsmi_interface import amdsmi_get_gpu_ecc_error_count # # Board Information from .amdsmi_interface import amdsmi_get_gpu_board_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index cb1b8a7d1b..b99feeaeed 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -779,7 +779,7 @@ def amdsmi_get_gpu_target_frequency_range( } -def amdsmi_get_ecc_error_count( +def amdsmi_get_gpu_ecc_error_count( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -789,7 +789,7 @@ def amdsmi_get_ecc_error_count( error_count = amdsmi_wrapper.amdsmi_error_count_t() _check_res( - amdsmi_wrapper.amdsmi_get_ecc_error_count( + amdsmi_wrapper.amdsmi_get_gpu_ecc_error_count( processor_handle, ctypes.byref(error_count) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index c7cec32ee1..0335975b9d 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1715,9 +1715,9 @@ amdsmi_get_process_list.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctyp amdsmi_get_process_info = _libraries['libamd_smi.so'].amdsmi_get_process_info amdsmi_get_process_info.restype = amdsmi_status_t amdsmi_get_process_info.argtypes = [amdsmi_processor_handle, amdsmi_process_handle, ctypes.POINTER(struct_c__SA_amdsmi_proc_info_t)] -amdsmi_get_ecc_error_count = _libraries['libamd_smi.so'].amdsmi_get_ecc_error_count -amdsmi_get_ecc_error_count.restype = amdsmi_status_t -amdsmi_get_ecc_error_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] +amdsmi_get_gpu_ecc_error_count = _libraries['libamd_smi.so'].amdsmi_get_gpu_ecc_error_count +amdsmi_get_gpu_ecc_error_count.restype = amdsmi_status_t +amdsmi_get_gpu_ecc_error_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] __all__ = \ ['AMDSMI_CNTR_CMD_START', 'AMDSMI_CNTR_CMD_STOP', 'AMDSMI_COARSE_GRAIN_GFX_ACTIVITY', @@ -1901,7 +1901,7 @@ __all__ = \ 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', 'amdsmi_get_gpu_device_uuid', - 'amdsmi_get_gpu_driver_version', 'amdsmi_get_ecc_error_count', + 'amdsmi_get_gpu_driver_version', 'amdsmi_get_gpu_ecc_error_count', 'amdsmi_get_event_notification', 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 7f8d103ea8..f47cf3c86b 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1598,7 +1598,7 @@ amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t } amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec) { +amdsmi_get_gpu_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); if (ec == nullptr) { From 60e0a30dfea2a018c37b93a131a4902fd77da2cf Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:27:29 -0500 Subject: [PATCH 58/95] Renamed API amdsmi_dev_get_ecc_count to amdsmi_dev_get_gpu_ecc_count grep -rli 'amdsmi_dev_get_ecc_count' * | xargs -i@ sed -i 's/amdsmi_dev_get_ecc_count/amdsmi_dev_get_gpu_ecc_count/g' @ Change-Id: I851aeec18de1e2151f74f39a149c6ddd53eee695 [ROCm/amdsmi commit: 8c76a96cfb7612d166168624d855b988a4a7276d] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e38d06c4e6..6ee1af9f78 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2679,7 +2679,7 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 6537f9ef1d..4874ea24d7 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2631,7 +2631,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_ecc_count +## amdsmi_dev_get_gpu_ecc_count Description: Retrieve the error counts for a GPU block Input parameters: @@ -2645,7 +2645,7 @@ Field | Description `correctable_count`| Count of correctable errors `uncorrectable_count`| Count of uncorrectable errors -Exceptions that can be thrown by ` amdsmi_dev_get_ecc_count` function: +Exceptions that can be thrown by ` amdsmi_dev_get_gpu_ecc_count` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2658,7 +2658,7 @@ try: print("No GPUs on machine") else: for device in devices: - ecc_count = amdsmi_dev_get_ecc_count(device, AmdSmiGpuBlock.UMC) + ecc_count = amdsmi_dev_get_gpu_ecc_count(device, AmdSmiGpuBlock.UMC) print(ecc_count) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 2db2cf0d66..171e721a9b 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -124,7 +124,7 @@ from .amdsmi_interface import amdsmi_read_counter from .amdsmi_interface import amdsmi_counter_get_available_counters # # Error Query -from .amdsmi_interface import amdsmi_dev_get_ecc_count +from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_count from .amdsmi_interface import amdsmi_dev_get_ecc_enabled from .amdsmi_interface import amdsmi_dev_get_ecc_status from .amdsmi_interface import amdsmi_status_string diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index b99feeaeed..19c8de8bb5 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2462,7 +2462,7 @@ def amdsmi_get_gpu_power_profile_presets( } -def amdsmi_dev_get_ecc_count( +def amdsmi_dev_get_gpu_ecc_count( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> Dict[str, int]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2475,7 +2475,7 @@ def amdsmi_dev_get_ecc_count( ec = amdsmi_wrapper.amdsmi_error_count_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_ecc_count( + amdsmi_wrapper. amdsmi_dev_get_gpu_ecc_count( processor_handle, block, ctypes.byref(ec)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 0335975b9d..6fb1c1cd12 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1577,9 +1577,9 @@ amdsmi_get_version.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_version_t)] amdsmi_get_version_str = _libraries['libamd_smi.so'].amdsmi_get_version_str amdsmi_get_version_str.restype = amdsmi_status_t amdsmi_get_version_str.argtypes = [amdsmi_sw_component_t, ctypes.POINTER(ctypes.c_char), uint32_t] -amdsmi_dev_get_ecc_count = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_count -amdsmi_dev_get_ecc_count.restype = amdsmi_status_t -amdsmi_dev_get_ecc_count.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] +amdsmi_dev_get_gpu_ecc_count = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_count +amdsmi_dev_get_gpu_ecc_count.restype = amdsmi_status_t +amdsmi_dev_get_gpu_ecc_count.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] amdsmi_dev_get_ecc_enabled = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_enabled amdsmi_dev_get_ecc_enabled.restype = amdsmi_status_t amdsmi_dev_get_ecc_enabled.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] @@ -1852,7 +1852,7 @@ __all__ = \ 'amdsmi_dev_close_supported_func_iterator', 'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter', 'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent', - 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_ecc_count', + 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', 'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index a2e7c17077..4dff80901d 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -321,7 +321,7 @@ class Formatter: | """ + self.style.text("32 Get device power profile presets. Api: amdsmi_get_gpu_power_profile_presets ") + """ | | """ + self.style.text("33 Get the build version. Api: amdsmi_get_version ") + """ | | """ + self.style.text("34 Get version string. Api: amdsmi_get_version_str ") + """ | - | """ + self.style.text("35 Get device ecc counter. Api: amdsmi_dev_get_ecc_count ") + """ | + | """ + self.style.text("35 Get device ecc counter. Api: amdsmi_dev_get_gpu_ecc_count ") + """ | | """ + self.style.text("36 Get device ecc enable. Api: amdsmi_dev_get_ecc_enabled ") + """ | | """ + self.style.text("37 Get device ecc status. Api: amdsmi_dev_get_ecc_status ") + """ | | """ + self.style.text("38 Get status string. Api: amdsmi_status_string ") + """ | @@ -509,7 +509,7 @@ def amdsmi_tool_dev_ecc_count_get(dev): result = {} for gpu_block in smi_api.AmdSmiGpuBlock: try: - value = smi_api. amdsmi_dev_get_ecc_count(dev, gpu_block) + value = smi_api. amdsmi_dev_get_gpu_ecc_count(dev, gpu_block) result.update({gpu_block.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(gpu_block.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index f47cf3c86b..6f22455f71 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -936,7 +936,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_gpu_clk_freq_get", " amdsmi_get_clk_freq"}, {"rsmi_dev_gpu_clk_freq_set", " amdsmi_set_clk_freq"}, {"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"}, - {"rsmi_dev_ecc_count_get", " amdsmi_dev_get_ecc_count"}, + {"rsmi_dev_ecc_count_get", " amdsmi_dev_get_gpu_ecc_count"}, {"rsmi_counter_available_counters_get", " amdsmi_counter_get_available_counters"}, {"rsmi_dev_power_ave_get", "amdsmi_get_power_ave"}, {"rsmi_dev_power_cap_get", "amdsmi_get_power_cap_info"}, @@ -1008,7 +1008,7 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, return amd::smi::rsmi_to_amdsmi_status(r); } -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc index db8dc6ba09..2ff4630459 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc @@ -139,7 +139,7 @@ void TestErrCntRead::Run(void) { nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), &ec); + err = amdsmi_dev_get_gpu_ecc_count(processor_handles_[i], static_cast(b), &ec); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -148,7 +148,7 @@ void TestErrCntRead::Run(void) { ": Not supported for this device" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), + err = amdsmi_dev_get_gpu_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); @@ -164,7 +164,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), + err = amdsmi_dev_get_gpu_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 31965fb834..021caa3372 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -249,7 +249,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); + ret = amdsmi_dev_get_gpu_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_ecc_enabled(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); From 6d927b285c400130f0ef966d0fa96d4873d350ce Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:29:02 -0500 Subject: [PATCH 59/95] Renamed API amdsmi_dev_get_ecc_enabled to amdsmi_dev_get_gpu_ecc_enabled grep -rli 'amdsmi_dev_get_ecc_enabled' * | xargs -i@ sed -i 's/amdsmi_dev_get_ecc_enabled/amdsmi_dev_get_gpu_ecc_enabled/g' @ Change-Id: I8cb31a2fc4128758a3545e1d17f743a6eff152a0 [ROCm/amdsmi commit: 4347ad6a0ca65dfe35ecf04bf2d56c1688b5cb57] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc | 6 +++--- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 6ee1af9f78..3ff5e536e9 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2706,7 +2706,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 4874ea24d7..9ca68d834e 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2664,7 +2664,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_ecc_enabled +## amdsmi_dev_get_gpu_ecc_enabled Description: Retrieve the enabled ECC bit-mask Input parameters: @@ -2672,7 +2672,7 @@ Input parameters: Output: Enabled ECC bit-mask -Exceptions that can be thrown by ` amdsmi_dev_get_ecc_enabled` function: +Exceptions that can be thrown by ` amdsmi_dev_get_gpu_ecc_enabled` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2685,7 +2685,7 @@ try: print("No GPUs on machine") else: for device in devices: - enabled = amdsmi_dev_get_ecc_enabled(device) + enabled = amdsmi_dev_get_gpu_ecc_enabled(device) print(enabled) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 171e721a9b..b111102b29 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -125,7 +125,7 @@ from .amdsmi_interface import amdsmi_counter_get_available_counters # # Error Query from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_count -from .amdsmi_interface import amdsmi_dev_get_ecc_enabled +from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_enabled from .amdsmi_interface import amdsmi_dev_get_ecc_status from .amdsmi_interface import amdsmi_status_string diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 19c8de8bb5..10721fbe5e 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2485,7 +2485,7 @@ def amdsmi_dev_get_gpu_ecc_count( } -def amdsmi_dev_get_ecc_enabled( +def amdsmi_dev_get_gpu_ecc_enabled( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2495,7 +2495,7 @@ def amdsmi_dev_get_ecc_enabled( blocks = ctypes.c_uint64(0) _check_res( - amdsmi_wrapper. amdsmi_dev_get_ecc_enabled( + amdsmi_wrapper. amdsmi_dev_get_gpu_ecc_enabled( processor_handle, ctypes.byref(blocks)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 6fb1c1cd12..7560192c51 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1580,9 +1580,9 @@ amdsmi_get_version_str.argtypes = [amdsmi_sw_component_t, ctypes.POINTER(ctypes. amdsmi_dev_get_gpu_ecc_count = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_count amdsmi_dev_get_gpu_ecc_count.restype = amdsmi_status_t amdsmi_dev_get_gpu_ecc_count.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] -amdsmi_dev_get_ecc_enabled = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_enabled -amdsmi_dev_get_ecc_enabled.restype = amdsmi_status_t -amdsmi_dev_get_ecc_enabled.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_dev_get_gpu_ecc_enabled = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_enabled +amdsmi_dev_get_gpu_ecc_enabled.restype = amdsmi_status_t +amdsmi_dev_get_gpu_ecc_enabled.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_get_ecc_status = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_status amdsmi_dev_get_ecc_status.restype = amdsmi_status_t amdsmi_dev_get_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] @@ -1853,7 +1853,7 @@ __all__ = \ 'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter', 'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', - 'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status', + 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', 'amdsmi_get_clk_freq', 'amdsmi_get_gpu_metrics_info', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 4dff80901d..1fea97ba02 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -322,7 +322,7 @@ class Formatter: | """ + self.style.text("33 Get the build version. Api: amdsmi_get_version ") + """ | | """ + self.style.text("34 Get version string. Api: amdsmi_get_version_str ") + """ | | """ + self.style.text("35 Get device ecc counter. Api: amdsmi_dev_get_gpu_ecc_count ") + """ | - | """ + self.style.text("36 Get device ecc enable. Api: amdsmi_dev_get_ecc_enabled ") + """ | + | """ + self.style.text("36 Get device ecc enable. Api: amdsmi_dev_get_gpu_ecc_enabled ") + """ | | """ + self.style.text("37 Get device ecc status. Api: amdsmi_dev_get_ecc_status ") + """ | | """ + self.style.text("38 Get status string. Api: amdsmi_status_string ") + """ | | """ + self.style.text("39 Get compute process info. Api: amdsmi_get_compute_process_info ") + """ | @@ -830,7 +830,7 @@ commands = { 35: [amdsmi_tool_dev_ecc_count_get, { "device_identifier1": [None, True] }], - 36: [smi_api. amdsmi_dev_get_ecc_enabled, { + 36: [smi_api. amdsmi_dev_get_gpu_ecc_enabled, { "device_identifier1": [None, True] }], 37: [amdsmi_tool_dev_ecc_status_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 6f22455f71..d6f28ac345 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -921,7 +921,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_od_volt_info_get", " amdsmi_dev_get_od_volt_info"}, {"rsmi_dev_od_volt_info_set", " amdsmi_dev_set_od_volt_info"}, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, - {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_ecc_enabled"}, + {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_ecc_status"}, {"rsmi_dev_counter_group_supported", "amdsmi_dev_counter_group_supported"}, {"rsmi_dev_counter_create", "amdsmi_dev_create_counter"}, @@ -1018,7 +1018,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_ static_cast(block), reinterpret_cast(ec)); } -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc index 2ff4630459..82ee0d6a48 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc @@ -100,7 +100,7 @@ void TestErrCntRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], &enabled_mask); + err = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[i], &enabled_mask); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -108,7 +108,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr); + err = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); continue; @@ -116,7 +116,7 @@ void TestErrCntRead::Run(void) { CHK_ERR_ASRT(err) // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr); + err = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 021caa3372..b64114b09e 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -251,7 +251,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_gpu_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_enabled(processor_handles_[0], &dmy_ui64); + ret = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); CHECK_RET(ret, AMDSMI_STATUS_BUSY); From 2e060f29349897632017cc2465f8ed1298701d7c Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:30:33 -0500 Subject: [PATCH 60/95] Renamed API amdsmi_dev_get_ecc_status to amdsmi_dev_get_gpu_ecc_status grep -rli 'amdsmi_dev_get_ecc_status' * | xargs -i@ sed -i 's/amdsmi_dev_get_ecc_status/amdsmi_dev_get_gpu_ecc_status/g' @ Change-Id: I11f9b818e251684d688f266e8721ff7a9277f6bd [ROCm/amdsmi commit: 7232a79e180be79d699491d4756fb501c22b803d] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 3ff5e536e9..18a0039545 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2730,7 +2730,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processo * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, +amdsmi_status_t amdsmi_dev_get_gpu_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 9ca68d834e..f04e7ec1ad 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2691,7 +2691,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_ecc_status +## amdsmi_dev_get_gpu_ecc_status Description: Retrieve the ECC status for a GPU block Input parameters: @@ -2700,7 +2700,7 @@ Input parameters: Output: ECC status for a requested GPU block -Exceptions that can be thrown by ` amdsmi_dev_get_ecc_status` function: +Exceptions that can be thrown by ` amdsmi_dev_get_gpu_ecc_status` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2713,7 +2713,7 @@ try: print("No GPUs on machine") else: for device in devices: - status = amdsmi_dev_get_ecc_status(device, AmdSmiGpuBlock.UMC) + status = amdsmi_dev_get_gpu_ecc_status(device, AmdSmiGpuBlock.UMC) print(status) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index b111102b29..2521bb3218 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -126,7 +126,7 @@ from .amdsmi_interface import amdsmi_counter_get_available_counters # # Error Query from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_count from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_enabled -from .amdsmi_interface import amdsmi_dev_get_ecc_status +from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_status from .amdsmi_interface import amdsmi_status_string # # System Information Query diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 10721fbe5e..d016069b68 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2502,7 +2502,7 @@ def amdsmi_dev_get_gpu_ecc_enabled( return blocks.value -def amdsmi_dev_get_ecc_status( +def amdsmi_dev_get_gpu_ecc_status( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> AmdSmiRasErrState: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2515,7 +2515,7 @@ def amdsmi_dev_get_ecc_status( state = amdsmi_wrapper.amdsmi_ras_err_state_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_ecc_status( + amdsmi_wrapper. amdsmi_dev_get_gpu_ecc_status( processor_handle, block, ctypes.byref(state) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 7560192c51..9e88b5d512 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1583,9 +1583,9 @@ amdsmi_dev_get_gpu_ecc_count.argtypes = [amdsmi_processor_handle, amdsmi_gpu_blo amdsmi_dev_get_gpu_ecc_enabled = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_enabled amdsmi_dev_get_gpu_ecc_enabled.restype = amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_dev_get_ecc_status = _libraries['libamd_smi.so'].amdsmi_dev_get_ecc_status -amdsmi_dev_get_ecc_status.restype = amdsmi_status_t -amdsmi_dev_get_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] +amdsmi_dev_get_gpu_ecc_status = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_status +amdsmi_dev_get_gpu_ecc_status.restype = amdsmi_status_t +amdsmi_dev_get_gpu_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] amdsmi_status_string = _libraries['libamd_smi.so'].amdsmi_status_string amdsmi_status_string.restype = amdsmi_status_t amdsmi_status_string.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] @@ -1853,7 +1853,7 @@ __all__ = \ 'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter', 'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', - 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_ecc_status', + 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_gpu_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', 'amdsmi_get_clk_freq', 'amdsmi_get_gpu_metrics_info', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 1fea97ba02..e645f4fb00 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -323,7 +323,7 @@ class Formatter: | """ + self.style.text("34 Get version string. Api: amdsmi_get_version_str ") + """ | | """ + self.style.text("35 Get device ecc counter. Api: amdsmi_dev_get_gpu_ecc_count ") + """ | | """ + self.style.text("36 Get device ecc enable. Api: amdsmi_dev_get_gpu_ecc_enabled ") + """ | - | """ + self.style.text("37 Get device ecc status. Api: amdsmi_dev_get_ecc_status ") + """ | + | """ + self.style.text("37 Get device ecc status. Api: amdsmi_dev_get_gpu_ecc_status ") + """ | | """ + self.style.text("38 Get status string. Api: amdsmi_status_string ") + """ | | """ + self.style.text("39 Get compute process info. Api: amdsmi_get_compute_process_info ") + """ | | """ + self.style.text("40 Get compute process info by pid. Api: amdsmi_get_compute_process_info_by_pid ") + """ | @@ -520,7 +520,7 @@ def amdsmi_tool_dev_ecc_status_get(dev): result = {} for gpu_block in smi_api.AmdSmiGpuBlock: try: - value = smi_api. amdsmi_dev_get_ecc_status(dev, gpu_block) + value = smi_api. amdsmi_dev_get_gpu_ecc_status(dev, gpu_block) result.update({gpu_block.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(gpu_block.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index d6f28ac345..a558318876 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -922,7 +922,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_od_volt_info_set", " amdsmi_dev_set_od_volt_info"}, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, - {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_ecc_status"}, + {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, {"rsmi_dev_counter_group_supported", "amdsmi_dev_counter_group_supported"}, {"rsmi_dev_counter_create", "amdsmi_dev_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, @@ -1027,7 +1027,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processo return rsmi_wrapper(rsmi_dev_ecc_enabled_get, processor_handle, enabled_blocks); } -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_dev_get_gpu_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc index 82ee0d6a48..c43771ef1c 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc @@ -126,7 +126,7 @@ void TestErrCntRead::Run(void) { } for (uint32_t b = AMDSMI_GPU_BLOCK_FIRST; b <= AMDSMI_GPU_BLOCK_LAST; b = b*2) { - err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast(b), + err = amdsmi_dev_get_gpu_ecc_status(processor_handles_[i], static_cast(b), &err_state); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { @@ -135,7 +135,7 @@ void TestErrCntRead::Run(void) { " block: " << GetErrStateNameStr(err_state) << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast(b), + err = amdsmi_dev_get_gpu_ecc_status(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index b64114b09e..b3fdaca149 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -253,7 +253,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); + ret = amdsmi_dev_get_gpu_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); CHECK_RET(ret, AMDSMI_STATUS_BUSY); /* Other functions holding device mutexes. Listed for reference. From e92d12ebbb105ddab8b21069dbdf0b08d14844b7 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:33:11 -0500 Subject: [PATCH 61/95] Renamed API amdsmi_get_process_list to amdsmi_get_gpu_process_list grep -rli 'amdsmi_get_process_list' * | xargs -i@ sed -i 's/amdsmi_get_process_list/amdsmi_get_gpu_process_list/g' @ Change-Id: I230c23aa135e9e11575e73c58355ae444783d1a5 [ROCm/amdsmi commit: c92f18dda1a38aa521df6245999da6160fd7cdf5] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 8 ++++---- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 6 +++--- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 9bc756a7ea..7b3be04939 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -514,7 +514,7 @@ int main() { freq_ranges.current_freq_range.upper_bound); uint32_t num_process = 0; - ret = amdsmi_get_process_list(processor_handles[j], nullptr, + ret = amdsmi_get_gpu_process_list(processor_handles[j], nullptr, &num_process); CHK_AMDSMI_RET(ret) if (!num_process) { @@ -529,7 +529,7 @@ int main() { sprintf(bdf_str, "%04lx:%02x:%02x.%d", bdf.domain_number, bdf.bus_number, bdf.device_number, bdf.function_number); int num = 0; - ret = amdsmi_get_process_list(processor_handles[j], process_list, + ret = amdsmi_get_gpu_process_list(processor_handles[j], process_list, &num_process); CHK_AMDSMI_RET(ret) for (uint32_t it = 0; it < num_process; it += 1) { diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 18a0039545..d6029f420d 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3841,7 +3841,7 @@ amdsmi_get_gpu_target_frequency_range(amdsmi_processor_handle processor_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes); +amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes); /** * @brief Returns the process information of a given process. diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index f04e7ec1ad..36d48261c0 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -810,7 +810,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_process_list +## amdsmi_get_gpu_process_list Description: Returns the list of processes for the given GPU Input parameters: @@ -819,7 +819,7 @@ Input parameters: Output: List of process handles found -Exceptions that can be thrown by `amdsmi_get_process_list` function: +Exceptions that can be thrown by `amdsmi_get_gpu_process_list` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -832,7 +832,7 @@ try: print("No GPUs on machine") else: for device in devices: - processes = amdsmi_get_process_list(device) + processes = amdsmi_get_gpu_process_list(device) print(processes) except AmdSmiException as e: print(e) @@ -868,7 +868,7 @@ try: print("No GPUs on machine") else: for device in devices: - processes = amdsmi_get_process_list(device) + processes = amdsmi_get_gpu_process_list(device) for process in processes: print(amdsmi_get_process_info(device, process)) except AmdSmiException as e: diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 2521bb3218..57726db832 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -59,7 +59,7 @@ from .amdsmi_interface import amdsmi_get_gpu_bad_page_info from .amdsmi_interface import amdsmi_get_gpu_target_frequency_range # # Process Information -from .amdsmi_interface import amdsmi_get_process_list +from .amdsmi_interface import amdsmi_get_gpu_process_list from .amdsmi_interface import amdsmi_get_process_info # # ECC Error Information diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index d016069b68..57d17608cb 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -853,7 +853,7 @@ def amdsmi_get_gpu_ras_block_features_enabled( return ras_states -def amdsmi_get_process_list( +def amdsmi_get_gpu_process_list( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> List[amdsmi_wrapper.amdsmi_process_handle]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -865,7 +865,7 @@ def amdsmi_get_process_list( process_list = (amdsmi_wrapper.amdsmi_process_handle * max_processes.value)() _check_res( - amdsmi_wrapper.amdsmi_get_process_list( + amdsmi_wrapper.amdsmi_get_gpu_process_list( processor_handle, process_list, ctypes.byref(max_processes) ) ) @@ -873,7 +873,7 @@ def amdsmi_get_process_list( process_list = (amdsmi_wrapper.amdsmi_process_handle * max_processes.value)() _check_res( - amdsmi_wrapper.amdsmi_get_process_list( + amdsmi_wrapper.amdsmi_get_gpu_process_list( processor_handle, process_list, ctypes.byref(max_processes) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9e88b5d512..74d4ad8f7a 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1709,9 +1709,9 @@ amdsmi_get_gpu_vram_usage.argtypes = [amdsmi_processor_handle, ctypes.POINTER(st amdsmi_get_gpu_target_frequency_range = _libraries['libamd_smi.so'].amdsmi_get_gpu_target_frequency_range amdsmi_get_gpu_target_frequency_range.restype = amdsmi_status_t amdsmi_get_gpu_target_frequency_range.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequency_range_t)] -amdsmi_get_process_list = _libraries['libamd_smi.so'].amdsmi_get_process_list -amdsmi_get_process_list.restype = amdsmi_status_t -amdsmi_get_process_list.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_process_list = _libraries['libamd_smi.so'].amdsmi_get_gpu_process_list +amdsmi_get_gpu_process_list.restype = amdsmi_status_t +amdsmi_get_gpu_process_list.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] amdsmi_get_process_info = _libraries['libamd_smi.so'].amdsmi_get_process_info amdsmi_get_process_info.restype = amdsmi_status_t amdsmi_get_process_info.argtypes = [amdsmi_processor_handle, amdsmi_process_handle, ctypes.POINTER(struct_c__SA_amdsmi_proc_info_t)] @@ -1907,7 +1907,7 @@ __all__ = \ 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_cap_info', 'amdsmi_get_power_measure', 'amdsmi_get_process_info', - 'amdsmi_get_process_list', + 'amdsmi_get_gpu_process_list', 'amdsmi_get_gpu_ras_block_features_enabled', 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', 'amdsmi_get_gpu_target_frequency_range', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index a558318876..98fb246aa0 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1625,7 +1625,7 @@ amdsmi_get_gpu_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_ } amdsmi_status_t -amdsmi_get_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes) { +amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes) { AMDSMI_CHECK_INIT(); if (max_processes == nullptr) { From edd17ebe301acaf60ce0b4fea8a393927ebf4c2a Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:34:28 -0500 Subject: [PATCH 62/95] Renamed API amdsmi_get_process_info to amdsmi_get_gpu_process_info grep -rli 'amdsmi_get_process_info' * | xargs -i@ sed -i 's/amdsmi_get_process_info/amdsmi_get_gpu_process_info/g' @ Change-Id: I8f050ed59c926a821894780f9036b9f52c48ef88 [ROCm/amdsmi commit: 64b258ae844c8712767d5d2401cc5fe9c15f0015] --- projects/amdsmi/example/amd_smi_drm_example.cc | 4 ++-- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 7b3be04939..38267cf3d0 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -536,10 +536,10 @@ int main() { if (getpid() == process_list[it]) { continue; } - ret = amdsmi_get_process_info(processor_handles[j], + ret = amdsmi_get_gpu_process_info(processor_handles[j], process_list[it], &process); if (ret != AMDSMI_STATUS_SUCCESS) { - printf("amdsmi_get_process_info() failed for " + printf("amdsmi_get_gpu_process_info() failed for " "process_list[%d], returned %d\n", it, ret); continue; diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index d6029f420d..e8d8f370a2 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3857,7 +3857,7 @@ amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, amdsmi_pro * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); +amdsmi_get_gpu_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); /** @} End processinfo */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 36d48261c0..96fa1f0f37 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -837,7 +837,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_process_info +## amdsmi_get_gpu_process_info Description: Returns the info for the given process Input parameters: @@ -855,7 +855,7 @@ Field | Description `engine_usage`|
Subfield Description
`gfx`GFX engine usage in ns
`compute`Compute engine usage in ns
`dma`DMA engine usage in ns
`enc`Encode engine usage in ns
`dec`Decode engine usage in ns
`memory_usage`|
Subfield Description
`gtt_mem`GTT memory usage
`cpu_mem`CPU memory usage
`vram_mem`VRAM memory usage
-Exceptions that can be thrown by `amdsmi_get_process_info` function: +Exceptions that can be thrown by `amdsmi_get_gpu_process_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -870,7 +870,7 @@ try: for device in devices: processes = amdsmi_get_gpu_process_list(device) for process in processes: - print(amdsmi_get_process_info(device, process)) + print(amdsmi_get_gpu_process_info(device, process)) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 57726db832..eb530fec69 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -60,7 +60,7 @@ from .amdsmi_interface import amdsmi_get_gpu_target_frequency_range # # Process Information from .amdsmi_interface import amdsmi_get_gpu_process_list -from .amdsmi_interface import amdsmi_get_process_info +from .amdsmi_interface import amdsmi_get_gpu_process_info # # ECC Error Information from .amdsmi_interface import amdsmi_get_gpu_ecc_error_count diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 57d17608cb..c0c8152256 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -881,7 +881,7 @@ def amdsmi_get_gpu_process_list( return [amdsmi_wrapper.amdsmi_process_handle(x) for x in list(process_list)] -def amdsmi_get_process_info( +def amdsmi_get_gpu_process_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, process: amdsmi_wrapper.amdsmi_process_handle, ) -> Dict[str, Any]: @@ -896,7 +896,7 @@ def amdsmi_get_process_info( info = amdsmi_wrapper.amdsmi_proc_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_process_info( + amdsmi_wrapper.amdsmi_get_gpu_process_info( processor_handle, process, ctypes.byref(info) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 74d4ad8f7a..c280e974ef 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1712,9 +1712,9 @@ amdsmi_get_gpu_target_frequency_range.argtypes = [amdsmi_processor_handle, amdsm amdsmi_get_gpu_process_list = _libraries['libamd_smi.so'].amdsmi_get_gpu_process_list amdsmi_get_gpu_process_list.restype = amdsmi_status_t amdsmi_get_gpu_process_list.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] -amdsmi_get_process_info = _libraries['libamd_smi.so'].amdsmi_get_process_info -amdsmi_get_process_info.restype = amdsmi_status_t -amdsmi_get_process_info.argtypes = [amdsmi_processor_handle, amdsmi_process_handle, ctypes.POINTER(struct_c__SA_amdsmi_proc_info_t)] +amdsmi_get_gpu_process_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_process_info +amdsmi_get_gpu_process_info.restype = amdsmi_status_t +amdsmi_get_gpu_process_info.argtypes = [amdsmi_processor_handle, amdsmi_process_handle, ctypes.POINTER(struct_c__SA_amdsmi_proc_info_t)] amdsmi_get_gpu_ecc_error_count = _libraries['libamd_smi.so'].amdsmi_get_gpu_ecc_error_count amdsmi_get_gpu_ecc_error_count.restype = amdsmi_status_t amdsmi_get_gpu_ecc_error_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] @@ -1906,7 +1906,7 @@ __all__ = \ 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_cap_info', - 'amdsmi_get_power_measure', 'amdsmi_get_process_info', + 'amdsmi_get_power_measure', 'amdsmi_get_gpu_process_info', 'amdsmi_get_gpu_process_list', 'amdsmi_get_gpu_ras_block_features_enabled', 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 98fb246aa0..befaa16d7d 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1673,7 +1673,7 @@ amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, amdsmi_pro } amdsmi_status_t -amdsmi_get_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { +amdsmi_get_gpu_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { From 48aa5df6efb8b8eb31a5d3a7ed8017281f154653 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:35:46 -0500 Subject: [PATCH 63/95] Renamed APIs 1) amdsmi_get_compute_process_info to amdsmi_get_gpu_compute_process_info 2) amdsmi_get_compute_process_info_by_pid to amdsmi_get_gpu_compute_process_info_by_pid grep -rli 'amdsmi_get_compute_process_info' * | xargs -i@ sed -i 's/amdsmi_get_compute_process_info/amdsmi_get_gpu_compute_process_info/g' @ Change-Id: Ia5c9c22d1466ecea27d3ae3025b3b87db75853e2 [ROCm/amdsmi commit: f3854b3d5f7f0cfb6f00d555c47c2eb9f547f826] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/README.md | 12 ++++++------ projects/amdsmi/py-interface/__init__.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_interface.py | 10 +++++----- projects/amdsmi/py-interface/amdsmi_wrapper.py | 16 ++++++++-------- projects/amdsmi/py-interface/rocm_smi_tool.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amd_smi_test/functional/process_info_read.cc | 14 +++++++------- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e8d8f370a2..5e6a7a001c 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3011,7 +3011,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_compute_process_info(amdsmi_process_info_t *procs, uint32_t *num_items); +amdsmi_get_gpu_compute_process_info(amdsmi_process_info_t *procs, uint32_t *num_items); /** * @brief Get process information about a specific process @@ -3030,7 +3030,7 @@ amdsmi_get_compute_process_info(amdsmi_process_info_t *procs, uint32_t *num_item * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t *proc); +amdsmi_get_gpu_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t *proc); /** * @brief Get the device indices currently being used by a process diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 96fa1f0f37..87b3323d64 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2739,7 +2739,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_compute_process_info +## amdsmi_get_gpu_compute_process_info Description: Get process information about processes currently using GPU Input parameters: None @@ -2754,21 +2754,21 @@ Field | Description `sdma_usage` | SDMA usage in microseconds `cu_occupancy` | Compute Unit usage in percents -Exceptions that can be thrown by `amdsmi_get_compute_process_info` function: +Exceptions that can be thrown by `amdsmi_get_gpu_compute_process_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` Example: ```python try: - procs = amdsmi_get_compute_process_info() + procs = amdsmi_get_gpu_compute_process_info() for proc in procs: print(proc) except AmdSmiException as e: print(e) ``` -## amdsmi_get_compute_process_info_by_pid +## amdsmi_get_gpu_compute_process_info_by_pid Description: Get process information about processes currently using GPU Input parameters: @@ -2784,7 +2784,7 @@ Field | Description `sdma_usage` | SDMA usage in microseconds `cu_occupancy` | Compute Unit usage in percents -Exceptions that can be thrown by `amdsmi_get_compute_process_info_by_pid` function: +Exceptions that can be thrown by `amdsmi_get_gpu_compute_process_info_by_pid` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2793,7 +2793,7 @@ Example: ```python try: pid = 0 # << valid pid here - proc = amdsmi_get_compute_process_info_by_pid(pid) + proc = amdsmi_get_gpu_compute_process_info_by_pid(pid) print(proc) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index eb530fec69..c72adbb1f3 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -130,8 +130,8 @@ from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_status from .amdsmi_interface import amdsmi_status_string # # System Information Query -from .amdsmi_interface import amdsmi_get_compute_process_info -from .amdsmi_interface import amdsmi_get_compute_process_info_by_pid +from .amdsmi_interface import amdsmi_get_gpu_compute_process_info +from .amdsmi_interface import amdsmi_get_gpu_compute_process_info_by_pid from .amdsmi_interface import amdsmi_get_compute_process_gpus from .amdsmi_interface import amdsmi_dev_xgmi_error_status from .amdsmi_interface import amdsmi_dev_reset_xgmi_error diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index c0c8152256..15ec7d3d3a 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2535,17 +2535,17 @@ def amdsmi_status_string(status: amdsmi_wrapper.amdsmi_status_t) -> str: return amdsmi_wrapper.string_cast(status_string_p_p.contents) -def amdsmi_get_compute_process_info() -> List[Dict[str, int]]: +def amdsmi_get_gpu_compute_process_info() -> List[Dict[str, int]]: num_items = ctypes.c_uint32(0) nullptr = ctypes.POINTER(amdsmi_wrapper.amdsmi_process_info_t)() _check_res( - amdsmi_wrapper.amdsmi_get_compute_process_info( + amdsmi_wrapper.amdsmi_get_gpu_compute_process_info( nullptr, ctypes.byref(num_items)) ) procs = (amdsmi_wrapper.amdsmi_process_info_t * num_items.value)() _check_res( - amdsmi_wrapper.amdsmi_get_compute_process_info( + amdsmi_wrapper.amdsmi_get_gpu_compute_process_info( procs, ctypes.byref(num_items)) ) @@ -2561,13 +2561,13 @@ def amdsmi_get_compute_process_info() -> List[Dict[str, int]]: ] -def amdsmi_get_compute_process_info_by_pid(pid: int) -> Dict[str, int]: +def amdsmi_get_gpu_compute_process_info_by_pid(pid: int) -> Dict[str, int]: if not isinstance(pid, int): raise AmdSmiParameterException(pid, int) proc = amdsmi_wrapper.amdsmi_process_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_compute_process_info_by_pid( + amdsmi_wrapper.amdsmi_get_gpu_compute_process_info_by_pid( ctypes.c_uint32(pid), ctypes.byref(proc) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index c280e974ef..ca244aad03 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1607,12 +1607,12 @@ amdsmi_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__ amdsmi_counter_get_available_counters = _libraries['libamd_smi.so'].amdsmi_counter_get_available_counters amdsmi_counter_get_available_counters.restype = amdsmi_status_t amdsmi_counter_get_available_counters.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t, ctypes.POINTER(ctypes.c_uint32)] -amdsmi_get_compute_process_info = _libraries['libamd_smi.so'].amdsmi_get_compute_process_info -amdsmi_get_compute_process_info.restype = amdsmi_status_t -amdsmi_get_compute_process_info.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_process_info_t), ctypes.POINTER(ctypes.c_uint32)] -amdsmi_get_compute_process_info_by_pid = _libraries['libamd_smi.so'].amdsmi_get_compute_process_info_by_pid -amdsmi_get_compute_process_info_by_pid.restype = amdsmi_status_t -amdsmi_get_compute_process_info_by_pid.argtypes = [uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_process_info_t)] +amdsmi_get_gpu_compute_process_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_compute_process_info +amdsmi_get_gpu_compute_process_info.restype = amdsmi_status_t +amdsmi_get_gpu_compute_process_info.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_process_info_t), ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_compute_process_info_by_pid = _libraries['libamd_smi.so'].amdsmi_get_gpu_compute_process_info_by_pid +amdsmi_get_gpu_compute_process_info_by_pid.restype = amdsmi_status_t +amdsmi_get_gpu_compute_process_info_by_pid.argtypes = [uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_process_info_t)] amdsmi_get_compute_process_gpus = _libraries['libamd_smi.so'].amdsmi_get_compute_process_gpus amdsmi_get_compute_process_gpus.restype = amdsmi_status_t amdsmi_get_compute_process_gpus.argtypes = [uint32_t, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] @@ -1897,8 +1897,8 @@ __all__ = \ 'amdsmi_get_gpu_bad_page_info', 'amdsmi_get_gpu_board_info', 'amdsmi_get_caps_info', 'amdsmi_get_clock_measure', 'amdsmi_get_compute_process_gpus', - 'amdsmi_get_compute_process_info', - 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', + 'amdsmi_get_gpu_compute_process_info', + 'amdsmi_get_gpu_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', 'amdsmi_get_gpu_device_uuid', 'amdsmi_get_gpu_driver_version', 'amdsmi_get_gpu_ecc_error_count', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index e645f4fb00..8be10a887e 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -325,8 +325,8 @@ class Formatter: | """ + self.style.text("36 Get device ecc enable. Api: amdsmi_dev_get_gpu_ecc_enabled ") + """ | | """ + self.style.text("37 Get device ecc status. Api: amdsmi_dev_get_gpu_ecc_status ") + """ | | """ + self.style.text("38 Get status string. Api: amdsmi_status_string ") + """ | - | """ + self.style.text("39 Get compute process info. Api: amdsmi_get_compute_process_info ") + """ | - | """ + self.style.text("40 Get compute process info by pid. Api: amdsmi_get_compute_process_info_by_pid ") + """ | + | """ + self.style.text("39 Get compute process info. Api: amdsmi_get_gpu_compute_process_info ") + """ | + | """ + self.style.text("40 Get compute process info by pid. Api: amdsmi_get_gpu_compute_process_info_by_pid ") + """ | | """ + self.style.text("41 Get compute process gpus. Api: amdsmi_get_compute_process_gpus ") + """ | | """ + self.style.text("42 Get device xgmi_error_status. Api: amdsmi_dev_xgmi_error_status ") + """ | | """ + self.style.text("43 Get device xgmi error reset. Api: amdsmi_dev_reset_xgmi_error ") + """ | @@ -537,7 +537,7 @@ def amdsmi_tool_compute_process_gpus_get(dic): def amdsmi_tool_compute_process_info_by_pid_get(dic): pid = dic["pid"] - return smi_api.amdsmi_get_compute_process_info_by_pid(pid) + return smi_api.amdsmi_get_gpu_compute_process_info_by_pid(pid) def amdsmi_tool_topo_get_link_weight(dev): return smi_api.amdsmi_topo_get_link_weight(dev[0], dev[1]) @@ -839,7 +839,7 @@ commands = { 38: [amdsmi_tool_status_string, { "status": [int, True] }], - 39: [smi_api.amdsmi_get_compute_process_info, {}], + 39: [smi_api.amdsmi_get_gpu_compute_process_info, {}], 40: [amdsmi_tool_compute_process_info_by_pid_get, { "pid": [int, True] }], diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index befaa16d7d..ff86747f76 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -975,7 +975,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, } amdsmi_status_t -amdsmi_get_compute_process_info(amdsmi_process_info_t *procs, uint32_t *num_items) { +amdsmi_get_gpu_compute_process_info(amdsmi_process_info_t *procs, uint32_t *num_items) { AMDSMI_CHECK_INIT(); if (num_items == nullptr) @@ -986,7 +986,7 @@ amdsmi_get_compute_process_info(amdsmi_process_info_t *procs, uint32_t *num_item return amd::smi::rsmi_to_amdsmi_status(r); } -amdsmi_status_t amdsmi_get_compute_process_info_by_pid(uint32_t pid, +amdsmi_status_t amdsmi_get_gpu_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t *proc) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc index 181b36cb90..1ab7f857ff 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc @@ -104,7 +104,7 @@ void TestProcInfoRead::Run(void) { uint32_t num_devices = num_monitor_devs(); - err = amdsmi_get_compute_process_info(nullptr, &num_proc_found); + err = amdsmi_get_gpu_compute_process_info(nullptr, &num_proc_found); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -129,7 +129,7 @@ void TestProcInfoRead::Run(void) { procs = new amdsmi_process_info_t[num_proc_found]; val_ui32 = num_proc_found; - err = amdsmi_get_compute_process_info(procs, &val_ui32); + err = amdsmi_get_gpu_compute_process_info(procs, &val_ui32); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_INSUFFICIENT_SIZE) { IF_VERB(STANDARD) { @@ -191,13 +191,13 @@ void TestProcInfoRead::Run(void) { amdsmi_process_info_t proc_info; for (uint32_t j = 0; j < num_proc_found; j++) { memset(&proc_info, 0x0, sizeof(amdsmi_process_info_t)); - err = amdsmi_get_compute_process_info_by_pid(procs[j].process_id, + err = amdsmi_get_gpu_compute_process_info_by_pid(procs[j].process_id, &proc_info); if (err == AMDSMI_STATUS_NOT_FOUND) { std::cout << - "\t** WARNING: amdsmi_get_compute_process_info() found process " << + "\t** WARNING: amdsmi_get_gpu_compute_process_info() found process " << procs[j].process_id << ", but subsequently, " - "amdsmi_get_compute_process_info_by_pid() did not" + "amdsmi_get_gpu_compute_process_info_by_pid() did not" " find this same process." << std::endl; } else { CHK_ERR_ASRT(err) @@ -217,10 +217,10 @@ void TestProcInfoRead::Run(void) { if (num_proc_found > 1) { amdsmi_process_info_t tmp_proc; val_ui32 = 1; - err = amdsmi_get_compute_process_info(&tmp_proc, &val_ui32); + err = amdsmi_get_gpu_compute_process_info(&tmp_proc, &val_ui32); if (err != AMDSMI_STATUS_INSUFFICIENT_SIZE) { - std::cout << "Expected amdsmi_get_compute_process_info() to tell us" + std::cout << "Expected amdsmi_get_gpu_compute_process_info() to tell us" " there are more processes available, but instead go return code " << err << std::endl; } From 8bc7c2acc90a9043b81053e67e5beb6c9d70b413 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:44:06 -0500 Subject: [PATCH 64/95] Renamed API amdsmi_get_compute_process_gpus to amdsmi_get_gpu_compute_process_gpus grep -rli 'amdsmi_get_compute_process_gpus' * | xargs -i@ sed -i 's/amdsmi_get_compute_process_gpus/amdsmi_get_gpu_compute_process_gpus/g' @ Change-Id: I230bbf85e96983f9e0d2e3c61464c2bf4b353a95 [ROCm/amdsmi commit: 26f8190cb42975566fda383e838d6aeb4d188c49] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 6 +++--- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/process_info_read.cc | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 5e6a7a001c..8e9f4ff32c 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3062,7 +3062,7 @@ amdsmi_get_gpu_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, +amdsmi_get_gpu_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, uint32_t *num_devices); /** @} End SysInfo */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 87b3323d64..3f2863f896 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2799,7 +2799,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_compute_process_gpus +## amdsmi_get_gpu_compute_process_gpus Description: Get the device indices currently being used by a process Input parameters: @@ -2807,7 +2807,7 @@ Input parameters: Output: List of indices of devices currently being used by the process -Exceptions that can be thrown by `amdsmi_get_compute_process_gpus` function: +Exceptions that can be thrown by `amdsmi_get_gpu_compute_process_gpus` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2816,7 +2816,7 @@ Example: ```python try: pid = 0 # << valid pid here - indices = amdsmi_get_compute_process_gpus(pid) + indices = amdsmi_get_gpu_compute_process_gpus(pid) print(indices) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index c72adbb1f3..efdb066dab 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -132,7 +132,7 @@ from .amdsmi_interface import amdsmi_status_string # # System Information Query from .amdsmi_interface import amdsmi_get_gpu_compute_process_info from .amdsmi_interface import amdsmi_get_gpu_compute_process_info_by_pid -from .amdsmi_interface import amdsmi_get_compute_process_gpus +from .amdsmi_interface import amdsmi_get_gpu_compute_process_gpus from .amdsmi_interface import amdsmi_dev_xgmi_error_status from .amdsmi_interface import amdsmi_dev_reset_xgmi_error diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 15ec7d3d3a..2e1e05bb8f 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2581,21 +2581,21 @@ def amdsmi_get_gpu_compute_process_info_by_pid(pid: int) -> Dict[str, int]: } -def amdsmi_get_compute_process_gpus(pid: int) -> List[int]: +def amdsmi_get_gpu_compute_process_gpus(pid: int) -> List[int]: if not isinstance(pid, int): raise AmdSmiParameterException(pid, int) num_devices = ctypes.c_uint32(0) nullptr = ctypes.POINTER(ctypes.c_uint32)() _check_res( - amdsmi_wrapper.amdsmi_get_compute_process_gpus( + amdsmi_wrapper.amdsmi_get_gpu_compute_process_gpus( pid, nullptr, ctypes.byref(num_devices) ) ) dv_indices = (ctypes.c_uint32 * num_devices.value)() _check_res( - amdsmi_wrapper.amdsmi_get_compute_process_gpus( + amdsmi_wrapper.amdsmi_get_gpu_compute_process_gpus( pid, dv_indices, ctypes.byref(num_devices) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index ca244aad03..afd4f38fff 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1613,9 +1613,9 @@ amdsmi_get_gpu_compute_process_info.argtypes = [ctypes.POINTER(struct_c__SA_amds amdsmi_get_gpu_compute_process_info_by_pid = _libraries['libamd_smi.so'].amdsmi_get_gpu_compute_process_info_by_pid amdsmi_get_gpu_compute_process_info_by_pid.restype = amdsmi_status_t amdsmi_get_gpu_compute_process_info_by_pid.argtypes = [uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_process_info_t)] -amdsmi_get_compute_process_gpus = _libraries['libamd_smi.so'].amdsmi_get_compute_process_gpus -amdsmi_get_compute_process_gpus.restype = amdsmi_status_t -amdsmi_get_compute_process_gpus.argtypes = [uint32_t, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_compute_process_gpus = _libraries['libamd_smi.so'].amdsmi_get_gpu_compute_process_gpus +amdsmi_get_gpu_compute_process_gpus.restype = amdsmi_status_t +amdsmi_get_gpu_compute_process_gpus.argtypes = [uint32_t, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] amdsmi_dev_xgmi_error_status = _libraries['libamd_smi.so'].amdsmi_dev_xgmi_error_status amdsmi_dev_xgmi_error_status.restype = amdsmi_status_t amdsmi_dev_xgmi_error_status.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_xgmi_status_t)] @@ -1896,7 +1896,7 @@ __all__ = \ 'amdsmi_fw_info_t', 'amdsmi_get_gpu_asic_info', 'amdsmi_get_gpu_bad_page_info', 'amdsmi_get_gpu_board_info', 'amdsmi_get_caps_info', 'amdsmi_get_clock_measure', - 'amdsmi_get_compute_process_gpus', + 'amdsmi_get_gpu_compute_process_gpus', 'amdsmi_get_gpu_compute_process_info', 'amdsmi_get_gpu_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 8be10a887e..1de296d653 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -327,7 +327,7 @@ class Formatter: | """ + self.style.text("38 Get status string. Api: amdsmi_status_string ") + """ | | """ + self.style.text("39 Get compute process info. Api: amdsmi_get_gpu_compute_process_info ") + """ | | """ + self.style.text("40 Get compute process info by pid. Api: amdsmi_get_gpu_compute_process_info_by_pid ") + """ | - | """ + self.style.text("41 Get compute process gpus. Api: amdsmi_get_compute_process_gpus ") + """ | + | """ + self.style.text("41 Get compute process gpus. Api: amdsmi_get_gpu_compute_process_gpus ") + """ | | """ + self.style.text("42 Get device xgmi_error_status. Api: amdsmi_dev_xgmi_error_status ") + """ | | """ + self.style.text("43 Get device xgmi error reset. Api: amdsmi_dev_reset_xgmi_error ") + """ | | """ + self.style.text("44 Get topo get numa node number. Api: amdsmi_topo_get_numa_node_number ") + """ | @@ -533,7 +533,7 @@ def amdsmi_tool_status_string(dic): def amdsmi_tool_compute_process_gpus_get(dic): pid = dic["pid"] - return smi_api.amdsmi_get_compute_process_gpus(pid) + return smi_api.amdsmi_get_gpu_compute_process_gpus(pid) def amdsmi_tool_compute_process_info_by_pid_get(dic): pid = dic["pid"] diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index ff86747f76..25ed1d15b5 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -998,7 +998,7 @@ amdsmi_status_t amdsmi_get_gpu_compute_process_info_by_pid(uint32_t pid, } amdsmi_status_t -amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, +amdsmi_get_gpu_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, uint32_t *num_devices) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc index 1ab7f857ff..18bb30d258 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/process_info_read.cc @@ -162,7 +162,7 @@ void TestProcInfoRead::Run(void) { uint32_t amt_allocd = num_devices; for (uint32_t j = 0; j < num_proc_found; j++) { - err = amdsmi_get_compute_process_gpus(procs[j].process_id, dev_inds, + err = amdsmi_get_gpu_compute_process_gpus(procs[j].process_id, dev_inds, &amt_allocd); if (err == AMDSMI_STATUS_NOT_FOUND) { std::cout << "\t** Process " << procs[j].process_id << From 19eefc2c6916f2b8a04d83981b96f332a2be6853 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:45:36 -0500 Subject: [PATCH 65/95] Renamed API amdsmi_get_event_notification to amdsmi_get_gpu_event_notification grep -rli 'amdsmi_get_event_notification' * | xargs -i@ sed -i 's/amdsmi_get_event_notification/amdsmi_get_gpu_event_notification/g' @ Change-Id: I587f1fa785fabbd5347dca886636a81e3c2d1003 [ROCm/amdsmi commit: 6d6d8ce819145cb8124b1bb72f067d6193e30b55] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 2 +- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 2 +- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/evt_notif_read_write.cc | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 8e9f4ff32c..e7812cb8d5 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3538,7 +3538,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_get_event_notification(int timeout_ms, + amdsmi_get_gpu_event_notification(int timeout_ms, uint32_t *num_elem, amdsmi_evt_notification_data_t *data); /** diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 2e1e05bb8f..b987e6d9ee 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -323,7 +323,7 @@ class AmdSmiEventReader: self.event_info = ( amdsmi_wrapper.amdsmi_evt_notification_data_t * num_elem)() _check_res( - amdsmi_wrapper. amdsmi_get_event_notification( + amdsmi_wrapper. amdsmi_get_gpu_event_notification( ctypes.c_int(timestamp), ctypes.byref(ctypes.c_uint32(num_elem)), self.event_info, diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index afd4f38fff..f921231aed 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1658,9 +1658,9 @@ amdsmi_init_event_notification.argtypes = [amdsmi_processor_handle] amdsmi_set_event_notification_mask = _libraries['libamd_smi.so'].amdsmi_set_event_notification_mask amdsmi_set_event_notification_mask.restype = amdsmi_status_t amdsmi_set_event_notification_mask.argtypes = [amdsmi_processor_handle, uint64_t] -amdsmi_get_event_notification = _libraries['libamd_smi.so'].amdsmi_get_event_notification -amdsmi_get_event_notification.restype = amdsmi_status_t -amdsmi_get_event_notification.argtypes = [ctypes.c_int32, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_evt_notification_data_t)] +amdsmi_get_gpu_event_notification = _libraries['libamd_smi.so'].amdsmi_get_gpu_event_notification +amdsmi_get_gpu_event_notification.restype = amdsmi_status_t +amdsmi_get_gpu_event_notification.argtypes = [ctypes.c_int32, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_evt_notification_data_t)] amdsmi_stop_event_notification = _libraries['libamd_smi.so'].amdsmi_stop_event_notification amdsmi_stop_event_notification.restype = amdsmi_status_t amdsmi_stop_event_notification.argtypes = [amdsmi_processor_handle] @@ -1902,7 +1902,7 @@ __all__ = \ 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', 'amdsmi_get_gpu_device_uuid', 'amdsmi_get_gpu_driver_version', 'amdsmi_get_gpu_ecc_error_count', - 'amdsmi_get_event_notification', 'amdsmi_get_func_iter_value', + 'amdsmi_get_gpu_event_notification', 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_cap_info', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 1de296d653..6fc53efbfe 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -337,7 +337,7 @@ class Formatter: | """ + self.style.text("48 Get is P2P accessible. Api: amdsmi_is_P2P_accessible ") + """ | | """ + self.style.text("49 Get asic info. Api: amdsmi_get_gpu_asic_info ") + """ | | """ + self.style.text("50 Get processor_handles. Api: amdsmi_get_processor_handles ") + """ | - | """ + self.style.text("51 Get event notification. Api: amdsmi_get_event_notification ") + """ | + | """ + self.style.text("51 Get event notification. Api: amdsmi_get_gpu_event_notification ") + """ | | """ + self.style.text("52 Init event notification. Api: amdsmi_init_event_notification ") + """ | | """ + self.style.text("53 Set event notification mask. Api: amdsmi_set_event_notification_mask ") + """ | | """ + self.style.text("54 Get event notification. Api: amdsmi_stop_event_notification ") + """ | diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 25ed1d15b5..c0135ed2d8 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -655,7 +655,7 @@ amdsmi_status_t } amdsmi_status_t - amdsmi_get_event_notification(int timeout_ms, + amdsmi_get_gpu_event_notification(int timeout_ms, uint32_t *num_elem, amdsmi_evt_notification_data_t *data) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc index 9a7505611b..1e2481c33f 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc @@ -127,7 +127,7 @@ void TestEvtNotifReadWrite::Run(void) { uint32_t num_elem = 10; bool read_again = false; - ret = amdsmi_get_event_notification(10000, &num_elem, data); + ret = amdsmi_get_gpu_event_notification(10000, &num_elem, data); if (ret == AMDSMI_STATUS_SUCCESS || ret == AMDSMI_STATUS_INSUFFICIENT_SIZE) { EXPECT_LE(num_elem, 10) << "Expected the number of elements found to be <= buffer size (10)"; @@ -155,13 +155,13 @@ void TestEvtNotifReadWrite::Run(void) { } else { // This should always fail. We want to print out the return code. EXPECT_EQ(ret, AMDSMI_STATUS_SUCCESS) << - "Unexpected return code for amdsmi_get_event_notification()"; + "Unexpected return code for amdsmi_get_gpu_event_notification()"; } // In case GPU Pre reset event was collected in the previous read, // read again to get the GPU Post reset event. if (read_again) { - ret = amdsmi_get_event_notification(10000, &num_elem, data); + ret = amdsmi_get_gpu_event_notification(10000, &num_elem, data); if (ret == AMDSMI_STATUS_SUCCESS || ret == AMDSMI_STATUS_INSUFFICIENT_SIZE) { EXPECT_LE(num_elem, 10) << "Expected the number of elements found to be <= buffer size (10)"; @@ -186,7 +186,7 @@ void TestEvtNotifReadWrite::Run(void) { } else { // This should always fail. We want to print out the return code. EXPECT_EQ(ret, AMDSMI_STATUS_SUCCESS) << - "Unexpected return code for amdsmi_get_event_notification()"; + "Unexpected return code for amdsmi_get_gpu_event_notification()"; } } From 3dd6db2044d2e6c12e6dbf0defe9fe9e39e86087 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:47:28 -0500 Subject: [PATCH 66/95] Renamed API amdsmi_stop_event_notification to amdsmi_stop_gpu_event_notification grep -rli 'amdsmi_stop_event_notification' * | xargs -i@ sed -i 's/amdsmi_stop_event_notification/amdsmi_stop_gpu_event_notification/g' @ Change-Id: If6b7ca238a911cef37306c0b623e219f7ee43225 [ROCm/amdsmi commit: 0bfc2a37aa638ec49e880af4c007f63f517b56a3] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/amdsmi_interface.py | 2 +- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/evt_notif_read_write.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e7812cb8d5..9f47efdc55 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3462,7 +3462,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, * * @details This function prepares to collect events for the GPU with device * ID @p processor_handle, by initializing any required system parameters. This call - * may open files which will remain open until ::amdsmi_stop_event_notification() + * may open files which will remain open until ::amdsmi_stop_gpu_event_notification() * is called. * * @param processor_handle a processor handle corresponding to the device on which to @@ -3555,7 +3555,7 @@ amdsmi_status_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_stop_event_notification(amdsmi_processor_handle processor_handle); +amdsmi_status_t amdsmi_stop_gpu_event_notification(amdsmi_processor_handle processor_handle); /** @} End EvntNotif */ diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index b987e6d9ee..9cee241c2b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -348,7 +348,7 @@ class AmdSmiEventReader: return ret def stop(self): - _check_res(amdsmi_wrapper.amdsmi_stop_event_notification( + _check_res(amdsmi_wrapper.amdsmi_stop_gpu_event_notification( self.processor_handle)) def __enter__(self): diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index f921231aed..d66f27dcd3 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1661,9 +1661,9 @@ amdsmi_set_event_notification_mask.argtypes = [amdsmi_processor_handle, uint64_t amdsmi_get_gpu_event_notification = _libraries['libamd_smi.so'].amdsmi_get_gpu_event_notification amdsmi_get_gpu_event_notification.restype = amdsmi_status_t amdsmi_get_gpu_event_notification.argtypes = [ctypes.c_int32, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_evt_notification_data_t)] -amdsmi_stop_event_notification = _libraries['libamd_smi.so'].amdsmi_stop_event_notification -amdsmi_stop_event_notification.restype = amdsmi_status_t -amdsmi_stop_event_notification.argtypes = [amdsmi_processor_handle] +amdsmi_stop_gpu_event_notification = _libraries['libamd_smi.so'].amdsmi_stop_gpu_event_notification +amdsmi_stop_gpu_event_notification.restype = amdsmi_status_t +amdsmi_stop_gpu_event_notification.argtypes = [amdsmi_processor_handle] amdsmi_get_gpu_device_bdf = _libraries['libamd_smi.so'].amdsmi_get_gpu_device_bdf amdsmi_get_gpu_device_bdf.restype = amdsmi_status_t amdsmi_get_gpu_device_bdf.argtypes = [amdsmi_processor_handle, ctypes.POINTER(union_c__UA_amdsmi_bdf_t)] @@ -1935,7 +1935,7 @@ __all__ = \ 'amdsmi_set_event_notification_mask', 'amdsmi_set_gpu_perf_determinism_mode', 'amdsmi_shut_down', 'amdsmi_socket_handle', 'amdsmi_status_string', 'amdsmi_status_t', - 'amdsmi_status_t__enumvalues', 'amdsmi_stop_event_notification', + 'amdsmi_status_t__enumvalues', 'amdsmi_stop_gpu_event_notification', 'amdsmi_sw_component_t', 'amdsmi_sw_component_t__enumvalues', 'amdsmi_temperature_metric_t', 'amdsmi_temperature_metric_t__enumvalues', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 6fc53efbfe..9f5bba9858 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -340,7 +340,7 @@ class Formatter: | """ + self.style.text("51 Get event notification. Api: amdsmi_get_gpu_event_notification ") + """ | | """ + self.style.text("52 Init event notification. Api: amdsmi_init_event_notification ") + """ | | """ + self.style.text("53 Set event notification mask. Api: amdsmi_set_event_notification_mask ") + """ | - | """ + self.style.text("54 Get event notification. Api: amdsmi_stop_event_notification ") + """ | + | """ + self.style.text("54 Get event notification. Api: amdsmi_stop_gpu_event_notification ") + """ | | """ + self.style.text("55 Init. Api: amdsmi_init ") + """ | | """ + self.style.text("56 Shut down. Api: amdsmi_shut_down ") + """ | | """ + self.style.text("57 Get fw info. Api: amdsmi_get_fw_info ") + """ | @@ -571,7 +571,7 @@ def amdsmi_tool_event_notification_mask_set(dev, dic): return smi_api.amdsmi_wrapper. amdsmi_set_event_notification_mask(dev, ctypes.c_uint64(mask)) def amdsmi_tool_event_notification_stop(dev): - return smi_api.amdsmi_wrapper.amdsmi_stop_event_notification(dev) + return smi_api.amdsmi_wrapper.amdsmi_stop_gpu_event_notification(dev) def amdsmi_tool_shut_down(): smi_api.amdsmi_init() diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index c0135ed2d8..e1213061ce 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -685,7 +685,7 @@ amdsmi_status_t return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_stop_event_notification( +amdsmi_status_t amdsmi_stop_gpu_event_notification( amdsmi_processor_handle processor_handle) { return rsmi_wrapper(rsmi_event_notification_stop, processor_handle); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc index 1e2481c33f..e9bc9b2482 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc @@ -191,7 +191,7 @@ void TestEvtNotifReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - ret = amdsmi_stop_event_notification(processor_handles_[dv_ind]); + ret = amdsmi_stop_gpu_event_notification(processor_handles_[dv_ind]); ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index b3fdaca149..fb8af2fc35 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -307,7 +307,7 @@ void TestMutualExclusion::Run(void) { amdsmi_topo_get_link_weight amdsmi_set_event_notification_mask amdsmi_init_event_notification - amdsmi_stop_event_notification + amdsmi_stop_gpu_event_notification */ IF_VERB(STANDARD) { From b3dac649d985e47f9094c5ad6c0a5d030bafb590 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:48:55 -0500 Subject: [PATCH 67/95] Renamed API amdsmi_set_event_notification_mask to amdsmi_set_gpu_event_notification_mask grep -rli 'amdsmi_set_event_notification_mask' * | xargs -i@ sed -i 's/amdsmi_set_event_notification_mask/amdsmi_set_gpu_event_notification_mask/g' @ Change-Id: Id4b9b6bc31f438b6d4d584142c8814f091b4b553 [ROCm/amdsmi commit: 828908424debe5e89bc7a174c19271cca19112f6] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/amdsmi_interface.py | 2 +- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/evt_notif_read_write.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 9f47efdc55..233ba5459b 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3500,7 +3500,7 @@ amdsmi_init_event_notification(amdsmi_processor_handle processor_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask); + amdsmi_set_gpu_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask); /** * @brief Collect event notifications, waiting a specified amount of time @@ -3517,9 +3517,9 @@ amdsmi_status_t * buffer available to write any new events that would be found. * * This function requires prior calls to ::amdsmi_init_event_notification() and - * :: amdsmi_set_event_notification_mask(). This function polls for the + * :: amdsmi_set_gpu_event_notification_mask(). This function polls for the * occurrance of the events on the respective devices that were previously - * specified by :: amdsmi_set_event_notification_mask(). + * specified by :: amdsmi_set_gpu_event_notification_mask(). * * @param[in] timeout_ms number of milliseconds to wait for an event * to occur diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 9cee241c2b..a9a6f898f8 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -316,7 +316,7 @@ class AmdSmiEventReader: mask |= (1 << (int(event_type) - 1)) _check_res(amdsmi_wrapper.amdsmi_init_event_notification(processor_handle)) - _check_res(amdsmi_wrapper. amdsmi_set_event_notification_mask( + _check_res(amdsmi_wrapper. amdsmi_set_gpu_event_notification_mask( processor_handle, ctypes.c_uint64(mask))) def read(self, timestamp, num_elem=10): diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index d66f27dcd3..9832088a7a 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1655,9 +1655,9 @@ amdsmi_get_func_iter_value.argtypes = [amdsmi_func_id_iter_handle_t, ctypes.POIN amdsmi_init_event_notification = _libraries['libamd_smi.so'].amdsmi_init_event_notification amdsmi_init_event_notification.restype = amdsmi_status_t amdsmi_init_event_notification.argtypes = [amdsmi_processor_handle] -amdsmi_set_event_notification_mask = _libraries['libamd_smi.so'].amdsmi_set_event_notification_mask -amdsmi_set_event_notification_mask.restype = amdsmi_status_t -amdsmi_set_event_notification_mask.argtypes = [amdsmi_processor_handle, uint64_t] +amdsmi_set_gpu_event_notification_mask = _libraries['libamd_smi.so'].amdsmi_set_gpu_event_notification_mask +amdsmi_set_gpu_event_notification_mask.restype = amdsmi_status_t +amdsmi_set_gpu_event_notification_mask.argtypes = [amdsmi_processor_handle, uint64_t] amdsmi_get_gpu_event_notification = _libraries['libamd_smi.so'].amdsmi_get_gpu_event_notification amdsmi_get_gpu_event_notification.restype = amdsmi_status_t amdsmi_get_gpu_event_notification.argtypes = [ctypes.c_int32, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_evt_notification_data_t)] @@ -1932,7 +1932,7 @@ __all__ = \ 'amdsmi_range_t', 'amdsmi_ras_err_state_t', 'amdsmi_ras_err_state_t__enumvalues', 'amdsmi_read_counter', 'amdsmi_retired_page_record_t', - 'amdsmi_set_event_notification_mask', + 'amdsmi_set_gpu_event_notification_mask', 'amdsmi_set_gpu_perf_determinism_mode', 'amdsmi_shut_down', 'amdsmi_socket_handle', 'amdsmi_status_string', 'amdsmi_status_t', 'amdsmi_status_t__enumvalues', 'amdsmi_stop_gpu_event_notification', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 9f5bba9858..eee2d9cffd 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -339,7 +339,7 @@ class Formatter: | """ + self.style.text("50 Get processor_handles. Api: amdsmi_get_processor_handles ") + """ | | """ + self.style.text("51 Get event notification. Api: amdsmi_get_gpu_event_notification ") + """ | | """ + self.style.text("52 Init event notification. Api: amdsmi_init_event_notification ") + """ | - | """ + self.style.text("53 Set event notification mask. Api: amdsmi_set_event_notification_mask ") + """ | + | """ + self.style.text("53 Set event notification mask. Api: amdsmi_set_gpu_event_notification_mask ") + """ | | """ + self.style.text("54 Get event notification. Api: amdsmi_stop_gpu_event_notification ") + """ | | """ + self.style.text("55 Init. Api: amdsmi_init ") + """ | | """ + self.style.text("56 Shut down. Api: amdsmi_shut_down ") + """ | @@ -568,7 +568,7 @@ def amdsmi_tool_event_notification_init(dev): def amdsmi_tool_event_notification_mask_set(dev, dic): mask = dic["mask"] - return smi_api.amdsmi_wrapper. amdsmi_set_event_notification_mask(dev, ctypes.c_uint64(mask)) + return smi_api.amdsmi_wrapper. amdsmi_set_gpu_event_notification_mask(dev, ctypes.c_uint64(mask)) def amdsmi_tool_event_notification_stop(dev): return smi_api.amdsmi_wrapper.amdsmi_stop_gpu_event_notification(dev) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index e1213061ce..c92197b21a 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -649,7 +649,7 @@ amdsmi_init_event_notification(amdsmi_processor_handle processor_handle) { } amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_processor_handle processor_handle, + amdsmi_set_gpu_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask) { return rsmi_wrapper(rsmi_event_notification_mask_set, processor_handle, mask); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc index e9bc9b2482..c7aeda8ab1 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc @@ -119,7 +119,7 @@ void TestEvtNotifReadWrite::Run(void) { return; } ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); - ret = amdsmi_set_event_notification_mask(processor_handles_[dv_ind], mask); + ret = amdsmi_set_gpu_event_notification_mask(processor_handles_[dv_ind], mask); ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index fb8af2fc35..7a56ee4285 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -305,7 +305,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_reset_xgmi_error amdsmi_dev_xgmi_hive_id_get amdsmi_topo_get_link_weight - amdsmi_set_event_notification_mask + amdsmi_set_gpu_event_notification_mask amdsmi_init_event_notification amdsmi_stop_gpu_event_notification */ From 370168e42cdc574fdbd508ca457efb8b2f1e6f6a Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 01:50:25 -0500 Subject: [PATCH 68/95] Renamed API amdsmi_init_event_notification to amdsmi_init_gpu_event_notification grep -rli 'amdsmi_init_event_notification' * | xargs -i@ sed -i 's/amdsmi_init_event_notification/amdsmi_init_gpu_event_notification/g' @ Change-Id: I6a45d38836f9d4221e3e5159370d4b6791fecca5 [ROCm/amdsmi commit: 2ad8b91e0e504fabc783dfbfdddd4707d85b3e60] --- projects/amdsmi/include/amd_smi/amdsmi.h | 8 ++++---- projects/amdsmi/py-interface/amdsmi_interface.py | 2 +- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/evt_notif_read_write.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 233ba5459b..2d845a1475 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3471,7 +3471,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_init_event_notification(amdsmi_processor_handle processor_handle); +amdsmi_init_gpu_event_notification(amdsmi_processor_handle processor_handle); /** * @brief Specify which events to collect for a device @@ -3494,7 +3494,7 @@ amdsmi_init_event_notification(amdsmi_processor_handle processor_handle); * AMDSMI_EVT_NOTIF_THERMAL_THROTTLE event (which has a value of 2). * * @note ::AMDSMI_STATUS_INIT_ERROR is returned if - * ::amdsmi_init_event_notification() has not been called before a call to this + * ::amdsmi_init_gpu_event_notification() has not been called before a call to this * function * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail @@ -3516,7 +3516,7 @@ amdsmi_status_t * to the buffer then poll for new events if there is still caller-provided * buffer available to write any new events that would be found. * - * This function requires prior calls to ::amdsmi_init_event_notification() and + * This function requires prior calls to ::amdsmi_init_gpu_event_notification() and * :: amdsmi_set_gpu_event_notification_mask(). This function polls for the * occurrance of the events on the respective devices that were previously * specified by :: amdsmi_set_gpu_event_notification_mask(). @@ -3548,7 +3548,7 @@ amdsmi_status_t * @details Any resources used by event notification for the GPU with * processor handle @p processor_handle will be free with this * function. This includes freeing any memory and closing file handles. This - * should be called for every call to ::amdsmi_init_event_notification() + * should be called for every call to ::amdsmi_init_gpu_event_notification() * * @param[in] processor_handle The processor handle of the GPU for which event * notification resources will be free diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index a9a6f898f8..305bf68f29 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -315,7 +315,7 @@ class AmdSmiEventReader: for event_type in event_types: mask |= (1 << (int(event_type) - 1)) - _check_res(amdsmi_wrapper.amdsmi_init_event_notification(processor_handle)) + _check_res(amdsmi_wrapper.amdsmi_init_gpu_event_notification(processor_handle)) _check_res(amdsmi_wrapper. amdsmi_set_gpu_event_notification_mask( processor_handle, ctypes.c_uint64(mask))) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9832088a7a..7c4e97a631 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1652,9 +1652,9 @@ amdsmi_dev_close_supported_func_iterator.argtypes = [ctypes.POINTER(ctypes.POINT amdsmi_get_func_iter_value = _libraries['libamd_smi.so'].amdsmi_get_func_iter_value amdsmi_get_func_iter_value.restype = amdsmi_status_t amdsmi_get_func_iter_value.argtypes = [amdsmi_func_id_iter_handle_t, ctypes.POINTER(union_c__UA_amdsmi_func_id_value_t)] -amdsmi_init_event_notification = _libraries['libamd_smi.so'].amdsmi_init_event_notification -amdsmi_init_event_notification.restype = amdsmi_status_t -amdsmi_init_event_notification.argtypes = [amdsmi_processor_handle] +amdsmi_init_gpu_event_notification = _libraries['libamd_smi.so'].amdsmi_init_gpu_event_notification +amdsmi_init_gpu_event_notification.restype = amdsmi_status_t +amdsmi_init_gpu_event_notification.argtypes = [amdsmi_processor_handle] amdsmi_set_gpu_event_notification_mask = _libraries['libamd_smi.so'].amdsmi_set_gpu_event_notification_mask amdsmi_set_gpu_event_notification_mask.restype = amdsmi_status_t amdsmi_set_gpu_event_notification_mask.argtypes = [amdsmi_processor_handle, uint64_t] @@ -1916,7 +1916,7 @@ __all__ = \ 'amdsmi_get_gpu_vram_usage', 'amdsmi_get_xgmi_info', 'amdsmi_gpu_block_t', 'amdsmi_gpu_block_t__enumvalues', 'amdsmi_gpu_caps_t', 'amdsmi_gpu_metrics_t', 'amdsmi_init', - 'amdsmi_init_event_notification', 'amdsmi_init_flags_t', + 'amdsmi_init_gpu_event_notification', 'amdsmi_init_flags_t', 'amdsmi_init_flags_t__enumvalues', 'amdsmi_is_P2P_accessible', 'amdsmi_memory_page_status_t', 'amdsmi_memory_page_status_t__enumvalues', 'amdsmi_memory_type_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index eee2d9cffd..6fdb0aaf36 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -338,7 +338,7 @@ class Formatter: | """ + self.style.text("49 Get asic info. Api: amdsmi_get_gpu_asic_info ") + """ | | """ + self.style.text("50 Get processor_handles. Api: amdsmi_get_processor_handles ") + """ | | """ + self.style.text("51 Get event notification. Api: amdsmi_get_gpu_event_notification ") + """ | - | """ + self.style.text("52 Init event notification. Api: amdsmi_init_event_notification ") + """ | + | """ + self.style.text("52 Init event notification. Api: amdsmi_init_gpu_event_notification ") + """ | | """ + self.style.text("53 Set event notification mask. Api: amdsmi_set_gpu_event_notification_mask ") + """ | | """ + self.style.text("54 Get event notification. Api: amdsmi_stop_gpu_event_notification ") + """ | | """ + self.style.text("55 Init. Api: amdsmi_init ") + """ | @@ -564,7 +564,7 @@ def amdsmi_tool_event_notification_get(dev): return result def amdsmi_tool_event_notification_init(dev): - return smi_api.amdsmi_wrapper.amdsmi_init_event_notification(dev) + return smi_api.amdsmi_wrapper.amdsmi_init_gpu_event_notification(dev) def amdsmi_tool_event_notification_mask_set(dev, dic): mask = dic["mask"] diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index c92197b21a..2da8a8ef73 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -644,7 +644,7 @@ amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_han } amdsmi_status_t -amdsmi_init_event_notification(amdsmi_processor_handle processor_handle) { +amdsmi_init_gpu_event_notification(amdsmi_processor_handle processor_handle) { return rsmi_wrapper(rsmi_event_notification_init, processor_handle); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc index c7aeda8ab1..5061c6f097 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/evt_notif_read_write.cc @@ -109,7 +109,7 @@ void TestEvtNotifReadWrite::Run(void) { } for (dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - ret = amdsmi_init_event_notification(processor_handles_[dv_ind]); + ret = amdsmi_init_gpu_event_notification(processor_handles_[dv_ind]); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 7a56ee4285..1599546925 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -306,7 +306,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_xgmi_hive_id_get amdsmi_topo_get_link_weight amdsmi_set_gpu_event_notification_mask - amdsmi_init_event_notification + amdsmi_init_gpu_event_notification amdsmi_stop_gpu_event_notification */ From 22ad287cbfda54b5d160b3db537f71366e90de56 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:00:14 -0500 Subject: [PATCH 69/95] Renamed API amdsmi_dev_counter_group_supported to amdsmi_gpu_counter_group_supported grep -rli 'amdsmi_dev_counter_group_supported' * | xargs -i@ sed -i 's/amdsmi_dev_counter_group_supported/amdsmi_gpu_counter_group_supported/g' @ Change-Id: I69a5534f779dc0013bbe75b3d9b2c6074b2f378b [ROCm/amdsmi commit: fb419ab6554515a21bdd489b46a5a26300033287] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/perf_cntr_read_write.cc | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 2d845a1475..9f655db4e2 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2765,7 +2765,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * The types of events available and the ability to count those * events are dependent on which device is being targeted and if counters are * still available for that device, respectively. - * ::amdsmi_dev_counter_group_supported() can be used to see which event types + * ::amdsmi_gpu_counter_group_supported() can be used to see which event types * (::amdsmi_event_group_t) are supported for a given device. Assuming a device * supports a given event type, we can then check to see if there are counters * available to count a specific event with @@ -2811,7 +2811,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * amdsmi_counter_value_t value; * * // Determine if AMDSMI_EVNT_GRP_XGMI is supported for device dv_ind - * ret = amdsmi_dev_counter_group_supported(dv_ind, AMDSMI_EVNT_GRP_XGMI); + * ret = amdsmi_gpu_counter_group_supported(dv_ind, AMDSMI_EVNT_GRP_XGMI); * * // See if there are counters available for device dv_ind for event * // AMDSMI_EVNT_GRP_XGMI @@ -2868,7 +2868,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_counter_group_supported(amdsmi_processor_handle processor_handle, amdsmi_event_group_t group); +amdsmi_gpu_counter_group_supported(amdsmi_processor_handle processor_handle, amdsmi_event_group_t group); /** * @brief Create a performance counter object diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 3f2863f896..8fe7a3d0c8 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2234,7 +2234,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_counter_group_supported +## amdsmi_gpu_counter_group_supported Description: Tell if an event group is supported by a given device Input parameters: @@ -2244,7 +2244,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_counter_group_supported` function: +Exceptions that can be thrown by `amdsmi_gpu_counter_group_supported` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2257,7 +2257,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_counter_group_supported(device, AmdSmiEventGroup.XGMI) + amdsmi_gpu_counter_group_supported(device, AmdSmiEventGroup.XGMI) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index efdb066dab..ea49b74d19 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -116,7 +116,7 @@ from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters -from .amdsmi_interface import amdsmi_dev_counter_group_supported +from .amdsmi_interface import amdsmi_gpu_counter_group_supported from .amdsmi_interface import amdsmi_dev_create_counter from .amdsmi_interface import amdsmi_dev_destroy_counter from .amdsmi_interface import amdsmi_control_counter diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 305bf68f29..b352f45d77 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1344,7 +1344,7 @@ def amdsmi_get_xgmi_info(processor_handle: amdsmi_wrapper.amdsmi_processor_handl } -def amdsmi_dev_counter_group_supported( +def amdsmi_gpu_counter_group_supported( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ): @@ -1356,7 +1356,7 @@ def amdsmi_dev_counter_group_supported( raise AmdSmiParameterException(event_group, AmdSmiEventGroup) _check_res( - amdsmi_wrapper.amdsmi_dev_counter_group_supported( + amdsmi_wrapper.amdsmi_gpu_counter_group_supported( processor_handle, event_group) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 7c4e97a631..20279e73a7 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1589,9 +1589,9 @@ amdsmi_dev_get_gpu_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_bl amdsmi_status_string = _libraries['libamd_smi.so'].amdsmi_status_string amdsmi_status_string.restype = amdsmi_status_t amdsmi_status_string.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] -amdsmi_dev_counter_group_supported = _libraries['libamd_smi.so'].amdsmi_dev_counter_group_supported -amdsmi_dev_counter_group_supported.restype = amdsmi_status_t -amdsmi_dev_counter_group_supported.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t] +amdsmi_gpu_counter_group_supported = _libraries['libamd_smi.so'].amdsmi_gpu_counter_group_supported +amdsmi_gpu_counter_group_supported.restype = amdsmi_status_t +amdsmi_gpu_counter_group_supported.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t] amdsmi_dev_create_counter = _libraries['libamd_smi.so'].amdsmi_dev_create_counter amdsmi_dev_create_counter.restype = amdsmi_status_t amdsmi_dev_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] @@ -1850,7 +1850,7 @@ __all__ = \ 'amdsmi_counter_command_t__enumvalues', 'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t', 'amdsmi_dev_close_supported_func_iterator', - 'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter', + 'amdsmi_gpu_counter_group_supported', 'amdsmi_dev_create_counter', 'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_gpu_ecc_status', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 6fdb0aaf36..f542ffc9c6 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -349,7 +349,7 @@ class Formatter: | """ + self.style.text("60 Get counter control. Api: amdsmi_control_counter ") + """ | | """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter ") + """ | | """ + self.style.text("62 Set dev clk range. Api: amdsmi_set_gpu_clk_range ") + """ | - | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_dev_counter_group_supported ") + """ | + | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_gpu_counter_group_supported ") + """ | | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_set_gpu_fan_speed ") + """ | | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_set_clk_freq ") + """ | @@ -631,7 +631,7 @@ def amdsmi_tool_dev_counter_group_supported(dev): result = {} for event_group in smi_api.AmdSmiEventGroup: try: - value = smi_api.amdsmi_dev_counter_group_supported(dev, event_group) + value = smi_api.amdsmi_gpu_counter_group_supported(dev, event_group) result.update({event_group.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(event_group.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 2da8a8ef73..fd48c6e4c6 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -690,7 +690,7 @@ amdsmi_status_t amdsmi_stop_gpu_event_notification( return rsmi_wrapper(rsmi_event_notification_stop, processor_handle); } -amdsmi_status_t amdsmi_dev_counter_group_supported( +amdsmi_status_t amdsmi_gpu_counter_group_supported( amdsmi_processor_handle processor_handle, amdsmi_event_group_t group) { return rsmi_wrapper(rsmi_dev_counter_group_supported, processor_handle, static_cast(group)); @@ -923,7 +923,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, - {"rsmi_dev_counter_group_supported", "amdsmi_dev_counter_group_supported"}, + {"rsmi_dev_counter_group_supported", "amdsmi_gpu_counter_group_supported"}, {"rsmi_dev_counter_create", "amdsmi_dev_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 1599546925..6e4607f0b6 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -299,7 +299,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_unique_id_get amdsmi_dev_create_counter amdsmi_counter_get_available_counters - amdsmi_dev_counter_group_supported + amdsmi_gpu_counter_group_supported amdsmi_get_gpu_memory_reserved_pages amdsmi_dev_xgmi_error_status amdsmi_dev_reset_xgmi_error diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index ca27023d67..2b5a48f83e 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -202,7 +202,7 @@ TestPerfCntrReadWrite::testEventsIndividually(amdsmi_processor_handle dv_ind) { std::cout << "****************************" << std::endl; } for (PerfCntrEvtGrp grp : s_event_groups) { - ret = amdsmi_dev_counter_group_supported(dv_ind, grp.group()); + ret = amdsmi_gpu_counter_group_supported(dv_ind, grp.group()); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { continue; } @@ -248,7 +248,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) * handling 1 event at a time. */ for (PerfCntrEvtGrp grp : s_event_groups) { - ret = amdsmi_dev_counter_group_supported(dv_ind, grp.group()); + ret = amdsmi_gpu_counter_group_supported(dv_ind, grp.group()); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\tEvent Group " << grp.name() << From 69267f01c1bf3516b47193d4ff2597eb80d8b5d6 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:01:35 -0500 Subject: [PATCH 70/95] Renamed API amdsmi_dev_create_counter to amdsmi_gpu_create_counter grep -rli 'amdsmi_dev_create_counter' * | xargs -i@ sed -i 's/amdsmi_dev_create_counter/amdsmi_gpu_create_counter/g' @ Change-Id: Ic296057314f98547dd6a01b1c7d51668cfe5bc9a [ROCm/amdsmi commit: 0c435b81c235f303b094b851d8456b94bdc30ea6] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 12 ++++++------ projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../amd_smi_test/functional/perf_cntr_read_write.cc | 8 ++++---- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 9f655db4e2..200342b262 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2775,7 +2775,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * Once it is determined that events are supported and counters are available, * an event counter can be created/destroyed and controlled. * - * ::amdsmi_dev_create_counter() allocates internal data structures that will be + * ::amdsmi_gpu_create_counter() allocates internal data structures that will be * used to used to control the event counter, and return a handle to this data * structure. * @@ -2825,7 +2825,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * // AMDSMI_EVNT_XGMI_0_BEATS_TX) and get the handle * // (amdsmi_event_handle_t). * - * ret = amdsmi_dev_create_counter(dv_ind, AMDSMI_EVNT_XGMI_0_BEATS_TX, + * ret = amdsmi_gpu_create_counter(dv_ind, AMDSMI_EVNT_XGMI_0_BEATS_TX, * &evnt_handle); * * // A program that generates the events of interest can be started @@ -2895,7 +2895,7 @@ amdsmi_gpu_counter_group_supported(amdsmi_processor_handle processor_handle, amd * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, +amdsmi_gpu_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 8fe7a3d0c8..8aa40c5399 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2262,7 +2262,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_create_counter +## amdsmi_gpu_create_counter Description: Creates a performance counter object Input parameters: @@ -2272,7 +2272,7 @@ Input parameters: Output: An event handle of the newly created performance counter object -Exceptions that can be thrown by `amdsmi_dev_create_counter` function: +Exceptions that can be thrown by `amdsmi_gpu_create_counter` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2285,7 +2285,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventGroup.XGMI) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI) except AmdSmiException as e: print(e) ``` @@ -2311,7 +2311,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventGroup.XGMI) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI) amdsmi_dev_destroy_counter(event_handle) except AmdSmiException as e: print(e) @@ -2339,7 +2339,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) amdsmi_control_counter(event_handle, AmdSmiCounterCommand.CMD_START) except AmdSmiException as e: print(e) @@ -2372,7 +2372,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) amdsmi_read_counter(event_handle) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index ea49b74d19..569dc9053d 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -117,7 +117,7 @@ from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters from .amdsmi_interface import amdsmi_gpu_counter_group_supported -from .amdsmi_interface import amdsmi_dev_create_counter +from .amdsmi_interface import amdsmi_gpu_create_counter from .amdsmi_interface import amdsmi_dev_destroy_counter from .amdsmi_interface import amdsmi_control_counter from .amdsmi_interface import amdsmi_read_counter diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index b352f45d77..57ce6f944e 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1361,7 +1361,7 @@ def amdsmi_gpu_counter_group_supported( ) -def amdsmi_dev_create_counter( +def amdsmi_gpu_create_counter( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_type: AmdSmiEventType, ) -> amdsmi_wrapper.amdsmi_event_handle_t: @@ -1374,7 +1374,7 @@ def amdsmi_dev_create_counter( event_handle = amdsmi_wrapper.amdsmi_event_handle_t() _check_res( - amdsmi_wrapper.amdsmi_dev_create_counter( + amdsmi_wrapper.amdsmi_gpu_create_counter( processor_handle, event_type, ctypes.byref(event_handle) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 20279e73a7..192ca8a569 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1592,9 +1592,9 @@ amdsmi_status_string.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER( amdsmi_gpu_counter_group_supported = _libraries['libamd_smi.so'].amdsmi_gpu_counter_group_supported amdsmi_gpu_counter_group_supported.restype = amdsmi_status_t amdsmi_gpu_counter_group_supported.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t] -amdsmi_dev_create_counter = _libraries['libamd_smi.so'].amdsmi_dev_create_counter -amdsmi_dev_create_counter.restype = amdsmi_status_t -amdsmi_dev_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_gpu_create_counter = _libraries['libamd_smi.so'].amdsmi_gpu_create_counter +amdsmi_gpu_create_counter.restype = amdsmi_status_t +amdsmi_gpu_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_destroy_counter = _libraries['libamd_smi.so'].amdsmi_dev_destroy_counter amdsmi_dev_destroy_counter.restype = amdsmi_status_t amdsmi_dev_destroy_counter.argtypes = [amdsmi_event_handle_t] @@ -1850,7 +1850,7 @@ __all__ = \ 'amdsmi_counter_command_t__enumvalues', 'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t', 'amdsmi_dev_close_supported_func_iterator', - 'amdsmi_gpu_counter_group_supported', 'amdsmi_dev_create_counter', + 'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter', 'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_gpu_ecc_status', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index f542ffc9c6..ae828089f4 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -594,7 +594,7 @@ def amdsmi_tool_counter_control(dev): for event_type in smi_api.AmdSmiEventType: for counter_command in smi_api.AmdSmiCounterCommand: try: - event_handle = smi_api.amdsmi_dev_create_counter(dev, event_type) + event_handle = smi_api.amdsmi_gpu_create_counter(dev, event_type) value = smi_api.amdsmi_control_counter(event_handle, counter_command) result.update({event_type.name: value}) except smi_api.AmdSmiException as e: @@ -606,7 +606,7 @@ def amdsmi_tool_counter_read(dev): result = {} for event_type in smi_api.AmdSmiEventType: try: - event_handle = smi_api.amdsmi_dev_create_counter(dev, event_type) + event_handle = smi_api.amdsmi_gpu_create_counter(dev, event_type) value = smi_api.amdsmi_read_counter(event_handle) result.update({event_type.name: value}) except smi_api.AmdSmiException as e: diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index fd48c6e4c6..8ba0962b8b 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -696,7 +696,7 @@ amdsmi_status_t amdsmi_gpu_counter_group_supported( static_cast(group)); } -amdsmi_status_t amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_gpu_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle) { return rsmi_wrapper(rsmi_dev_counter_create, processor_handle, static_cast(type), @@ -924,7 +924,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, {"rsmi_dev_counter_group_supported", "amdsmi_gpu_counter_group_supported"}, - {"rsmi_dev_counter_create", "amdsmi_dev_create_counter"}, + {"rsmi_dev_counter_create", "amdsmi_gpu_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 6e4607f0b6..627eac2922 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -297,7 +297,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_serial_number_get amdsmi_get_gpu_pci_replay_counter amdsmi_dev_unique_id_get - amdsmi_dev_create_counter + amdsmi_gpu_create_counter amdsmi_counter_get_available_counters amdsmi_gpu_counter_group_supported amdsmi_get_gpu_memory_reserved_pages diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index 2b5a48f83e..a9b454718b 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -115,14 +115,14 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_processor_handle dv_ind, amdsmi_event_handle_t evt_handle; amdsmi_status_t ret; - ret = amdsmi_dev_create_counter(dv_ind, + ret = amdsmi_gpu_create_counter(dv_ind, static_cast(evnt), &evt_handle); CHK_ERR_ASRT(ret) - // Note that amdsmi_dev_create_counter() should never return + // Note that amdsmi_gpu_create_counter() should never return // AMDSMI_STATUS_NOT_SUPPORTED. It will return AMDSMI_STATUS_OUT_OF_RESOURCES // if it is unable to create a counter. - ret = amdsmi_dev_create_counter(dv_ind, + ret = amdsmi_gpu_create_counter(dv_ind, static_cast(evnt), nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); @@ -294,7 +294,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) std::cout << "\tEvent Type " << tmp << std::endl; } - ret = amdsmi_dev_create_counter(dv_ind, + ret = amdsmi_gpu_create_counter(dv_ind, static_cast(tmp), &evt_handle.get()[j]); CHK_ERR_ASRT(ret) } From ca4b919b165766d7a34ff404e19077a2cbc200c8 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:03:20 -0500 Subject: [PATCH 71/95] Renamed API amdsmi_dev_destroy_counter to amdsmi_gpu_destroy_counter grep -rli 'amdsmi_dev_destroy_counter' * | xargs -i@ sed -i 's/amdsmi_dev_destroy_counter/amdsmi_gpu_destroy_counter/g' @ Change-Id: I328f65f5a2a86108ee5b217f95ed0f4f03745286 [ROCm/amdsmi commit: e6dd8d49bac481dba3d3f7f06ab4a79bc7b1f961] --- projects/amdsmi/include/amd_smi/amdsmi.h | 8 ++++---- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/perf_cntr_read_write.cc | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 200342b262..90b7627e72 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2786,7 +2786,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * ::amdsmi_read_counter() reads an event counter. * * Once the counter is no longer needed, the resources it uses should be freed - * by calling ::amdsmi_dev_destroy_counter(). + * by calling ::amdsmi_gpu_destroy_counter(). * * * Important Notes about Counter Values @@ -2848,7 +2848,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * * // Release all resources (e.g., counter and memory resources) associated * with evnt_handle. - * ret = amdsmi_dev_destroy_counter(evnt_handle); + * ret = amdsmi_gpu_destroy_counter(evnt_handle); * @endcode * @{ */ @@ -2877,7 +2877,7 @@ amdsmi_gpu_counter_group_supported(amdsmi_processor_handle processor_handle, amd * with a processor handle of @p processor_handle, and write a handle to the object to the * memory location pointed to by @p evnt_handle. @p evnt_handle can be used * with other performance event operations. The handle should be deallocated - * with ::amdsmi_dev_destroy_counter() when no longer needed. + * with ::amdsmi_gpu_destroy_counter() when no longer needed. * * @note This function requires root access * @@ -2911,7 +2911,7 @@ amdsmi_gpu_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_destroy_counter(amdsmi_event_handle_t evnt_handle); +amdsmi_gpu_destroy_counter(amdsmi_event_handle_t evnt_handle); /** * @brief Issue performance counter control commands diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 8aa40c5399..0d4250eb2b 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2289,7 +2289,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_destroy_counter +## amdsmi_gpu_destroy_counter Description: Destroys a performance counter object Input parameters: @@ -2298,7 +2298,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_destroy_counter` function: +Exceptions that can be thrown by `amdsmi_gpu_destroy_counter` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2312,7 +2312,7 @@ try: else: for device in devices: event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI) - amdsmi_dev_destroy_counter(event_handle) + amdsmi_gpu_destroy_counter(event_handle) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 569dc9053d..b10bc77f99 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -118,7 +118,7 @@ from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters from .amdsmi_interface import amdsmi_gpu_counter_group_supported from .amdsmi_interface import amdsmi_gpu_create_counter -from .amdsmi_interface import amdsmi_dev_destroy_counter +from .amdsmi_interface import amdsmi_gpu_destroy_counter from .amdsmi_interface import amdsmi_control_counter from .amdsmi_interface import amdsmi_read_counter from .amdsmi_interface import amdsmi_counter_get_available_counters diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 57ce6f944e..6026bf8cbe 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1382,12 +1382,12 @@ def amdsmi_gpu_create_counter( return event_handle -def amdsmi_dev_destroy_counter(event_handle: amdsmi_wrapper.amdsmi_event_handle_t): +def amdsmi_gpu_destroy_counter(event_handle: amdsmi_wrapper.amdsmi_event_handle_t): if not isinstance(event_handle, amdsmi_wrapper.amdsmi_event_handle_t): raise AmdSmiParameterException( event_handle, amdsmi_wrapper.amdsmi_event_handle_t ) - _check_res(amdsmi_wrapper.amdsmi_dev_destroy_counter(event_handle)) + _check_res(amdsmi_wrapper.amdsmi_gpu_destroy_counter(event_handle)) def amdsmi_control_counter( diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 192ca8a569..5065aa5627 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1595,9 +1595,9 @@ amdsmi_gpu_counter_group_supported.argtypes = [amdsmi_processor_handle, amdsmi_e amdsmi_gpu_create_counter = _libraries['libamd_smi.so'].amdsmi_gpu_create_counter amdsmi_gpu_create_counter.restype = amdsmi_status_t amdsmi_gpu_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_dev_destroy_counter = _libraries['libamd_smi.so'].amdsmi_dev_destroy_counter -amdsmi_dev_destroy_counter.restype = amdsmi_status_t -amdsmi_dev_destroy_counter.argtypes = [amdsmi_event_handle_t] +amdsmi_gpu_destroy_counter = _libraries['libamd_smi.so'].amdsmi_gpu_destroy_counter +amdsmi_gpu_destroy_counter.restype = amdsmi_status_t +amdsmi_gpu_destroy_counter.argtypes = [amdsmi_event_handle_t] amdsmi_control_counter = _libraries['libamd_smi.so'].amdsmi_control_counter amdsmi_control_counter.restype = amdsmi_status_t amdsmi_control_counter.argtypes = [amdsmi_event_handle_t, amdsmi_counter_command_t, ctypes.POINTER(None)] @@ -1851,7 +1851,7 @@ __all__ = \ 'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t', 'amdsmi_dev_close_supported_func_iterator', 'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter', - 'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent', + 'amdsmi_gpu_destroy_counter', 'amdsmi_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_gpu_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 8ba0962b8b..48e1c62168 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -703,7 +703,7 @@ amdsmi_status_t amdsmi_gpu_create_counter(amdsmi_processor_handle processor_hand static_cast(evnt_handle)); } -amdsmi_status_t amdsmi_dev_destroy_counter(amdsmi_event_handle_t evnt_handle) { +amdsmi_status_t amdsmi_gpu_destroy_counter(amdsmi_event_handle_t evnt_handle) { rsmi_status_t r = rsmi_dev_counter_destroy( static_cast(evnt_handle)); return amd::smi::rsmi_to_amdsmi_status(r); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index a9b454718b..4a1f13468d 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -146,7 +146,7 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_processor_handle dv_ind, std::cout << "\t\t\tEvents/Second Running: " << val->value/static_cast(val->time_running) << std::endl; } - ret = amdsmi_dev_destroy_counter(evt_handle); + ret = amdsmi_gpu_destroy_counter(evt_handle); CHK_ERR_ASRT(ret) } @@ -337,7 +337,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) } } for (j = 0; j < num_created; ++j) { - ret = amdsmi_dev_destroy_counter(evt_handle.get()[j]); + ret = amdsmi_gpu_destroy_counter(evt_handle.get()[j]); CHK_ERR_ASRT(ret) } } From c70ff3cbed3240d50d85ad74af3f7df0ce7e6f9b Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:04:54 -0500 Subject: [PATCH 72/95] Renamed API amdsmi_control_counter to amdsmi_gpu_control_counter grep -rli 'amdsmi_control_counter' * | xargs -i@ sed -i 's/amdsmi_control_counter/amdsmi_gpu_control_counter/g' @ Change-Id: Ibdcd32327ebd2646375fb5c3b913cb528ac8aa97 [ROCm/amdsmi commit: 6e1a72d2c10cdb51cc3dd806302d0401f510f82d] --- projects/amdsmi/include/amd_smi/amdsmi.h | 8 ++++---- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/perf_cntr_read_write.cc | 6 +++--- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 90b7627e72..dbc58fba85 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2780,7 +2780,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * structure. * * Once an event counter handle is obtained, the event counter can be - * controlled (i.e., started, stopped,...) with ::amdsmi_control_counter() by + * controlled (i.e., started, stopped,...) with ::amdsmi_gpu_control_counter() by * passing ::amdsmi_counter_command_t commands. ::AMDSMI_CNTR_CMD_START starts an * event counter and ::AMDSMI_CNTR_CMD_STOP stops a counter. * ::amdsmi_read_counter() reads an event counter. @@ -2831,7 +2831,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * // A program that generates the events of interest can be started * // immediately before or after starting the counters. * // Start counting: - * ret = amdsmi_control_counter(evnt_handle, AMDSMI_CNTR_CMD_START, NULL); + * ret = amdsmi_gpu_control_counter(evnt_handle, AMDSMI_CNTR_CMD_START, NULL); * * // Wait... * @@ -2844,7 +2844,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * ret = amdsmi_read_counter(amdsmi_event_handle_t evt_handle, &value) * * // Stop counting. - * ret = amdsmi_control_counter(evnt_handle, AMDSMI_CNTR_CMD_STOP, NULL); + * ret = amdsmi_gpu_control_counter(evnt_handle, AMDSMI_CNTR_CMD_STOP, NULL); * * // Release all resources (e.g., counter and memory resources) associated * with evnt_handle. @@ -2930,7 +2930,7 @@ amdsmi_gpu_destroy_counter(amdsmi_event_handle_t evnt_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_control_counter(amdsmi_event_handle_t evt_handle, +amdsmi_gpu_control_counter(amdsmi_event_handle_t evt_handle, amdsmi_counter_command_t cmd, void *cmd_args); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 0d4250eb2b..934d06c21e 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2316,7 +2316,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_control_counter +## amdsmi_gpu_control_counter Description: Issue performance counter control commands Input parameters: @@ -2326,7 +2326,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_control_counter` function: +Exceptions that can be thrown by `amdsmi_gpu_control_counter` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2340,7 +2340,7 @@ try: else: for device in devices: event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) - amdsmi_control_counter(event_handle, AmdSmiCounterCommand.CMD_START) + amdsmi_gpu_control_counter(event_handle, AmdSmiCounterCommand.CMD_START) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index b10bc77f99..fbd8519285 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -119,7 +119,7 @@ from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets from .amdsmi_interface import amdsmi_gpu_counter_group_supported from .amdsmi_interface import amdsmi_gpu_create_counter from .amdsmi_interface import amdsmi_gpu_destroy_counter -from .amdsmi_interface import amdsmi_control_counter +from .amdsmi_interface import amdsmi_gpu_control_counter from .amdsmi_interface import amdsmi_read_counter from .amdsmi_interface import amdsmi_counter_get_available_counters diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 6026bf8cbe..e28e45d14a 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1390,7 +1390,7 @@ def amdsmi_gpu_destroy_counter(event_handle: amdsmi_wrapper.amdsmi_event_handle_ _check_res(amdsmi_wrapper.amdsmi_gpu_destroy_counter(event_handle)) -def amdsmi_control_counter( +def amdsmi_gpu_control_counter( event_handle: amdsmi_wrapper.amdsmi_event_handle_t, counter_command: AmdSmiCounterCommand, ): @@ -1403,7 +1403,7 @@ def amdsmi_control_counter( command_args = ctypes.c_void_p() _check_res( - amdsmi_wrapper.amdsmi_control_counter( + amdsmi_wrapper.amdsmi_gpu_control_counter( event_handle, counter_command, command_args ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 5065aa5627..0c40857a48 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1598,9 +1598,9 @@ amdsmi_gpu_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type amdsmi_gpu_destroy_counter = _libraries['libamd_smi.so'].amdsmi_gpu_destroy_counter amdsmi_gpu_destroy_counter.restype = amdsmi_status_t amdsmi_gpu_destroy_counter.argtypes = [amdsmi_event_handle_t] -amdsmi_control_counter = _libraries['libamd_smi.so'].amdsmi_control_counter -amdsmi_control_counter.restype = amdsmi_status_t -amdsmi_control_counter.argtypes = [amdsmi_event_handle_t, amdsmi_counter_command_t, ctypes.POINTER(None)] +amdsmi_gpu_control_counter = _libraries['libamd_smi.so'].amdsmi_gpu_control_counter +amdsmi_gpu_control_counter.restype = amdsmi_status_t +amdsmi_gpu_control_counter.argtypes = [amdsmi_event_handle_t, amdsmi_counter_command_t, ctypes.POINTER(None)] amdsmi_read_counter = _libraries['libamd_smi.so'].amdsmi_read_counter amdsmi_read_counter.restype = amdsmi_status_t amdsmi_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__SA_amdsmi_counter_value_t)] @@ -1845,7 +1845,7 @@ __all__ = \ 'amdsmi_bdf_t', 'amdsmi_bit_field_t', 'amdsmi_board_info_t', 'amdsmi_clk_measure_t', 'amdsmi_clk_type_t', 'amdsmi_clk_type_t__enumvalues', 'amdsmi_container_types_t', - 'amdsmi_container_types_t__enumvalues', 'amdsmi_control_counter', + 'amdsmi_container_types_t__enumvalues', 'amdsmi_gpu_control_counter', 'amdsmi_counter_command_t', 'amdsmi_counter_command_t__enumvalues', 'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index ae828089f4..6c071dccb3 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -346,7 +346,7 @@ class Formatter: | """ + self.style.text("57 Get fw info. Api: amdsmi_get_fw_info ") + """ | | """ + self.style.text("58 Get vbios info. Api: amdsmi_get_gpu_vbios_info ") + """ | | """ + self.style.text("59 Get counter available counters. Api: amdsmi_counter_get_available_counters ") + """ | - | """ + self.style.text("60 Get counter control. Api: amdsmi_control_counter ") + """ | + | """ + self.style.text("60 Get counter control. Api: amdsmi_gpu_control_counter ") + """ | | """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter ") + """ | | """ + self.style.text("62 Set dev clk range. Api: amdsmi_set_gpu_clk_range ") + """ | | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_gpu_counter_group_supported ") + """ | @@ -595,7 +595,7 @@ def amdsmi_tool_counter_control(dev): for counter_command in smi_api.AmdSmiCounterCommand: try: event_handle = smi_api.amdsmi_gpu_create_counter(dev, event_type) - value = smi_api.amdsmi_control_counter(event_handle, counter_command) + value = smi_api.amdsmi_gpu_control_counter(event_handle, counter_command) result.update({event_type.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(event_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 48e1c62168..3e4c76c4a7 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -709,7 +709,7 @@ amdsmi_status_t amdsmi_gpu_destroy_counter(amdsmi_event_handle_t evnt_handle) { return amd::smi::rsmi_to_amdsmi_status(r); } -amdsmi_status_t amdsmi_control_counter(amdsmi_event_handle_t evt_handle, +amdsmi_status_t amdsmi_gpu_control_counter(amdsmi_event_handle_t evt_handle, amdsmi_counter_command_t cmd, void *cmd_args) { rsmi_status_t r = rsmi_counter_control( static_cast(evt_handle), diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index 4a1f13468d..fc03238151 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -126,9 +126,9 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_processor_handle dv_ind, static_cast(evnt), nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); - ret = amdsmi_control_counter(evt_handle, AMDSMI_CNTR_CMD_START, nullptr); + ret = amdsmi_gpu_control_counter(evt_handle, AMDSMI_CNTR_CMD_START, nullptr); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { - std::cout << "amdsmi_control_counter() returned " + std::cout << "amdsmi_gpu_control_counter() returned " "AMDSMI_STATUS_NOT_SUPPORTED" << std::endl; throw AMDSMI_STATUS_NOT_SUPPORTED; } else { @@ -307,7 +307,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) for (j = 0; j < num_created; ++j) { tmp = static_cast(evnt + j); - ret = amdsmi_control_counter(evt_handle.get()[j], AMDSMI_CNTR_CMD_START, + ret = amdsmi_gpu_control_counter(evt_handle.get()[j], AMDSMI_CNTR_CMD_START, nullptr); CHK_ERR_ASRT(ret) From 1894e4d345c9543da4753cba7957aaacf7a7b479 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:06:14 -0500 Subject: [PATCH 73/95] Renamed API amdsmi_read_counter to amdsmi_gpu_read_counter grep -rli 'amdsmi_read_counter' * | xargs -i@ sed -i 's/amdsmi_read_counter/amdsmi_gpu_read_counter/g' @ Change-Id: Ie9fec914358dd901930db54ab94e05f2fe32fa5a [ROCm/amdsmi commit: 7a6c26244e42d2b6a2de471b84c8c97e1113e8fa] --- projects/amdsmi/include/amd_smi/amdsmi.h | 16 ++++++++-------- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../functional/perf_cntr_read_write.cc | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index dbc58fba85..0bd44732fd 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2783,7 +2783,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * controlled (i.e., started, stopped,...) with ::amdsmi_gpu_control_counter() by * passing ::amdsmi_counter_command_t commands. ::AMDSMI_CNTR_CMD_START starts an * event counter and ::AMDSMI_CNTR_CMD_STOP stops a counter. - * ::amdsmi_read_counter() reads an event counter. + * ::amdsmi_gpu_read_counter() reads an event counter. * * Once the counter is no longer needed, the resources it uses should be freed * by calling ::amdsmi_gpu_destroy_counter(). @@ -2794,12 +2794,12 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * - A running "absolute" counter is kept internally. For the discussion that * follows, we will call the internal counter value at time @a t @a * valt - * - Issuing ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_read_counter(), causes + * - Issuing ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_gpu_read_counter(), causes * AMDSMI (in kernel) to internally record the current absolute counter value - * - ::amdsmi_read_counter() returns the number of events that have occurred + * - ::amdsmi_gpu_read_counter() returns the number of events that have occurred * since the previously recorded value (ie, a relative value, * @a valt - valt-1) from the issuing of - * ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_read_counter() + * ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_gpu_read_counter() * * Example of event counting sequence: * @@ -2836,12 +2836,12 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * // Wait... * * // Get the number of events since AMDSMI_CNTR_CMD_START was issued: - * ret = amdsmi_read_counter(amdsmi_event_handle_t evt_handle, &value) + * ret = amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, &value) * * // Wait... * - * // Get the number of events since amdsmi_read_counter() was last called: - * ret = amdsmi_read_counter(amdsmi_event_handle_t evt_handle, &value) + * // Get the number of events since amdsmi_gpu_read_counter() was last called: + * ret = amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, &value) * * // Stop counting. * ret = amdsmi_gpu_control_counter(evnt_handle, AMDSMI_CNTR_CMD_STOP, NULL); @@ -2950,7 +2950,7 @@ amdsmi_gpu_control_counter(amdsmi_event_handle_t evt_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_read_counter(amdsmi_event_handle_t evt_handle, +amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, amdsmi_counter_value_t *value); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 934d06c21e..d5a8b2f4f2 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2344,7 +2344,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_read_counter +## amdsmi_gpu_read_counter Description: Read the current value of a performance counter Input parameters: @@ -2359,7 +2359,7 @@ Field | Description `time_enabled`| Time that the counter was enabled in nanoseconds `time_running`| Time that the counter was running in nanoseconds -Exceptions that can be thrown by `amdsmi_read_counter` function: +Exceptions that can be thrown by `amdsmi_gpu_read_counter` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2373,7 +2373,7 @@ try: else: for device in devices: event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) - amdsmi_read_counter(event_handle) + amdsmi_gpu_read_counter(event_handle) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index fbd8519285..a0dd3bf969 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -120,7 +120,7 @@ from .amdsmi_interface import amdsmi_gpu_counter_group_supported from .amdsmi_interface import amdsmi_gpu_create_counter from .amdsmi_interface import amdsmi_gpu_destroy_counter from .amdsmi_interface import amdsmi_gpu_control_counter -from .amdsmi_interface import amdsmi_read_counter +from .amdsmi_interface import amdsmi_gpu_read_counter from .amdsmi_interface import amdsmi_counter_get_available_counters # # Error Query diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index e28e45d14a..5e19b47266 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1409,7 +1409,7 @@ def amdsmi_gpu_control_counter( ) -def amdsmi_read_counter( +def amdsmi_gpu_read_counter( event_handle: amdsmi_wrapper.amdsmi_event_handle_t, ) -> Dict[str, Any]: if not isinstance(event_handle, amdsmi_wrapper.amdsmi_event_handle_t): @@ -1420,7 +1420,7 @@ def amdsmi_read_counter( counter_value = amdsmi_wrapper.amdsmi_counter_value_t() _check_res( - amdsmi_wrapper.amdsmi_read_counter( + amdsmi_wrapper.amdsmi_gpu_read_counter( event_handle, ctypes.byref(counter_value)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 0c40857a48..226e9da9b4 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1601,9 +1601,9 @@ amdsmi_gpu_destroy_counter.argtypes = [amdsmi_event_handle_t] amdsmi_gpu_control_counter = _libraries['libamd_smi.so'].amdsmi_gpu_control_counter amdsmi_gpu_control_counter.restype = amdsmi_status_t amdsmi_gpu_control_counter.argtypes = [amdsmi_event_handle_t, amdsmi_counter_command_t, ctypes.POINTER(None)] -amdsmi_read_counter = _libraries['libamd_smi.so'].amdsmi_read_counter -amdsmi_read_counter.restype = amdsmi_status_t -amdsmi_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__SA_amdsmi_counter_value_t)] +amdsmi_gpu_read_counter = _libraries['libamd_smi.so'].amdsmi_gpu_read_counter +amdsmi_gpu_read_counter.restype = amdsmi_status_t +amdsmi_gpu_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__SA_amdsmi_counter_value_t)] amdsmi_counter_get_available_counters = _libraries['libamd_smi.so'].amdsmi_counter_get_available_counters amdsmi_counter_get_available_counters.restype = amdsmi_status_t amdsmi_counter_get_available_counters.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t, ctypes.POINTER(ctypes.c_uint32)] @@ -1930,7 +1930,7 @@ __all__ = \ 'amdsmi_power_profile_status_t', 'amdsmi_proc_info_t', 'amdsmi_process_handle', 'amdsmi_process_info_t', 'amdsmi_range_t', 'amdsmi_ras_err_state_t', - 'amdsmi_ras_err_state_t__enumvalues', 'amdsmi_read_counter', + 'amdsmi_ras_err_state_t__enumvalues', 'amdsmi_gpu_read_counter', 'amdsmi_retired_page_record_t', 'amdsmi_set_gpu_event_notification_mask', 'amdsmi_set_gpu_perf_determinism_mode', 'amdsmi_shut_down', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 6c071dccb3..e18f7dbcf8 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -347,7 +347,7 @@ class Formatter: | """ + self.style.text("58 Get vbios info. Api: amdsmi_get_gpu_vbios_info ") + """ | | """ + self.style.text("59 Get counter available counters. Api: amdsmi_counter_get_available_counters ") + """ | | """ + self.style.text("60 Get counter control. Api: amdsmi_gpu_control_counter ") + """ | - | """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter ") + """ | + | """ + self.style.text("61 Get counter read. Api: amdsmi_gpu_read_counter ") + """ | | """ + self.style.text("62 Set dev clk range. Api: amdsmi_set_gpu_clk_range ") + """ | | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_gpu_counter_group_supported ") + """ | | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | @@ -607,7 +607,7 @@ def amdsmi_tool_counter_read(dev): for event_type in smi_api.AmdSmiEventType: try: event_handle = smi_api.amdsmi_gpu_create_counter(dev, event_type) - value = smi_api.amdsmi_read_counter(event_handle) + value = smi_api.amdsmi_gpu_read_counter(event_handle) result.update({event_type.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(event_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 3e4c76c4a7..a0cfb46d93 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -718,7 +718,7 @@ amdsmi_status_t amdsmi_gpu_control_counter(amdsmi_event_handle_t evt_handle, } amdsmi_status_t -amdsmi_read_counter(amdsmi_event_handle_t evt_handle, +amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, amdsmi_counter_value_t *value) { rsmi_status_t r = rsmi_counter_read( static_cast(evt_handle), diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index fc03238151..0f6a5a1b23 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -136,7 +136,7 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_processor_handle dv_ind, } sleep(sleep_sec); - ret = amdsmi_read_counter(evt_handle, val); + ret = amdsmi_gpu_read_counter(evt_handle, val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -325,7 +325,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) for (j = 0; j < num_created; ++j) { tmp = static_cast(evnt + j); - ret = amdsmi_read_counter(evt_handle.get()[j], &val); + ret = amdsmi_gpu_read_counter(evt_handle.get()[j], &val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { From 3be8f88cab6a777bec6a6f7608283d2a2bbd2d2e Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:08:28 -0500 Subject: [PATCH 74/95] Renamed API amdsmi_counter_get_available_counters to amdsmi_get_gpu_available_counters grep -rli 'amdsmi_counter_get_available_counters' * | xargs -i@ sed -i 's/amdsmi_counter_get_available_counters/amdsmi_get_gpu_available_counters/g' @ Change-Id: Ief60be6c95f2ea4d0f6f91b153263d95710e6942 [ROCm/amdsmi commit: 0cb9e157db84be127528ec7aebdacf7c2da3eaec] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/perf_cntr_read_write.cc | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 0bd44732fd..307871e89a 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2769,7 +2769,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * (::amdsmi_event_group_t) are supported for a given device. Assuming a device * supports a given event type, we can then check to see if there are counters * available to count a specific event with - * :: amdsmi_counter_get_available_counters(). Counters may be occupied by other + * :: amdsmi_get_gpu_available_counters(). Counters may be occupied by other * perf based programs. * * Once it is determined that events are supported and counters are available, @@ -2816,7 +2816,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * // See if there are counters available for device dv_ind for event * // AMDSMI_EVNT_GRP_XGMI * - * ret = amdsmi_counter_get_available_counters(dv_ind, + * ret = amdsmi_get_gpu_available_counters(dv_ind, * AMDSMI_EVNT_GRP_XGMI, &counters_available); * * // Assuming AMDSMI_EVNT_GRP_XGMI is supported and there is at least 1 @@ -2971,7 +2971,7 @@ amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_processor_handle processor_handle, + amdsmi_get_gpu_available_counters(amdsmi_processor_handle processor_handle, amdsmi_event_group_t grp, uint32_t *available); /** @} End PerfCntr */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index d5a8b2f4f2..217823592a 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2377,7 +2377,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_counter_get_available_counters +## amdsmi_get_gpu_available_counters Description: Get the number of currently available counters Input parameters: @@ -2387,7 +2387,7 @@ Input parameters: Output: Number of available counters for the given device of the inputted event group -Exceptions that can be thrown by ` amdsmi_counter_get_available_counters` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_available_counters` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2400,7 +2400,7 @@ try: print("No GPUs on machine") else: for device in devices: - available_counters = amdsmi_counter_get_available_counters(device, AmdSmiEventGroup.XGMI) + available_counters = amdsmi_get_gpu_available_counters(device, AmdSmiEventGroup.XGMI) print(available_counters) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index a0dd3bf969..1151cb4684 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -121,7 +121,7 @@ from .amdsmi_interface import amdsmi_gpu_create_counter from .amdsmi_interface import amdsmi_gpu_destroy_counter from .amdsmi_interface import amdsmi_gpu_control_counter from .amdsmi_interface import amdsmi_gpu_read_counter -from .amdsmi_interface import amdsmi_counter_get_available_counters +from .amdsmi_interface import amdsmi_get_gpu_available_counters # # Error Query from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_count diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 5e19b47266..314439ebc0 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1431,7 +1431,7 @@ def amdsmi_gpu_read_counter( } -def amdsmi_counter_get_available_counters( +def amdsmi_get_gpu_available_counters( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ) -> int: @@ -1444,7 +1444,7 @@ def amdsmi_counter_get_available_counters( available = ctypes.c_uint32() _check_res( - amdsmi_wrapper. amdsmi_counter_get_available_counters( + amdsmi_wrapper. amdsmi_get_gpu_available_counters( processor_handle, event_group, ctypes.byref(available) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 226e9da9b4..9e578fc414 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1604,9 +1604,9 @@ amdsmi_gpu_control_counter.argtypes = [amdsmi_event_handle_t, amdsmi_counter_com amdsmi_gpu_read_counter = _libraries['libamd_smi.so'].amdsmi_gpu_read_counter amdsmi_gpu_read_counter.restype = amdsmi_status_t amdsmi_gpu_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__SA_amdsmi_counter_value_t)] -amdsmi_counter_get_available_counters = _libraries['libamd_smi.so'].amdsmi_counter_get_available_counters -amdsmi_counter_get_available_counters.restype = amdsmi_status_t -amdsmi_counter_get_available_counters.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_available_counters = _libraries['libamd_smi.so'].amdsmi_get_gpu_available_counters +amdsmi_get_gpu_available_counters.restype = amdsmi_status_t +amdsmi_get_gpu_available_counters.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t, ctypes.POINTER(ctypes.c_uint32)] amdsmi_get_gpu_compute_process_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_compute_process_info amdsmi_get_gpu_compute_process_info.restype = amdsmi_status_t amdsmi_get_gpu_compute_process_info.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_process_info_t), ctypes.POINTER(ctypes.c_uint32)] @@ -1848,7 +1848,7 @@ __all__ = \ 'amdsmi_container_types_t__enumvalues', 'amdsmi_gpu_control_counter', 'amdsmi_counter_command_t', 'amdsmi_counter_command_t__enumvalues', - 'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t', + 'amdsmi_get_gpu_available_counters', 'amdsmi_counter_value_t', 'amdsmi_dev_close_supported_func_iterator', 'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter', 'amdsmi_gpu_destroy_counter', 'amdsmi_get_busy_percent', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index e18f7dbcf8..5a644ef271 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -345,7 +345,7 @@ class Formatter: | """ + self.style.text("56 Shut down. Api: amdsmi_shut_down ") + """ | | """ + self.style.text("57 Get fw info. Api: amdsmi_get_fw_info ") + """ | | """ + self.style.text("58 Get vbios info. Api: amdsmi_get_gpu_vbios_info ") + """ | - | """ + self.style.text("59 Get counter available counters. Api: amdsmi_counter_get_available_counters ") + """ | + | """ + self.style.text("59 Get counter available counters. Api: amdsmi_get_gpu_available_counters ") + """ | | """ + self.style.text("60 Get counter control. Api: amdsmi_gpu_control_counter ") + """ | | """ + self.style.text("61 Get counter read. Api: amdsmi_gpu_read_counter ") + """ | | """ + self.style.text("62 Set dev clk range. Api: amdsmi_set_gpu_clk_range ") + """ | @@ -582,7 +582,7 @@ def amdsmi_tool_counter_available_counters_get(dev): result = {} for event_group in smi_api.AmdSmiEventGroup: try: - value = smi_api. amdsmi_counter_get_available_counters(dev, event_group) + value = smi_api. amdsmi_get_gpu_available_counters(dev, event_group) result.update({event_group.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(event_group.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index a0cfb46d93..e9bdad0057 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -727,7 +727,7 @@ amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, } amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_processor_handle processor_handle, + amdsmi_get_gpu_available_counters(amdsmi_processor_handle processor_handle, amdsmi_event_group_t grp, uint32_t *available) { return rsmi_wrapper(rsmi_counter_available_counters_get, processor_handle, static_cast(grp), @@ -937,7 +937,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_gpu_clk_freq_set", " amdsmi_set_clk_freq"}, {"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"}, {"rsmi_dev_ecc_count_get", " amdsmi_dev_get_gpu_ecc_count"}, - {"rsmi_counter_available_counters_get", " amdsmi_counter_get_available_counters"}, + {"rsmi_counter_available_counters_get", " amdsmi_get_gpu_available_counters"}, {"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"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 627eac2922..71eebf63d6 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -298,7 +298,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_pci_replay_counter amdsmi_dev_unique_id_get amdsmi_gpu_create_counter - amdsmi_counter_get_available_counters + amdsmi_get_gpu_available_counters amdsmi_gpu_counter_group_supported amdsmi_get_gpu_memory_reserved_pages amdsmi_dev_xgmi_error_status diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index 0f6a5a1b23..804b462a54 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -261,7 +261,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) std::cout << "Testing Event Group " << grp.name() << std::endl; } - ret = amdsmi_counter_get_available_counters(dv_ind, grp.group(), + ret = amdsmi_get_gpu_available_counters(dv_ind, grp.group(), &avail_counters); IF_VERB(STANDARD) { std::cout << "Available Counters: " << avail_counters << std::endl; @@ -311,7 +311,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) nullptr); CHK_ERR_ASRT(ret) - ret = amdsmi_counter_get_available_counters(dv_ind, grp.group(), + ret = amdsmi_get_gpu_available_counters(dv_ind, grp.group(), &tmp_cntrs); CHK_ERR_ASRT(ret) ASSERT_EQ(tmp_cntrs, (avail_counters - j - 1)); From f9e0851070c424aa2b0e3f9af5bb77271c0a2a78 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:10:20 -0500 Subject: [PATCH 75/95] Renamed API amdsmi_dev_xgmi_error_status to amdsmi_gpu_xgmi_error_status grep -rli 'amdsmi_dev_xgmi_error_status' * | xargs -i@ sed -i 's/amdsmi_dev_xgmi_error_status/amdsmi_gpu_xgmi_error_status/g' @ Change-Id: I0d2338f0e924da5d69d280fdd988c2a6f9fe4ace [ROCm/amdsmi commit: d83dc2b0059e3773267e60258bf86d1c2f9f0580] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/xgmi_read_write.cc | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 307871e89a..905c1deb5a 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3093,7 +3093,7 @@ amdsmi_get_gpu_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status); +amdsmi_gpu_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status); /** * @brief Reset the XGMI error status for a device diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 217823592a..800cafebd7 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2822,7 +2822,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_xgmi_error_status +## amdsmi_gpu_xgmi_error_status Description: Retrieve the XGMI error status for a device Input parameters: @@ -2830,7 +2830,7 @@ Input parameters: Output: XGMI error status for a requested device -Exceptions that can be thrown by `amdsmi_dev_xgmi_error_status` function: +Exceptions that can be thrown by `amdsmi_gpu_xgmi_error_status` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2843,7 +2843,7 @@ try: print("No GPUs on machine") else: for device in devices: - status = amdsmi_dev_xgmi_error_status(device) + status = amdsmi_gpu_xgmi_error_status(device) print(status) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 1151cb4684..6bd79150b0 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -133,7 +133,7 @@ from .amdsmi_interface import amdsmi_status_string from .amdsmi_interface import amdsmi_get_gpu_compute_process_info from .amdsmi_interface import amdsmi_get_gpu_compute_process_info_by_pid from .amdsmi_interface import amdsmi_get_gpu_compute_process_gpus -from .amdsmi_interface import amdsmi_dev_xgmi_error_status +from .amdsmi_interface import amdsmi_gpu_xgmi_error_status from .amdsmi_interface import amdsmi_dev_reset_xgmi_error # # PCIE information diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 314439ebc0..bec164965a 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2603,7 +2603,7 @@ def amdsmi_get_gpu_compute_process_gpus(pid: int) -> List[int]: return [dv_index.value for dv_index in dv_indices] -def amdsmi_dev_xgmi_error_status( +def amdsmi_gpu_xgmi_error_status( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> AmdSmiXgmiStatus: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2613,7 +2613,7 @@ def amdsmi_dev_xgmi_error_status( status = amdsmi_wrapper.amdsmi_xgmi_status_t() _check_res( - amdsmi_wrapper.amdsmi_dev_xgmi_error_status( + amdsmi_wrapper.amdsmi_gpu_xgmi_error_status( processor_handle, ctypes.byref(status)) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9e578fc414..0adf0eba36 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1616,9 +1616,9 @@ amdsmi_get_gpu_compute_process_info_by_pid.argtypes = [uint32_t, ctypes.POINTER( amdsmi_get_gpu_compute_process_gpus = _libraries['libamd_smi.so'].amdsmi_get_gpu_compute_process_gpus amdsmi_get_gpu_compute_process_gpus.restype = amdsmi_status_t amdsmi_get_gpu_compute_process_gpus.argtypes = [uint32_t, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] -amdsmi_dev_xgmi_error_status = _libraries['libamd_smi.so'].amdsmi_dev_xgmi_error_status -amdsmi_dev_xgmi_error_status.restype = amdsmi_status_t -amdsmi_dev_xgmi_error_status.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_xgmi_status_t)] +amdsmi_gpu_xgmi_error_status = _libraries['libamd_smi.so'].amdsmi_gpu_xgmi_error_status +amdsmi_gpu_xgmi_error_status.restype = amdsmi_status_t +amdsmi_gpu_xgmi_error_status.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_xgmi_status_t)] amdsmi_dev_reset_xgmi_error = _libraries['libamd_smi.so'].amdsmi_dev_reset_xgmi_error amdsmi_dev_reset_xgmi_error.restype = amdsmi_status_t amdsmi_dev_reset_xgmi_error.argtypes = [amdsmi_processor_handle] @@ -1881,7 +1881,7 @@ __all__ = \ 'amdsmi_dev_set_overdrive_level_v1', 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_set_gpu_perf_level', 'amdsmi_set_gpu_perf_level_v1', 'amdsmi_set_power_cap', - 'amdsmi_set_gpu_power_profile', 'amdsmi_dev_xgmi_error_status', + 'amdsmi_set_gpu_power_profile', 'amdsmi_gpu_xgmi_error_status', 'amdsmi_processor_handle', 'amdsmi_engine_usage_t', 'amdsmi_error_count_t', 'amdsmi_event_group_t', 'amdsmi_event_group_t__enumvalues', 'amdsmi_event_handle_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 5a644ef271..3a385b23b6 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -328,7 +328,7 @@ class Formatter: | """ + self.style.text("39 Get compute process info. Api: amdsmi_get_gpu_compute_process_info ") + """ | | """ + self.style.text("40 Get compute process info by pid. Api: amdsmi_get_gpu_compute_process_info_by_pid ") + """ | | """ + self.style.text("41 Get compute process gpus. Api: amdsmi_get_gpu_compute_process_gpus ") + """ | - | """ + self.style.text("42 Get device xgmi_error_status. Api: amdsmi_dev_xgmi_error_status ") + """ | + | """ + self.style.text("42 Get device xgmi_error_status. Api: amdsmi_gpu_xgmi_error_status ") + """ | | """ + self.style.text("43 Get device xgmi error reset. Api: amdsmi_dev_reset_xgmi_error ") + """ | | """ + self.style.text("44 Get topo get numa node number. Api: amdsmi_topo_get_numa_node_number ") + """ | | """ + self.style.text("45 Get topo get link weight. Api: amdsmi_topo_get_link_weight ") + """ | @@ -846,7 +846,7 @@ commands = { 41: [amdsmi_tool_compute_process_gpus_get, { "pid": [int, True] }], - 42: [smi_api.amdsmi_dev_xgmi_error_status, { + 42: [smi_api.amdsmi_gpu_xgmi_error_status, { "device_identifier1": [None, True] }], 43: [smi_api.amdsmi_dev_reset_xgmi_error, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index e9bdad0057..3103fc0a0a 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -824,7 +824,7 @@ amdsmi_get_xgmi_info(amdsmi_processor_handle processor_handle, amdsmi_xgmi_info_ } amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status) { +amdsmi_gpu_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status) { return rsmi_wrapper(rsmi_dev_xgmi_error_status, processor_handle, reinterpret_cast(status)); } @@ -925,7 +925,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, {"rsmi_dev_counter_group_supported", "amdsmi_gpu_counter_group_supported"}, {"rsmi_dev_counter_create", "amdsmi_gpu_create_counter"}, - {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, + {"rsmi_dev_xgmi_error_status", "amdsmi_gpu_xgmi_error_status"}, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 71eebf63d6..770234b053 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -301,7 +301,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_available_counters amdsmi_gpu_counter_group_supported amdsmi_get_gpu_memory_reserved_pages - amdsmi_dev_xgmi_error_status + amdsmi_gpu_xgmi_error_status amdsmi_dev_reset_xgmi_error amdsmi_dev_xgmi_hive_id_get amdsmi_topo_get_link_weight diff --git a/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc index 6312b5e7c2..926e88ac54 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc @@ -116,7 +116,7 @@ void TestXGMIReadWrite::Run(void) { } } - err = amdsmi_dev_xgmi_error_status(device, &err_stat); + err = amdsmi_gpu_xgmi_error_status(device, &err_stat); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -124,7 +124,7 @@ void TestXGMIReadWrite::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_xgmi_error_status(device, nullptr); + err = amdsmi_gpu_xgmi_error_status(device, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); continue; @@ -135,7 +135,7 @@ void TestXGMIReadWrite::Run(void) { static_cast(err_stat) << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_xgmi_error_status(device, nullptr); + err = amdsmi_gpu_xgmi_error_status(device, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); // TODO(cfree) We need to find a way to generate xgmi errors so this From 6229bac89bd975718de0917cdf8579c05cc834e3 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 04:05:11 -0500 Subject: [PATCH 76/95] Renamed API amdsmi_dev_get_overdrive_level to amdsmi_get_gpu_overdrive_level grep -rli 'amdsmi_dev_get_overdrive_level' * | xargs -i@ sed -i 's/amdsmi_dev_get_overdrive_level/amdsmi_get_gpu_overdrive_level/g' @ Change-Id: Id33a4544a2f2fd9d77de601addcf4e45d09d65d1 [ROCm/amdsmi commit: 78ce4979e1ddad55599a432d319a6ea513fac72d] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/overdrive_read.cc | 4 ++-- .../tests/amd_smi_test/functional/overdrive_read_write.cc | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 905c1deb5a..4c6d50962e 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2219,7 +2219,7 @@ amdsmi_set_gpu_perf_determinism_mode(amdsmi_processor_handle processor_handle, u * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t *od); +amdsmi_status_t amdsmi_get_gpu_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t *od); /** * @brief Get the list of possible system clock speeds of device for a diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 800cafebd7..d744c37549 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2011,7 +2011,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_overdrive_level +## amdsmi_get_gpu_overdrive_level Description: Get the overdrive percent associated with the device with provided device handle @@ -2020,7 +2020,7 @@ Input parameters: Output: Overdrive percentage as integer -Exceptions that can be thrown by `amdsmi_dev_get_overdrive_level` function: +Exceptions that can be thrown by `amdsmi_get_gpu_overdrive_level` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2033,7 +2033,7 @@ try: print("No GPUs on machine") else: for device in devices: - od_level = amdsmi_dev_get_overdrive_level(dev) + od_level = amdsmi_get_gpu_overdrive_level(dev) print(od_level) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 6bd79150b0..5b22c3313e 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -108,7 +108,7 @@ from .amdsmi_interface import amdsmi_get_busy_percent from .amdsmi_interface import amdsmi_get_utilization_count from .amdsmi_interface import amdsmi_get_gpu_perf_level from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode -from .amdsmi_interface import amdsmi_dev_get_overdrive_level +from .amdsmi_interface import amdsmi_get_gpu_overdrive_level from .amdsmi_interface import amdsmi_get_clk_freq from .amdsmi_interface import amdsmi_dev_get_od_volt_info from .amdsmi_interface import amdsmi_get_gpu_metrics_info diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index bec164965a..e0c37d830e 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2267,7 +2267,7 @@ def amdsmi_set_gpu_perf_determinism_mode( processor_handle, clkvalue)) -def amdsmi_dev_get_overdrive_level( +def amdsmi_get_gpu_overdrive_level( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2277,7 +2277,7 @@ def amdsmi_dev_get_overdrive_level( od_level = ctypes.c_uint32() _check_res( - amdsmi_wrapper.amdsmi_dev_get_overdrive_level( + amdsmi_wrapper.amdsmi_get_gpu_overdrive_level( processor_handle, ctypes.byref(od_level) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 0adf0eba36..5b1161910f 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1526,9 +1526,9 @@ amdsmi_get_gpu_perf_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c_ amdsmi_set_gpu_perf_determinism_mode = _libraries['libamd_smi.so'].amdsmi_set_gpu_perf_determinism_mode amdsmi_set_gpu_perf_determinism_mode.restype = amdsmi_status_t amdsmi_set_gpu_perf_determinism_mode.argtypes = [amdsmi_processor_handle, uint64_t] -amdsmi_dev_get_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_get_overdrive_level -amdsmi_dev_get_overdrive_level.restype = amdsmi_status_t -amdsmi_dev_get_overdrive_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] +amdsmi_get_gpu_overdrive_level = _libraries['libamd_smi.so'].amdsmi_get_gpu_overdrive_level +amdsmi_get_gpu_overdrive_level.restype = amdsmi_status_t +amdsmi_get_gpu_overdrive_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] amdsmi_get_clk_freq = _libraries['libamd_smi.so'].amdsmi_get_clk_freq amdsmi_get_clk_freq.restype = amdsmi_status_t amdsmi_get_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)] @@ -1861,7 +1861,7 @@ __all__ = \ 'amdsmi_get_gpu_memory_reserved_pages', 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', - 'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level', + 'amdsmi_dev_get_od_volt_info', 'amdsmi_get_gpu_overdrive_level', 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', 'amdsmi_get_gpu_pci_replay_counter', 'amdsmi_get_gpu_pci_throughput', 'amdsmi_get_gpu_perf_level', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 3a385b23b6..8eb4513690 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -313,7 +313,7 @@ class Formatter: | """ + self.style.text("24 Get utilization count. Api: amdsmi_get_utilization_count ") + """ | | """ + self.style.text("25 Get device perf level. Api: amdsmi_get_gpu_perf_level ") + """ | | """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_gpu_perf_determinism_mode ") + """ | - | """ + self.style.text("27 Get device overdrive level. Api: amdsmi_dev_get_overdrive_level ") + """ | + | """ + self.style.text("27 Get device overdrive level. Api: amdsmi_get_gpu_overdrive_level ") + """ | | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_get_clk_freq ") + """ | | """ + self.style.text("29 Get device od volt. Api: amdsmi_dev_get_od_volt_info ") + """ | | """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_get_gpu_metrics_info ") + """ | @@ -805,7 +805,7 @@ commands = { "device_identifier1": [None, True], "clock_value": [int, True] }], - 27: [smi_api.amdsmi_dev_get_overdrive_level, { + 27: [smi_api.amdsmi_get_gpu_overdrive_level, { "device_identifier1": [None, True] }], 28: [amdsmi_tool_dev_gpu_clk_freq_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 3103fc0a0a..7a19173469 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -910,7 +910,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_memory_busy_percent_get", "amdsmi_get_gpu_memory_busy_percent"}, {"rsmi_dev_busy_percent_get", "amdsmi_get_busy_percent"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, - {"rsmi_dev_overdrive_level_get", "amdsmi_dev_get_overdrive_level"}, + {"rsmi_dev_overdrive_level_get", "amdsmi_get_gpu_overdrive_level"}, {"rsmi_dev_power_profile_presets_get", " amdsmi_get_gpu_power_profile_presets"}, {"rsmi_dev_perf_level_set", " amdsmi_set_gpu_perf_level"}, {"rsmi_dev_perf_level_set_v1", " amdsmi_set_gpu_perf_level_v1"}, @@ -1280,7 +1280,7 @@ amdsmi_status_t amdsmi_get_gpu_memory_usage(amdsmi_processor_handle processor_ha static_cast(mem_type), used); } -amdsmi_status_t amdsmi_dev_get_overdrive_level( +amdsmi_status_t amdsmi_get_gpu_overdrive_level( amdsmi_processor_handle processor_handle, uint32_t *od) { return rsmi_wrapper(rsmi_dev_overdrive_level_get, processor_handle, od); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 770234b053..09588bafe5 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -237,7 +237,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_perf_level(processor_handles_[0], &dmy_perf_lvl); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_overdrive_level(processor_handles_[0], &dmy_ui32); + ret = amdsmi_get_gpu_overdrive_level(processor_handles_[0], &dmy_ui32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs); CHECK_RET(ret, AMDSMI_STATUS_BUSY); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc index 2aa7e45e39..ccc3df1eb7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc @@ -98,12 +98,12 @@ void TestOverdriveRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_overdrive_level(processor_handles_[i], &val_ui32); + err = amdsmi_get_gpu_overdrive_level(processor_handles_[i], &val_ui32); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**OverDrive Level:" << val_ui32 << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_overdrive_level(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_overdrive_level(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc index 08f700ec2a..e389409787 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc @@ -107,7 +107,7 @@ void TestOverdriveReadWrite::Run(void) { } ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 10); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val); + ret = amdsmi_get_gpu_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New OverDrive Level:" << val << std::endl; @@ -115,7 +115,7 @@ void TestOverdriveReadWrite::Run(void) { } ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val); + ret = amdsmi_get_gpu_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New OverDrive Level:" << val << std::endl; From cd81fa970db2c6b0f79c567fce7d8f513ab1027e Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 04:06:56 -0500 Subject: [PATCH 77/95] Renamed API amdsmi_dev_get_od_volt_info to amdsmi_get_gpu_od_volt_info grep -rli 'amdsmi_dev_get_od_volt_info' * | xargs -i@ sed -i 's/amdsmi_dev_get_od_volt_info/amdsmi_get_gpu_od_volt_info/g' @ Change-Id: Icd8658509b28523b7c04f8d2c53efb82689e294b [ROCm/amdsmi commit: 2bd94db02c85c80cec065767af6c057ac0391cfc] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- .../tests/amd_smi_test/functional/perf_determinism.cc | 2 +- .../tests/amd_smi_test/functional/volt_freq_curv_read.cc | 8 ++++---- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 4c6d50962e..b5bd26c19d 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2271,7 +2271,7 @@ amdsmi_status_t amdsmi_reset_gpu(amdsmi_processor_handle processor_handle); * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_od_volt_info(amdsmi_processor_handle processor_handle, amdsmi_od_volt_freq_data_t *odv); /** @@ -2374,7 +2374,7 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_h * be written to @p buffer in @p num_regions. * * The number of regions to expect this function provide (@p num_regions) can - * be obtained by calling :: amdsmi_dev_get_od_volt_info(). + * be obtained by calling :: amdsmi_get_gpu_od_volt_info(). * * @param[in] processor_handle a processor handle * diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index d744c37549..0ac61222a1 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2071,7 +2071,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_od_volt_info +## amdsmi_get_gpu_od_volt_info Description: This function retrieves the voltage/frequency curve information Input parameters: @@ -2089,7 +2089,7 @@ Field | Description `num_regions`| The current frequency index -Exceptions that can be thrown by ` amdsmi_dev_get_od_volt_info` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_od_volt_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2102,7 +2102,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_get_od_volt_info(dev) + amdsmi_get_gpu_od_volt_info(dev) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 5b22c3313e..0958984b66 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -110,7 +110,7 @@ from .amdsmi_interface import amdsmi_get_gpu_perf_level from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_get_gpu_overdrive_level from .amdsmi_interface import amdsmi_get_clk_freq -from .amdsmi_interface import amdsmi_dev_get_od_volt_info +from .amdsmi_interface import amdsmi_get_gpu_od_volt_info from .amdsmi_interface import amdsmi_get_gpu_metrics_info from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index e0c37d830e..dd5258be0b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2309,7 +2309,7 @@ def amdsmi_get_clk_freq( } -def amdsmi_dev_get_od_volt_info( +def amdsmi_get_gpu_od_volt_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2319,7 +2319,7 @@ def amdsmi_dev_get_od_volt_info( freq_data = amdsmi_wrapper.amdsmi_od_volt_freq_data_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_od_volt_info( + amdsmi_wrapper. amdsmi_get_gpu_od_volt_info( processor_handle, ctypes.byref(freq_data) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 5b1161910f..9162f79503 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1535,9 +1535,9 @@ amdsmi_get_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctyp amdsmi_reset_gpu = _libraries['libamd_smi.so'].amdsmi_reset_gpu amdsmi_reset_gpu.restype = amdsmi_status_t amdsmi_reset_gpu.argtypes = [amdsmi_processor_handle] -amdsmi_dev_get_od_volt_info = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_info -amdsmi_dev_get_od_volt_info.restype = amdsmi_status_t -amdsmi_dev_get_od_volt_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_od_volt_freq_data_t)] +amdsmi_get_gpu_od_volt_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_od_volt_info +amdsmi_get_gpu_od_volt_info.restype = amdsmi_status_t +amdsmi_get_gpu_od_volt_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_od_volt_freq_data_t)] amdsmi_get_gpu_metrics_info = _libraries['libamd_smi.so'].amdsmi_get_gpu_metrics_info amdsmi_get_gpu_metrics_info.restype = amdsmi_status_t amdsmi_get_gpu_metrics_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_metrics_t)] @@ -1861,7 +1861,7 @@ __all__ = \ 'amdsmi_get_gpu_memory_reserved_pages', 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', 'amdsmi_dev_get_od_volt_curve_regions', - 'amdsmi_dev_get_od_volt_info', 'amdsmi_get_gpu_overdrive_level', + 'amdsmi_get_gpu_od_volt_info', 'amdsmi_get_gpu_overdrive_level', 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', 'amdsmi_get_gpu_pci_replay_counter', 'amdsmi_get_gpu_pci_throughput', 'amdsmi_get_gpu_perf_level', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 8eb4513690..cb28862de2 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -315,7 +315,7 @@ class Formatter: | """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_gpu_perf_determinism_mode ") + """ | | """ + self.style.text("27 Get device overdrive level. Api: amdsmi_get_gpu_overdrive_level ") + """ | | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_get_clk_freq ") + """ | - | """ + self.style.text("29 Get device od volt. Api: amdsmi_dev_get_od_volt_info ") + """ | + | """ + self.style.text("29 Get device od volt. Api: amdsmi_get_gpu_od_volt_info ") + """ | | """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_get_gpu_metrics_info ") + """ | | """ + self.style.text("31 Get device od volt curve regions. Api: amdsmi_dev_get_od_volt_curve_regions ") + """ | | """ + self.style.text("32 Get device power profile presets. Api: amdsmi_get_gpu_power_profile_presets ") + """ | @@ -811,7 +811,7 @@ commands = { 28: [amdsmi_tool_dev_gpu_clk_freq_get, { "device_identifier1": [None, True] }], - 29: [smi_api. amdsmi_dev_get_od_volt_info, { + 29: [smi_api. amdsmi_get_gpu_od_volt_info, { "device_identifier1": [None, True] }], 30: [smi_api. amdsmi_get_gpu_metrics_info, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 7a19173469..eff05f6d17 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -918,7 +918,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_perf_determinism_mode_set", "amdsmi_set_gpu_perf_determinism_mode"}, {"rsmi_dev_overdrive_level_set", " amdsmi_dev_set_overdrive_level"}, {"rsmi_dev_vbios_version_get", "amdsmi_get_gpu_vbios_info"}, - {"rsmi_dev_od_volt_info_get", " amdsmi_dev_get_od_volt_info"}, + {"rsmi_dev_od_volt_info_get", " amdsmi_get_gpu_od_volt_info"}, {"rsmi_dev_od_volt_info_set", " amdsmi_dev_set_od_volt_info"}, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, @@ -1302,7 +1302,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_throughput( sent, received, max_pkt_sz); } -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_od_volt_info(amdsmi_processor_handle processor_handle, amdsmi_od_volt_freq_data_t *odv) { return rsmi_wrapper(rsmi_dev_od_volt_info_get, processor_handle, reinterpret_cast(odv)); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 09588bafe5..6e3dec5409 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -241,7 +241,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_od_volt_info(processor_handles_[0], &dmy_od_volt); + ret = amdsmi_get_gpu_od_volt_info(processor_handles_[0], &dmy_od_volt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[0], &dmy_ui32, &dmy_vlt_reg); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -279,7 +279,7 @@ void TestMutualExclusion::Run(void) { amdsmi_reset_gpu_fan amdsmi_set_gpu_fan_speed amdsmi_get_gpu_fan_speed_max - amdsmi_dev_get_od_volt_info + amdsmi_get_gpu_od_volt_info amdsmi_get_gpu_metrics_info amdsmi_dev_get_od_volt_curve_regions amdsmi_dev_power_max_get diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc index 6f0f470563..f20215606e 100644 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_determinism.cc @@ -103,7 +103,7 @@ void TestPerfDeterminism::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv); + err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], &odv); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t** Not supported on this machine" << std::endl; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc index 484c9964c7..38a2eba73e 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc @@ -157,20 +157,20 @@ void TestVoltCurvRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv); + err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], &odv); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << - "\t** amdsmi_dev_get_od_volt_info: Not supported on this machine" + "\t** amdsmi_get_gpu_od_volt_info: Not supported on this machine" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) // Verify api support checking functionality is working - err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_od_volt_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } From 19d30f71bdbbcf985178f7138fb36aaafb5264d6 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 04:08:29 -0500 Subject: [PATCH 78/95] Renamed API amdsmi_dev_set_od_clk_info to amdsmi_set_gpu_od_clk_info grep -rli 'amdsmi_dev_set_od_clk_info' * | xargs -i@ sed -i 's/amdsmi_dev_set_od_clk_info/amdsmi_set_gpu_od_clk_info/g' @ Change-Id: I0f1fd5a80322a544f7d25e09146c9e52b82091f6 [ROCm/amdsmi commit: a72e1ec91d533bda46763579950715d6937e5361] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index b5bd26c19d..07b7b60de0 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2336,7 +2336,7 @@ amdsmi_status_t amdsmi_set_gpu_clk_range(amdsmi_processor_handle processor_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, +amdsmi_status_t amdsmi_set_gpu_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType); diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 0ac61222a1..d5443bf798 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1591,7 +1591,7 @@ except AmdSmiException as e: -## amdsmi_dev_set_od_clk_info +## amdsmi_set_gpu_od_clk_info Description: This function sets the clock frequency information Input parameters: @@ -1603,7 +1603,7 @@ or maximum (1) speed Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_od_clk_info` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_od_clk_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1616,7 +1616,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_od_clk_info( + amdsmi_set_gpu_od_clk_info( device, AmdSmiFreqInd.AMDSMI_FREQ_IND_MAX, 1000, diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 0958984b66..a1bc588643 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -83,7 +83,7 @@ from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_set_power_cap from .amdsmi_interface import amdsmi_set_gpu_power_profile from .amdsmi_interface import amdsmi_set_gpu_clk_range -from .amdsmi_interface import amdsmi_dev_set_od_clk_info +from .amdsmi_interface import amdsmi_set_gpu_od_clk_info from .amdsmi_interface import amdsmi_dev_set_od_volt_info from .amdsmi_interface import amdsmi_set_gpu_perf_level_v1 from .amdsmi_interface import amdsmi_set_gpu_perf_level diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index dd5258be0b..ea563d8b4b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1950,7 +1950,7 @@ def amdsmi_get_gpu_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processo return total.value -def amdsmi_dev_set_od_clk_info( +def amdsmi_set_gpu_od_clk_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, level: AmdSmiFreqInd, value: int, @@ -1971,7 +1971,7 @@ def amdsmi_dev_set_od_clk_info( raise AmdSmiParameterException(clk_type, AmdSmiClkType) _check_res( - amdsmi_wrapper. amdsmi_dev_set_od_clk_info( + amdsmi_wrapper. amdsmi_set_gpu_od_clk_info( processor_handle, level, ctypes.c_uint64(value), clk_type ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 9162f79503..1de5640edc 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1544,9 +1544,9 @@ amdsmi_get_gpu_metrics_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER( amdsmi_set_gpu_clk_range = _libraries['libamd_smi.so'].amdsmi_set_gpu_clk_range amdsmi_set_gpu_clk_range.restype = amdsmi_status_t amdsmi_set_gpu_clk_range.argtypes = [amdsmi_processor_handle, uint64_t, uint64_t, amdsmi_clk_type_t] -amdsmi_dev_set_od_clk_info = _libraries['libamd_smi.so'].amdsmi_dev_set_od_clk_info -amdsmi_dev_set_od_clk_info.restype = amdsmi_status_t -amdsmi_dev_set_od_clk_info.argtypes = [amdsmi_processor_handle, amdsmi_freq_ind_t, uint64_t, amdsmi_clk_type_t] +amdsmi_set_gpu_od_clk_info = _libraries['libamd_smi.so'].amdsmi_set_gpu_od_clk_info +amdsmi_set_gpu_od_clk_info.restype = amdsmi_status_t +amdsmi_set_gpu_od_clk_info.argtypes = [amdsmi_processor_handle, amdsmi_freq_ind_t, uint64_t, amdsmi_clk_type_t] amdsmi_dev_set_od_volt_info = _libraries['libamd_smi.so'].amdsmi_dev_set_od_volt_info amdsmi_dev_set_od_volt_info.restype = amdsmi_status_t amdsmi_dev_set_od_volt_info.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t, uint64_t] @@ -1876,7 +1876,7 @@ __all__ = \ 'amdsmi_reset_gpu_fan', 'amdsmi_reset_gpu', 'amdsmi_dev_reset_xgmi_error', 'amdsmi_set_clk_freq', 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', - 'amdsmi_dev_set_od_clk_info', 'amdsmi_dev_set_od_volt_info', + 'amdsmi_set_gpu_od_clk_info', 'amdsmi_dev_set_od_volt_info', 'amdsmi_dev_set_overdrive_level', 'amdsmi_dev_set_overdrive_level_v1', 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_set_gpu_perf_level', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index cb28862de2..198cb6940e 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -354,7 +354,7 @@ class Formatter: | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_set_gpu_fan_speed ") + """ | | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_set_clk_freq ") + """ | | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_reset_gpu ") + """ | - | """ + self.style.text("68 Set dev od clk info. Api: amdsmi_dev_set_od_clk_info ") + """ | + | """ + self.style.text("68 Set dev od clk info. Api: amdsmi_set_gpu_od_clk_info ") + """ | | """ + self.style.text("69 Set dev od volt info. Api: amdsmi_dev_set_od_volt_info ") + """| | """ + self.style.text("70 Set dev overdrive level. Api: amdsmi_dev_set_overdrive_level ") + """ | | """ + self.style.text("71 Set v1 dev overdrive level. Api: amdsmi_dev_set_overdrive_level_v1 ") + """ | @@ -656,7 +656,7 @@ def amdsmi_tool_dev_od_clk_info_set(dev, dic): for freq_ind in smi_api.AmdSmiFreqInd: for clock_type in smi_api.AmdSmiClkType: try: - value = smi_api. amdsmi_dev_set_od_clk_info(dev, freq_ind, value, clock_type) + value = smi_api. amdsmi_set_gpu_od_clk_info(dev, freq_ind, value, clock_type) result.update({"AmdSmiFreqInd: " + freq_ind.name + ", AmdSmiClkType: " + clock_type.name: value}) except smi_api.AmdSmiException as e: print("{},{}:\t{}".format(freq_ind.name, clock_type.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index eff05f6d17..87c338b199 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1323,7 +1323,7 @@ amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_ha static_cast(metric), voltage); } -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_gpu_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType) { diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 6e3dec5409..0e8d0d83b2 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -259,7 +259,7 @@ void TestMutualExclusion::Run(void) { /* Other functions holding device mutexes. Listed for reference. amdsmi_dev_sku_get amdsmi_set_gpu_perf_level_v1 - amdsmi_dev_set_od_clk_info + amdsmi_set_gpu_od_clk_info amdsmi_dev_set_od_volt_info amdsmi_dev_firmware_version_get amdsmi_dev_firmware_version_get From a970cea1b0871a294d27b0d8e4580b8f92a5eace Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 04:10:34 -0500 Subject: [PATCH 79/95] Renamed API amdsmi_dev_set_od_volt_info to amdsmi_set_gpu_od_volt_info grep -rli 'amdsmi_dev_set_od_volt_info' * | xargs -i@ sed -i 's/amdsmi_dev_set_od_volt_info/amdsmi_set_gpu_od_volt_info/g' @ Change-Id: I2364f9f555c010e1022e2c946a65b72fcf3d2233 [ROCm/amdsmi commit: 467f3e3bb7da1a9603ea31b6374a347162798280] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 07b7b60de0..430b0aa6d6 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2358,7 +2358,7 @@ amdsmi_status_t amdsmi_set_gpu_od_clk_info(amdsmi_processor_handle processor_ha * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, +amdsmi_status_t amdsmi_set_gpu_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index d5443bf798..acc7b77146 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1658,7 +1658,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_set_od_volt_info +## amdsmi_set_gpu_od_volt_info Description: This function sets 1 of the 3 voltage curve points Input parameters: @@ -1669,7 +1669,7 @@ Input parameters: Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_od_volt_info` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_od_volt_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1682,7 +1682,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_od_volt_info(device, 1, 1000, 980) + amdsmi_set_gpu_od_volt_info(device, 1, 1000, 980) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index a1bc588643..97081fd01b 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -84,7 +84,7 @@ from .amdsmi_interface import amdsmi_set_power_cap from .amdsmi_interface import amdsmi_set_gpu_power_profile from .amdsmi_interface import amdsmi_set_gpu_clk_range from .amdsmi_interface import amdsmi_set_gpu_od_clk_info -from .amdsmi_interface import amdsmi_dev_set_od_volt_info +from .amdsmi_interface import amdsmi_set_gpu_od_volt_info from .amdsmi_interface import amdsmi_set_gpu_perf_level_v1 from .amdsmi_interface import amdsmi_set_gpu_perf_level from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ea563d8b4b..4e91c66382 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1998,7 +1998,7 @@ def amdsmi_get_gpu_memory_usage(processor_handle: amdsmi_wrapper.amdsmi_processo return used.value -def amdsmi_dev_set_od_volt_info( +def amdsmi_set_gpu_od_volt_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, vpoint: int, clk_value: int, @@ -2019,7 +2019,7 @@ def amdsmi_dev_set_od_volt_info( raise AmdSmiParameterException(volt_value, int) _check_res( - amdsmi_wrapper. amdsmi_dev_set_od_volt_info( + amdsmi_wrapper. amdsmi_set_gpu_od_volt_info( processor_handle, ctypes.c_uint32(vpoint), ctypes.c_uint64(clk_value), diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 1de5640edc..c2bad37a6d 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1547,9 +1547,9 @@ amdsmi_set_gpu_clk_range.argtypes = [amdsmi_processor_handle, uint64_t, uint64_t amdsmi_set_gpu_od_clk_info = _libraries['libamd_smi.so'].amdsmi_set_gpu_od_clk_info amdsmi_set_gpu_od_clk_info.restype = amdsmi_status_t amdsmi_set_gpu_od_clk_info.argtypes = [amdsmi_processor_handle, amdsmi_freq_ind_t, uint64_t, amdsmi_clk_type_t] -amdsmi_dev_set_od_volt_info = _libraries['libamd_smi.so'].amdsmi_dev_set_od_volt_info -amdsmi_dev_set_od_volt_info.restype = amdsmi_status_t -amdsmi_dev_set_od_volt_info.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t, uint64_t] +amdsmi_set_gpu_od_volt_info = _libraries['libamd_smi.so'].amdsmi_set_gpu_od_volt_info +amdsmi_set_gpu_od_volt_info.restype = amdsmi_status_t +amdsmi_set_gpu_od_volt_info.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t, uint64_t] amdsmi_dev_get_od_volt_curve_regions = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_curve_regions amdsmi_dev_get_od_volt_curve_regions.restype = amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_freq_volt_region_t)] @@ -1876,7 +1876,7 @@ __all__ = \ 'amdsmi_reset_gpu_fan', 'amdsmi_reset_gpu', 'amdsmi_dev_reset_xgmi_error', 'amdsmi_set_clk_freq', 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', - 'amdsmi_set_gpu_od_clk_info', 'amdsmi_dev_set_od_volt_info', + 'amdsmi_set_gpu_od_clk_info', 'amdsmi_set_gpu_od_volt_info', 'amdsmi_dev_set_overdrive_level', 'amdsmi_dev_set_overdrive_level_v1', 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_set_gpu_perf_level', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 198cb6940e..796601f5e7 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -355,7 +355,7 @@ class Formatter: | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_set_clk_freq ") + """ | | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_reset_gpu ") + """ | | """ + self.style.text("68 Set dev od clk info. Api: amdsmi_set_gpu_od_clk_info ") + """ | - | """ + self.style.text("69 Set dev od volt info. Api: amdsmi_dev_set_od_volt_info ") + """| + | """ + self.style.text("69 Set dev od volt info. Api: amdsmi_set_gpu_od_volt_info ") + """| | """ + self.style.text("70 Set dev overdrive level. Api: amdsmi_dev_set_overdrive_level ") + """ | | """ + self.style.text("71 Set v1 dev overdrive level. Api: amdsmi_dev_set_overdrive_level_v1 ") + """ | | """ + self.style.text("72 Set dev pci bandwidth. Api: amdsmi_set_gpu_pci_bandwidth ") + """ | @@ -667,7 +667,7 @@ def amdsmi_tool_dev_od_volt_info_set(dev, dic): vpoint = dic["vpoint"] clk_value = dic["clk_value"] volt_value = dic["volt_value"] - return smi_api. amdsmi_dev_set_od_volt_info(dev, vpoint, clk_value, volt_value) + return smi_api. amdsmi_set_gpu_od_volt_info(dev, vpoint, clk_value, volt_value) def amdsmi_tool_dev_perf_level_set(dev): result = {} diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 87c338b199..e15fdce81f 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -919,7 +919,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_overdrive_level_set", " amdsmi_dev_set_overdrive_level"}, {"rsmi_dev_vbios_version_get", "amdsmi_get_gpu_vbios_info"}, {"rsmi_dev_od_volt_info_get", " amdsmi_get_gpu_od_volt_info"}, - {"rsmi_dev_od_volt_info_set", " amdsmi_dev_set_od_volt_info"}, + {"rsmi_dev_od_volt_info_set", " amdsmi_set_gpu_od_volt_info"}, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, @@ -1332,7 +1332,7 @@ amdsmi_status_t amdsmi_set_gpu_od_clk_info(amdsmi_processor_handle processor_ha static_cast(clkType)); } -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_set_gpu_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue) { return rsmi_wrapper(rsmi_dev_od_volt_info_set, processor_handle, vpoint, clkvalue, voltvalue); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 0e8d0d83b2..df666139f7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -260,7 +260,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_sku_get amdsmi_set_gpu_perf_level_v1 amdsmi_set_gpu_od_clk_info - amdsmi_dev_set_od_volt_info + amdsmi_set_gpu_od_volt_info amdsmi_dev_firmware_version_get amdsmi_dev_firmware_version_get amdsmi_dev_name_get From 9d23ac40c6f230bf0c7130535259fcde51cd4794 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 04:12:11 -0500 Subject: [PATCH 80/95] Renamed API amdsmi_dev_get_od_volt_curve_regions to amdsmi_get_gpu_od_volt_curve_regions grep -rli 'amdsmi_dev_get_od_volt_curve_regions' * | xargs -i@ sed -i 's/amdsmi_dev_get_od_volt_curve_regions/amdsmi_get_gpu_od_volt_curve_regions/g' @ Change-Id: I4b390c2d5173ca919c4ab5b1173a4fc40e2a0015 [ROCm/amdsmi commit: ced22230c48401d29aea7afe3784d74ddfc8fa7e] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- .../tests/amd_smi_test/functional/volt_freq_curv_read.cc | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 430b0aa6d6..22b92fe6b9 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2396,7 +2396,7 @@ amdsmi_status_t amdsmi_set_gpu_od_volt_info(amdsmi_processor_handle processor_h * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_od_volt_curve_regions(amdsmi_processor_handle processor_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index acc7b77146..82059410cb 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2168,7 +2168,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_od_volt_curve_regions +## amdsmi_get_gpu_od_volt_curve_regions Description: This function will retrieve the current valid regions in the frequency/voltage space @@ -2183,7 +2183,7 @@ Field | Description `freq_range` |
Subfield Description
`lower_bound`lower bound freq range
`upper_bound`upper bound freq range
`volt_range` |
Subfield Description
`lower_bound`lower bound volt range
`upper_bound`upper bound volt range
-Exceptions that can be thrown by ` amdsmi_dev_get_od_volt_curve_regions` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_od_volt_curve_regions` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2196,7 +2196,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_get_od_volt_curve_regions(device, 3) + amdsmi_get_gpu_od_volt_curve_regions(device, 3) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 97081fd01b..d46957923f 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -112,7 +112,7 @@ from .amdsmi_interface import amdsmi_get_gpu_overdrive_level from .amdsmi_interface import amdsmi_get_clk_freq from .amdsmi_interface import amdsmi_get_gpu_od_volt_info from .amdsmi_interface import amdsmi_get_gpu_metrics_info -from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions +from .amdsmi_interface import amdsmi_get_gpu_od_volt_curve_regions from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 4e91c66382..d252a5dce0 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2399,7 +2399,7 @@ def amdsmi_get_gpu_metrics_info( } -def amdsmi_dev_get_od_volt_curve_regions( +def amdsmi_get_gpu_od_volt_curve_regions( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, num_regions: int ) -> List[Dict[str, Any]]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2412,7 +2412,7 @@ def amdsmi_dev_get_od_volt_curve_regions( region_count = ctypes.c_uint32(num_regions) buffer = (amdsmi_wrapper.amdsmi_freq_volt_region_t * num_regions)() _check_res( - amdsmi_wrapper. amdsmi_dev_get_od_volt_curve_regions( + amdsmi_wrapper. amdsmi_get_gpu_od_volt_curve_regions( processor_handle, ctypes.byref(region_count), buffer ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index c2bad37a6d..c13d523cca 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1550,9 +1550,9 @@ amdsmi_set_gpu_od_clk_info.argtypes = [amdsmi_processor_handle, amdsmi_freq_ind_ amdsmi_set_gpu_od_volt_info = _libraries['libamd_smi.so'].amdsmi_set_gpu_od_volt_info amdsmi_set_gpu_od_volt_info.restype = amdsmi_status_t amdsmi_set_gpu_od_volt_info.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t, uint64_t] -amdsmi_dev_get_od_volt_curve_regions = _libraries['libamd_smi.so'].amdsmi_dev_get_od_volt_curve_regions -amdsmi_dev_get_od_volt_curve_regions.restype = amdsmi_status_t -amdsmi_dev_get_od_volt_curve_regions.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_freq_volt_region_t)] +amdsmi_get_gpu_od_volt_curve_regions = _libraries['libamd_smi.so'].amdsmi_get_gpu_od_volt_curve_regions +amdsmi_get_gpu_od_volt_curve_regions.restype = amdsmi_status_t +amdsmi_get_gpu_od_volt_curve_regions.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_c__SA_amdsmi_freq_volt_region_t)] amdsmi_get_gpu_power_profile_presets = _libraries['libamd_smi.so'].amdsmi_get_gpu_power_profile_presets amdsmi_get_gpu_power_profile_presets.restype = amdsmi_status_t amdsmi_get_gpu_power_profile_presets.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_c__SA_amdsmi_power_profile_status_t)] @@ -1860,7 +1860,7 @@ __all__ = \ 'amdsmi_get_gpu_id', 'amdsmi_get_gpu_memory_busy_percent', 'amdsmi_get_gpu_memory_reserved_pages', 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', - 'amdsmi_dev_get_od_volt_curve_regions', + 'amdsmi_get_gpu_od_volt_curve_regions', 'amdsmi_get_gpu_od_volt_info', 'amdsmi_get_gpu_overdrive_level', 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', 'amdsmi_get_gpu_pci_replay_counter', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 796601f5e7..392570b7f9 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -317,7 +317,7 @@ class Formatter: | """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_get_clk_freq ") + """ | | """ + self.style.text("29 Get device od volt. Api: amdsmi_get_gpu_od_volt_info ") + """ | | """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_get_gpu_metrics_info ") + """ | - | """ + self.style.text("31 Get device od volt curve regions. Api: amdsmi_dev_get_od_volt_curve_regions ") + """ | + | """ + self.style.text("31 Get device od volt curve regions. Api: amdsmi_get_gpu_od_volt_curve_regions ") + """ | | """ + self.style.text("32 Get device power profile presets. Api: amdsmi_get_gpu_power_profile_presets ") + """ | | """ + self.style.text("33 Get the build version. Api: amdsmi_get_version ") + """ | | """ + self.style.text("34 Get version string. Api: amdsmi_get_version_str ") + """ | @@ -502,7 +502,7 @@ def amdsmi_tool_dev_gpu_clk_freq_get(dev): def amdsmi_tool_dev_od_volt_curve_regions_get(dev, dic): num_regions = dic["num_regions"] - return smi_api. amdsmi_dev_get_od_volt_curve_regions(dev, num_regions) + return smi_api. amdsmi_get_gpu_od_volt_curve_regions(dev, num_regions) def amdsmi_tool_dev_ecc_count_get(dev): diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index e15fdce81f..7de9d3ee6b 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -920,7 +920,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_vbios_version_get", "amdsmi_get_gpu_vbios_info"}, {"rsmi_dev_od_volt_info_get", " amdsmi_get_gpu_od_volt_info"}, {"rsmi_dev_od_volt_info_set", " amdsmi_set_gpu_od_volt_info"}, - {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, + {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_get_gpu_od_volt_curve_regions"}, {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, {"rsmi_dev_counter_group_supported", "amdsmi_gpu_counter_group_supported"}, @@ -1308,7 +1308,7 @@ amdsmi_status_t amdsmi_get_gpu_od_volt_info(amdsmi_processor_handle processor_h reinterpret_cast(odv)); } -amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions( +amdsmi_status_t amdsmi_get_gpu_od_volt_curve_regions( amdsmi_processor_handle processor_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer) { return rsmi_wrapper(rsmi_dev_od_volt_curve_regions_get, processor_handle, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index df666139f7..9489a89e9c 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -243,7 +243,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_od_volt_info(processor_handles_[0], &dmy_od_volt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[0], &dmy_ui32, &dmy_vlt_reg); + ret = amdsmi_get_gpu_od_volt_curve_regions(processor_handles_[0], &dmy_ui32, &dmy_vlt_reg); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_set_overdrive_level_v1(processor_handles_[0], dmy_i32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -281,7 +281,7 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_fan_speed_max amdsmi_get_gpu_od_volt_info amdsmi_get_gpu_metrics_info - amdsmi_dev_get_od_volt_curve_regions + amdsmi_get_gpu_od_volt_curve_regions amdsmi_dev_power_max_get amdsmi_get_power_ave amdsmi_dev_power_cap_get diff --git a/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc index 38a2eba73e..9796115dd7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/volt_freq_curv_read.cc @@ -184,7 +184,7 @@ void TestVoltCurvRead::Run(void) { ASSERT_TRUE(regions != nullptr); num_regions = odv.num_regions; - err = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[i], &num_regions, regions); + err = amdsmi_get_gpu_od_volt_curve_regions(processor_handles_[i], &num_regions, regions); CHK_ERR_ASRT(err) ASSERT_TRUE(num_regions == odv.num_regions); From e0d2d9b90936c87b1d4fc5a3500818604722b408 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 04:14:05 -0500 Subject: [PATCH 81/95] Renamed APIs 1) amdsmi_dev_set_overdrive_level to amdsmi_set_gpu_overdrive_level 2) amdsmi_dev_set_overdrive_level_v1 to amdsmi_set_gpu_overdrive_level_v1 grep -rli 'amdsmi_dev_set_overdrive_level' * | xargs -i@ sed -i 's/amdsmi_dev_set_overdrive_level/amdsmi_set_gpu_overdrive_level/g' @ Change-Id: Id6934e5b0962c9262cca041bdfdf02c60f69573b [ROCm/amdsmi commit: e687a72235e5699bb4869db0e2c4f53502e36284] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- projects/amdsmi/py-interface/README.md | 12 ++++++------ projects/amdsmi/py-interface/__init__.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_interface.py | 8 ++++---- projects/amdsmi/py-interface/amdsmi_wrapper.py | 16 ++++++++-------- projects/amdsmi/py-interface/rocm_smi_tool.py | 8 ++++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 6 +++--- .../amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../functional/overdrive_read_write.cc | 6 +++--- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 22b92fe6b9..ab7ada448d 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2488,7 +2488,7 @@ amdsmi_status_t * @brief Set the overdrive percent associated with the device with provided * processor handle with the provided value. See details for WARNING. * - * @deprecated This function is deprecated. :: amdsmi_dev_set_overdrive_level_v1 + * @deprecated This function is deprecated. :: amdsmi_set_gpu_overdrive_level_v1 * has the same functionaltiy, with an interface that more closely * matches the rest of the amd_smi API. * @@ -2523,7 +2523,7 @@ amdsmi_status_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t od); +amdsmi_status_t amdsmi_set_gpu_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t od); /** * @brief Set the overdrive percent associated with the device with provided @@ -2562,7 +2562,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle processo * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle processor_handle, uint32_t od); +amdsmi_status_t amdsmi_set_gpu_overdrive_level_v1(amdsmi_processor_handle processor_handle, uint32_t od); /** * @brief Control the set of allowed frequencies that can be used for the diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 82059410cb..440b19a199 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2576,7 +2576,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_overdrive_level_v1 +## amdsmi_set_gpu_overdrive_level_v1 Description: Set the overdrive percent associated with the device with provided device handle with the provided value @@ -2586,7 +2586,7 @@ Input parameters: Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_overdrive_level_v1` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_overdrive_level_v1` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2599,11 +2599,11 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_overdrive_level_v1(device, 0) + amdsmi_set_gpu_overdrive_level_v1(device, 0) except AmdSmiException as e: print(e) ``` -## amdsmi_dev_set_overdrive_level +## amdsmi_set_gpu_overdrive_level Description: **deprecated** Set the overdrive percent associated with the device with provided device handle with the provided value @@ -2613,7 +2613,7 @@ Input parameters: Output: None -Exceptions that can be thrown by ` amdsmi_dev_set_overdrive_level` function: +Exceptions that can be thrown by ` amdsmi_set_gpu_overdrive_level` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2626,7 +2626,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_set_overdrive_level(device, 0) + amdsmi_set_gpu_overdrive_level(device, 0) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index d46957923f..aebe9bc58d 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -93,8 +93,8 @@ from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_set_gpu_fan_speed from .amdsmi_interface import amdsmi_reset_gpu_fan from .amdsmi_interface import amdsmi_set_clk_freq -from .amdsmi_interface import amdsmi_dev_set_overdrive_level_v1 -from .amdsmi_interface import amdsmi_dev_set_overdrive_level +from .amdsmi_interface import amdsmi_set_gpu_overdrive_level_v1 +from .amdsmi_interface import amdsmi_set_gpu_overdrive_level # # Physical State Queries from .amdsmi_interface import amdsmi_get_gpu_fan_rpms diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index d252a5dce0..41fc3d46e4 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1574,7 +1574,7 @@ def amdsmi_set_clk_freq( ) -def amdsmi_dev_set_overdrive_level_v1( +def amdsmi_set_gpu_overdrive_level_v1( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1586,12 +1586,12 @@ def amdsmi_dev_set_overdrive_level_v1( overdrive_value = ctypes.c_uint32(overdrive_value) _check_res( - amdsmi_wrapper. amdsmi_dev_set_overdrive_level_v1( + amdsmi_wrapper. amdsmi_set_gpu_overdrive_level_v1( processor_handle, overdrive_value) ) -def amdsmi_dev_set_overdrive_level( +def amdsmi_set_gpu_overdrive_level( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1603,7 +1603,7 @@ def amdsmi_dev_set_overdrive_level( overdrive_value = ctypes.c_uint32(overdrive_value) _check_res( - amdsmi_wrapper. amdsmi_dev_set_overdrive_level( + amdsmi_wrapper. amdsmi_set_gpu_overdrive_level( processor_handle, overdrive_value) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index c13d523cca..8626358345 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1562,12 +1562,12 @@ amdsmi_set_gpu_perf_level.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_l amdsmi_set_gpu_perf_level_v1 = _libraries['libamd_smi.so'].amdsmi_set_gpu_perf_level_v1 amdsmi_set_gpu_perf_level_v1.restype = amdsmi_status_t amdsmi_set_gpu_perf_level_v1.argtypes = [amdsmi_processor_handle, amdsmi_dev_perf_level_t] -amdsmi_dev_set_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_set_overdrive_level -amdsmi_dev_set_overdrive_level.restype = amdsmi_status_t -amdsmi_dev_set_overdrive_level.argtypes = [amdsmi_processor_handle, uint32_t] -amdsmi_dev_set_overdrive_level_v1 = _libraries['libamd_smi.so'].amdsmi_dev_set_overdrive_level_v1 -amdsmi_dev_set_overdrive_level_v1.restype = amdsmi_status_t -amdsmi_dev_set_overdrive_level_v1.argtypes = [amdsmi_processor_handle, uint32_t] +amdsmi_set_gpu_overdrive_level = _libraries['libamd_smi.so'].amdsmi_set_gpu_overdrive_level +amdsmi_set_gpu_overdrive_level.restype = amdsmi_status_t +amdsmi_set_gpu_overdrive_level.argtypes = [amdsmi_processor_handle, uint32_t] +amdsmi_set_gpu_overdrive_level_v1 = _libraries['libamd_smi.so'].amdsmi_set_gpu_overdrive_level_v1 +amdsmi_set_gpu_overdrive_level_v1.restype = amdsmi_status_t +amdsmi_set_gpu_overdrive_level_v1.argtypes = [amdsmi_processor_handle, uint32_t] amdsmi_set_clk_freq = _libraries['libamd_smi.so'].amdsmi_set_clk_freq amdsmi_set_clk_freq.restype = amdsmi_status_t amdsmi_set_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, uint64_t] @@ -1877,8 +1877,8 @@ __all__ = \ 'amdsmi_dev_reset_xgmi_error', 'amdsmi_set_clk_freq', 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', 'amdsmi_set_gpu_od_clk_info', 'amdsmi_set_gpu_od_volt_info', - 'amdsmi_dev_set_overdrive_level', - 'amdsmi_dev_set_overdrive_level_v1', + 'amdsmi_set_gpu_overdrive_level', + 'amdsmi_set_gpu_overdrive_level_v1', 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_set_gpu_perf_level', 'amdsmi_set_gpu_perf_level_v1', 'amdsmi_set_power_cap', 'amdsmi_set_gpu_power_profile', 'amdsmi_gpu_xgmi_error_status', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 392570b7f9..e53a577bc6 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -356,8 +356,8 @@ class Formatter: | """ + self.style.text("67 Reset dev gpu. Api: amdsmi_reset_gpu ") + """ | | """ + self.style.text("68 Set dev od clk info. Api: amdsmi_set_gpu_od_clk_info ") + """ | | """ + self.style.text("69 Set dev od volt info. Api: amdsmi_set_gpu_od_volt_info ") + """| - | """ + self.style.text("70 Set dev overdrive level. Api: amdsmi_dev_set_overdrive_level ") + """ | - | """ + self.style.text("71 Set v1 dev overdrive level. Api: amdsmi_dev_set_overdrive_level_v1 ") + """ | + | """ + self.style.text("70 Set dev overdrive level. Api: amdsmi_set_gpu_overdrive_level ") + """ | + | """ + self.style.text("71 Set v1 dev overdrive level. Api: amdsmi_set_gpu_overdrive_level_v1 ") + """ | | """ + self.style.text("72 Set dev pci bandwidth. Api: amdsmi_set_gpu_pci_bandwidth ") + """ | | """ + self.style.text("73 Set dev perf level. Api: amdsmi_set_gpu_perf_level ") + """ | | """ + self.style.text("74 Set dev perf level v1. Api: amdsmi_set_gpu_perf_level_v1 ") + """ | @@ -478,11 +478,11 @@ def amdsmi_tool_dev_fan_speed_set(dev, dic): def amdsmi_tool_dev_overdrive_level_set(dev, dic): overdrive_value = dic["overdrive_value"] - return smi_api. amdsmi_dev_set_overdrive_level(dev, overdrive_value) + return smi_api. amdsmi_set_gpu_overdrive_level(dev, overdrive_value) def amdsmi_tool_dev_overdrive_level_set_v1(dev, dic): overdrive_value = dic["overdrive_value"] - return smi_api. amdsmi_dev_set_overdrive_level(dev, overdrive_value) + return smi_api. amdsmi_set_gpu_overdrive_level(dev, overdrive_value) def amdsmi_tool_dev_pci_bandwidth_set(dev, dic): bitmask = dic["bitmask"] diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 7de9d3ee6b..401bec7158 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -916,7 +916,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_perf_level_set_v1", " amdsmi_set_gpu_perf_level_v1"}, {"rsmi_dev_perf_level_get", "amdsmi_get_gpu_perf_level"}, {"rsmi_perf_determinism_mode_set", "amdsmi_set_gpu_perf_determinism_mode"}, - {"rsmi_dev_overdrive_level_set", " amdsmi_dev_set_overdrive_level"}, + {"rsmi_dev_overdrive_level_set", " amdsmi_set_gpu_overdrive_level"}, {"rsmi_dev_vbios_version_get", "amdsmi_get_gpu_vbios_info"}, {"rsmi_dev_od_volt_info_get", " amdsmi_get_gpu_od_volt_info"}, {"rsmi_dev_od_volt_info_set", " amdsmi_set_gpu_od_volt_info"}, @@ -1286,7 +1286,7 @@ amdsmi_status_t amdsmi_get_gpu_overdrive_level( return rsmi_wrapper(rsmi_dev_overdrive_level_get, processor_handle, od); } -amdsmi_status_t amdsmi_dev_set_overdrive_level( +amdsmi_status_t amdsmi_set_gpu_overdrive_level( amdsmi_processor_handle processor_handle, uint32_t od) { return rsmi_wrapper(rsmi_dev_overdrive_level_set, processor_handle, od); } @@ -1347,7 +1347,7 @@ amdsmi_status_t amdsmi_set_gpu_clk_range(amdsmi_processor_handle processor_handl static_cast(clkType)); } -amdsmi_status_t amdsmi_dev_set_overdrive_level_v1( +amdsmi_status_t amdsmi_set_gpu_overdrive_level_v1( amdsmi_processor_handle processor_handle, uint32_t od) { return rsmi_wrapper(rsmi_dev_overdrive_level_set_v1, processor_handle, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 9489a89e9c..00caa421de 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -245,7 +245,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_od_volt_curve_regions(processor_handles_[0], &dmy_ui32, &dmy_vlt_reg); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_overdrive_level_v1(processor_handles_[0], dmy_i32); + ret = amdsmi_set_gpu_overdrive_level_v1(processor_handles_[0], dmy_i32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc index e389409787..a8f258061c 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc @@ -100,12 +100,12 @@ void TestOverdriveReadWrite::Run(void) { IF_VERB(STANDARD) { std::cout << "Set Overdrive level to 0%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0); + ret = amdsmi_set_gpu_overdrive_level(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "Set Overdrive level to 10%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 10); + ret = amdsmi_set_gpu_overdrive_level(processor_handles_[dv_ind], 10); CHK_ERR_ASRT(ret) ret = amdsmi_get_gpu_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) @@ -113,7 +113,7 @@ void TestOverdriveReadWrite::Run(void) { std::cout << "\t**New OverDrive Level:" << val << std::endl; std::cout << "Reset Overdrive level to 0%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0); + ret = amdsmi_set_gpu_overdrive_level(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) ret = amdsmi_get_gpu_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) From 0be5a5fb82c2353856d88c3c757d9c7b0bd4e672 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Mon, 27 Feb 2023 10:39:42 -0500 Subject: [PATCH 82/95] Renamed APIs amdsmi_dev_get_gpu_ecc_status -> amdsmi_get_gpu_ecc_status amdsmi_dev_get_gpu_ecc_enabled -> amdsmi_get_gpu_ecc_enabled amdsmi_dev_get_gpu_ecc_count -> amdsmi_get_gpu_ecc_count Change-Id: I84e6489f82bae115e1a13c9e4fce8029888ca379 [ROCm/amdsmi commit: d9ba131f7358bb3fc12674db9fceb1b932e2688c] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 ++--- projects/amdsmi/py-interface/README.md | 18 +++++++-------- projects/amdsmi/py-interface/__init__.py | 6 ++--- .../amdsmi/py-interface/amdsmi_interface.py | 12 +++++----- .../amdsmi/py-interface/amdsmi_wrapper.py | 22 +++++++++---------- projects/amdsmi/py-interface/rocm_smi_tool.py | 12 +++++----- projects/amdsmi/src/amd_smi/amd_smi.cc | 12 +++++----- .../amd_smi_test/functional/err_cnt_read.cc | 16 +++++++------- .../functional/mutual_exclusion.cc | 6 ++--- 9 files changed, 55 insertions(+), 55 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index ab7ada448d..b43da2919c 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2679,7 +2679,7 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec); /** @@ -2706,7 +2706,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks); /** @@ -2730,7 +2730,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processo * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, +amdsmi_status_t amdsmi_get_gpu_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 440b19a199..e97aa59e52 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2631,7 +2631,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_gpu_ecc_count +## amdsmi_get_gpu_ecc_count Description: Retrieve the error counts for a GPU block Input parameters: @@ -2645,7 +2645,7 @@ Field | Description `correctable_count`| Count of correctable errors `uncorrectable_count`| Count of uncorrectable errors -Exceptions that can be thrown by ` amdsmi_dev_get_gpu_ecc_count` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_ecc_count` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2658,13 +2658,13 @@ try: print("No GPUs on machine") else: for device in devices: - ecc_count = amdsmi_dev_get_gpu_ecc_count(device, AmdSmiGpuBlock.UMC) + ecc_count = amdsmi_get_gpu_ecc_count(device, AmdSmiGpuBlock.UMC) print(ecc_count) except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_gpu_ecc_enabled +## amdsmi_get_gpu_ecc_enabled Description: Retrieve the enabled ECC bit-mask Input parameters: @@ -2672,7 +2672,7 @@ Input parameters: Output: Enabled ECC bit-mask -Exceptions that can be thrown by ` amdsmi_dev_get_gpu_ecc_enabled` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_ecc_enabled` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2685,13 +2685,13 @@ try: print("No GPUs on machine") else: for device in devices: - enabled = amdsmi_dev_get_gpu_ecc_enabled(device) + enabled = amdsmi_get_gpu_ecc_enabled(device) print(enabled) except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_gpu_ecc_status +## amdsmi_get_gpu_ecc_status Description: Retrieve the ECC status for a GPU block Input parameters: @@ -2700,7 +2700,7 @@ Input parameters: Output: ECC status for a requested GPU block -Exceptions that can be thrown by ` amdsmi_dev_get_gpu_ecc_status` function: +Exceptions that can be thrown by ` amdsmi_get_gpu_ecc_status` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2713,7 +2713,7 @@ try: print("No GPUs on machine") else: for device in devices: - status = amdsmi_dev_get_gpu_ecc_status(device, AmdSmiGpuBlock.UMC) + status = amdsmi_get_gpu_ecc_status(device, AmdSmiGpuBlock.UMC) print(status) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index aebe9bc58d..19892b78d5 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -124,9 +124,9 @@ from .amdsmi_interface import amdsmi_gpu_read_counter from .amdsmi_interface import amdsmi_get_gpu_available_counters # # Error Query -from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_count -from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_enabled -from .amdsmi_interface import amdsmi_dev_get_gpu_ecc_status +from .amdsmi_interface import amdsmi_get_gpu_ecc_count +from .amdsmi_interface import amdsmi_get_gpu_ecc_enabled +from .amdsmi_interface import amdsmi_get_gpu_ecc_status from .amdsmi_interface import amdsmi_status_string # # System Information Query diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 41fc3d46e4..8946d4b12f 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2462,7 +2462,7 @@ def amdsmi_get_gpu_power_profile_presets( } -def amdsmi_dev_get_gpu_ecc_count( +def amdsmi_get_gpu_ecc_count( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> Dict[str, int]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2475,7 +2475,7 @@ def amdsmi_dev_get_gpu_ecc_count( ec = amdsmi_wrapper.amdsmi_error_count_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_gpu_ecc_count( + amdsmi_wrapper. amdsmi_get_gpu_ecc_count( processor_handle, block, ctypes.byref(ec)) ) @@ -2485,7 +2485,7 @@ def amdsmi_dev_get_gpu_ecc_count( } -def amdsmi_dev_get_gpu_ecc_enabled( +def amdsmi_get_gpu_ecc_enabled( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2495,14 +2495,14 @@ def amdsmi_dev_get_gpu_ecc_enabled( blocks = ctypes.c_uint64(0) _check_res( - amdsmi_wrapper. amdsmi_dev_get_gpu_ecc_enabled( + amdsmi_wrapper. amdsmi_get_gpu_ecc_enabled( processor_handle, ctypes.byref(blocks)) ) return blocks.value -def amdsmi_dev_get_gpu_ecc_status( +def amdsmi_get_gpu_ecc_status( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> AmdSmiRasErrState: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2515,7 +2515,7 @@ def amdsmi_dev_get_gpu_ecc_status( state = amdsmi_wrapper.amdsmi_ras_err_state_t() _check_res( - amdsmi_wrapper. amdsmi_dev_get_gpu_ecc_status( + amdsmi_wrapper. amdsmi_get_gpu_ecc_status( processor_handle, block, ctypes.byref(state) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 8626358345..2ba92c0b0e 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1577,15 +1577,15 @@ amdsmi_get_version.argtypes = [ctypes.POINTER(struct_c__SA_amdsmi_version_t)] amdsmi_get_version_str = _libraries['libamd_smi.so'].amdsmi_get_version_str amdsmi_get_version_str.restype = amdsmi_status_t amdsmi_get_version_str.argtypes = [amdsmi_sw_component_t, ctypes.POINTER(ctypes.c_char), uint32_t] -amdsmi_dev_get_gpu_ecc_count = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_count -amdsmi_dev_get_gpu_ecc_count.restype = amdsmi_status_t -amdsmi_dev_get_gpu_ecc_count.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] -amdsmi_dev_get_gpu_ecc_enabled = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_enabled -amdsmi_dev_get_gpu_ecc_enabled.restype = amdsmi_status_t -amdsmi_dev_get_gpu_ecc_enabled.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] -amdsmi_dev_get_gpu_ecc_status = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_ecc_status -amdsmi_dev_get_gpu_ecc_status.restype = amdsmi_status_t -amdsmi_dev_get_gpu_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] +amdsmi_get_gpu_ecc_count = _libraries['libamd_smi.so'].amdsmi_get_gpu_ecc_count +amdsmi_get_gpu_ecc_count.restype = amdsmi_status_t +amdsmi_get_gpu_ecc_count.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(struct_c__SA_amdsmi_error_count_t)] +amdsmi_get_gpu_ecc_enabled = _libraries['libamd_smi.so'].amdsmi_get_gpu_ecc_enabled +amdsmi_get_gpu_ecc_enabled.restype = amdsmi_status_t +amdsmi_get_gpu_ecc_enabled.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_ecc_status = _libraries['libamd_smi.so'].amdsmi_get_gpu_ecc_status +amdsmi_get_gpu_ecc_status.restype = amdsmi_status_t +amdsmi_get_gpu_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_block_t, ctypes.POINTER(c__EA_amdsmi_ras_err_state_t)] amdsmi_status_string = _libraries['libamd_smi.so'].amdsmi_status_string amdsmi_status_string.restype = amdsmi_status_t amdsmi_status_string.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] @@ -1852,8 +1852,8 @@ __all__ = \ 'amdsmi_dev_close_supported_func_iterator', 'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter', 'amdsmi_gpu_destroy_counter', 'amdsmi_get_busy_percent', - 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', - 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_gpu_ecc_status', + 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_get_gpu_ecc_count', + 'amdsmi_get_gpu_ecc_enabled', 'amdsmi_get_gpu_ecc_status', 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', 'amdsmi_get_clk_freq', 'amdsmi_get_gpu_metrics_info', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index e53a577bc6..34fffee4f1 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -321,9 +321,9 @@ class Formatter: | """ + self.style.text("32 Get device power profile presets. Api: amdsmi_get_gpu_power_profile_presets ") + """ | | """ + self.style.text("33 Get the build version. Api: amdsmi_get_version ") + """ | | """ + self.style.text("34 Get version string. Api: amdsmi_get_version_str ") + """ | - | """ + self.style.text("35 Get device ecc counter. Api: amdsmi_dev_get_gpu_ecc_count ") + """ | - | """ + self.style.text("36 Get device ecc enable. Api: amdsmi_dev_get_gpu_ecc_enabled ") + """ | - | """ + self.style.text("37 Get device ecc status. Api: amdsmi_dev_get_gpu_ecc_status ") + """ | + | """ + self.style.text("35 Get device ecc counter. Api: amdsmi_get_gpu_ecc_count ") + """ | + | """ + self.style.text("36 Get device ecc enable. Api: amdsmi_get_gpu_ecc_enabled ") + """ | + | """ + self.style.text("37 Get device ecc status. Api: amdsmi_get_gpu_ecc_status ") + """ | | """ + self.style.text("38 Get status string. Api: amdsmi_status_string ") + """ | | """ + self.style.text("39 Get compute process info. Api: amdsmi_get_gpu_compute_process_info ") + """ | | """ + self.style.text("40 Get compute process info by pid. Api: amdsmi_get_gpu_compute_process_info_by_pid ") + """ | @@ -509,7 +509,7 @@ def amdsmi_tool_dev_ecc_count_get(dev): result = {} for gpu_block in smi_api.AmdSmiGpuBlock: try: - value = smi_api. amdsmi_dev_get_gpu_ecc_count(dev, gpu_block) + value = smi_api. amdsmi_get_gpu_ecc_count(dev, gpu_block) result.update({gpu_block.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(gpu_block.name, e)) @@ -520,7 +520,7 @@ def amdsmi_tool_dev_ecc_status_get(dev): result = {} for gpu_block in smi_api.AmdSmiGpuBlock: try: - value = smi_api. amdsmi_dev_get_gpu_ecc_status(dev, gpu_block) + value = smi_api. amdsmi_get_gpu_ecc_status(dev, gpu_block) result.update({gpu_block.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(gpu_block.name, e)) @@ -830,7 +830,7 @@ commands = { 35: [amdsmi_tool_dev_ecc_count_get, { "device_identifier1": [None, True] }], - 36: [smi_api. amdsmi_dev_get_gpu_ecc_enabled, { + 36: [smi_api. amdsmi_get_gpu_ecc_enabled, { "device_identifier1": [None, True] }], 37: [amdsmi_tool_dev_ecc_status_get, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 401bec7158..82623cfb34 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -921,8 +921,8 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_od_volt_info_get", " amdsmi_get_gpu_od_volt_info"}, {"rsmi_dev_od_volt_info_set", " amdsmi_set_gpu_od_volt_info"}, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_get_gpu_od_volt_curve_regions"}, - {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, - {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, + {"rsmi_dev_ecc_enabled_get", " amdsmi_get_gpu_ecc_enabled"}, + {"rsmi_dev_ecc_status_get", " amdsmi_get_gpu_ecc_status"}, {"rsmi_dev_counter_group_supported", "amdsmi_gpu_counter_group_supported"}, {"rsmi_dev_counter_create", "amdsmi_gpu_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_gpu_xgmi_error_status"}, @@ -936,7 +936,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_gpu_clk_freq_get", " amdsmi_get_clk_freq"}, {"rsmi_dev_gpu_clk_freq_set", " amdsmi_set_clk_freq"}, {"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"}, - {"rsmi_dev_ecc_count_get", " amdsmi_dev_get_gpu_ecc_count"}, + {"rsmi_dev_ecc_count_get", " amdsmi_get_gpu_ecc_count"}, {"rsmi_counter_available_counters_get", " amdsmi_get_gpu_available_counters"}, {"rsmi_dev_power_ave_get", "amdsmi_get_power_ave"}, {"rsmi_dev_power_cap_get", "amdsmi_get_power_cap_info"}, @@ -1008,7 +1008,7 @@ amdsmi_get_gpu_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, return amd::smi::rsmi_to_amdsmi_status(r); } -amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); @@ -1018,7 +1018,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_count(amdsmi_processor_handle processor_ static_cast(block), reinterpret_cast(ec)); } -amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks) { AMDSMI_CHECK_INIT(); @@ -1027,7 +1027,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_ecc_enabled(amdsmi_processor_handle processo return rsmi_wrapper(rsmi_dev_ecc_enabled_get, processor_handle, enabled_blocks); } -amdsmi_status_t amdsmi_dev_get_gpu_ecc_status(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); diff --git a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc index c43771ef1c..c63d561fa1 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/err_cnt_read.cc @@ -100,7 +100,7 @@ void TestErrCntRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[i], &enabled_mask); + err = amdsmi_get_gpu_ecc_enabled(processor_handles_[i], &enabled_mask); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -108,7 +108,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); continue; @@ -116,7 +116,7 @@ void TestErrCntRead::Run(void) { CHK_ERR_ASRT(err) // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { @@ -126,7 +126,7 @@ void TestErrCntRead::Run(void) { } for (uint32_t b = AMDSMI_GPU_BLOCK_FIRST; b <= AMDSMI_GPU_BLOCK_LAST; b = b*2) { - err = amdsmi_dev_get_gpu_ecc_status(processor_handles_[i], static_cast(b), + err = amdsmi_get_gpu_ecc_status(processor_handles_[i], static_cast(b), &err_state); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { @@ -135,11 +135,11 @@ void TestErrCntRead::Run(void) { " block: " << GetErrStateNameStr(err_state) << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_ecc_status(processor_handles_[i], static_cast(b), + err = amdsmi_get_gpu_ecc_status(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_dev_get_gpu_ecc_count(processor_handles_[i], static_cast(b), &ec); + err = amdsmi_get_gpu_ecc_count(processor_handles_[i], static_cast(b), &ec); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -148,7 +148,7 @@ void TestErrCntRead::Run(void) { ": Not supported for this device" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_ecc_count(processor_handles_[i], static_cast(b), + err = amdsmi_get_gpu_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); @@ -164,7 +164,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_ecc_count(processor_handles_[i], static_cast(b), + err = amdsmi_get_gpu_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 00caa421de..404968ba17 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -249,11 +249,11 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_gpu_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); + ret = amdsmi_get_gpu_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_gpu_ecc_enabled(processor_handles_[0], &dmy_ui64); + ret = amdsmi_get_gpu_ecc_enabled(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_gpu_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); + ret = amdsmi_get_gpu_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); CHECK_RET(ret, AMDSMI_STATUS_BUSY); /* Other functions holding device mutexes. Listed for reference. From 13c55d85fe1f622f62ac77b830c85a198c918c8c Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Mon, 27 Feb 2023 11:28:27 -0500 Subject: [PATCH 83/95] Renamed amd_smi_device.h to amd_smi_processor.h Change-Id: I9f3cd8b29e4b5e9e552faeb7e977d7a1002abd65 [ROCm/amdsmi commit: a8acfbf8ff89bc4e8afd8daf337370731f84fef8] --- projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h | 2 +- .../amd_smi/impl/{amd_smi_device.h => amd_smi_processor.h} | 0 projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h | 2 +- projects/amdsmi/include/amd_smi/impl/amd_smi_system.h | 2 +- projects/amdsmi/src/CMakeLists.txt | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename projects/amdsmi/include/amd_smi/impl/{amd_smi_device.h => amd_smi_processor.h} (100%) diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h index 0d66d939de..002e177146 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h @@ -45,7 +45,7 @@ #define AMD_SMI_INCLUDE_IMPL_AMD_SMI_GPU_DEVICE_H_ #include "amd_smi/amdsmi.h" -#include "amd_smi/impl/amd_smi_device.h" +#include "amd_smi/impl/amd_smi_processor.h" #include "amd_smi/impl/amd_smi_drm.h" #include "shared_mutex.h" // NOLINT diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_device.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_processor.h similarity index 100% rename from projects/amdsmi/include/amd_smi/impl/amd_smi_device.h rename to projects/amdsmi/include/amd_smi/impl/amd_smi_processor.h diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h index 9fb95be375..93c5bd38d1 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_socket.h @@ -48,7 +48,7 @@ #include #include #include "amd_smi/amdsmi.h" -#include "amd_smi/impl/amd_smi_device.h" +#include "amd_smi/impl/amd_smi_processor.h" namespace amd { namespace smi { diff --git a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h index f388df6652..531a7b9499 100644 --- a/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h +++ b/projects/amdsmi/include/amd_smi/impl/amd_smi_system.h @@ -48,7 +48,7 @@ #include #include "amd_smi/amdsmi.h" #include "amd_smi/impl/amd_smi_socket.h" -#include "amd_smi/impl/amd_smi_device.h" +#include "amd_smi/impl/amd_smi_processor.h" #include "amd_smi/impl/amd_smi_drm.h" namespace amd { diff --git a/projects/amdsmi/src/CMakeLists.txt b/projects/amdsmi/src/CMakeLists.txt index 48cc43ecc6..07b45cf3b4 100644 --- a/projects/amdsmi/src/CMakeLists.txt +++ b/projects/amdsmi/src/CMakeLists.txt @@ -41,7 +41,7 @@ set(SRC_LIST set(INC_LIST "${INC_DIR}/amdsmi.h" "${INC_DIR}/impl/amd_smi_common.h" - "${INC_DIR}/impl/amd_smi_device.h" + "${INC_DIR}/impl/amd_smi_processor.h" "${INC_DIR}/impl/amd_smi_drm.h" "${INC_DIR}/impl/amd_smi_gpu_device.h" "${INC_DIR}/impl/amd_smi_lib_loader.h" From 19262e1fd887e21ef51172c3392a21c4871a017f Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Tue, 28 Feb 2023 01:59:12 -0500 Subject: [PATCH 84/95] Renamed API amdsmi_dev_reset_xgmi_error amdsmi_dev_reset_xgmi_error -> amdsmi_reset_gpu_xgmi_error grep -rli 'amdsmi_dev_reset_xgmi_error' * | xargs -i@ sed -i 's/amdsmi_dev_reset_xgmi_error/amdsmi_reset_gpu_xgmi_error/g' @ Change-Id: Ic7e4c4b345fdf6187aed42d53fb7ae8536c2edea [ROCm/amdsmi commit: 6256bf6f1ab3aa93b723c6f736add05085e2fd9f] --- projects/amdsmi/include/amd_smi/amdsmi.h | 2 +- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/xgmi_read_write.cc | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index b43da2919c..348a41cfe2 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3107,7 +3107,7 @@ amdsmi_gpu_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xg * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle processor_handle); +amdsmi_reset_gpu_xgmi_error(amdsmi_processor_handle processor_handle); /** @} End SysInfo */ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index e97aa59e52..9977a11e08 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2849,7 +2849,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_reset_xgmi_error +## amdsmi_reset_gpu_xgmi_error Description: Reset the XGMI error status for a device Input parameters: @@ -2857,7 +2857,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_reset_xgmi_error` function: +Exceptions that can be thrown by `amdsmi_reset_gpu_xgmi_error` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2870,7 +2870,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_reset_xgmi_error(device) + amdsmi_reset_gpu_xgmi_error(device) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 19892b78d5..03b4e5f210 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -134,7 +134,7 @@ from .amdsmi_interface import amdsmi_get_gpu_compute_process_info from .amdsmi_interface import amdsmi_get_gpu_compute_process_info_by_pid from .amdsmi_interface import amdsmi_get_gpu_compute_process_gpus from .amdsmi_interface import amdsmi_gpu_xgmi_error_status -from .amdsmi_interface import amdsmi_dev_reset_xgmi_error +from .amdsmi_interface import amdsmi_reset_gpu_xgmi_error # # PCIE information from .amdsmi_interface import amdsmi_get_gpu_pci_id diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 8946d4b12f..c4d4d4924a 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2620,7 +2620,7 @@ def amdsmi_gpu_xgmi_error_status( return AmdSmiXgmiStatus(status.value) -def amdsmi_dev_reset_xgmi_error( +def amdsmi_reset_gpu_xgmi_error( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> None: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -2628,7 +2628,7 @@ def amdsmi_dev_reset_xgmi_error( processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_xgmi_error(processor_handle)) + _check_res(amdsmi_wrapper.amdsmi_reset_gpu_xgmi_error(processor_handle)) def amdsmi_get_gpu_memory_reserved_pages( diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 2ba92c0b0e..64eb00d497 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1619,9 +1619,9 @@ amdsmi_get_gpu_compute_process_gpus.argtypes = [uint32_t, ctypes.POINTER(ctypes. amdsmi_gpu_xgmi_error_status = _libraries['libamd_smi.so'].amdsmi_gpu_xgmi_error_status amdsmi_gpu_xgmi_error_status.restype = amdsmi_status_t amdsmi_gpu_xgmi_error_status.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_amdsmi_xgmi_status_t)] -amdsmi_dev_reset_xgmi_error = _libraries['libamd_smi.so'].amdsmi_dev_reset_xgmi_error -amdsmi_dev_reset_xgmi_error.restype = amdsmi_status_t -amdsmi_dev_reset_xgmi_error.argtypes = [amdsmi_processor_handle] +amdsmi_reset_gpu_xgmi_error = _libraries['libamd_smi.so'].amdsmi_reset_gpu_xgmi_error +amdsmi_reset_gpu_xgmi_error.restype = amdsmi_status_t +amdsmi_reset_gpu_xgmi_error.argtypes = [amdsmi_processor_handle] amdsmi_topo_get_numa_node_number = _libraries['libamd_smi.so'].amdsmi_topo_get_numa_node_number amdsmi_topo_get_numa_node_number.restype = amdsmi_status_t amdsmi_topo_get_numa_node_number.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] @@ -1874,7 +1874,7 @@ __all__ = \ 'amdsmi_dev_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', 'amdsmi_reset_gpu_fan', 'amdsmi_reset_gpu', - 'amdsmi_dev_reset_xgmi_error', 'amdsmi_set_clk_freq', + 'amdsmi_reset_gpu_xgmi_error', 'amdsmi_set_clk_freq', 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', 'amdsmi_set_gpu_od_clk_info', 'amdsmi_set_gpu_od_volt_info', 'amdsmi_set_gpu_overdrive_level', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 34fffee4f1..f02bb83db1 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -329,7 +329,7 @@ class Formatter: | """ + self.style.text("40 Get compute process info by pid. Api: amdsmi_get_gpu_compute_process_info_by_pid ") + """ | | """ + self.style.text("41 Get compute process gpus. Api: amdsmi_get_gpu_compute_process_gpus ") + """ | | """ + self.style.text("42 Get device xgmi_error_status. Api: amdsmi_gpu_xgmi_error_status ") + """ | - | """ + self.style.text("43 Get device xgmi error reset. Api: amdsmi_dev_reset_xgmi_error ") + """ | + | """ + self.style.text("43 Get device xgmi error reset. Api: amdsmi_reset_gpu_xgmi_error ") + """ | | """ + self.style.text("44 Get topo get numa node number. Api: amdsmi_topo_get_numa_node_number ") + """ | | """ + self.style.text("45 Get topo get link weight. Api: amdsmi_topo_get_link_weight ") + """ | | """ + self.style.text("46 Get minmax_bandwidth_get. Api: amdsmi_get_minmax_bandwidth ") + """ | @@ -849,7 +849,7 @@ commands = { 42: [smi_api.amdsmi_gpu_xgmi_error_status, { "device_identifier1": [None, True] }], - 43: [smi_api.amdsmi_dev_reset_xgmi_error, { + 43: [smi_api.amdsmi_reset_gpu_xgmi_error, { "device_identifier1": [None, True] }], 44: [smi_api.amdsmi_topo_get_numa_node_number, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 82623cfb34..c73f2d37a6 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -830,7 +830,7 @@ amdsmi_gpu_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xg } amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle processor_handle) { +amdsmi_reset_gpu_xgmi_error(amdsmi_processor_handle processor_handle) { return rsmi_wrapper(rsmi_dev_xgmi_error_reset, processor_handle); } @@ -926,7 +926,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_counter_group_supported", "amdsmi_gpu_counter_group_supported"}, {"rsmi_dev_counter_create", "amdsmi_gpu_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_gpu_xgmi_error_status"}, - {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, + {"rsmi_dev_xgmi_error_reset", "amdsmi_reset_gpu_xgmi_error"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, {"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"}, {"rsmi_dev_gpu_metrics_info_get", " amdsmi_get_gpu_metrics_info"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 404968ba17..26a2d97590 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -302,7 +302,7 @@ void TestMutualExclusion::Run(void) { amdsmi_gpu_counter_group_supported amdsmi_get_gpu_memory_reserved_pages amdsmi_gpu_xgmi_error_status - amdsmi_dev_reset_xgmi_error + amdsmi_reset_gpu_xgmi_error amdsmi_dev_xgmi_hive_id_get amdsmi_topo_get_link_weight amdsmi_set_gpu_event_notification_mask diff --git a/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc index 926e88ac54..756e793db3 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/xgmi_read_write.cc @@ -140,7 +140,7 @@ void TestXGMIReadWrite::Run(void) { // TODO(cfree) We need to find a way to generate xgmi errors so this // test won't be meaningless - err = amdsmi_dev_reset_xgmi_error(device); + err = amdsmi_reset_gpu_xgmi_error(device); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Successfully reset XGMI Error Status: " << std::endl; From 90607682ef430f101ccc50fd9cc09c9e411aea8b Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Tue, 28 Feb 2023 02:23:06 -0500 Subject: [PATCH 85/95] Renamed APIs amdsmi_dev_open_supported_func_iterator -> amdsmi_open_supported_func_iterator amdsmi_dev_open_supported_variant_iterator -> amdsmi_open_supported_variant_iterator amdsmi_dev_close_supported_func_iterator -> amdsmi_close_supported_func_iterator Change-Id: Ie9b2efa5aee7095c3c835b91de1951df6b065510 [ROCm/amdsmi commit: edd8f1ae2375ad11b0775bf39af44dce583b30d0] --- projects/amdsmi/include/amd_smi/amdsmi.h | 28 +++++++-------- projects/amdsmi/py-interface/README.md | 36 +++++++++---------- projects/amdsmi/py-interface/__init__.py | 6 ++-- .../amdsmi/py-interface/amdsmi_interface.py | 12 +++---- .../amdsmi/py-interface/amdsmi_wrapper.py | 24 ++++++------- projects/amdsmi/py-interface/rocm_smi_tool.py | 12 +++---- projects/amdsmi/src/amd_smi/amd_smi.cc | 6 ++-- .../functional/api_support_read.cc | 14 ++++---- 8 files changed, 69 insertions(+), 69 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 348a41cfe2..30f8843b02 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -3283,13 +3283,13 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * // ... ... * * std::cout << "Supported AMDSMI Functions:" << std::endl; * - * err = amdsmi_dev_open_supported_func_iterator(device, &iter_handle); + * err = amdsmi_open_supported_func_iterator(device, &iter_handle); * * while (1) { * err = amdsmi_get_func_iter_value(iter_handle, &value); * std::cout << "Function Name: " << value.name << std::endl; * - * err = amdsmi_dev_open_supported_variant_iterator(iter_handle, &var_iter); + * err = amdsmi_open_supported_variant_iterator(iter_handle, &var_iter); * if (err != AMDSMI_STATUS_NO_DATA) { * std::cout << "\tVariants/Monitors: "; * while (1) { @@ -3302,7 +3302,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * std::cout << " ("; * * err = - * amdsmi_dev_open_supported_variant_iterator(var_iter, &sub_var_iter); + * amdsmi_open_supported_variant_iterator(var_iter, &sub_var_iter); * if (err != AMDSMI_STATUS_NO_DATA) { * * while (1) { @@ -3315,7 +3315,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * break; * } * } - * err = amdsmi_dev_close_supported_func_iterator(&sub_var_iter); + * err = amdsmi_close_supported_func_iterator(&sub_var_iter); * } * * std::cout << "), "; @@ -3328,7 +3328,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * } * std::cout << std::endl; * - * err = amdsmi_dev_close_supported_func_iterator(&var_iter); + * err = amdsmi_close_supported_func_iterator(&var_iter); * } * * err = amdsmi_next_func_iter(iter_handle); @@ -3337,7 +3337,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * break; * } * } - * err = amdsmi_dev_close_supported_func_iterator(&iter_handle); + * err = amdsmi_close_supported_func_iterator(&iter_handle); * } * @endcode * @@ -3352,9 +3352,9 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * handle can be used to iterate through all the supported functions. * * Note that although this function takes in @p processor_handle as an argument, - * ::amdsmi_dev_open_supported_func_iterator itself will not be among the + * ::amdsmi_open_supported_func_iterator itself will not be among the * functions listed as supported. This is because - * ::amdsmi_dev_open_supported_func_iterator does not depend on hardware or + * ::amdsmi_open_supported_func_iterator does not depend on hardware or * driver support and should always be supported. * * @param[in] processor_handle a processor handle of device for which support information is @@ -3366,7 +3366,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_pr * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle, +amdsmi_open_supported_func_iterator(amdsmi_processor_handle processor_handle, amdsmi_func_id_iter_handle_t *handle); /** @@ -3376,13 +3376,13 @@ amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle * write a function iterator handle to the caller-provided memory pointed to * by @p var_iter. This handle can be used to iterate through all the supported * variants of the provided handle. @p obj_h may be a handle to a function - * object, as provided by a call to ::amdsmi_dev_open_supported_func_iterator, or + * object, as provided by a call to ::amdsmi_open_supported_func_iterator, or * it may be a variant itself (from a call to - * ::amdsmi_dev_open_supported_variant_iterator), it which case @p var_iter will + * ::amdsmi_open_supported_variant_iterator), it which case @p var_iter will * be an iterator of the sub-variants of @p obj_h (e.g., monitors). * * This call allocates a small amount of memory to @p var_iter. To free this memory - * ::amdsmi_dev_close_supported_func_iterator should be called on the returned + * ::amdsmi_close_supported_func_iterator should be called on the returned * iterator handle @p var_iter when it is no longer needed. * * @param[in] obj_h an iterator handle for which the variants are being requested @@ -3393,7 +3393,7 @@ amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_open_supported_variant_iterator(amdsmi_func_id_iter_handle_t obj_h, +amdsmi_open_supported_variant_iterator(amdsmi_func_id_iter_handle_t obj_h, amdsmi_func_id_iter_handle_t *var_iter); /** @@ -3425,7 +3425,7 @@ amdsmi_next_func_iter(amdsmi_func_id_iter_handle_t handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_close_supported_func_iterator(amdsmi_func_id_iter_handle_t *handle); +amdsmi_close_supported_func_iterator(amdsmi_func_id_iter_handle_t *handle); /** * @brief Get the value associated with a function/variant iterator diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 9977a11e08..035c50d74c 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1041,7 +1041,7 @@ except AmdSmiException as e: ``` -## amdsmi_dev_open_supported_func_iterator +## amdsmi_open_supported_func_iterator Description: Get a function name iterator of supported AMDSMI functions for a device Input parameters: @@ -1050,7 +1050,7 @@ Input parameters: Output: Handle for a function iterator -Exceptions that can be thrown by `amdsmi_dev_open_supported_func_iterator` function: +Exceptions that can be thrown by `amdsmi_open_supported_func_iterator` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1063,14 +1063,14 @@ try: print("No GPUs on machine") else: for device in devices: - obj_handle = amdsmi_dev_open_supported_func_iterator(device) + obj_handle = amdsmi_open_supported_func_iterator(device) print(obj_handle) - amdsmi_dev_close_supported_func_iterator(obj_handle) + amdsmi_close_supported_func_iterator(obj_handle) except AmdSmiException as e: print(e) ``` -## amdsmi_dev_open_supported_variant_iterator +## amdsmi_open_supported_variant_iterator Description: Get a variant iterator for a given handle Input parameters: @@ -1079,7 +1079,7 @@ Input parameters: Output: Variant iterator handle -Exceptions that can be thrown by `amdsmi_dev_open_supported_variant_iterator` function: +Exceptions that can be thrown by `amdsmi_open_supported_variant_iterator` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1092,11 +1092,11 @@ try: print("No GPUs on machine") else: for device in devices: - obj_handle = amdsmi_dev_open_supported_func_iterator(device) - var_iter = amdsmi_dev_open_supported_variant_iterator(obj_handle) + obj_handle = amdsmi_open_supported_func_iterator(device) + var_iter = amdsmi_open_supported_variant_iterator(obj_handle) print(var_iter) - amdsmi_dev_close_supported_func_iterator(obj_handle) - amdsmi_dev_close_supported_func_iterator(var_iter) + amdsmi_close_supported_func_iterator(obj_handle) + amdsmi_close_supported_func_iterator(var_iter) except AmdSmiException as e: print(e) ``` @@ -1123,16 +1123,16 @@ try: print("No GPUs on machine") else: for device in devices: - obj_handle = amdsmi_dev_open_supported_func_iterator(device) + obj_handle = amdsmi_open_supported_func_iterator(device) print(obj_handle) obj_handle = amdsmi_next_func_iter(obj_handle) print(obj_handle) - amdsmi_dev_close_supported_func_iterator(obj_handle) + amdsmi_close_supported_func_iterator(obj_handle) except AmdSmiException as e: print(e) ``` -## amdsmi_dev_close_supported_func_iterator +## amdsmi_close_supported_func_iterator Description: Close a variant iterator handle Input parameters: @@ -1141,7 +1141,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_close_supported_func_iterator` function: +Exceptions that can be thrown by `amdsmi_close_supported_func_iterator` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -1154,8 +1154,8 @@ try: print("No GPUs on machine") else: for device in devices: - obj_handle = amdsmi_dev_open_supported_func_iterator(device) - amdsmi_dev_close_supported_func_iterator(obj_handle) + obj_handle = amdsmi_open_supported_func_iterator(device) + amdsmi_close_supported_func_iterator(obj_handle) except AmdSmiException as e: print(e) ``` @@ -1188,10 +1188,10 @@ try: print("No GPUs on machine") else: for device in devices: - obj_handle = amdsmi_dev_open_supported_func_iterator(device) + obj_handle = amdsmi_open_supported_func_iterator(device) value = amdsmi_get_func_iter_value(obj_handle) print(value) - amdsmi_dev_close_supported_func_iterator(obj_handle) + amdsmi_close_supported_func_iterator(obj_handle) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 03b4e5f210..ae5eaaf648 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -72,9 +72,9 @@ from .amdsmi_interface import amdsmi_get_gpu_board_info from .amdsmi_interface import amdsmi_get_gpu_ras_block_features_enabled # # Supported Function Checks -from .amdsmi_interface import amdsmi_dev_open_supported_func_iterator -from .amdsmi_interface import amdsmi_dev_open_supported_variant_iterator -from .amdsmi_interface import amdsmi_dev_close_supported_func_iterator +from .amdsmi_interface import amdsmi_open_supported_func_iterator +from .amdsmi_interface import amdsmi_open_supported_variant_iterator +from .amdsmi_interface import amdsmi_close_supported_func_iterator from .amdsmi_interface import amdsmi_next_func_iter from .amdsmi_interface import amdsmi_get_func_iter_value diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index c4d4d4924a..019ce5d44d 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1608,7 +1608,7 @@ def amdsmi_set_gpu_overdrive_level( ) -def amdsmi_dev_open_supported_func_iterator( +def amdsmi_open_supported_func_iterator( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> amdsmi_wrapper.amdsmi_func_id_iter_handle_t: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -1618,7 +1618,7 @@ def amdsmi_dev_open_supported_func_iterator( obj_handle = amdsmi_wrapper.amdsmi_func_id_iter_handle_t() _check_res( - amdsmi_wrapper.amdsmi_dev_open_supported_func_iterator( + amdsmi_wrapper.amdsmi_open_supported_func_iterator( processor_handle, ctypes.byref(obj_handle) ) ) @@ -1641,7 +1641,7 @@ def amdsmi_get_gpu_pci_id(processor_handle: amdsmi_wrapper.amdsmi_processor_hand return bdfid.value -def amdsmi_dev_open_supported_variant_iterator( +def amdsmi_open_supported_variant_iterator( obj_handle: amdsmi_wrapper.amdsmi_func_id_iter_handle_t, ) -> amdsmi_wrapper.amdsmi_func_id_iter_handle_t: if not isinstance(obj_handle, amdsmi_wrapper.amdsmi_func_id_iter_handle_t): @@ -1651,7 +1651,7 @@ def amdsmi_dev_open_supported_variant_iterator( var_iter = amdsmi_wrapper.amdsmi_func_id_iter_handle_t() _check_res( - amdsmi_wrapper.amdsmi_dev_open_supported_variant_iterator( + amdsmi_wrapper.amdsmi_open_supported_variant_iterator( obj_handle, ctypes.byref(var_iter) ) ) @@ -1659,7 +1659,7 @@ def amdsmi_dev_open_supported_variant_iterator( return var_iter -def amdsmi_dev_close_supported_func_iterator( +def amdsmi_close_supported_func_iterator( obj_handle: amdsmi_wrapper.amdsmi_func_id_iter_handle_t, ) -> None: if not isinstance(obj_handle, amdsmi_wrapper.amdsmi_func_id_iter_handle_t): @@ -1668,7 +1668,7 @@ def amdsmi_dev_close_supported_func_iterator( ) _check_res( - amdsmi_wrapper.amdsmi_dev_close_supported_func_iterator( + amdsmi_wrapper.amdsmi_close_supported_func_iterator( obj_handle, ctypes.byref(obj_handle) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 64eb00d497..d65660dae2 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1637,18 +1637,18 @@ amdsmi_topo_get_link_type.argtypes = [amdsmi_processor_handle, amdsmi_processor_ amdsmi_is_P2P_accessible = _libraries['libamd_smi.so'].amdsmi_is_P2P_accessible amdsmi_is_P2P_accessible.restype = amdsmi_status_t amdsmi_is_P2P_accessible.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_bool)] -amdsmi_dev_open_supported_func_iterator = _libraries['libamd_smi.so'].amdsmi_dev_open_supported_func_iterator -amdsmi_dev_open_supported_func_iterator.restype = amdsmi_status_t -amdsmi_dev_open_supported_func_iterator.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] -amdsmi_dev_open_supported_variant_iterator = _libraries['libamd_smi.so'].amdsmi_dev_open_supported_variant_iterator -amdsmi_dev_open_supported_variant_iterator.restype = amdsmi_status_t -amdsmi_dev_open_supported_variant_iterator.argtypes = [amdsmi_func_id_iter_handle_t, ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] +amdsmi_open_supported_func_iterator = _libraries['libamd_smi.so'].amdsmi_open_supported_func_iterator +amdsmi_open_supported_func_iterator.restype = amdsmi_status_t +amdsmi_open_supported_func_iterator.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] +amdsmi_open_supported_variant_iterator = _libraries['libamd_smi.so'].amdsmi_open_supported_variant_iterator +amdsmi_open_supported_variant_iterator.restype = amdsmi_status_t +amdsmi_open_supported_variant_iterator.argtypes = [amdsmi_func_id_iter_handle_t, ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] amdsmi_next_func_iter = _libraries['libamd_smi.so'].amdsmi_next_func_iter amdsmi_next_func_iter.restype = amdsmi_status_t amdsmi_next_func_iter.argtypes = [amdsmi_func_id_iter_handle_t] -amdsmi_dev_close_supported_func_iterator = _libraries['libamd_smi.so'].amdsmi_dev_close_supported_func_iterator -amdsmi_dev_close_supported_func_iterator.restype = amdsmi_status_t -amdsmi_dev_close_supported_func_iterator.argtypes = [ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] +amdsmi_close_supported_func_iterator = _libraries['libamd_smi.so'].amdsmi_close_supported_func_iterator +amdsmi_close_supported_func_iterator.restype = amdsmi_status_t +amdsmi_close_supported_func_iterator.argtypes = [ctypes.POINTER(ctypes.POINTER(struct_amdsmi_func_id_iter_handle))] amdsmi_get_func_iter_value = _libraries['libamd_smi.so'].amdsmi_get_func_iter_value amdsmi_get_func_iter_value.restype = amdsmi_status_t amdsmi_get_func_iter_value.argtypes = [amdsmi_func_id_iter_handle_t, ctypes.POINTER(union_c__UA_amdsmi_func_id_value_t)] @@ -1849,7 +1849,7 @@ __all__ = \ 'amdsmi_counter_command_t', 'amdsmi_counter_command_t__enumvalues', 'amdsmi_get_gpu_available_counters', 'amdsmi_counter_value_t', - 'amdsmi_dev_close_supported_func_iterator', + 'amdsmi_close_supported_func_iterator', 'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter', 'amdsmi_gpu_destroy_counter', 'amdsmi_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_get_gpu_ecc_count', @@ -1870,8 +1870,8 @@ __all__ = \ 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', 'amdsmi_get_temp_metric', 'amdsmi_get_gpu_vendor_name', 'amdsmi_get_gpu_volt_metric', 'amdsmi_get_gpu_vram_vendor', - 'amdsmi_dev_open_supported_func_iterator', - 'amdsmi_dev_open_supported_variant_iterator', + 'amdsmi_open_supported_func_iterator', + 'amdsmi_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', 'amdsmi_reset_gpu_fan', 'amdsmi_reset_gpu', 'amdsmi_reset_gpu_xgmi_error', 'amdsmi_set_clk_freq', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index f02bb83db1..f2d81110ba 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -363,8 +363,8 @@ class Formatter: | """ + self.style.text("74 Set dev perf level v1. Api: amdsmi_set_gpu_perf_level_v1 ") + """ | | """ + self.style.text("75 Set dev power cap. Api: amdsmi_set_power_cap ") + """ | | """ + self.style.text("76 Set dev power profile. Api: amdsmi_set_gpu_power_profile ") + """ | - | """ + self.style.text("77 Close dev supported func iterator. Api: amdsmi_dev_close_supported_func_iterator ") + """ | - | """ + self.style.text("78 Pen dev supported func iterator. Api: amdsmi_dev_open_supported_func_iterator ") + """ | + | """ + self.style.text("77 Close dev supported func iterator. Api: amdsmi_close_supported_func_iterator ") + """ | + | """ + self.style.text("78 Pen dev supported func iterator. Api: amdsmi_open_supported_func_iterator ") + """ | | """ + self.style.text("79 Get func iter next. Api: amdsmi_next_func_iter ") + """ | | """ + self.style.text("80 Get power cap info. Api: amdsmi_get_power_cap_info ") + """ | | """ + self.style.text("81 Get xgmi info. Api: amdsmi_get_xgmi_info ") + """ | @@ -709,11 +709,11 @@ def amdsmi_tool_dev_power_profile_set(dev, dic): return result def amdsmi_tool_dev_supported_func_iterator_close(dev): - obj_handle = smi_api.amdsmi_dev_open_supported_func_iterator(dev) - return smi_api.amdsmi_dev_close_supported_func_iterator(obj_handle) + obj_handle = smi_api.amdsmi_open_supported_func_iterator(dev) + return smi_api.amdsmi_close_supported_func_iterator(obj_handle) def amdsmi_tool_func_iter_next(dev): - obj_handle = smi_api.amdsmi_dev_open_supported_func_iterator(dev) + obj_handle = smi_api.amdsmi_open_supported_func_iterator(dev) return smi_api.amdsmi_next_func_iter(obj_handle) ############################################## @@ -969,7 +969,7 @@ commands = { 77: [amdsmi_tool_dev_supported_func_iterator_close, { "device_identifier1": [None, True] }], - 78: [smi_api.amdsmi_dev_open_supported_func_iterator, { + 78: [smi_api.amdsmi_open_supported_func_iterator, { "device_identifier1": [None, True] }], 79: [amdsmi_tool_func_iter_next, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index c73f2d37a6..59b995c714 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -835,7 +835,7 @@ amdsmi_reset_gpu_xgmi_error(amdsmi_processor_handle processor_handle) { } amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle, +amdsmi_open_supported_func_iterator(amdsmi_processor_handle processor_handle, amdsmi_func_id_iter_handle_t *handle) { AMDSMI_CHECK_INIT(); @@ -846,7 +846,7 @@ amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle } amdsmi_status_t -amdsmi_dev_open_supported_variant_iterator(amdsmi_func_id_iter_handle_t obj_h, +amdsmi_open_supported_variant_iterator(amdsmi_func_id_iter_handle_t obj_h, amdsmi_func_id_iter_handle_t *var_iter) { AMDSMI_CHECK_INIT(); @@ -868,7 +868,7 @@ amdsmi_next_func_iter(amdsmi_func_id_iter_handle_t handle) { } amdsmi_status_t -amdsmi_dev_close_supported_func_iterator(amdsmi_func_id_iter_handle_t *handle) { +amdsmi_close_supported_func_iterator(amdsmi_func_id_iter_handle_t *handle) { AMDSMI_CHECK_INIT(); if (handle == nullptr) diff --git a/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc index d7de667630..25dee643fe 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/api_support_read.cc @@ -106,7 +106,7 @@ void TestAPISupportRead::Run(void) { std::cout << "Supported AMDSMI Functions:" << std::endl; std::cout << "\tVariants (Monitors)" << std::endl; } - err = amdsmi_dev_open_supported_func_iterator(processor_handles_[i], &iter_handle); + err = amdsmi_open_supported_func_iterator(processor_handles_[i], &iter_handle); CHK_ERR_ASRT(err) while (1) { @@ -115,7 +115,7 @@ void TestAPISupportRead::Run(void) { IF_VERB(STANDARD) { std::cout << "Function Name: " << value.name << std::endl; } - err = amdsmi_dev_open_supported_variant_iterator(iter_handle, &var_iter); + err = amdsmi_open_supported_variant_iterator(iter_handle, &var_iter); if (err != AMDSMI_STATUS_NO_DATA) { CHK_ERR_ASRT(err) IF_VERB(STANDARD) { @@ -133,7 +133,7 @@ void TestAPISupportRead::Run(void) { std::cout << " ("; } err = - amdsmi_dev_open_supported_variant_iterator(var_iter, &sub_var_iter); + amdsmi_open_supported_variant_iterator(var_iter, &sub_var_iter); if (err != AMDSMI_STATUS_NO_DATA) { CHK_ERR_ASRT(err) @@ -150,7 +150,7 @@ void TestAPISupportRead::Run(void) { } CHK_ERR_ASRT(err) } - err = amdsmi_dev_close_supported_func_iterator(&sub_var_iter); + err = amdsmi_close_supported_func_iterator(&sub_var_iter); CHK_ERR_ASRT(err) } @@ -167,7 +167,7 @@ void TestAPISupportRead::Run(void) { IF_VERB(STANDARD) { std::cout << std::endl; } - err = amdsmi_dev_close_supported_func_iterator(&var_iter); + err = amdsmi_close_supported_func_iterator(&var_iter); CHK_ERR_ASRT(err) } @@ -178,10 +178,10 @@ void TestAPISupportRead::Run(void) { } CHK_ERR_ASRT(err) - // err = amdsmi_dev_open_supported_variant_iterator(iter_handle, &var_iter); + // err = amdsmi_open_supported_variant_iterator(iter_handle, &var_iter); // } - err = amdsmi_dev_close_supported_func_iterator(&iter_handle); + err = amdsmi_close_supported_func_iterator(&iter_handle); CHK_ERR_ASRT(err) } } From 6b138833bff4760b4b7f273b151a3acf06b8e181 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Fri, 3 Mar 2023 04:31:45 -0500 Subject: [PATCH 86/95] updated amdsmi_wrapper.py following command is run to generate this file cmake -B build && make -C build && make -C build python_wrapper Change-Id: I9ee03c4030537c9e8d260e776c04da52d93a9570 [ROCm/amdsmi commit: 3fa4402833d8c8bf6d32575c17c91c7e618809f8] --- .../amdsmi/py-interface/amdsmi_wrapper.py | 171 +++++++++--------- 1 file changed, 89 insertions(+), 82 deletions(-) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index d65660dae2..7cb9dc4492 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -23,7 +23,7 @@ import os # -*- coding: utf-8 -*- # -# TARGET arch is: ['-I/usr/lib/llvm-14/lib/clang/14.0.0/include'] +# TARGET arch is: ['-I/usr/lib64/clang/10.0.1/include'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 @@ -504,17 +504,6 @@ amdsmi_xgmi_info_t = struct_c__SA_amdsmi_xgmi_info_t class struct_c__SA_amdsmi_gpu_caps_t(Structure): pass -class struct_c__SA_amdsmi_gpu_caps_t_1(Structure): - pass - -struct_c__SA_amdsmi_gpu_caps_t_1._pack_ = 1 # source:False -struct_c__SA_amdsmi_gpu_caps_t_1._fields_ = [ - ('mm_ip_count', ctypes.c_ubyte), - ('mm_ip_list', ctypes.c_ubyte * 8), - ('PADDING_0', ctypes.c_ubyte * 3), - ('reserved', ctypes.c_uint32 * 5), -] - class struct_c__SA_amdsmi_gpu_caps_t_0(Structure): pass @@ -527,6 +516,17 @@ struct_c__SA_amdsmi_gpu_caps_t_0._fields_ = [ ('reserved', ctypes.c_uint32 * 5), ] +class struct_c__SA_amdsmi_gpu_caps_t_1(Structure): + pass + +struct_c__SA_amdsmi_gpu_caps_t_1._pack_ = 1 # source:False +struct_c__SA_amdsmi_gpu_caps_t_1._fields_ = [ + ('mm_ip_count', ctypes.c_ubyte), + ('mm_ip_list', ctypes.c_ubyte * 8), + ('PADDING_0', ctypes.c_ubyte * 3), + ('reserved', ctypes.c_uint32 * 5), +] + struct_c__SA_amdsmi_gpu_caps_t._pack_ = 1 # source:False struct_c__SA_amdsmi_gpu_caps_t._fields_ = [ ('gfx', struct_c__SA_amdsmi_gpu_caps_t_0), @@ -1844,48 +1844,17 @@ __all__ = \ 'amd_metrics_table_header_t', 'amdsmi_asic_info_t', 'amdsmi_bdf_t', 'amdsmi_bit_field_t', 'amdsmi_board_info_t', 'amdsmi_clk_measure_t', 'amdsmi_clk_type_t', - 'amdsmi_clk_type_t__enumvalues', 'amdsmi_container_types_t', - 'amdsmi_container_types_t__enumvalues', 'amdsmi_gpu_control_counter', - 'amdsmi_counter_command_t', - 'amdsmi_counter_command_t__enumvalues', - 'amdsmi_get_gpu_available_counters', 'amdsmi_counter_value_t', + 'amdsmi_clk_type_t__enumvalues', 'amdsmi_close_supported_func_iterator', - 'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_create_counter', - 'amdsmi_gpu_destroy_counter', 'amdsmi_get_busy_percent', - 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_get_gpu_ecc_count', - 'amdsmi_get_gpu_ecc_enabled', 'amdsmi_get_gpu_ecc_status', - 'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms', - 'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max', - 'amdsmi_get_clk_freq', 'amdsmi_get_gpu_metrics_info', - 'amdsmi_get_gpu_id', 'amdsmi_get_gpu_memory_busy_percent', - 'amdsmi_get_gpu_memory_reserved_pages', - 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', - 'amdsmi_get_gpu_od_volt_curve_regions', - 'amdsmi_get_gpu_od_volt_info', 'amdsmi_get_gpu_overdrive_level', - 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', - 'amdsmi_get_gpu_pci_replay_counter', - 'amdsmi_get_gpu_pci_throughput', 'amdsmi_get_gpu_perf_level', - 'amdsmi_get_power_ave', - 'amdsmi_get_gpu_power_profile_presets', - 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', - 'amdsmi_get_temp_metric', 'amdsmi_get_gpu_vendor_name', - 'amdsmi_get_gpu_volt_metric', 'amdsmi_get_gpu_vram_vendor', - 'amdsmi_open_supported_func_iterator', - 'amdsmi_open_supported_variant_iterator', + 'amdsmi_container_types_t', + 'amdsmi_container_types_t__enumvalues', + 'amdsmi_counter_command_t', + 'amdsmi_counter_command_t__enumvalues', 'amdsmi_counter_value_t', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', - 'amdsmi_reset_gpu_fan', 'amdsmi_reset_gpu', - 'amdsmi_reset_gpu_xgmi_error', 'amdsmi_set_clk_freq', - 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_fan_speed', - 'amdsmi_set_gpu_od_clk_info', 'amdsmi_set_gpu_od_volt_info', - 'amdsmi_set_gpu_overdrive_level', - 'amdsmi_set_gpu_overdrive_level_v1', - 'amdsmi_set_gpu_pci_bandwidth', 'amdsmi_set_gpu_perf_level', - 'amdsmi_set_gpu_perf_level_v1', 'amdsmi_set_power_cap', - 'amdsmi_set_gpu_power_profile', 'amdsmi_gpu_xgmi_error_status', - 'amdsmi_processor_handle', 'amdsmi_engine_usage_t', - 'amdsmi_error_count_t', 'amdsmi_event_group_t', - 'amdsmi_event_group_t__enumvalues', 'amdsmi_event_handle_t', - 'amdsmi_event_type_t', 'amdsmi_event_type_t__enumvalues', + 'amdsmi_engine_usage_t', 'amdsmi_error_count_t', + 'amdsmi_event_group_t', 'amdsmi_event_group_t__enumvalues', + 'amdsmi_event_handle_t', 'amdsmi_event_type_t', + 'amdsmi_event_type_t__enumvalues', 'amdsmi_evt_notification_data_t', 'amdsmi_evt_notification_type_t', 'amdsmi_evt_notification_type_t__enumvalues', 'amdsmi_freq_ind_t', @@ -1893,56 +1862,94 @@ __all__ = \ 'amdsmi_frequencies_t', 'amdsmi_frequency_range_t', 'amdsmi_func_id_iter_handle_t', 'amdsmi_func_id_value_t', 'amdsmi_fw_block_t', 'amdsmi_fw_block_t__enumvalues', - 'amdsmi_fw_info_t', 'amdsmi_get_gpu_asic_info', + 'amdsmi_fw_info_t', 'amdsmi_get_busy_percent', + 'amdsmi_get_caps_info', 'amdsmi_get_clk_freq', + 'amdsmi_get_clock_measure', 'amdsmi_get_energy_count', + 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', + 'amdsmi_get_gpu_activity', 'amdsmi_get_gpu_asic_info', + 'amdsmi_get_gpu_available_counters', 'amdsmi_get_gpu_bad_page_info', 'amdsmi_get_gpu_board_info', - 'amdsmi_get_caps_info', 'amdsmi_get_clock_measure', 'amdsmi_get_gpu_compute_process_gpus', 'amdsmi_get_gpu_compute_process_info', - 'amdsmi_get_gpu_compute_process_info_by_pid', 'amdsmi_get_gpu_device_bdf', - 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', - 'amdsmi_get_processor_type', 'amdsmi_get_gpu_device_uuid', - 'amdsmi_get_gpu_driver_version', 'amdsmi_get_gpu_ecc_error_count', - 'amdsmi_get_gpu_event_notification', 'amdsmi_get_func_iter_value', - 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', - 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', - 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_cap_info', - 'amdsmi_get_power_measure', 'amdsmi_get_gpu_process_info', - 'amdsmi_get_gpu_process_list', + 'amdsmi_get_gpu_compute_process_info_by_pid', + 'amdsmi_get_gpu_device_bdf', 'amdsmi_get_gpu_device_uuid', + 'amdsmi_get_gpu_driver_version', + 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_get_gpu_ecc_count', + 'amdsmi_get_gpu_ecc_enabled', 'amdsmi_get_gpu_ecc_error_count', + 'amdsmi_get_gpu_ecc_status', 'amdsmi_get_gpu_event_notification', + 'amdsmi_get_gpu_fan_rpms', 'amdsmi_get_gpu_fan_speed', + 'amdsmi_get_gpu_fan_speed_max', 'amdsmi_get_gpu_id', + 'amdsmi_get_gpu_memory_busy_percent', + 'amdsmi_get_gpu_memory_reserved_pages', + 'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage', + 'amdsmi_get_gpu_metrics_info', + 'amdsmi_get_gpu_od_volt_curve_regions', + 'amdsmi_get_gpu_od_volt_info', 'amdsmi_get_gpu_overdrive_level', + 'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id', + 'amdsmi_get_gpu_pci_replay_counter', + 'amdsmi_get_gpu_pci_throughput', 'amdsmi_get_gpu_perf_level', + 'amdsmi_get_gpu_power_profile_presets', + 'amdsmi_get_gpu_process_info', 'amdsmi_get_gpu_process_list', 'amdsmi_get_gpu_ras_block_features_enabled', - 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', + 'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name', 'amdsmi_get_gpu_target_frequency_range', - 'amdsmi_get_utilization_count', 'amdsmi_get_gpu_vbios_info', + 'amdsmi_get_gpu_topo_numa_affinity', 'amdsmi_get_gpu_vbios_info', + 'amdsmi_get_gpu_vendor_name', 'amdsmi_get_gpu_volt_metric', + 'amdsmi_get_gpu_vram_usage', 'amdsmi_get_gpu_vram_vendor', + 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', + 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_ave', + 'amdsmi_get_power_cap_info', 'amdsmi_get_power_measure', + 'amdsmi_get_processor_handle_from_bdf', + 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', + 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', + 'amdsmi_get_temp_metric', 'amdsmi_get_utilization_count', 'amdsmi_get_version', 'amdsmi_get_version_str', - 'amdsmi_get_gpu_vram_usage', 'amdsmi_get_xgmi_info', - 'amdsmi_gpu_block_t', 'amdsmi_gpu_block_t__enumvalues', - 'amdsmi_gpu_caps_t', 'amdsmi_gpu_metrics_t', 'amdsmi_init', - 'amdsmi_init_gpu_event_notification', 'amdsmi_init_flags_t', - 'amdsmi_init_flags_t__enumvalues', 'amdsmi_is_P2P_accessible', + 'amdsmi_get_xgmi_info', 'amdsmi_gpu_block_t', + 'amdsmi_gpu_block_t__enumvalues', 'amdsmi_gpu_caps_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_xgmi_error_status', + 'amdsmi_init', 'amdsmi_init_flags_t', + 'amdsmi_init_flags_t__enumvalues', + 'amdsmi_init_gpu_event_notification', 'amdsmi_is_P2P_accessible', 'amdsmi_memory_page_status_t', 'amdsmi_memory_page_status_t__enumvalues', 'amdsmi_memory_type_t', 'amdsmi_memory_type_t__enumvalues', 'amdsmi_mm_ip_t', 'amdsmi_mm_ip_t__enumvalues', 'amdsmi_next_func_iter', 'amdsmi_od_vddc_point_t', 'amdsmi_od_volt_curve_t', - 'amdsmi_od_volt_freq_data_t', 'amdsmi_pcie_bandwidth_t', - 'amdsmi_pcie_info_t', 'amdsmi_power_cap_info_t', - 'amdsmi_power_measure_t', 'amdsmi_power_profile_preset_masks_t', + 'amdsmi_od_volt_freq_data_t', + 'amdsmi_open_supported_func_iterator', + 'amdsmi_open_supported_variant_iterator', + 'amdsmi_pcie_bandwidth_t', 'amdsmi_pcie_info_t', + 'amdsmi_power_cap_info_t', 'amdsmi_power_measure_t', + 'amdsmi_power_profile_preset_masks_t', 'amdsmi_power_profile_preset_masks_t__enumvalues', 'amdsmi_power_profile_status_t', 'amdsmi_proc_info_t', 'amdsmi_process_handle', 'amdsmi_process_info_t', - 'amdsmi_range_t', 'amdsmi_ras_err_state_t', - 'amdsmi_ras_err_state_t__enumvalues', 'amdsmi_gpu_read_counter', - 'amdsmi_retired_page_record_t', + 'amdsmi_processor_handle', 'amdsmi_range_t', + 'amdsmi_ras_err_state_t', 'amdsmi_ras_err_state_t__enumvalues', + 'amdsmi_reset_gpu', 'amdsmi_reset_gpu_fan', + 'amdsmi_reset_gpu_xgmi_error', 'amdsmi_retired_page_record_t', + 'amdsmi_set_clk_freq', 'amdsmi_set_gpu_clk_range', 'amdsmi_set_gpu_event_notification_mask', - 'amdsmi_set_gpu_perf_determinism_mode', 'amdsmi_shut_down', - 'amdsmi_socket_handle', 'amdsmi_status_string', 'amdsmi_status_t', - 'amdsmi_status_t__enumvalues', 'amdsmi_stop_gpu_event_notification', - 'amdsmi_sw_component_t', 'amdsmi_sw_component_t__enumvalues', + 'amdsmi_set_gpu_fan_speed', 'amdsmi_set_gpu_od_clk_info', + 'amdsmi_set_gpu_od_volt_info', 'amdsmi_set_gpu_overdrive_level', + 'amdsmi_set_gpu_overdrive_level_v1', + 'amdsmi_set_gpu_pci_bandwidth', + 'amdsmi_set_gpu_perf_determinism_mode', + 'amdsmi_set_gpu_perf_level', 'amdsmi_set_gpu_perf_level_v1', + 'amdsmi_set_gpu_power_profile', 'amdsmi_set_power_cap', + 'amdsmi_shut_down', 'amdsmi_socket_handle', + 'amdsmi_status_string', 'amdsmi_status_t', + 'amdsmi_status_t__enumvalues', + 'amdsmi_stop_gpu_event_notification', 'amdsmi_sw_component_t', + 'amdsmi_sw_component_t__enumvalues', 'amdsmi_temperature_metric_t', 'amdsmi_temperature_metric_t__enumvalues', 'amdsmi_temperature_type_t', 'amdsmi_temperature_type_t__enumvalues', 'amdsmi_topo_get_link_type', 'amdsmi_topo_get_link_weight', - 'amdsmi_get_gpu_topo_numa_affinity', 'amdsmi_topo_get_numa_node_number', 'amdsmi_utilization_counter_t', 'amdsmi_vbios_info_t', 'amdsmi_version_t', 'amdsmi_voltage_metric_t', From da3da06941bbfc1f2ca5b15742b2a7e5f7e0837b Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Thu, 11 May 2023 10:42:22 -0500 Subject: [PATCH 87/95] Return NOT_SUPPORT for set function in VM guest Fix the unit tests which are fail in VM guest environment. Change-Id: Id7c58887692bbdecba54f5d2d8463b292e19b4ad [ROCm/amdsmi commit: dc4ba12e00f34fde001e66b4c33836c07d2db910] --- .../include/rocm_smi/rocm_smi_utils.h | 4 ++ projects/amdsmi/rocm_smi/src/rocm_smi.cc | 48 +++++++++++++++++++ .../amdsmi/rocm_smi/src/rocm_smi_utils.cc | 19 ++++++++ .../amd_smi_test/functional/overdrive_read.cc | 6 +++ .../functional/overdrive_read_write.cc | 6 +++ .../functional/perf_level_read_write.cc | 6 +++ .../functional/power_cap_read_write.cc | 6 +++ 7 files changed, 95 insertions(+) diff --git a/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_utils.h b/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_utils.h index a8f4cfa848..d40b4e5404 100755 --- a/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_utils.h +++ b/projects/amdsmi/rocm_smi/include/rocm_smi/rocm_smi_utils.h @@ -198,6 +198,10 @@ class ScopedAcquire { DISALLOW_COPY_AND_ASSIGN(ScopedAcquire); }; +// The best effort way to decide whether it is in VM guest environment: +// In VM environment, the /proc/cpuinfo set hypervisor flag by default +bool is_vm_guest(); + } // namespace smi } // namespace amd diff --git a/projects/amdsmi/rocm_smi/src/rocm_smi.cc b/projects/amdsmi/rocm_smi/src/rocm_smi.cc index 12b8061a0c..75e92aff2e 100755 --- a/projects/amdsmi/rocm_smi/src/rocm_smi.cc +++ b/projects/amdsmi/rocm_smi/src/rocm_smi.cc @@ -850,6 +850,11 @@ rsmi_dev_overdrive_level_get(uint32_t dv_ind, uint32_t *od) { CHK_SUPPORT_NAME_ONLY(od) DEVICE_MUTEX + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } + rsmi_status_t ret = get_dev_value_str(amd::smi::kDevOverDriveLevel, dv_ind, &val_str); if (ret != RSMI_STATUS_SUCCESS) { @@ -886,6 +891,12 @@ rsmi_dev_overdrive_level_set_v1(uint32_t dv_ind, uint32_t od) { if (od > kMaxOverdriveLevel) { return RSMI_STATUS_INVALID_ARGS; } + + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } + DEVICE_MUTEX return set_dev_value(amd::smi::kDevOverDriveLevel, dv_ind, od); CATCH @@ -905,6 +916,11 @@ rsmi_dev_perf_level_set_v1(uint32_t dv_ind, rsmi_dev_perf_level_t perf_level) { return RSMI_STATUS_INVALID_ARGS; } + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } + DEVICE_MUTEX return set_dev_value(amd::smi::kDevPerfLevel, dv_ind, perf_level); CATCH @@ -992,6 +1008,10 @@ static rsmi_status_t get_power_profiles(uint32_t dv_ind, } assert(val_vec.size() <= RSMI_MAX_NUM_POWER_PROFILES); if (val_vec.size() > RSMI_MAX_NUM_POWER_PROFILES + 1 || val_vec.size() < 1) { + // Guest may not have power related information. + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } return RSMI_STATUS_UNEXPECTED_SIZE; } // -1 for the header line, below @@ -1177,6 +1197,11 @@ rsmi_status_t rsmi_dev_clk_range_set(uint32_t dv_ind, uint64_t minclkvalue, return RSMI_STATUS_INVALID_ARGS; } + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } + // Can only set the clock type for sys and mem type if (clkType != RSMI_CLK_TYPE_SYS && clkType != RSMI_CLK_TYPE_MEM) { return RSMI_STATUS_NOT_SUPPORTED; @@ -1601,6 +1626,11 @@ rsmi_dev_gpu_clk_freq_set(uint32_t dv_ind, return RSMI_STATUS_INVALID_ARGS; } + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } + ret = rsmi_dev_gpu_clk_freq_get(dv_ind, clk_type, &freqs); if (ret != RSMI_STATUS_SUCCESS) { @@ -2058,6 +2088,10 @@ rsmi_dev_pci_bandwidth_set(uint32_t dv_ind, uint64_t bw_bitmask) { TRY REQUIRE_ROOT_ACCESS DEVICE_MUTEX + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } ret = rsmi_dev_pci_bandwidth_get(dv_ind, &bws); if (ret != RSMI_STATUS_SUCCESS) { @@ -2369,6 +2403,11 @@ rsmi_dev_fan_speed_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t speed) { REQUIRE_ROOT_ACCESS DEVICE_MUTEX + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } + ret = rsmi_dev_fan_speed_max_get(dv_ind, sensor_ind, &max_speed); if (ret != RSMI_STATUS_SUCCESS) { @@ -2580,6 +2619,11 @@ rsmi_dev_power_cap_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t cap) { REQUIRE_ROOT_ACCESS DEVICE_MUTEX + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } + ret = rsmi_dev_power_cap_range_get(dv_ind, sensor_ind, &max, &min); if (ret != RSMI_STATUS_SUCCESS) { return ret; @@ -2622,6 +2666,10 @@ rsmi_dev_power_profile_set(uint32_t dv_ind, uint32_t dummy, (void)dummy; DEVICE_MUTEX + // Bare Metal only feature + if (amd::smi::is_vm_guest()) { + return RSMI_STATUS_NOT_SUPPORTED; + } rsmi_status_t ret = set_power_profile(dv_ind, profile); return ret; CATCH diff --git a/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc b/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc index 473d1e2b67..93ff80be74 100755 --- a/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc +++ b/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc @@ -234,5 +234,24 @@ rsmi_status_t ErrnoToRsmiStatus(int err) { } } +bool is_vm_guest() { + // the cpuinfo will set hypervisor flag in VM guest + const std::string hypervisor = "hypervisor"; + std::string line; + + // default to false if cannot find the file + std::ifstream infile("/proc/cpuinfo"); + if (infile.fail()) { + return false; + } + + while (std::getline(infile, line)) { + if (line.find(hypervisor) != std::string::npos) { + return true; + } + } + return false; +} + } // namespace smi } // namespace amd diff --git a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc index ccc3df1eb7..4c609c50d4 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read.cc @@ -99,6 +99,12 @@ void TestOverdriveRead::Run(void) { PrintDeviceHeader(processor_handles_[i]); err = amdsmi_get_gpu_overdrive_level(processor_handles_[i], &val_ui32); + if (err == AMDSMI_STATUS_NOT_SUPPORTED) { + IF_VERB(STANDARD) { + std::cout << "\t** Not supported on this machine" << std::endl; + } + continue; + } CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**OverDrive Level:" << val_ui32 << std::endl; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc index a8f258061c..55662bae28 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/overdrive_read_write.cc @@ -101,6 +101,12 @@ void TestOverdriveReadWrite::Run(void) { std::cout << "Set Overdrive level to 0%..." << std::endl; } ret = amdsmi_set_gpu_overdrive_level(processor_handles_[dv_ind], 0); + if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { + IF_VERB(STANDARD) { + std::cout << "\t** Not supported on this machine" << std::endl; + } + continue; + } CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "Set Overdrive level to 10%..." << std::endl; diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc index 121e7b5a90..0e59053cb7 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_level_read_write.cc @@ -140,6 +140,12 @@ void TestPerfLevelReadWrite::Run(void) { " ..." << std::endl; } ret = amdsmi_set_gpu_perf_level(processor_handles_[dv_ind], orig_pfl); + if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { + IF_VERB(STANDARD) { + std::cout << "\t** Not supported on this machine" << std::endl; + } + continue; + } CHK_ERR_ASRT(ret) ret = amdsmi_get_gpu_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc index e0b05abe42..f6fd038ba4 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_cap_read_write.cc @@ -125,6 +125,12 @@ void TestPowerCapReadWrite::Run(void) { end = clock(); cpu_time_used = ((double) (end - start)) * 1000000UL / CLOCKS_PER_SEC; + if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { + IF_VERB(STANDARD) { + std::cout << "\t** Not supported on this machine" << std::endl; + } + continue; + } CHK_ERR_ASRT(ret) ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); From c76586e482fec8431df738f32ae74408239006e7 Mon Sep 17 00:00:00 2001 From: Dalibor Stanisavljevic Date: Tue, 16 May 2023 12:31:52 +0200 Subject: [PATCH 88/95] SWDEV-384797 - Renamed measure to info Change-Id: I2397ed189fe0171ed29bd6440f8fa0bb210b95a5 Signed-off-by: Dalibor Stanisavljevic [ROCm/amdsmi commit: ca7f965018735a97de3650c6769c6b259cb29cf4] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 34 ++++++------- .../amdsmi/example/amd_smi_drm_example.cc | 18 +++---- projects/amdsmi/include/amd_smi/amdsmi.h | 14 +++--- projects/amdsmi/py-interface/README.md | 16 +++--- projects/amdsmi/py-interface/__init__.py | 4 +- .../amdsmi/py-interface/amdsmi_interface.py | 14 +++--- .../amdsmi/py-interface/amdsmi_wrapper.py | 49 ++++++++++--------- projects/amdsmi/src/amd_smi/amd_smi.cc | 6 +-- 8 files changed, 78 insertions(+), 77 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index be12192cdd..e5796e27fa 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -283,7 +283,7 @@ class AMDSMICommands(): raise e if args.limit: try: - power_limit = amdsmi_interface.amdsmi_get_power_measure(args.gpu)['power_limit'] + power_limit = amdsmi_interface.amdsmi_get_power_info(args.gpu)['power_limit'] except amdsmi_exception.AmdSmiLibraryException as e: power_limit = e.get_error_info() if not self.all_arguments: @@ -811,32 +811,32 @@ class AMDSMICommands(): if args.power: power_dict = {} try: - power_measure = amdsmi_interface.amdsmi_get_power_measure(args.gpu) + power_measure = amdsmi_interface.amdsmi_get_power_info(args.gpu) power_dict = {'average_socket_power': power_measure['average_socket_power'], - 'voltage_gfx': power_measure['voltage_gfx'], - 'voltage_soc': amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info, - 'voltage_mem': amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info} + 'gfx_voltage': power_measure['gfx_voltage'], + 'soc_voltage': amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info, + 'mem_voltage': amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info} if self.logger.is_human_readable_format(): power_dict['average_socket_power'] = f"{power_dict['average_socket_power']} W" - power_dict['voltage_gfx'] = f"{power_dict['voltage_gfx']} mV" - power_dict['voltage_soc'] = amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info - power_dict['voltage_mem'] = amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info + power_dict['gfx_voltage'] = f"{power_dict['gfx_voltage']} mV" + power_dict['soc_voltage'] = amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info + power_dict['mem_voltage'] = amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info except amdsmi_exception.AmdSmiLibraryException as e: power_dict = {'average_socket_power': e.get_error_info(), - 'voltage_gfx': e.get_error_info(), - 'voltage_soc': e.get_error_info(), - 'voltage_mem': e.get_error_info()} + 'gfx_voltage': e.get_error_info(), + 'soc_voltage': e.get_error_info(), + 'mem_voltage': e.get_error_info()} if not self.all_arguments: raise e if self.logger.is_gpuvsmi_compatibility(): power_dict['current_power'] = power_dict.pop('average_socket_power') - power_dict['current_voltage'] = power_dict.pop('voltage_gfx') - power_dict['current_voltage_soc'] = power_dict.pop('voltage_soc') - power_dict['current_voltage_mem'] = power_dict.pop('voltage_mem') + power_dict['current_voltage'] = power_dict.pop('gfx_voltage') + power_dict['current_soc_voltage'] = power_dict.pop('soc_voltage') + power_dict['current_mem_voltage'] = power_dict.pop('mem_voltage') try: power_dict['current_fan_rpm'] = amdsmi_interface.amdsmi_dev_get_fan_rpms(args.gpu, 0) @@ -850,8 +850,8 @@ class AMDSMICommands(): values_dict['power'] = power_dict if args.clock: try: - clock_gfx = amdsmi_interface.amdsmi_get_clock_measure(args.gpu, amdsmi_interface.AmdSmiClkType.GFX) - clock_mem = amdsmi_interface.amdsmi_get_clock_measure(args.gpu, amdsmi_interface.AmdSmiClkType.MEM) + clock_gfx = amdsmi_interface.amdsmi_get_clock_info(args.gpu, amdsmi_interface.AmdSmiClkType.GFX) + clock_mem = amdsmi_interface.amdsmi_get_clock_info(args.gpu, amdsmi_interface.AmdSmiClkType.MEM) clocks = {'gfx': clock_gfx, 'mem': clock_mem} @@ -1056,7 +1056,7 @@ class AMDSMICommands(): raise e if args.energy: try: - energy = amdsmi_interface.amdsmi_get_power_measure(args.gpu)['energy_accumulator'] + energy = amdsmi_interface.amdsmi_get_power_info(args.gpu)['energy_accumulator'] if self.logger.is_human_readable_format(): unit = 'J' diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index 38267cf3d0..cce662d68f 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -305,12 +305,12 @@ int main() { vbios_info.vbios_version_string); // Get power measure - amdsmi_power_measure_t power_measure = {}; - ret = amdsmi_get_power_measure(processor_handles[j], &power_measure); + amdsmi_power_info_t power_measure = {}; + ret = amdsmi_get_power_info(processor_handles[j], &power_measure); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_power_measure:\n"); + printf(" Output of amdsmi_get_power_info:\n"); printf("\tCurrent GFX Voltage: %d\n", - power_measure.voltage_gfx); + power_measure.gfx_voltage); printf("\tAverage socket power: %d\n", power_measure.average_socket_power); printf("\tEnergy accumulator: %ld\n\n", @@ -358,18 +358,18 @@ int main() { } // Get GFX clock measurements - amdsmi_clk_measure_t gfx_clk_values = {}; - ret = amdsmi_get_clock_measure(processor_handles[j], CLK_TYPE_GFX, + amdsmi_clk_info_t gfx_clk_values = {}; + ret = amdsmi_get_clock_info(processor_handles[j], CLK_TYPE_GFX, &gfx_clk_values); CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_clock_measure:\n"); + printf(" Output of amdsmi_get_clock_info:\n"); printf("\tGPU GFX Max Clock: %d\n", gfx_clk_values.max_clk); printf("\tGPU GFX Average Clock: %d\n", gfx_clk_values.avg_clk); printf("\tGPU GFX Current Clock: %d\n", gfx_clk_values.cur_clk); // Get MEM clock measurements - amdsmi_clk_measure_t mem_clk_values = {}; - ret = amdsmi_get_clock_measure(processor_handles[j], CLK_TYPE_MEM, + amdsmi_clk_info_t mem_clk_values = {}; + ret = amdsmi_get_clock_info(processor_handles[j], CLK_TYPE_MEM, &mem_clk_values); CHK_AMDSMI_RET(ret) printf("\tGPU MEM Max Clock: %d\n", mem_clk_values.max_clk); diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 30f8843b02..1e8a61a0b4 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -379,12 +379,12 @@ typedef struct { typedef struct { uint32_t average_socket_power; uint64_t energy_accumulator; // v1 mod. (32->64) - uint32_t voltage_gfx; // GFX voltage measurement in mV - uint32_t voltage_soc; // SOC voltage measurement in mV - uint32_t voltage_mem; // MEM voltage measurement in mV + uint32_t gfx_voltage; // GFX voltage measurement in mV + uint32_t soc_voltage; // SOC voltage measurement in mV + uint32_t mem_voltage; // MEM voltage measurement in mV uint32_t power_limit; // The power limit; uint32_t reserved[9]; -} amdsmi_power_measure_t; +} amdsmi_power_info_t; typedef struct { uint32_t cur_clk; @@ -392,7 +392,7 @@ typedef struct { uint32_t min_clk; uint32_t max_clk; uint32_t reserved[4]; -} amdsmi_clk_measure_t; +} amdsmi_clk_info_t; typedef struct { uint32_t gfx_activity; @@ -3754,7 +3754,7 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_measure_t *info); +amdsmi_get_power_info(amdsmi_processor_handle processor_handle, amdsmi_power_info_t *info); /** * @brief Returns the measurements of the clocks in the GPU @@ -3771,7 +3771,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info); +amdsmi_get_clock_info(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_info_t *info); /** * @brief Returns the VRAM usage (both total and used memory) diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 035c50d74c..71cbabec9d 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -511,7 +511,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_power_measure +## amdsmi_get_power_info Description: Returns the current power and voltage for the given GPU Input parameters: @@ -522,11 +522,11 @@ Output: Dictionary with fields Field | Description ---|--- `average_socket_power`| average socket power -`voltage_gfx` | voltage gfx +`gfx_voltage` | voltage gfx `energy_accumulator` | energy accumulator `power_limit` | power limit -Exceptions that can be thrown by `amdsmi_get_power_measure` function: +Exceptions that can be thrown by `amdsmi_get_power_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -539,9 +539,9 @@ try: print("No GPUs on machine") else: for device in devices: - power_measure = amdsmi_get_power_measure(device) + power_measure = amdsmi_get_power_info(device) print(power_measure['average_socket_power']) - print(power_measure['voltage_gfx']) + print(power_measure['gfx_voltage']) print(power_measure['energy_accumulator']) print(power_measure['power_limit']) except AmdSmiException as e: @@ -579,7 +579,7 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_clock_measure +## amdsmi_get_clock_info Description: Returns the clock measure for the given GPU Input parameters: @@ -609,7 +609,7 @@ Field | Description `min_clk` | Minimum clock for given clock type `max_clk` | Maximum clock for given clock type -Exceptions that can be thrown by `amdsmi_get_clock_measure` function: +Exceptions that can be thrown by `amdsmi_get_clock_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -622,7 +622,7 @@ try: print("No GPUs on machine") else: for device in devices: - clock_measure = amdsmi_get_clock_measure(device, AmdSmiClkType.GFX) + clock_measure = amdsmi_get_clock_info(device, AmdSmiClkType.GFX) print(clock_measure['cur_clk']) print(clock_measure['avg_clk']) print(clock_measure['min_clk']) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index ae5eaaf648..1bde3e24be 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -48,8 +48,8 @@ from .amdsmi_interface import amdsmi_get_fw_info # # GPU Monitoring from .amdsmi_interface import amdsmi_get_gpu_activity from .amdsmi_interface import amdsmi_get_gpu_vram_usage -from .amdsmi_interface import amdsmi_get_power_measure -from .amdsmi_interface import amdsmi_get_clock_measure +from .amdsmi_interface import amdsmi_get_power_info +from .amdsmi_interface import amdsmi_get_clock_info from .amdsmi_interface import amdsmi_get_pcie_link_status from .amdsmi_interface import amdsmi_get_pcie_link_caps diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 019ce5d44d..957e16ceaa 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -698,7 +698,7 @@ def amdsmi_get_gpu_activity( } -def amdsmi_get_clock_measure( +def amdsmi_get_clock_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: @@ -709,9 +709,9 @@ def amdsmi_get_clock_measure( if not isinstance(clock_type, AmdSmiClkType): raise AmdSmiParameterException(clock_type, AmdSmiClkType) - clock_measure = amdsmi_wrapper.amdsmi_clk_measure_t() + clock_measure = amdsmi_wrapper.amdsmi_clk_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_clock_measure( + amdsmi_wrapper.amdsmi_get_clock_info( processor_handle, amdsmi_wrapper.amdsmi_clk_type_t(clock_type), ctypes.byref(clock_measure), @@ -962,7 +962,7 @@ def amdsmi_get_gpu_driver_version( return version.value.decode("utf-8") -def amdsmi_get_power_measure( +def amdsmi_get_power_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): @@ -970,16 +970,16 @@ def amdsmi_get_power_measure( processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) - power_measure = amdsmi_wrapper.amdsmi_power_measure_t() + power_measure = amdsmi_wrapper.amdsmi_power_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_power_measure( + amdsmi_wrapper.amdsmi_get_power_info( processor_handle, ctypes.byref(power_measure) ) ) return { "average_socket_power": power_measure.average_socket_power, - "voltage_gfx": power_measure.voltage_gfx, + "gfx_voltage": power_measure.gfx_voltage, "energy_accumulator": power_measure.energy_accumulator, "power_limit" : power_measure.power_limit, } diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 7cb9dc4492..94b6220254 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -23,7 +23,7 @@ import os # -*- coding: utf-8 -*- # -# TARGET arch is: ['-I/usr/lib64/clang/10.0.1/include'] +# TARGET arch is: ['-I/usr/lib/llvm-14/lib/clang/14.0.0/include'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 @@ -187,6 +187,7 @@ else: _libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_cwd) + # values for enumeration 'c__EA_amdsmi_init_flags_t' c__EA_amdsmi_init_flags_t__enumvalues = { 0: 'AMDSMI_INIT_ALL_DEVICES', @@ -667,28 +668,28 @@ struct_c__SA_amdsmi_board_info_t._fields_ = [ ] amdsmi_board_info_t = struct_c__SA_amdsmi_board_info_t -class struct_c__SA_amdsmi_power_measure_t(Structure): +class struct_c__SA_amdsmi_power_info_t(Structure): pass -struct_c__SA_amdsmi_power_measure_t._pack_ = 1 # source:False -struct_c__SA_amdsmi_power_measure_t._fields_ = [ +struct_c__SA_amdsmi_power_info_t._pack_ = 1 # source:False +struct_c__SA_amdsmi_power_info_t._fields_ = [ ('average_socket_power', ctypes.c_uint32), ('PADDING_0', ctypes.c_ubyte * 4), ('energy_accumulator', ctypes.c_uint64), - ('voltage_gfx', ctypes.c_uint32), - ('voltage_soc', ctypes.c_uint32), - ('voltage_mem', ctypes.c_uint32), + ('gfx_voltage', ctypes.c_uint32), + ('soc_voltage', ctypes.c_uint32), + ('mem_voltage', ctypes.c_uint32), ('power_limit', ctypes.c_uint32), ('reserved', ctypes.c_uint32 * 9), ('PADDING_1', ctypes.c_ubyte * 4), ] -amdsmi_power_measure_t = struct_c__SA_amdsmi_power_measure_t -class struct_c__SA_amdsmi_clk_measure_t(Structure): +amdsmi_power_info_t = struct_c__SA_amdsmi_power_info_t +class struct_c__SA_amdsmi_clk_info_t(Structure): pass -struct_c__SA_amdsmi_clk_measure_t._pack_ = 1 # source:False -struct_c__SA_amdsmi_clk_measure_t._fields_ = [ +struct_c__SA_amdsmi_clk_info_t._pack_ = 1 # source:False +struct_c__SA_amdsmi_clk_info_t._fields_ = [ ('cur_clk', ctypes.c_uint32), ('avg_clk', ctypes.c_uint32), ('min_clk', ctypes.c_uint32), @@ -696,7 +697,7 @@ struct_c__SA_amdsmi_clk_measure_t._fields_ = [ ('reserved', ctypes.c_uint32 * 4), ] -amdsmi_clk_measure_t = struct_c__SA_amdsmi_clk_measure_t +amdsmi_clk_info_t = struct_c__SA_amdsmi_clk_info_t class struct_c__SA_amdsmi_engine_usage_t(Structure): pass @@ -1697,12 +1698,12 @@ amdsmi_get_gpu_vbios_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(st amdsmi_get_gpu_activity = _libraries['libamd_smi.so'].amdsmi_get_gpu_activity amdsmi_get_gpu_activity.restype = amdsmi_status_t amdsmi_get_gpu_activity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_engine_usage_t)] -amdsmi_get_power_measure = _libraries['libamd_smi.so'].amdsmi_get_power_measure -amdsmi_get_power_measure.restype = amdsmi_status_t -amdsmi_get_power_measure.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_power_measure_t)] -amdsmi_get_clock_measure = _libraries['libamd_smi.so'].amdsmi_get_clock_measure -amdsmi_get_clock_measure.restype = amdsmi_status_t -amdsmi_get_clock_measure.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_clk_measure_t)] +amdsmi_get_power_info = _libraries['libamd_smi.so'].amdsmi_get_power_info +amdsmi_get_power_info.restype = amdsmi_status_t +amdsmi_get_power_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_power_info_t)] +amdsmi_get_clock_info = _libraries['libamd_smi.so'].amdsmi_get_clock_info +amdsmi_get_clock_info.restype = amdsmi_status_t +amdsmi_get_clock_info.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_clk_info_t)] amdsmi_get_gpu_vram_usage = _libraries['libamd_smi.so'].amdsmi_get_gpu_vram_usage amdsmi_get_gpu_vram_usage.restype = amdsmi_status_t amdsmi_get_gpu_vram_usage.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_vram_info_t)] @@ -1843,7 +1844,7 @@ __all__ = \ 'TEMPERATURE_TYPE_VRAM', 'TEMPERATURE_TYPE__MAX', 'UNKNOWN', 'amd_metrics_table_header_t', 'amdsmi_asic_info_t', 'amdsmi_bdf_t', 'amdsmi_bit_field_t', 'amdsmi_board_info_t', - 'amdsmi_clk_measure_t', 'amdsmi_clk_type_t', + 'amdsmi_clk_info_t', 'amdsmi_clk_type_t', 'amdsmi_clk_type_t__enumvalues', 'amdsmi_close_supported_func_iterator', 'amdsmi_container_types_t', @@ -1864,7 +1865,7 @@ __all__ = \ 'amdsmi_fw_block_t', 'amdsmi_fw_block_t__enumvalues', 'amdsmi_fw_info_t', 'amdsmi_get_busy_percent', 'amdsmi_get_caps_info', 'amdsmi_get_clk_freq', - 'amdsmi_get_clock_measure', 'amdsmi_get_energy_count', + 'amdsmi_get_clock_info', 'amdsmi_get_energy_count', 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', 'amdsmi_get_gpu_asic_info', 'amdsmi_get_gpu_available_counters', @@ -1898,7 +1899,7 @@ __all__ = \ 'amdsmi_get_gpu_vram_usage', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_ave', - 'amdsmi_get_power_cap_info', 'amdsmi_get_power_measure', + 'amdsmi_get_power_cap_info', 'amdsmi_get_power_info', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', @@ -1922,7 +1923,7 @@ __all__ = \ 'amdsmi_open_supported_func_iterator', 'amdsmi_open_supported_variant_iterator', 'amdsmi_pcie_bandwidth_t', 'amdsmi_pcie_info_t', - 'amdsmi_power_cap_info_t', 'amdsmi_power_measure_t', + 'amdsmi_power_cap_info_t', 'amdsmi_power_info_t', 'amdsmi_power_profile_preset_masks_t', 'amdsmi_power_profile_preset_masks_t__enumvalues', 'amdsmi_power_profile_status_t', 'amdsmi_proc_info_t', @@ -1977,7 +1978,7 @@ __all__ = \ 'struct_c__SA_amd_metrics_table_header_t', 'struct_c__SA_amdsmi_asic_info_t', 'struct_c__SA_amdsmi_board_info_t', - 'struct_c__SA_amdsmi_clk_measure_t', + 'struct_c__SA_amdsmi_clk_info_t', 'struct_c__SA_amdsmi_counter_value_t', 'struct_c__SA_amdsmi_engine_usage_t', 'struct_c__SA_amdsmi_error_count_t', @@ -1997,7 +1998,7 @@ __all__ = \ 'struct_c__SA_amdsmi_pcie_bandwidth_t', 'struct_c__SA_amdsmi_pcie_info_t', 'struct_c__SA_amdsmi_power_cap_info_t', - 'struct_c__SA_amdsmi_power_measure_t', + 'struct_c__SA_amdsmi_power_info_t', 'struct_c__SA_amdsmi_power_profile_status_t', 'struct_c__SA_amdsmi_proc_info_t', 'struct_c__SA_amdsmi_proc_info_t_0', diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 59b995c714..1732803a36 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1492,7 +1492,7 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_ } amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) { +amdsmi_get_clock_info(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1698,7 +1698,7 @@ amdsmi_get_gpu_process_info(amdsmi_processor_handle processor_handle, amdsmi_pro } amdsmi_status_t -amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_measure_t *info) { +amdsmi_get_power_info(amdsmi_processor_handle processor_handle, amdsmi_power_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1732,7 +1732,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_ } info->power_limit = power_limit; - info->voltage_gfx = voltage_read; + info->gfx_voltage = voltage_read; info->average_socket_power = metrics.average_socket_power; info->energy_accumulator = metrics.energy_accumulator; From d95be94e51918bdec449c0b328f3ca3e19e29058 Mon Sep 17 00:00:00 2001 From: Dalibor Stanisavljevic Date: Wed, 17 May 2023 15:45:18 +0200 Subject: [PATCH 89/95] SWDEV-384793 - Clean up API Change-Id: I441b315d32df59a454e06d521e5ca8b2c229451a Signed-off-by: Dalibor Stanisavljevic [ROCm/amdsmi commit: 1bc1d431d82f59f0ad9d0cc9a1cb3eabb22d2da4] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 35 +----- .../amdsmi/example/amd_smi_drm_example.cc | 55 ++------- .../amdsmi/example/amd_smi_nodrm_example.cc | 22 +--- projects/amdsmi/include/amd_smi/amdsmi.h | 80 +----------- projects/amdsmi/py-interface/README.md | 87 +------------ projects/amdsmi/py-interface/__init__.py | 2 - .../amdsmi/py-interface/amdsmi_interface.py | 55 +-------- .../amdsmi/py-interface/amdsmi_wrapper.py | 90 +++----------- projects/amdsmi/py-interface/rocm_smi_tool.py | 5 - projects/amdsmi/src/amd_smi/amd_smi.cc | 114 +----------------- projects/amdsmi/src/amd_smi/fdinfo.cc | 21 ---- .../functional/mutual_exclusion.cc | 1 - .../amd_smi_test/functional/power_read.cc | 12 -- .../amd_smi_test/functional/sys_info_read.cc | 2 +- 14 files changed, 48 insertions(+), 533 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index e5796e27fa..1653858868 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -216,7 +216,6 @@ class AMDSMICommands(): if args.asic: try: asic_info = amdsmi_interface.amdsmi_get_asic_info(args.gpu) - asic_info['family'] = hex(asic_info['family']) asic_info['vendor_id'] = hex(asic_info['vendor_id']) asic_info['device_id'] = hex(asic_info['device_id']) asic_info['rev_id'] = hex(asic_info['rev_id']) @@ -255,10 +254,9 @@ class AMDSMICommands(): try: vbios_info = amdsmi_interface.amdsmi_get_vbios_info(args.gpu) if self.logger.is_gpuvsmi_compatibility(): - vbios_info['version'] = vbios_info.pop('vbios_version_string') + vbios_info['version'] = vbios_info.pop('version') vbios_info['build_date'] = vbios_info.pop('build_date') vbios_info['part_number'] = vbios_info.pop('part_number') - vbios_info['vbios_version'] = vbios_info.pop('vbios_version') static_dict['vbios'] = vbios_info except amdsmi_exception.AmdSmiLibraryException as e: @@ -351,23 +349,7 @@ class AMDSMICommands(): if not self.all_arguments: raise e if args.caps: - try: - caps_info = amdsmi_interface.amdsmi_get_caps_info(args.gpu) - caps_info.pop('mm_ip_list') - caps_info.pop('ras_supported') - - if self.logger.is_human_readable_format(): - for capability_name, capability_value in caps_info.items(): - if isinstance(capability_value, list): - caps_info[capability_name] = f"{capability_value}" - if isinstance(capability_value, bool): - caps_info[capability_name] = f"{bool(capability_value)}" - - static_dict['caps'] = caps_info - except amdsmi_exception.AmdSmiLibraryException as e: - static_dict['caps'] = e.get_error_info() - if not self.all_arguments: - raise e + pass if (self.helpers.is_linux() and self.helpers.is_baremetal()): if args.numa: try: @@ -1055,18 +1037,7 @@ class AMDSMICommands(): elif not self.all_arguments: raise e if args.energy: - try: - energy = amdsmi_interface.amdsmi_get_power_info(args.gpu)['energy_accumulator'] - - if self.logger.is_human_readable_format(): - unit = 'J' - energy = f"{energy} {unit}" - - values_dict['energy'] = energy - except amdsmi_exception.AmdSmiLibraryException as e: - values_dict['energy'] = e.get_error_info() - if not self.all_arguments: - raise e + pass if args.mem_usage: memory_total = {} try: diff --git a/projects/amdsmi/example/amd_smi_drm_example.cc b/projects/amdsmi/example/amd_smi_drm_example.cc index cce662d68f..f67895cc7d 100644 --- a/projects/amdsmi/example/amd_smi_drm_example.cc +++ b/projects/amdsmi/example/amd_smi_drm_example.cc @@ -286,7 +286,6 @@ int main() { CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_gpu_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); - printf("\tFamilyID: 0x%x\n", asic_info.family); printf("\tDeviceID: 0x%lx\n", asic_info.device_id); printf("\tVendorID: 0x%x\n", asic_info.vendor_id); printf("\tRevisionID: 0x%x\n", asic_info.rev_id); @@ -300,9 +299,8 @@ int main() { printf("\tVBios Name: %s\n", vbios_info.name); printf("\tBuild Date: %s\n", vbios_info.build_date); printf("\tPart Number: %s\n", vbios_info.part_number); - printf("\tVBios Version: %d\n", vbios_info.vbios_version); printf("\tVBios Version String: %s\n\n", - vbios_info.vbios_version_string); + vbios_info.version); // Get power measure amdsmi_power_info_t power_measure = {}; @@ -313,8 +311,6 @@ int main() { power_measure.gfx_voltage); printf("\tAverage socket power: %d\n", power_measure.average_socket_power); - printf("\tEnergy accumulator: %ld\n\n", - power_measure.energy_accumulator); printf("\tGPU Power limit: %d\n\n", power_measure.power_limit); // Get driver version @@ -341,7 +337,7 @@ int main() { printf("\tAverage GFX Activity: %d\n", engine_usage.gfx_activity); printf("\tAverage MM Activity: %d\n", - engine_usage.mm_activity[0]); + engine_usage.mm_activity); printf("\tAverage UMC Activity: %d\n\n", engine_usage.umc_activity); @@ -364,7 +360,6 @@ int main() { CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_clock_info:\n"); printf("\tGPU GFX Max Clock: %d\n", gfx_clk_values.max_clk); - printf("\tGPU GFX Average Clock: %d\n", gfx_clk_values.avg_clk); printf("\tGPU GFX Current Clock: %d\n", gfx_clk_values.cur_clk); // Get MEM clock measurements @@ -373,7 +368,6 @@ int main() { &mem_clk_values); CHK_AMDSMI_RET(ret) printf("\tGPU MEM Max Clock: %d\n", mem_clk_values.max_clk); - printf("\tGPU MEM Average Clock: %d\n", mem_clk_values.avg_clk); printf("\tGPU MEM Current Clock: %d\n\n", mem_clk_values.cur_clk); // Get PCIe status @@ -524,7 +518,7 @@ int main() { amdsmi_proc_info_t info_list[num_process]; amdsmi_proc_info_t process = {}; uint64_t mem = 0, gtt_mem = 0, cpu_mem = 0, vram_mem = 0; - uint64_t gfx = 0, comp = 0, dma = 0, enc = 0, dec = 0; + uint64_t gfx = 0, enc = 0; char bdf_str[20]; sprintf(bdf_str, "%04lx:%02x:%02x.%d", bdf.domain_number, bdf.bus_number, bdf.device_number, bdf.function_number); @@ -556,8 +550,8 @@ int main() { "engine usage (ns) |\n"); printf("| | | | " "| | | | " - " | gfx comp dma enc dec |\n"); - printf("+=======+==================+============+==============" + " | gfx enc |\n"); + printf("+=======+" "+=============+=============+=============+============" "==+=========================================+\n"); for (int it = 0; it < num; it++) { @@ -571,41 +565,30 @@ int main() { pwd = getpwuid(st.st_uid); if (!pwd) printf("| %5d | %16s | %10d | %s | %7ld KiB | %7ld KiB " - "| %7ld KiB | %7ld KiB | %lu %lu %lu " - "%lu %lu |\n", + "| %7ld KiB | %7ld KiB | %lu %lu |\n", info_list[it].pid, info_list[it].name, st.st_uid, bdf_str, info_list[it].mem / 1024, info_list[it].memory_usage.gtt_mem / 1024, info_list[it].memory_usage.cpu_mem / 1024, info_list[it].memory_usage.vram_mem / 1024, info_list[it].engine_usage.gfx, - info_list[it].engine_usage.compute, - info_list[it].engine_usage.dma, - info_list[it].engine_usage.enc, - info_list[it].engine_usage.dec); + info_list[it].engine_usage.enc); else printf("| %5d | %16s | %10s | %s | %7ld KiB | %7ld KiB " - "| %7ld KiB | %7ld KiB | %lu %lu %lu " - "%lu %lu |\n", + "| %7ld KiB | %7ld KiB | %lu %lu |\n", info_list[it].pid, info_list[it].name, pwd->pw_name, bdf_str, info_list[it].mem / 1024, info_list[it].memory_usage.gtt_mem / 1024, info_list[it].memory_usage.cpu_mem / 1024, info_list[it].memory_usage.vram_mem / 1024, info_list[it].engine_usage.gfx, - info_list[it].engine_usage.compute, - info_list[it].engine_usage.dma, - info_list[it].engine_usage.enc, - info_list[it].engine_usage.dec); + info_list[it].engine_usage.enc); mem += info_list[it].mem / 1024; gtt_mem += info_list[it].memory_usage.gtt_mem / 1024; cpu_mem += info_list[it].memory_usage.cpu_mem / 1024; vram_mem += info_list[it].memory_usage.vram_mem / 1024; gfx = info_list[it].engine_usage.gfx; - comp = info_list[it].engine_usage.compute; - dma = info_list[it].engine_usage.dma; enc = info_list[it].engine_usage.enc; - dec = info_list[it].engine_usage.dec; printf( "+-------+------------------+------------+-------------" "-+-------------+-------------+-------------+----------" @@ -614,8 +597,8 @@ int main() { printf("| TOTAL:| %s | %7ld " "KiB | %7ld KiB | %7ld KiB | %7ld KiB | %lu %lu " "%lu %lu %lu |\n", - bdf_str, mem, gtt_mem, cpu_mem, vram_mem, gfx, comp, dma, - enc, dec); + bdf_str, mem, gtt_mem, cpu_mem, vram_mem, gfx, + enc); printf("+=======+==================+============+==============" "+=============+=============+=============+============" "=+==========================================+\n"); @@ -651,22 +634,6 @@ int main() { std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used << "/" << vram_usage.vram_total << "\n\n"; - // Get Cap info - amdsmi_gpu_caps_t caps_info = {}; - ret = amdsmi_get_caps_info(processor_handles[j], &caps_info); - CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_caps_info:\n"); - std::cout << "\t\tGFX IP Major: " << caps_info.gfx.gfxip_major - << "\n" - << "\t\tGFX IP Minor: " << caps_info.gfx.gfxip_minor - << "\n" - << "\t\tCU IP Count: " << caps_info.gfx.gfxip_cu_count - << "\n" - << "\t\tDMA IP Count: " << caps_info.dma_ip_count << "\n" - << "\t\tGFX IP Count: " << caps_info.gfx_ip_count << "\n" - << "\t\tMM IP Count: " << int(caps_info.mm.mm_ip_count) - << "\n\n"; - amdsmi_power_cap_info_t cap_info = {}; ret = amdsmi_get_power_cap_info(processor_handles[j], 0, &cap_info); CHK_AMDSMI_RET(ret) diff --git a/projects/amdsmi/example/amd_smi_nodrm_example.cc b/projects/amdsmi/example/amd_smi_nodrm_example.cc index 6a8325f7b1..7222bdf339 100644 --- a/projects/amdsmi/example/amd_smi_nodrm_example.cc +++ b/projects/amdsmi/example/amd_smi_nodrm_example.cc @@ -131,7 +131,6 @@ int main() { CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_gpu_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); - printf("\tFamilyID: 0x%x\n", asic_info.family); printf("\tDeviceID: 0x%lx\n", asic_info.device_id); printf("\tVendorID: 0x%x\n", asic_info.vendor_id); printf("\tRevisionID: 0x%x\n", asic_info.rev_id); @@ -145,9 +144,8 @@ int main() { printf("\tVBios Name: %s\n", vbios_info.name); printf("\tBuild Date: %s\n", vbios_info.build_date); printf("\tPart Number: %s\n", vbios_info.part_number); - printf("\tVBios Version: %d\n", vbios_info.vbios_version); printf("\tVBios Version String: %s\n\n", - vbios_info.vbios_version_string); + vbios_info.version); // Get engine usage info amdsmi_engine_usage_t engine_usage = {}; @@ -157,7 +155,7 @@ int main() { printf("\tAverage GFX Activity: %d\n", engine_usage.gfx_activity); printf("\tAverage MM Activity: %d\n", - engine_usage.mm_activity[0]); + engine_usage.mm_activity); printf("\tAverage UMC Activity: %d\n\n", engine_usage.umc_activity); @@ -315,22 +313,6 @@ int main() { std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used << "/" << vram_usage.vram_total << "\n\n"; - // Get Cap info - amdsmi_gpu_caps_t caps_info = {}; - ret = amdsmi_get_caps_info(processor_handles[j], &caps_info); - CHK_AMDSMI_RET(ret) - printf(" Output of amdsmi_get_caps_info:\n"); - std::cout << "\t\tGFX IP Major: " << caps_info.gfx.gfxip_major - << "\n" - << "\t\tGFX IP Minor: " << caps_info.gfx.gfxip_minor - << "\n" - << "\t\tCU IP Count: " << caps_info.gfx.gfxip_cu_count - << "\n" - << "\t\tDMA IP Count: " << caps_info.dma_ip_count << "\n" - << "\t\tGFX IP Count: " << caps_info.gfx_ip_count << "\n" - << "\t\tMM IP Count: " << int(caps_info.mm.mm_ip_count) - << "\n\n"; - amdsmi_power_cap_info_t cap_info = {}; ret = amdsmi_get_power_cap_info(processor_handles[j], 0, &cap_info); CHK_AMDSMI_RET(ret) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 1e8a61a0b4..7618ab6477 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -284,29 +284,6 @@ typedef struct { uint32_t reserved[9]; } amdsmi_xgmi_info_t; -/** - * GPU Capability info - */ -typedef struct { - struct { - uint32_t gfxip_major; - uint32_t gfxip_minor; - uint16_t gfxip_cu_count; - uint32_t reserved[5]; - } gfx; - struct { - uint8_t mm_ip_count; - uint8_t mm_ip_list[AMDSMI_MAX_MM_IP_COUNT]; - uint32_t reserved[5]; - } mm; - - bool ras_supported; - uint8_t max_vf_num; - uint32_t gfx_ip_count; - uint32_t dma_ip_count; - uint32_t reserved[5]; -} amdsmi_gpu_caps_t; - typedef struct { uint32_t vram_total; uint32_t vram_used; @@ -339,10 +316,9 @@ typedef struct { typedef struct { char name[AMDSMI_MAX_STRING_LENGTH]; - uint32_t vbios_version; char build_date[AMDSMI_MAX_DATE_LENGTH]; char part_number[AMDSMI_MAX_STRING_LENGTH]; - char vbios_version_string[AMDSMI_NORMAL_STRING_LENGTH]; + char version[AMDSMI_NORMAL_STRING_LENGTH]; uint32_t reserved[15]; } amdsmi_vbios_info_t; @@ -358,7 +334,6 @@ typedef struct { typedef struct { char market_name[AMDSMI_MAX_STRING_LENGTH]; - uint32_t family; /**< Has zero value */ uint32_t vendor_id; //< Use 32 bit to be compatible with other platform. uint32_t subvendor_id; //< The subsystem vendor id uint64_t device_id; //< The unique id of a GPU @@ -378,17 +353,15 @@ typedef struct { typedef struct { uint32_t average_socket_power; - uint64_t energy_accumulator; // v1 mod. (32->64) uint32_t gfx_voltage; // GFX voltage measurement in mV uint32_t soc_voltage; // SOC voltage measurement in mV uint32_t mem_voltage; // MEM voltage measurement in mV uint32_t power_limit; // The power limit; - uint32_t reserved[9]; + uint32_t reserved[11]; } amdsmi_power_info_t; typedef struct { uint32_t cur_clk; - uint32_t avg_clk; uint32_t min_clk; uint32_t max_clk; uint32_t reserved[4]; @@ -397,8 +370,8 @@ typedef struct { typedef struct { uint32_t gfx_activity; uint32_t umc_activity; - uint32_t mm_activity[AMDSMI_MAX_MM_IP_COUNT]; - uint32_t reserved[6]; + uint32_t mm_activity; + uint32_t reserved[13]; } amdsmi_engine_usage_t; typedef uint32_t amdsmi_process_handle; @@ -409,10 +382,7 @@ typedef struct { uint64_t mem; /** in bytes */ struct { uint64_t gfx; - uint64_t compute; - uint64_t dma; uint64_t enc; - uint64_t dec; } engine_usage; /** How much time the process spend using these engines in ns */ struct { uint64_t gtt_mem; @@ -420,7 +390,7 @@ typedef struct { uint64_t vram_mem; } memory_usage; /** in bytes */ char container_name[AMDSMI_NORMAL_STRING_LENGTH]; - uint32_t reserved[10]; + uint32_t reserved[4]; } amdsmi_proc_info_t; //! Guaranteed maximum possible number of supported frequencies @@ -1625,30 +1595,6 @@ amdsmi_status_t amdsmi_set_gpu_pci_bandwidth(amdsmi_processor_handle processor_ * @{ */ -/** - * @brief Get the average power consumption of a processor - * - * @details This function will write the current average power consumption - * (in microwatts) to the uint64_t pointed to by @p power, for the given - * processor handle @p processor_handle and a pointer to a uint64_t @p power - * - * @param[in] processor_handle a processor handle - * - * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. - * If a processor has more than one sensor, it could be greater than 0. - * - * @param[in,out] power a pointer to uint64_t to which the average power - * consumption will be written - * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, - * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the - * provided arguments. - * - * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail - */ -amdsmi_status_t -amdsmi_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *power); - /** * @brief Get the energy accumulator counter of the processor with provided * processor handle. @@ -3621,7 +3567,7 @@ amdsmi_get_gpu_driver_version(amdsmi_processor_handle processor_handle, int *len * @brief Returns the ASIC information for the device * * @details This function returns ASIC information such as the product name, - * the family, the vendor ID, the subvendor ID, the device ID, + * the vendor ID, the subvendor ID, the device ID, * the revision ID and the serial number. * * @param[in] processor_handle Device which to query @@ -3677,20 +3623,6 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sen amdsmi_status_t amdsmi_get_xgmi_info(amdsmi_processor_handle processor_handle, amdsmi_xgmi_info_t *info); -/** - * @brief Returns the device capabilities as currently configured in - * the system - * - * @param[in] processor_handle Device which to query - * - * @param[out] info Reference to caps information structure. Must be - * allocated by user. - * - * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail - */ -amdsmi_status_t -amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_caps_t *info); - /** @} End asicinfo */ /*****************************************************************************/ diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 71cbabec9d..99ed3ac6ea 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -295,7 +295,6 @@ Output: Dictionary with fields Field | Content ---|--- `market_name` | market name -`family` | family `vendor_id` | vendor id `device_id` | device id `rev_id` | revision id @@ -316,7 +315,6 @@ try: for device in devices: asic_info = amdsmi_get_gpu_asic_info(device) print(asic_info['market_name']) - print(hex(asic_info['family'])) print(hex(asic_info['vendor_id'])) print(hex(asic_info['device_id'])) print(hex(asic_info['rev_id'])) @@ -364,46 +362,6 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_caps_info -Description: Returns capabilities as currently configured for the given GPU - -Input parameters: -* `processor_handle` device which to query - -Output: Dictionary with fields - -Field | Description ----|--- - `gfx` |
Subfield Description
`gfxip_major` major revision of GFX IP
`gfxip_minor`minor revision of GFX IP
`gfxip_cu_count`number of GFX compute units
- `mm_ip_list` | List of MM engines on the device, of AmdSmiMmIp type - `ras_supported` | `True` if ecc is supported, `False` if not - `gfx_ip_count` | Number of GFX engines on the device - `dma_ip_count` | Number of DMA engines on the device - -Exceptions that can be thrown by `amdsmi_get_caps_info` function: -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on machine") - else: - for device in devices: - caps_info = amdsmi_get_caps_info(device) - print(caps_info['ras_supported']) - print(caps_info['gfx']['gfxip_major']) - print(caps_info['gfx']['gfxip_minor']) - print(caps_info['gfx']['gfxip_cu_count']) - print(caps_info['mm_ip_list']) - print(caps_info['gfx_ip_count']) - print(caps_info['dma_ip_count']) -except AmdSmiException as e: - print(e) -``` ## amdsmi_get_gpu_vbios_info Description: Returns the static information for the VBIOS on the device. @@ -416,10 +374,9 @@ Output: Dictionary with fields Field | Description ---|--- `name` | vbios name -`vbios_version` | vbios current version `build_date` | vbios build date `part_number` | vbios part number -`vbios_version_string` | vbios version string +`version` | vbios version string Exceptions that can be thrown by `amdsmi_get_gpu_vbios_info` function: * `AmdSmiLibraryException` @@ -436,10 +393,9 @@ try: for device in devices: vbios_info = amdsmi_get_gpu_vbios_info(device) print(vbios_info['name']) - print(vbios_info['vbios_version']) print(vbios_info['build_date']) print(vbios_info['part_number']) - print(vbios_info['vbios_version_string']) + print(vbios_info['version']) except AmdSmiException as e: print(e) ``` @@ -489,7 +445,7 @@ Field | Description ---|--- `gfx_activity`| graphics engine usage percentage (0 - 100) `umc_activity` | memory engine usage percentage (0 - 100) -`mm_activity` | list of multimedia engine usages in percentage (0 - 100) +`mm_activity` | average multimedia engine usages in percentage (0 - 100) Exceptions that can be thrown by `amdsmi_get_gpu_activity` function: * `AmdSmiLibraryException` @@ -523,7 +479,6 @@ Field | Description ---|--- `average_socket_power`| average socket power `gfx_voltage` | voltage gfx -`energy_accumulator` | energy accumulator `power_limit` | power limit Exceptions that can be thrown by `amdsmi_get_power_info` function: @@ -542,7 +497,6 @@ try: power_measure = amdsmi_get_power_info(device) print(power_measure['average_socket_power']) print(power_measure['gfx_voltage']) - print(power_measure['energy_accumulator']) print(power_measure['power_limit']) except AmdSmiException as e: print(e) @@ -605,7 +559,6 @@ Output: Dictionary with fields Field | Description ---|--- `cur_clk`| Current clock for given clock type -`avg_clk` | Average clock for given clock type `min_clk` | Minimum clock for given clock type `max_clk` | Maximum clock for given clock type @@ -624,7 +577,6 @@ try: for device in devices: clock_measure = amdsmi_get_clock_info(device, AmdSmiClkType.GFX) print(clock_measure['cur_clk']) - print(clock_measure['avg_clk']) print(clock_measure['min_clk']) print(clock_measure['max_clk']) except AmdSmiException as e: @@ -852,7 +804,7 @@ Field | Description `name` | Name of process `pid` | Process ID `mem` | Process memory usage -`engine_usage`|
Subfield Description
`gfx`GFX engine usage in ns
`compute`Compute engine usage in ns
`dma`DMA engine usage in ns
`enc`Encode engine usage in ns
`dec`Decode engine usage in ns
+`engine_usage`|
Subfield Description
`gfx`GFX engine usage in ns
`enc`Encode engine usage in ns
`memory_usage`|
Subfield Description
`gtt_mem`GTT memory usage
`cpu_mem`CPU memory usage
`vram_mem`VRAM memory usage
Exceptions that can be thrown by `amdsmi_get_gpu_process_info` function: @@ -1490,37 +1442,6 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_power_ave - -Description: Get the average power consumption of the device - -Input parameters: - -* `processor_handle` device which to query -* `sensor_id` a 0-based sensor index. Normally, this will be 0. -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_get_power_ave` function: -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: -```python -try: - devices = gpuvsmi_get_devices() - if len(devices) == 0: - print("No GPUs on machine") - else: - for device in devices: - power = amdsmi_get_power_ave(device) - print(power) -except AmdSmiException as e: - print(e) -``` - ## amdsmi_get_energy_count diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index 1bde3e24be..af9293a7a4 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -39,7 +39,6 @@ from .amdsmi_interface import amdsmi_get_gpu_driver_version # # ASIC and Bus Static Information from .amdsmi_interface import amdsmi_get_gpu_asic_info from .amdsmi_interface import amdsmi_get_power_cap_info -from .amdsmi_interface import amdsmi_get_caps_info # # Microcode and VBIOS Information from .amdsmi_interface import amdsmi_get_gpu_vbios_info @@ -144,7 +143,6 @@ 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_get_power_ave from .amdsmi_interface import amdsmi_get_energy_count # # Memory information diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 957e16ceaa..700f3b543b 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -597,7 +597,6 @@ def amdsmi_get_gpu_asic_info( return { "market_name": asic_info.market_name.decode("utf-8"), - "family": asic_info.family, "vendor_id": asic_info.vendor_id, "device_id": asic_info.device_id, "rev_id": asic_info.rev_id, @@ -626,32 +625,6 @@ def amdsmi_get_power_cap_info( "min_power_cap": power_info.min_power_cap, "max_power_cap": power_info.max_power_cap} -def amdsmi_get_caps_info( - processor_handle: amdsmi_wrapper.amdsmi_processor_handle, -) -> Dict[str, Any]: - if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): - raise AmdSmiParameterException( - processor_handle, amdsmi_wrapper.amdsmi_processor_handle - ) - - gpu_caps = amdsmi_wrapper.amdsmi_gpu_caps_t() - _check_res( - amdsmi_wrapper.amdsmi_get_caps_info( - processor_handle, ctypes.byref(gpu_caps)) - ) - - return { - "gfx": { - "gfxip_major": gpu_caps.gfx.gfxip_major, - "gfxip_minor": gpu_caps.gfx.gfxip_minor, - "gfxip_cu_count": gpu_caps.gfx.gfxip_cu_count, - }, - "mm_ip_list": list(gpu_caps.mm.mm_ip_list), - "ras_supported": gpu_caps.ras_supported, - "gfx_ip_count": gpu_caps.gfx_ip_count, - "dma_ip_count": gpu_caps.dma_ip_count, - } - def amdsmi_get_gpu_vbios_info( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, @@ -669,10 +642,9 @@ def amdsmi_get_gpu_vbios_info( return { "name": vbios_info.name.decode("utf-8"), - "vbios_version_string": vbios_info.vbios_version_string.decode("utf-8"), + "version": vbios_info.version.decode("utf-8"), "build_date": vbios_info.build_date.decode("utf-8"), "part_number": vbios_info.part_number.decode("utf-8"), - "vbios_version": vbios_info.vbios_version, } @@ -694,7 +666,7 @@ def amdsmi_get_gpu_activity( return { "gfx_activity": engine_usage.gfx_activity, "umc_activity": engine_usage.umc_activity, - "mm_activity": list(engine_usage.mm_activity), + "mm_activity": engine_usage.mm_activity, } @@ -720,7 +692,6 @@ def amdsmi_get_clock_info( return { "cur_clk": clock_measure.cur_clk, - "avg_clk": clock_measure.avg_clk, "min_clk": clock_measure.min_clk, "max_clk": clock_measure.max_clk, } @@ -907,10 +878,7 @@ def amdsmi_get_gpu_process_info( "mem": info.mem, "engine_usage": { "gfx": info.engine_usage.gfx, - "compute": info.engine_usage.compute, - "dma": info.engine_usage.dma, - "enc": info.engine_usage.enc, - "dec": info.engine_usage.dec, + "enc": info.engine_usage.enc }, "memory_usage": { "gtt_mem": info.memory_usage.gtt_mem, @@ -980,7 +948,6 @@ def amdsmi_get_power_info( return { "average_socket_power": power_measure.average_socket_power, "gfx_voltage": power_measure.gfx_voltage, - "energy_accumulator": power_measure.energy_accumulator, "power_limit" : power_measure.power_limit, } @@ -1838,22 +1805,6 @@ def amdsmi_set_power_cap( ) -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 - ) - - power = ctypes.c_uint64() - - _check_res( - amdsmi_wrapper.amdsmi_get_power_ave( - processor_handle, sensor_id, ctypes.byref(power)) - ) - - return power.value - - def amdsmi_set_gpu_power_profile( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, reserved: int, diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 94b6220254..2d6b693a26 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -498,49 +498,11 @@ struct_c__SA_amdsmi_xgmi_info_t._fields_ = [ ('xgmi_hive_id', ctypes.c_uint64), ('xgmi_node_id', ctypes.c_uint64), ('index', ctypes.c_uint32), - ('reserved', ctypes.c_uint32 * 9), + ('number_adapters', ctypes.c_uint32), + ('reserved', ctypes.c_uint32 * 8), ] amdsmi_xgmi_info_t = struct_c__SA_amdsmi_xgmi_info_t -class struct_c__SA_amdsmi_gpu_caps_t(Structure): - pass - -class struct_c__SA_amdsmi_gpu_caps_t_0(Structure): - pass - -struct_c__SA_amdsmi_gpu_caps_t_0._pack_ = 1 # source:False -struct_c__SA_amdsmi_gpu_caps_t_0._fields_ = [ - ('gfxip_major', ctypes.c_uint32), - ('gfxip_minor', ctypes.c_uint32), - ('gfxip_cu_count', ctypes.c_uint16), - ('PADDING_0', ctypes.c_ubyte * 2), - ('reserved', ctypes.c_uint32 * 5), -] - -class struct_c__SA_amdsmi_gpu_caps_t_1(Structure): - pass - -struct_c__SA_amdsmi_gpu_caps_t_1._pack_ = 1 # source:False -struct_c__SA_amdsmi_gpu_caps_t_1._fields_ = [ - ('mm_ip_count', ctypes.c_ubyte), - ('mm_ip_list', ctypes.c_ubyte * 8), - ('PADDING_0', ctypes.c_ubyte * 3), - ('reserved', ctypes.c_uint32 * 5), -] - -struct_c__SA_amdsmi_gpu_caps_t._pack_ = 1 # source:False -struct_c__SA_amdsmi_gpu_caps_t._fields_ = [ - ('gfx', struct_c__SA_amdsmi_gpu_caps_t_0), - ('mm', struct_c__SA_amdsmi_gpu_caps_t_1), - ('ras_supported', ctypes.c_bool), - ('max_vf_num', ctypes.c_ubyte), - ('PADDING_0', ctypes.c_ubyte * 2), - ('gfx_ip_count', ctypes.c_uint32), - ('dma_ip_count', ctypes.c_uint32), - ('reserved', ctypes.c_uint32 * 5), -] - -amdsmi_gpu_caps_t = struct_c__SA_amdsmi_gpu_caps_t class struct_c__SA_amdsmi_vram_info_t(Structure): pass @@ -603,10 +565,9 @@ class struct_c__SA_amdsmi_vbios_info_t(Structure): struct_c__SA_amdsmi_vbios_info_t._pack_ = 1 # source:False struct_c__SA_amdsmi_vbios_info_t._fields_ = [ ('name', ctypes.c_char * 64), - ('vbios_version', ctypes.c_uint32), ('build_date', ctypes.c_char * 32), ('part_number', ctypes.c_char * 64), - ('vbios_version_string', ctypes.c_char * 32), + ('version', ctypes.c_char * 32), ('reserved', ctypes.c_uint32 * 15), ] @@ -641,14 +602,12 @@ class struct_c__SA_amdsmi_asic_info_t(Structure): struct_c__SA_amdsmi_asic_info_t._pack_ = 1 # source:False struct_c__SA_amdsmi_asic_info_t._fields_ = [ ('market_name', ctypes.c_char * 64), - ('family', ctypes.c_uint32), ('vendor_id', ctypes.c_uint32), ('subvendor_id', ctypes.c_uint32), - ('PADDING_0', ctypes.c_ubyte * 4), ('device_id', ctypes.c_uint64), ('rev_id', ctypes.c_uint32), ('asic_serial', ctypes.c_char * 32), - ('PADDING_1', ctypes.c_ubyte * 4), + ('PADDING_0', ctypes.c_ubyte * 4), ] amdsmi_asic_info_t = struct_c__SA_amdsmi_asic_info_t @@ -674,14 +633,11 @@ class struct_c__SA_amdsmi_power_info_t(Structure): struct_c__SA_amdsmi_power_info_t._pack_ = 1 # source:False struct_c__SA_amdsmi_power_info_t._fields_ = [ ('average_socket_power', ctypes.c_uint32), - ('PADDING_0', ctypes.c_ubyte * 4), - ('energy_accumulator', ctypes.c_uint64), ('gfx_voltage', ctypes.c_uint32), ('soc_voltage', ctypes.c_uint32), ('mem_voltage', ctypes.c_uint32), ('power_limit', ctypes.c_uint32), - ('reserved', ctypes.c_uint32 * 9), - ('PADDING_1', ctypes.c_ubyte * 4), + ('reserved', ctypes.c_uint32 * 11), ] amdsmi_power_info_t = struct_c__SA_amdsmi_power_info_t @@ -691,7 +647,6 @@ class struct_c__SA_amdsmi_clk_info_t(Structure): struct_c__SA_amdsmi_clk_info_t._pack_ = 1 # source:False struct_c__SA_amdsmi_clk_info_t._fields_ = [ ('cur_clk', ctypes.c_uint32), - ('avg_clk', ctypes.c_uint32), ('min_clk', ctypes.c_uint32), ('max_clk', ctypes.c_uint32), ('reserved', ctypes.c_uint32 * 4), @@ -705,8 +660,8 @@ struct_c__SA_amdsmi_engine_usage_t._pack_ = 1 # source:False struct_c__SA_amdsmi_engine_usage_t._fields_ = [ ('gfx_activity', ctypes.c_uint32), ('umc_activity', ctypes.c_uint32), - ('mm_activity', ctypes.c_uint32 * 8), - ('reserved', ctypes.c_uint32 * 6), + ('mm_activity', ctypes.c_uint32), + ('reserved', ctypes.c_uint32 * 13), ] amdsmi_engine_usage_t = struct_c__SA_amdsmi_engine_usage_t @@ -730,10 +685,7 @@ class struct_c__SA_amdsmi_proc_info_t_0(Structure): struct_c__SA_amdsmi_proc_info_t_0._pack_ = 1 # source:False struct_c__SA_amdsmi_proc_info_t_0._fields_ = [ ('gfx', ctypes.c_uint64), - ('compute', ctypes.c_uint64), - ('dma', ctypes.c_uint64), ('enc', ctypes.c_uint64), - ('dec', ctypes.c_uint64), ] struct_c__SA_amdsmi_proc_info_t._pack_ = 1 # source:False @@ -745,7 +697,7 @@ struct_c__SA_amdsmi_proc_info_t._fields_ = [ ('engine_usage', struct_c__SA_amdsmi_proc_info_t_0), ('memory_usage', struct_c__SA_amdsmi_proc_info_t_1), ('container_name', ctypes.c_char * 32), - ('reserved', ctypes.c_uint32 * 10), + ('reserved', ctypes.c_uint32 * 4), ] amdsmi_proc_info_t = struct_c__SA_amdsmi_proc_info_t @@ -1458,9 +1410,6 @@ 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_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_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)] @@ -1686,9 +1635,6 @@ amdsmi_get_power_cap_info.argtypes = [amdsmi_processor_handle, uint32_t, ctypes. amdsmi_get_xgmi_info = _libraries['libamd_smi.so'].amdsmi_get_xgmi_info amdsmi_get_xgmi_info.restype = amdsmi_status_t amdsmi_get_xgmi_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_xgmi_info_t)] -amdsmi_get_caps_info = _libraries['libamd_smi.so'].amdsmi_get_caps_info -amdsmi_get_caps_info.restype = amdsmi_status_t -amdsmi_get_caps_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_gpu_caps_t)] amdsmi_get_fw_info = _libraries['libamd_smi.so'].amdsmi_get_fw_info amdsmi_get_fw_info.restype = amdsmi_status_t amdsmi_get_fw_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_fw_info_t)] @@ -1864,11 +1810,10 @@ __all__ = \ 'amdsmi_func_id_iter_handle_t', 'amdsmi_func_id_value_t', 'amdsmi_fw_block_t', 'amdsmi_fw_block_t__enumvalues', 'amdsmi_fw_info_t', 'amdsmi_get_busy_percent', - 'amdsmi_get_caps_info', 'amdsmi_get_clk_freq', - 'amdsmi_get_clock_info', 'amdsmi_get_energy_count', - 'amdsmi_get_func_iter_value', 'amdsmi_get_fw_info', - 'amdsmi_get_gpu_activity', 'amdsmi_get_gpu_asic_info', - 'amdsmi_get_gpu_available_counters', + 'amdsmi_get_clk_freq', 'amdsmi_get_clock_info', + 'amdsmi_get_energy_count', 'amdsmi_get_func_iter_value', + 'amdsmi_get_fw_info', 'amdsmi_get_gpu_activity', + 'amdsmi_get_gpu_asic_info', 'amdsmi_get_gpu_available_counters', 'amdsmi_get_gpu_bad_page_info', 'amdsmi_get_gpu_board_info', 'amdsmi_get_gpu_compute_process_gpus', 'amdsmi_get_gpu_compute_process_info', @@ -1898,16 +1843,14 @@ __all__ = \ 'amdsmi_get_gpu_vendor_name', 'amdsmi_get_gpu_volt_metric', 'amdsmi_get_gpu_vram_usage', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_get_minmax_bandwidth', 'amdsmi_get_pcie_link_caps', - 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_ave', - 'amdsmi_get_power_cap_info', 'amdsmi_get_power_info', - 'amdsmi_get_processor_handle_from_bdf', + 'amdsmi_get_pcie_link_status', 'amdsmi_get_power_cap_info', + 'amdsmi_get_power_info', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_processor_type', 'amdsmi_get_socket_handles', 'amdsmi_get_socket_info', 'amdsmi_get_temp_metric', 'amdsmi_get_utilization_count', 'amdsmi_get_version', 'amdsmi_get_version_str', 'amdsmi_get_xgmi_info', 'amdsmi_gpu_block_t', - 'amdsmi_gpu_block_t__enumvalues', 'amdsmi_gpu_caps_t', - 'amdsmi_gpu_control_counter', + 'amdsmi_gpu_block_t__enumvalues', '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_xgmi_error_status', @@ -1988,9 +1931,6 @@ __all__ = \ 'struct_c__SA_amdsmi_frequency_range_t', 'struct_c__SA_amdsmi_fw_info_t', 'struct_c__SA_amdsmi_fw_info_t_0', - 'struct_c__SA_amdsmi_gpu_caps_t', - 'struct_c__SA_amdsmi_gpu_caps_t_0', - 'struct_c__SA_amdsmi_gpu_caps_t_1', 'struct_c__SA_amdsmi_gpu_metrics_t', 'struct_c__SA_amdsmi_od_vddc_point_t', 'struct_c__SA_amdsmi_od_volt_curve_t', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index f2d81110ba..b478db80d8 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -298,7 +298,6 @@ 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_get_power_ave ") + """ | | """ + self.style.text("13 Get device energy count. Api: amdsmi_get_energy_count ") + """ | | """ + self.style.text("14 Get device memory total. Api: amdsmi_get_gpu_memory_total ") + """ | | """ + self.style.text("15 Get device memory usage. Api: amdsmi_get_gpu_memory_usage ") + """ | @@ -375,10 +374,6 @@ class Formatter: ############################################## # SMI tool wrapper ############################################## -def amdsmi_tool_dev_power_ave_get(dev, dic): - sensor_id = dic["sensor_id"] - return smi_api.amdsmi_get_power_ave(dev, ctypes.c_uint32(sensor_id)) - def amdsmi_tool_dev_memory_total_get(dev): result = {} for memory_type in smi_api.AmdSmiMemoryType: diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 1732803a36..87ff9f566a 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -388,96 +388,6 @@ amdsmi_status_t amdsmi_get_gpu_vram_usage(amdsmi_processor_handle processor_hand return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, - amdsmi_gpu_caps_t *info) { - - AMDSMI_CHECK_INIT(); - - if (info == nullptr) { - return AMDSMI_STATUS_INVAL; - } - - amd::smi::AMDSmiProcessor* amd_device = nullptr; - amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() - .handle_to_processor(processor_handle, &amd_device); - if (ret != AMDSMI_STATUS_SUCCESS) return ret; - - if (amd_device->get_processor_type() != AMD_GPU) { - return AMDSMI_STATUS_NOT_SUPPORTED; - } - amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); - if (r != AMDSMI_STATUS_SUCCESS) - return r; - - unsigned uvd, vce, uvd_enc, vcn_enc; - struct drm_amdgpu_info_hw_ip ip; - struct drm_amdgpu_info_device device; - unsigned count, j; - - r = gpu_device->amdgpu_query_info(AMDGPU_INFO_DEV_INFO, - sizeof(struct drm_amdgpu_info_device), &device); - if (r != AMDSMI_STATUS_SUCCESS) return r; - - info->gfx.gfxip_cu_count = (uint16_t)device.cu_active_number; - - r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_INFO, - AMDGPU_HW_IP_GFX, sizeof(ip), &ip); - if (r != AMDSMI_STATUS_SUCCESS) return r; - - info->gfx.gfxip_major = ip.hw_ip_version_major; - info->gfx.gfxip_minor = ip.hw_ip_version_minor; - - r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT, - AMDGPU_HW_IP_GFX, sizeof(unsigned), &count); - if (r != AMDSMI_STATUS_SUCCESS) return r; - info->gfx_ip_count = count; - - r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT, - AMDGPU_HW_IP_DMA, sizeof(unsigned), &count); - if (r != AMDSMI_STATUS_SUCCESS) return r; - info->dma_ip_count = count; - - - count = 0; - /* Count multimedia engines */ - r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT, - AMDGPU_HW_IP_UVD, sizeof(struct drm_amdgpu_info_device), &uvd); - if (r != AMDSMI_STATUS_SUCCESS) return r; - - for (j = 0; j < uvd; j++) - info->mm.mm_ip_list[count++] = AMDSMI_MM_UVD; - - r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT, - AMDGPU_HW_IP_UVD_ENC, sizeof(struct drm_amdgpu_info_device), &uvd_enc); - if (r != AMDSMI_STATUS_SUCCESS) return r; - - for (j = 0; j < uvd_enc; j++) - info->mm.mm_ip_list[count++] = AMDSMI_MM_UVD; - - r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT, - AMDGPU_HW_IP_VCE, sizeof(struct drm_amdgpu_info_device), &vce); - if (r != AMDSMI_STATUS_SUCCESS) return r; - - for (j = 0; j < vce; j++) - info->mm.mm_ip_list[count++] = AMDSMI_MM_VCE; - - /* VCN is shared DEC/ENC check only ENC */ - r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT, - AMDGPU_HW_IP_VCN_ENC, sizeof(struct drm_amdgpu_info_device), - &vcn_enc); - if (r != AMDSMI_STATUS_SUCCESS) return r; - - for (j = 0; j < vcn_enc; j++) - info->mm.mm_ip_list[count++] = AMDSMI_MM_VCN; - - info->mm.mm_ip_count = static_cast(count); - - info->ras_supported = false; - - return AMDSMI_STATUS_SUCCESS; -} - amdsmi_status_t amdsmi_get_gpu_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed) { return rsmi_wrapper(rsmi_dev_fan_rpms_get, processor_handle, sensor_ind, @@ -597,7 +507,6 @@ amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_i } info->device_id = dev_info.device_id; - info->family = dev_info.family; info->rev_id = dev_info.pci_rev; info->vendor_id = gpu_device->get_vendor_id(); } @@ -938,7 +847,6 @@ 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_get_gpu_ecc_count"}, {"rsmi_counter_available_counters_get", " amdsmi_get_gpu_available_counters"}, - {"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"}, @@ -1130,16 +1038,6 @@ amdsmi_status_t sensor_ind, cap); } -amdsmi_status_t -amdsmi_get_power_ave(amdsmi_processor_handle processor_handle, - uint32_t sensor_ind, uint64_t *power) { - AMDSMI_CHECK_INIT(); - - if (power == nullptr) - return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_power_ave_get, processor_handle, - sensor_ind, power); -} amdsmi_status_t amdsmi_get_gpu_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, @@ -1446,8 +1344,7 @@ amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios strncpy(info->name, (char *) vbios.name, AMDSMI_MAX_STRING_LENGTH); strncpy(info->build_date, (char *) vbios.date, AMDSMI_MAX_DATE_LENGTH); strncpy(info->part_number, (char *) vbios.vbios_pn, AMDSMI_MAX_STRING_LENGTH); - strncpy(info->vbios_version_string, (char *) vbios.vbios_ver_str, AMDSMI_NORMAL_STRING_LENGTH); - info->vbios_version = vbios.version; + strncpy(info->version, (char *) vbios.vbios_ver_str, AMDSMI_NORMAL_STRING_LENGTH); } else { // get vbios version string from rocm_smi @@ -1458,7 +1355,7 @@ amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios // ignore the errors so that it can populate as many fields as possible. if (status == AMDSMI_STATUS_SUCCESS) { - strncpy(info->vbios_version_string, + strncpy(info->version, vbios_version, AMDSMI_NORMAL_STRING_LENGTH); } } @@ -1485,7 +1382,7 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_ return status; } info->gfx_activity = metrics.average_gfx_activity; - info->mm_activity[0] = metrics.average_mm_activity; + info->mm_activity = metrics.average_mm_activity; info->umc_activity = metrics.average_umc_activity; return AMDSMI_STATUS_SUCCESS; @@ -1524,19 +1421,15 @@ amdsmi_get_clock_info(amdsmi_processor_handle processor_handle, amdsmi_clk_type_ switch (clk_type) { case CLK_TYPE_GFX: - info->avg_clk = metrics.average_gfxclk_frequency; info->cur_clk = metrics.current_gfxclk; break; case CLK_TYPE_MEM: - info->avg_clk = metrics.average_uclk_frequency; info->cur_clk = metrics.current_uclk; break; case CLK_TYPE_VCLK0: - info->avg_clk = metrics.average_vclk0_frequency; info->cur_clk = metrics.current_vclk0; break; case CLK_TYPE_VCLK1: - info->avg_clk = metrics.average_vclk1_frequency; info->cur_clk = metrics.current_vclk1; break; default: @@ -1735,7 +1628,6 @@ amdsmi_get_power_info(amdsmi_processor_handle processor_handle, amdsmi_power_inf info->gfx_voltage = voltage_read; info->average_socket_power = metrics.average_socket_power; - info->energy_accumulator = metrics.energy_accumulator; return status; } diff --git a/projects/amdsmi/src/amd_smi/fdinfo.cc b/projects/amdsmi/src/amd_smi/fdinfo.cc index 0876e7990a..81b80da6d4 100644 --- a/projects/amdsmi/src/amd_smi/fdinfo.cc +++ b/projects/amdsmi/src/amd_smi/fdinfo.cc @@ -191,20 +191,6 @@ amdsmi_status_t gpuvsmi_get_pid_info(const amdsmi_bdf_t &bdf, long int pid, continue; info.engine_usage.gfx = engine_gfx; - } else if (line.find("drm-engine-compute") != std::string::npos) { - uint64_t engine_compute; - - if (sscanf(line.c_str(), "drm-engine-compute: %lu", &engine_compute) != 1) - continue; - - info.engine_usage.compute = engine_compute; - } else if (line.find("drm-engine-dma") != std::string::npos) { - uint64_t engine_dma; - - if (sscanf(line.c_str(), "drm-engine-dma: %lu", &engine_dma) != 1) - continue; - - info.engine_usage.dma = engine_dma; } else if (line.find("drm-engine-enc") != std::string::npos) { uint64_t engine_enc; @@ -212,13 +198,6 @@ amdsmi_status_t gpuvsmi_get_pid_info(const amdsmi_bdf_t &bdf, long int pid, continue; info.engine_usage.enc = engine_enc; - } else if (line.find("drm-engine-dec") != std::string::npos) { - uint64_t engine_dec; - - if (sscanf(line.c_str(), "drm-engine-dec: %lu", &engine_dec) != 1) - continue; - - info.engine_usage.dec = engine_dec; } } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index 26a2d97590..116b624d2a 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -283,7 +283,6 @@ void TestMutualExclusion::Run(void) { amdsmi_get_gpu_metrics_info amdsmi_get_gpu_od_volt_curve_regions amdsmi_dev_power_max_get - amdsmi_get_power_ave amdsmi_dev_power_cap_get amdsmi_dev_power_cap_range_get amdsmi_set_power_cap diff --git a/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc index 3246025939..d1f9a4a7e4 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/power_read.cc @@ -111,18 +111,6 @@ void TestPowerRead::Run(void) { std::cout << "\t**Power Cap Range: " << info.min_power_cap << " to " << info.max_power_cap << " uW" << std::endl; } - - 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) - if (err == AMDSMI_STATUS_SUCCESS) { - std::cout << static_cast(val_ui64)/1000 << " mW" << std::endl; - } - // Verify api support checking functionality is working - err = amdsmi_get_power_ave(processor_handles_[i], 0, nullptr); - ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - } } } } diff --git a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc index b7d3c12dfc..334b30e79a 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/sys_info_read.cc @@ -124,7 +124,7 @@ void TestSysInfoRead::Run(void) { } else { IF_VERB(STANDARD) { std::cout << "\t**VBIOS Version: " - << info.vbios_version_string << std::endl; + << info.version << std::endl; } } From 09940e45df6471f27eb0dc25a4ff0b2311e80dd5 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Sun, 21 May 2023 11:38:00 -0500 Subject: [PATCH 90/95] AMD-SMI-CLI - Updated amdsmi_interface calls to new headers Change-Id: I031f08c912f2cc77bba3a6f4356b5121072fb71e Signed-off-by: Maisam Arif [ROCm/amdsmi commit: 01bd64c718eb788bc3069f802de2c1cef7399c1c] --- projects/amdsmi/amdsmi_cli/amdsmi_cli.py | 3 +- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 152 +++++++++--------- projects/amdsmi/amdsmi_cli/amdsmi_helpers.py | 18 +-- projects/amdsmi/py-interface/__init__.py | 48 +++--- 4 files changed, 111 insertions(+), 110 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_cli.py b/projects/amdsmi/amdsmi_cli/amdsmi_cli.py index 2381c88669..23564faa55 100755 --- a/projects/amdsmi/amdsmi_cli/amdsmi_cli.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_cli.py @@ -28,6 +28,7 @@ from amdsmi_parser import AMDSMIParser from amdsmi_logger import AMDSMILogger import amdsmi_cli_exceptions from amdsmi import amdsmi_interface +from amdsmi import amdsmi_exception def _print_error(e, destination): @@ -85,6 +86,6 @@ if __name__ == "__main__": args.func(args) except amdsmi_cli_exceptions.AmdSmiException as e: _print_error(str(e), amd_smi_commands.logger.destination) - except amdsmi_interface.AmdSmiLibraryException as e: + except amdsmi_exception.AmdSmiLibraryException as e: exc = amdsmi_cli_exceptions.AmdSmiAMDSMIErrorException(amd_smi_commands.logger.format, e.get_error_code()) _print_error(str(exc), amd_smi_commands.logger.destination) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 1653858868..f63ecb2766 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -44,7 +44,7 @@ class AMDSMICommands(): format=format, destination=destination) try: - self.device_handles = amdsmi_interface.amdsmi_get_device_handles() + self.device_handles = amdsmi_interface.amdsmi_get_processor_handles() except amdsmi_exception.AmdSmiLibraryException as e: raise e self.stop = '' @@ -117,12 +117,12 @@ class AMDSMICommands(): args.gpu = device_handle try: - bdf = amdsmi_interface.amdsmi_get_device_bdf(args.gpu) + bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: bdf = e.get_error_info() try: - uuid = amdsmi_interface.amdsmi_get_device_uuid(args.gpu) + uuid = amdsmi_interface.amdsmi_get_gpu_device_uuid(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: uuid = e.get_error_info() @@ -215,7 +215,7 @@ class AMDSMICommands(): if args.asic: try: - asic_info = amdsmi_interface.amdsmi_get_asic_info(args.gpu) + asic_info = amdsmi_interface.amdsmi_get_gpu_asic_info(args.gpu) asic_info['vendor_id'] = hex(asic_info['vendor_id']) asic_info['device_id'] = hex(asic_info['device_id']) asic_info['rev_id'] = hex(asic_info['rev_id']) @@ -242,7 +242,7 @@ class AMDSMICommands(): raise e try: - bus_output_info['bdf'] = amdsmi_interface.amdsmi_get_device_bdf(args.gpu) + bus_output_info['bdf'] = amdsmi_interface.amdsmi_get_gpu_device_bdf(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: bus_output_info['bdf'] = e.get_error_info() if not self.all_arguments: @@ -252,7 +252,7 @@ class AMDSMICommands(): static_dict['bus'] = bus_output_info if args.vbios: try: - vbios_info = amdsmi_interface.amdsmi_get_vbios_info(args.gpu) + vbios_info = amdsmi_interface.amdsmi_get_gpu_vbios_info(args.gpu) if self.logger.is_gpuvsmi_compatibility(): vbios_info['version'] = vbios_info.pop('version') vbios_info['build_date'] = vbios_info.pop('build_date') @@ -266,7 +266,7 @@ class AMDSMICommands(): if (self.helpers.is_linux() and self.helpers.is_baremetal()): if args.board: try: - board_info = amdsmi_interface.amdsmi_get_board_info(args.gpu) + board_info = amdsmi_interface.amdsmi_get_gpu_board_info(args.gpu) board_info['serial_number'] = hex(board_info['serial_number']) board_info['product_serial'] = '0x' + board_info['product_serial'] @@ -288,7 +288,7 @@ class AMDSMICommands(): raise e try: - temp_edge_limit = amdsmi_interface.amdsmi_dev_get_temp_metric(args.gpu, + temp_edge_limit = amdsmi_interface.amdsmi_get_temp_metric(args.gpu, amdsmi_interface.AmdSmiTemperatureType.EDGE, amdsmi_interface.AmdSmiTemperatureMetric.CRITICAL) except amdsmi_exception.AmdSmiLibraryException as e: temp_edge_limit = e.get_error_info() @@ -296,7 +296,7 @@ class AMDSMICommands(): raise e try: - temp_junction_limit = amdsmi_interface.amdsmi_dev_get_temp_metric(args.gpu, + temp_junction_limit = amdsmi_interface.amdsmi_get_temp_metric(args.gpu, amdsmi_interface.AmdSmiTemperatureType.JUNCTION, amdsmi_interface.AmdSmiTemperatureMetric.CRITICAL) except amdsmi_exception.AmdSmiLibraryException as e: temp_junction_limit = e.get_error_info() @@ -304,7 +304,7 @@ class AMDSMICommands(): raise e try: - temp_vram_limit = amdsmi_interface.amdsmi_dev_get_temp_metric(args.gpu, + temp_vram_limit = amdsmi_interface.amdsmi_get_temp_metric(args.gpu, amdsmi_interface.AmdSmiTemperatureType.VRAM, amdsmi_interface.AmdSmiTemperatureMetric.CRITICAL) except amdsmi_exception.AmdSmiLibraryException as e: temp_junction_limit = e.get_error_info() @@ -330,7 +330,7 @@ class AMDSMICommands(): if args.driver: try: driver_info = {} - driver_info['driver_version'] = amdsmi_interface.amdsmi_get_driver_version(args.gpu) + driver_info['driver_version'] = amdsmi_interface.amdsmi_get_gpu_driver_version(args.gpu) static_dict['driver'] = driver_info except amdsmi_exception.AmdSmiLibraryException as e: @@ -340,7 +340,7 @@ class AMDSMICommands(): if (self.helpers.is_linux() and self.helpers.is_baremetal()): if args.ras: try: - static_dict['ras'] = amdsmi_interface.amdsmi_get_ras_block_features_enabled(args.gpu) + static_dict['ras'] = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NOT_SUPPORTED: static_dict['ras'] = 'N/A' @@ -360,7 +360,7 @@ class AMDSMICommands(): raise e try: - numa_affinity = amdsmi_interface.amdsmi_topo_get_numa_affinity(args.gpu) + numa_affinity = amdsmi_interface.amdsmi_get_gpu_topo_numa_affinity(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: numa_affinity = e.get_error_info() if not self.all_arguments: @@ -529,7 +529,7 @@ class AMDSMICommands(): bad_page_err_output = '' try: - bad_page_info = amdsmi_interface.amdsmi_get_bad_page_info(args.gpu) + bad_page_info = amdsmi_interface.amdsmi_get_gpu_bad_page_info(args.gpu) bad_page_error = False except amdsmi_exception.AmdSmiLibraryException as e: bad_page_info = "" @@ -772,7 +772,7 @@ class AMDSMICommands(): raise e if args.fb_usage: try: - vram_usage = amdsmi_interface.amdsmi_get_vram_usage(args.gpu) + vram_usage = amdsmi_interface.amdsmi_get_gpu_vram_usage(args.gpu) if self.logger.is_gpuvsmi_compatibility(): vram_usage['fb_total'] = vram_usage.pop('vram_total') @@ -821,7 +821,7 @@ class AMDSMICommands(): power_dict['current_mem_voltage'] = power_dict.pop('mem_voltage') try: - power_dict['current_fan_rpm'] = amdsmi_interface.amdsmi_dev_get_fan_rpms(args.gpu, 0) + power_dict['current_fan_rpm'] = amdsmi_interface.amdsmi_get_gpu_fan_rpms(args.gpu, 0) if self.logger.is_human_readable_format(): power_dict['current_fan_rpm'] = f"{power_dict['current_fan_rpm']} RPM" except amdsmi_exception.AmdSmiLibraryException as e: @@ -851,11 +851,11 @@ class AMDSMICommands(): raise e if args.temperature: try: - temperature_edge_current = amdsmi_interface.amdsmi_dev_get_temp_metric( + temperature_edge_current = amdsmi_interface.amdsmi_get_temp_metric( args.gpu, amdsmi_interface.AmdSmiTemperatureType.EDGE, amdsmi_interface.AmdSmiTemperatureMetric.CURRENT) - temperature_junction_current = amdsmi_interface.amdsmi_dev_get_temp_metric( + temperature_junction_current = amdsmi_interface.amdsmi_get_temp_metric( args.gpu, amdsmi_interface.AmdSmiTemperatureType.JUNCTION, amdsmi_interface.AmdSmiTemperatureMetric.CURRENT) - temperature_vram_current = amdsmi_interface.amdsmi_dev_get_temp_metric( + temperature_vram_current = amdsmi_interface.amdsmi_get_temp_metric( args.gpu, amdsmi_interface.AmdSmiTemperatureType.VRAM, amdsmi_interface.AmdSmiTemperatureMetric.CURRENT) temperatures = {'edge': temperature_edge_current, @@ -881,7 +881,7 @@ class AMDSMICommands(): raise e if args.ecc: try: - ecc_count = amdsmi_interface.amdsmi_get_ecc_error_count(args.gpu) + ecc_count = amdsmi_interface.amdsmi_get_gpu_ecc_error_count(args.gpu) ecc_count['correctable'] = ecc_count.pop('correctable_count') ecc_count['uncorrectable'] = ecc_count.pop('uncorrectable_count') @@ -900,11 +900,11 @@ class AMDSMICommands(): ecc_dict = {} try: if self.helpers.has_ras_support(args.gpu): - ras_states = amdsmi_interface.amdsmi_get_ras_block_features_enabled(args.gpu) + ras_states = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu) for state in ras_states: if state['status'] == amdsmi_interface.AmdSmiRasErrState.ENABLED: gpu_block = amdsmi_interface.AmdSmiGpuBlock[state['block']] - ecc_count = amdsmi_interface.amdsmi_dev_get_ecc_count(args.gpu, gpu_block) + ecc_count = amdsmi_interface.amdsmi_get_gpu_ecc_count(args.gpu, gpu_block) ecc_dict[state['block']] = {'correctable' : ecc_count['correctable_count'], 'uncorrectable': ecc_count['uncorrectable_count']} if not ecc_dict: @@ -934,7 +934,7 @@ class AMDSMICommands(): if args.voltage: try: - volt_metric = amdsmi_interface.amdsmi_dev_get_volt_metric( + volt_metric = amdsmi_interface.amdsmi_get_gpu_volt_metric( args.gpu, amdsmi_interface.AmdSmiVoltageType.VDDGFX, amdsmi_interface.AmdSmiVoltageMetric.CURRENT) if self.logger.is_human_readable_format(): @@ -948,14 +948,14 @@ class AMDSMICommands(): raise e if args.fan: try: - fan_speed = amdsmi_interface.amdsmi_dev_get_fan_speed(args.gpu, 0) + fan_speed = amdsmi_interface.amdsmi_get_gpu_fan_speed(args.gpu, 0) fan_speed_error = False except amdsmi_exception.AmdSmiLibraryException as e: fan_speed = e.get_error_info() fan_speed_error = True try: - fan_max = amdsmi_interface.amdsmi_dev_get_fan_speed_max(args.gpu, 0) + fan_max = amdsmi_interface.amdsmi_get_gpu_fan_speed_max(args.gpu, 0) if not fan_speed_error and fan_max > 0: fan_percent = round((float(fan_speed) / float(fan_max)) * 100, 2) if self.logger.is_human_readable_format(): @@ -968,7 +968,7 @@ class AMDSMICommands(): fan_percent = 'Unable to detect fan speed' try: - fan_rpm = amdsmi_interface.amdsmi_dev_get_fan_rpms(args.gpu, 0) + fan_rpm = amdsmi_interface.amdsmi_get_gpu_fan_rpms(args.gpu, 0) except amdsmi_exception.AmdSmiLibraryException as e: fan_rpm = e.get_error_info() @@ -978,7 +978,7 @@ class AMDSMICommands(): 'usage' : fan_percent} if args.voltage_curve: try: - od_volt = amdsmi_interface.amdsmi_dev_get_od_volt_info(args.gpu) + od_volt = amdsmi_interface.amdsmi_get_gpu_od_volt_info(args.gpu) voltage_point_dict = {} @@ -998,7 +998,7 @@ class AMDSMICommands(): raise e if args.overdrive: try: - overdrive_level = amdsmi_interface.amdsmi_dev_get_overdrive_level(args.gpu) + overdrive_level = amdsmi_interface.amdsmi_get_gpu_overdrive_level(args.gpu) if self.logger.is_human_readable_format(): unit = '%' @@ -1013,7 +1013,7 @@ class AMDSMICommands(): values_dict['mem_overdrive'] = amdsmi_exception.AmdSmiLibraryException(amdsmi_exception.AmdSmiRetCode.NOT_IMPLEMENTED).err_info if args.perf_level: try: - perf_level = amdsmi_interface.amdsmi_dev_get_perf_level(args.gpu) + perf_level = amdsmi_interface.amdsmi_get_gpu_perf_level(args.gpu) values_dict['perf_level'] = perf_level except amdsmi_exception.AmdSmiLibraryException as e: values_dict['perf_level'] = e.get_error_info() @@ -1021,7 +1021,7 @@ class AMDSMICommands(): raise e if args.replay_count: try: - pci_replay_counter = amdsmi_interface.amdsmi_dev_get_pci_replay_counter(args.gpu) + pci_replay_counter = amdsmi_interface.amdsmi_get_gpu_pci_replay_counter(args.gpu) values_dict['replay_count'] = pci_replay_counter except amdsmi_exception.AmdSmiLibraryException as e: values_dict['replay_count'] = e.get_error_info() @@ -1030,7 +1030,7 @@ class AMDSMICommands(): if (self.helpers.is_linux() and self.helpers.is_baremetal()): if args.xgmi_err: try: - values_dict['xgmi_err'] = amdsmi_interface.amdsmi_dev_xgmi_error_status(args.gpu) + values_dict['xgmi_err'] = amdsmi_interface.amdsmi_gpu_xgmi_error_status(args.gpu) except amdsmi_interface.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NOT_SUPPORTED: values_dict['xgmi_err'] = 'N/A' @@ -1041,9 +1041,9 @@ class AMDSMICommands(): if args.mem_usage: memory_total = {} try: - memory_total_vram = amdsmi_interface.amdsmi_dev_get_memory_total(args.gpu, amdsmi_interface.AmdSmiMemoryType.VRAM) - memory_total_vis_vram = amdsmi_interface.amdsmi_dev_get_memory_total(args.gpu, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM) - memory_total_gtt = amdsmi_interface.amdsmi_dev_get_memory_total(args.gpu, amdsmi_interface.AmdSmiMemoryType.GTT) + memory_total_vram = amdsmi_interface.amdsmi_get_gpu_memory_total(args.gpu, amdsmi_interface.AmdSmiMemoryType.VRAM) + memory_total_vis_vram = amdsmi_interface.amdsmi_get_gpu_memory_total(args.gpu, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM) + memory_total_gtt = amdsmi_interface.amdsmi_get_gpu_memory_total(args.gpu, amdsmi_interface.AmdSmiMemoryType.GTT) # Convert mem_usage to megabytes memory_total['vram'] = memory_total_vram // (1024*1024) @@ -1065,9 +1065,9 @@ class AMDSMICommands(): raise e try: - total_used_vram = amdsmi_interface.amdsmi_dev_get_memory_usage(args.gpu, amdsmi_interface.AmdSmiMemoryType.VRAM) - total_used_vis_vram = amdsmi_interface.amdsmi_dev_get_memory_usage(args.gpu, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM) - total_used_gtt = amdsmi_interface.amdsmi_dev_get_memory_usage(args.gpu, amdsmi_interface.AmdSmiMemoryType.GTT) + total_used_vram = amdsmi_interface.amdsmi_get_gpu_memory_usage(args.gpu, amdsmi_interface.AmdSmiMemoryType.VRAM) + total_used_vis_vram = amdsmi_interface.amdsmi_get_gpu_memory_usage(args.gpu, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM) + total_used_gtt = amdsmi_interface.amdsmi_get_gpu_memory_usage(args.gpu, amdsmi_interface.AmdSmiMemoryType.GTT) # Convert mem_usage to megabytes memory_total['used_vram'] = total_used_vram // (1024*1024) @@ -1187,14 +1187,14 @@ class AMDSMICommands(): # Populate initial processes try: - process_list = amdsmi_interface.amdsmi_get_process_list(args.gpu) + process_list = amdsmi_interface.amdsmi_get_gpu_process_list(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: raise e filtered_process_values = [] for process_handle in process_list: try: - process_info = amdsmi_interface.amdsmi_get_process_info(args.gpu, process_handle) + process_info = amdsmi_interface.amdsmi_get_gpu_process_info(args.gpu, process_handle) except amdsmi_exception.AmdSmiLibraryException as e: process_info = e.get_error_info() filtered_process_values.append({'process_info': process_info}) @@ -1563,7 +1563,7 @@ class AMDSMICommands(): # Build GPU string for errors try: - gpu_bdf = amdsmi_interface.amdsmi_get_device_bdf(args.gpu) + gpu_bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(args.gpu) except amdsmi_exception.AmdSmiLibraryException: gpu_bdf = f'BDF Unavailable for {args.gpu}' try: @@ -1578,7 +1578,7 @@ class AMDSMICommands(): # Check if the performance level is manual, if not then set it to manual try: - perf_level = amdsmi_interface.amdsmi_dev_get_perf_level(args.gpu) + perf_level = amdsmi_interface.amdsmi_get_gpu_perf_level(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1586,7 +1586,7 @@ class AMDSMICommands(): if 'manual' in perf_level.lower(): try: - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1594,14 +1594,14 @@ class AMDSMICommands(): if clock_type != amdsmi_interface.AmdSmiClkType.PCIE: try: - amdsmi_interface.amdsmi_dev_set_clk_freq(args.gpu, clock_type, freq_bitmask) + amdsmi_interface.amdsmi_set_clk_freq(args.gpu, clock_type, freq_bitmask) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e raise ValueError(f"Unable to set the {clock_type} clock frequency on {gpu_string}") from e else: try: - amdsmi_interface.amdsmi_dev_set_pci_bandwidth(args.gpu, freq_bitmask) + amdsmi_interface.amdsmi_set_gpu_pci_bandwidth(args.gpu, freq_bitmask) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1613,7 +1613,7 @@ class AMDSMICommands(): clock_type = amdsmi_interface.AmdSmiClkType.SYS # Check if the performance level is manual, if not then set it to manual try: - perf_level = amdsmi_interface.amdsmi_dev_get_perf_level(args.gpu) + perf_level = amdsmi_interface.amdsmi_get_gpu_perf_level(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1621,14 +1621,14 @@ class AMDSMICommands(): if 'manual' in perf_level.lower(): try: - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e raise ValueError(f"Unable to set the performance level of {gpu_string} to manual") from e try: - amdsmi_interface.amdsmi_dev_set_clk_freq(args.gpu, clock_type, freq_bitmask) + amdsmi_interface.amdsmi_set_clk_freq(args.gpu, clock_type, freq_bitmask) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1640,7 +1640,7 @@ class AMDSMICommands(): clock_type = amdsmi_interface.AmdSmiClkType.MEM # Check if the performance level is manual, if not then set it to manual try: - perf_level = amdsmi_interface.amdsmi_dev_get_perf_level(args.gpu) + perf_level = amdsmi_interface.amdsmi_get_gpu_perf_level(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1648,14 +1648,14 @@ class AMDSMICommands(): if 'manual' in perf_level.lower(): try: - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e raise ValueError(f"Unable to set the performance level of {gpu_string} to manual") from e try: - amdsmi_interface.amdsmi_dev_set_clk_freq(args.gpu, clock_type, freq_bitmask) + amdsmi_interface.amdsmi_set_clk_freq(args.gpu, clock_type, freq_bitmask) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1667,7 +1667,7 @@ class AMDSMICommands(): clock_type = amdsmi_interface.AmdSmiClkType.PCIE # Check if the performance level is manual, if not then set it to manual try: - perf_level = amdsmi_interface.amdsmi_dev_get_perf_level(args.gpu) + perf_level = amdsmi_interface.amdsmi_get_gpu_perf_level(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1675,13 +1675,13 @@ class AMDSMICommands(): if 'manual' in perf_level.lower(): try: - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e raise ValueError(f"Unable to set the performance level of {gpu_string} to manual") from e try: - amdsmi_interface.amdsmi_dev_set_pci_bandwidth(args.gpu, freq_bitmask) + amdsmi_interface.amdsmi_set_gpu_pci_bandwidth(args.gpu, freq_bitmask) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1694,7 +1694,7 @@ class AMDSMICommands(): level = amdsmi_interface.AmdSmiFreqInd(level) clock_type = amdsmi_interface.AmdSmiClkType.SYS try: - amdsmi_interface.amdsmi_dev_set_od_clk_info(args.gpu, level, value, clock_type) + amdsmi_interface.amdsmi_set_gpu_od_clk_info(args.gpu, level, value, clock_type) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1706,7 +1706,7 @@ class AMDSMICommands(): level = amdsmi_interface.AmdSmiFreqInd(level) clock_type = amdsmi_interface.AmdSmiClkType.MEM try: - amdsmi_interface.amdsmi_dev_set_od_clk_info(args.gpu, level, value, clock_type) + amdsmi_interface.amdsmi_set_gpu_od_clk_info(args.gpu, level, value, clock_type) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1716,7 +1716,7 @@ class AMDSMICommands(): if isinstance(args.vc, int): point, clk, volt = args.vc try: - amdsmi_interface.amdsmi_dev_set_od_volt_info(args.gpu, point, clk, volt) + amdsmi_interface.amdsmi_set_gpu_od_volt_info(args.gpu, point, clk, volt) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1727,7 +1727,7 @@ class AMDSMICommands(): min_value, max_value = args.srange clock_type = amdsmi_interface.AmdSmiClkType.SYS try: - amdsmi_interface.amdsmi_dev_set_clk_range(args.gpu, min_value, max_value, clock_type) + amdsmi_interface.amdsmi_set_gpu_clk_range(args.gpu, min_value, max_value, clock_type) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1738,7 +1738,7 @@ class AMDSMICommands(): min_value, max_value = args.srange clock_type = amdsmi_interface.AmdSmiClkType.MEM try: - amdsmi_interface.amdsmi_dev_set_clk_range(args.gpu, min_value, max_value, clock_type) + amdsmi_interface.amdsmi_set_gpu_clk_range(args.gpu, min_value, max_value, clock_type) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1747,7 +1747,7 @@ class AMDSMICommands(): self.logger.store_output(args.gpu, 'mrange', f"Successfully set {clock_type} from {min_value}(MHz) to {max_value}(MHz)") if isinstance(args.fan, int): try: - amdsmi_interface.amdsmi_dev_set_fan_speed(args.gpu, 0, args.fan) + amdsmi_interface.amdsmi_set_gpu_fan_speed(args.gpu, 0, args.fan) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1757,7 +1757,7 @@ class AMDSMICommands(): if args.perflevel: perf_level = amdsmi_interface.AmdSmiDevPerfLevel[args.perflevel] try: - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, perf_level) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, perf_level) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1767,7 +1767,7 @@ class AMDSMICommands(): if isinstance(args.overdrive, int): # Check if the performance level is manual, if not then set it to manual try: - perf_level = amdsmi_interface.amdsmi_dev_get_perf_level(args.gpu) + perf_level = amdsmi_interface.amdsmi_get_gpu_perf_level(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1775,14 +1775,14 @@ class AMDSMICommands(): if 'manual' in perf_level.lower(): try: - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e raise ValueError(f"Unable to set the performance level of {gpu_string} to manual") from e try: - amdsmi_interface.amdsmi_dev_set_overdrive_level_v1(args.gpu, args.overdrive) + amdsmi_interface.amdsmi_set_gpu_overdrive_level_v1(args.gpu, args.overdrive) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1792,7 +1792,7 @@ class AMDSMICommands(): if isinstance(args.memoverdrive, int): # Check if the performance level is manual, if not then set it to manual try: - perf_level = amdsmi_interface.amdsmi_dev_get_perf_level(args.gpu) + perf_level = amdsmi_interface.amdsmi_get_gpu_perf_level(args.gpu) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1800,7 +1800,7 @@ class AMDSMICommands(): if 'manual' in perf_level.lower(): try: - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, amdsmi_interface.AmdSmiDevPerfLevel.MANUAL) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1830,7 +1830,7 @@ class AMDSMICommands(): raise ValueError(f"Requested power cap: {overdrive_power_cap} is the same as the current power cap: {power_caps['power_cap']}") try: - amdsmi_interface.amdsmi_dev_set_power_cap(args.gpu, 0, overdrive_power_cap) + amdsmi_interface.amdsmi_set_power_cap(args.gpu, 0, overdrive_power_cap) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1851,7 +1851,7 @@ class AMDSMICommands(): self.logger.store_output(args.gpu, 'profile', "Not Yet Implemented") if isinstance(args.perfdeterminism, int): try: - amdsmi_interface.amdsmi_set_perf_determinism_mode(args.gpu, args.perfdeterminism) + amdsmi_interface.amdsmi_set_gpu_perf_determinism_mode(args.gpu, args.perfdeterminism) except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: raise PermissionError('Command requires elevation') from e @@ -1922,7 +1922,7 @@ class AMDSMICommands(): if args.gpureset: if self.helpers.is_amd_device(args.gpu): try: - amdsmi_interface.amdsmi_dev_reset_gpu(args.gpu) + amdsmi_interface.amdsmi_reset_gpu(args.gpu) result = 'Successfully reset GPU' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -1937,7 +1937,7 @@ class AMDSMICommands(): 'clocks' : '', 'performance': ''} try: - amdsmi_interface.amdsmi_dev_set_overdrive_level_v1(args.gpu, 0) + amdsmi_interface.amdsmi_set_gpu_overdrive_level_v1(args.gpu, 0) reset_clocks_results['overdrive'] = 'Overdrive set to 0' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -1946,7 +1946,7 @@ class AMDSMICommands(): try: level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, level_auto) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, level_auto) reset_clocks_results['clocks'] = 'Successfully reset clocks' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -1955,7 +1955,7 @@ class AMDSMICommands(): try: level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, level_auto) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, level_auto) reset_clocks_results['performance'] = 'Performance level reset to auto' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -1965,7 +1965,7 @@ class AMDSMICommands(): self.logger.store_output(args.gpu, 'reset_clocks', reset_clocks_results) if args.fans: try: - amdsmi_interface.amdsmi_dev_reset_fan(args.gpu, 0) + amdsmi_interface.amdsmi_reset_gpu_fan(args.gpu, 0) result = 'Successfully reset fan speed to driver control' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -1978,7 +1978,7 @@ class AMDSMICommands(): 'performance_level': ''} try: power_profile_mask = amdsmi_interface.AmdSmiPowerProfilePresetMasks.BOOTUP_DEFAULT - amdsmi_interface.amdsmi_dev_set_power_profile(args.gpu, 0, power_profile_mask) + amdsmi_interface.amdsmi_set_gpu_power_profile(args.gpu, 0, power_profile_mask) reset_profile_results['power_profile'] = 'Successfully reset Power Profile' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -1987,7 +1987,7 @@ class AMDSMICommands(): try: level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, level_auto) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, level_auto) reset_profile_results['performance_level'] = 'Successfully reset Performance Level' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -1997,7 +1997,7 @@ class AMDSMICommands(): self.logger.store_output(args.gpu, 'reset_profile', reset_profile_results) if args.xgmierr: try: - amdsmi_interface.amdsmi_dev_reset_xgmi_error(args.gpu) + amdsmi_interface.amdsmi_reset_gpu_xgmi_error(args.gpu) result = 'Successfully reset XGMI Error count' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: @@ -2007,7 +2007,7 @@ class AMDSMICommands(): if args.perfdeterminism: try: level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO - amdsmi_interface.amdsmi_dev_set_perf_level_v1(args.gpu, level_auto) + amdsmi_interface.amdsmi_set_gpu_perf_level_v1(args.gpu, level_auto) result = 'Successfully disabled performance determinism' except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_exception.AmdSmiRetCode.ERR_NO_PERM: diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py index e9cebac434..f97417fa90 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py @@ -141,11 +141,11 @@ class AMDSMIHelpers(): gpu_choices = {} gpu_choices_str = "" - # amdsmi_get_device_handles returns the device_handles storted by gpu_id - device_handles = amdsmi_interface.amdsmi_get_device_handles() + # amdsmi_get_processor_handles returns the device_handles storted for gpu_id + device_handles = amdsmi_interface.amdsmi_get_processor_handles() for gpu_id, device_handle in enumerate(device_handles): - bdf = amdsmi_interface.amdsmi_get_device_bdf(device_handle) - uuid = amdsmi_interface.amdsmi_get_device_uuid(device_handle) + bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(device_handle) + uuid = amdsmi_interface.amdsmi_get_gpu_device_uuid(device_handle) gpu_choices[str(gpu_id)] = { "BDF": bdf, "UUID": uuid, @@ -285,9 +285,9 @@ class AMDSMIHelpers(): def get_gpu_id_from_device_handle(self, input_device_handle): """Get the gpu index from the device_handle. - amdsmi_get_device_handles() returns the list of device_handles in order of gpu_index + amdsmi_get_processor_handles() returns the list of device_handles in order of gpu_index """ - device_handles = amdsmi_interface.amdsmi_get_device_handles() + device_handles = amdsmi_interface.amdsmi_get_processor_handles() for gpu_index, device_handle in enumerate(device_handles): if input_device_handle.value == device_handle.value: return gpu_index @@ -301,10 +301,10 @@ class AMDSMIHelpers(): list[BDF]: List of GPU BDFs """ gpu_bdfs = [] - device_handles = amdsmi_interface.amdsmi_get_device_handles() + device_handles = amdsmi_interface.amdsmi_get_processor_handles() for device_handle in device_handles: - bdf = amdsmi_interface.amdsmi_get_device_bdf(device_handle) + bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(device_handle) gpu_bdfs.append(bdf) return gpu_bdfs @@ -316,7 +316,7 @@ class AMDSMIHelpers(): param device: DRM device identifier """ # Get card vendor id - asic_info = amdsmi_interface.amdsmi_get_asic_info(device_handle) + asic_info = amdsmi_interface.amdsmi_get_gpu_asic_info(device_handle) return asic_info['vendor_id'] == AMD_VENDOR_ID diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index af9293a7a4..ef7732c84e 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -78,29 +78,29 @@ from .amdsmi_interface import amdsmi_next_func_iter from .amdsmi_interface import amdsmi_get_func_iter_value # # Unsupported Functions In Virtual Environment -from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth -from .amdsmi_interface import amdsmi_set_power_cap -from .amdsmi_interface import amdsmi_set_gpu_power_profile +from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth +from .amdsmi_interface import amdsmi_set_power_cap +from .amdsmi_interface import amdsmi_set_gpu_power_profile from .amdsmi_interface import amdsmi_set_gpu_clk_range -from .amdsmi_interface import amdsmi_set_gpu_od_clk_info -from .amdsmi_interface import amdsmi_set_gpu_od_volt_info -from .amdsmi_interface import amdsmi_set_gpu_perf_level_v1 -from .amdsmi_interface import amdsmi_set_gpu_perf_level -from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets +from .amdsmi_interface import amdsmi_set_gpu_od_clk_info +from .amdsmi_interface import amdsmi_set_gpu_od_volt_info +from .amdsmi_interface import amdsmi_set_gpu_perf_level_v1 +from .amdsmi_interface import amdsmi_set_gpu_perf_level +from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets from .amdsmi_interface import amdsmi_reset_gpu from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_set_gpu_fan_speed from .amdsmi_interface import amdsmi_reset_gpu_fan -from .amdsmi_interface import amdsmi_set_clk_freq -from .amdsmi_interface import amdsmi_set_gpu_overdrive_level_v1 -from .amdsmi_interface import amdsmi_set_gpu_overdrive_level +from .amdsmi_interface import amdsmi_set_clk_freq +from .amdsmi_interface import amdsmi_set_gpu_overdrive_level_v1 +from .amdsmi_interface import amdsmi_set_gpu_overdrive_level # # Physical State Queries from .amdsmi_interface import amdsmi_get_gpu_fan_rpms from .amdsmi_interface import amdsmi_get_gpu_fan_speed from .amdsmi_interface import amdsmi_get_gpu_fan_speed_max -from .amdsmi_interface import amdsmi_get_temp_metric -from .amdsmi_interface import amdsmi_get_gpu_volt_metric +from .amdsmi_interface import amdsmi_get_temp_metric +from .amdsmi_interface import amdsmi_get_gpu_volt_metric # # Clock, Power and Performance Query from .amdsmi_interface import amdsmi_get_busy_percent @@ -108,11 +108,11 @@ from .amdsmi_interface import amdsmi_get_utilization_count from .amdsmi_interface import amdsmi_get_gpu_perf_level from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode from .amdsmi_interface import amdsmi_get_gpu_overdrive_level -from .amdsmi_interface import amdsmi_get_clk_freq -from .amdsmi_interface import amdsmi_get_gpu_od_volt_info -from .amdsmi_interface import amdsmi_get_gpu_metrics_info -from .amdsmi_interface import amdsmi_get_gpu_od_volt_curve_regions -from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets +from .amdsmi_interface import amdsmi_get_clk_freq +from .amdsmi_interface import amdsmi_get_gpu_od_volt_info +from .amdsmi_interface import amdsmi_get_gpu_metrics_info +from .amdsmi_interface import amdsmi_get_gpu_od_volt_curve_regions +from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters from .amdsmi_interface import amdsmi_gpu_counter_group_supported @@ -120,12 +120,12 @@ from .amdsmi_interface import amdsmi_gpu_create_counter from .amdsmi_interface import amdsmi_gpu_destroy_counter from .amdsmi_interface import amdsmi_gpu_control_counter from .amdsmi_interface import amdsmi_gpu_read_counter -from .amdsmi_interface import amdsmi_get_gpu_available_counters +from .amdsmi_interface import amdsmi_get_gpu_available_counters # # Error Query -from .amdsmi_interface import amdsmi_get_gpu_ecc_count -from .amdsmi_interface import amdsmi_get_gpu_ecc_enabled -from .amdsmi_interface import amdsmi_get_gpu_ecc_status +from .amdsmi_interface import amdsmi_get_gpu_ecc_count +from .amdsmi_interface import amdsmi_get_gpu_ecc_enabled +from .amdsmi_interface import amdsmi_get_gpu_ecc_status from .amdsmi_interface import amdsmi_status_string # # System Information Query @@ -139,7 +139,7 @@ from .amdsmi_interface import amdsmi_reset_gpu_xgmi_error from .amdsmi_interface import amdsmi_get_gpu_pci_id from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_get_gpu_pci_throughput -from .amdsmi_interface import amdsmi_get_gpu_pci_replay_counter +from .amdsmi_interface import amdsmi_get_gpu_pci_replay_counter from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity # # Power information @@ -169,7 +169,7 @@ from .amdsmi_interface import amdsmi_get_version_str # # Hardware topology query from .amdsmi_interface import amdsmi_topo_get_numa_node_number from .amdsmi_interface import amdsmi_topo_get_link_weight -from .amdsmi_interface import amdsmi_get_minmax_bandwidth +from .amdsmi_interface import amdsmi_get_minmax_bandwidth from .amdsmi_interface import amdsmi_topo_get_link_type from .amdsmi_interface import amdsmi_is_P2P_accessible from .amdsmi_interface import amdsmi_get_xgmi_info From 66f933eeb34ce1792df84cc9fd6a884d0367b049 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Thu, 18 May 2023 15:28:13 -0500 Subject: [PATCH 91/95] SWDEV-399063 - Fixed process metrics showing incorrectly for all gpus Change-Id: I4ae576f34472c3dbbfa0b136f55ce996834323ad Signed-off-by: Maisam Arif [ROCm/amdsmi commit: 6b8fe4a377b1ac8431fda0075835a35be5b71db9] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 6 +- projects/amdsmi/src/amd_smi/fdinfo.cc | 86 +++++++++++-------- 2 files changed, 54 insertions(+), 38 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index f63ecb2766..e44ab1aede 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -185,7 +185,7 @@ class AMDSMICommands(): args.caps = caps if numa: args.numa = numa - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if ras: args.ras = ras if limit: @@ -204,10 +204,10 @@ class AMDSMICommands(): args.gpu = device_handle # If all arguments are False, it means that no argument was passed and the entire static should be printed - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if not any([args.asic, args.bus, args.vbios, args.limit, args.driver, args.caps, args.ras, args.board]): args.asic = args.bus = args.vbios = args.limit = args.driver = args.caps = args.ras = args.board = args.numa = self.all_arguments = True - if (self.helpers.is_linux() and self.helpers.is_virtual_os()): + if self.helpers.is_linux() and self.helpers.is_virtual_os(): if not any([args.asic, args.bus, args.vbios, args.driver, args.caps]): args.asic = args.bus = args.vbios = args.driver = args.caps = self.all_arguments = True diff --git a/projects/amdsmi/src/amd_smi/fdinfo.cc b/projects/amdsmi/src/amd_smi/fdinfo.cc index 81b80da6d4..7bb794e00a 100644 --- a/projects/amdsmi/src/amd_smi/fdinfo.cc +++ b/projects/amdsmi/src/amd_smi/fdinfo.cc @@ -149,55 +149,71 @@ amdsmi_status_t gpuvsmi_get_pid_info(const amdsmi_bdf_t &bdf, long int pid, std::string file = path + dir->d_name; std::ifstream fdinfo(file.c_str()); - for (std::string line; getline(fdinfo, line);) { - if (line.find("pasid:") != std::string::npos) { - int pasid; + for (std::string bdfline; getline(fdinfo, bdfline);) { + if (bdfline.find("drm-pdev:") != std::string::npos) { + char fd_bdf_str[13]; - if (sscanf(line.c_str(), "pasid: %d", &pasid) != 1) + /* Only check against fdinfo files that contain a bdf */ + if (sscanf(bdfline.c_str(), "drm-pdev: %s", &fd_bdf_str) != 1) continue; - auto it = std::find(pasids.begin(), pasids.end(), pasid); + /* Populate amdsmi_proc_info_t struct only if the bdf in + * the fdinfo file matches the passed bdf */ + if (strncmp(bdf_str, fd_bdf_str, 13) == 0){ + std::ifstream fdinfo(file.c_str()); - if (it == pasids.end()) - pasids.push_back(pasid); - } else if (line.find("drm-memory-gtt:") != std::string::npos) { - unsigned long mem; + for (std::string line; getline(fdinfo, line);) { + if (line.find("pasid:") != std::string::npos) { + int pasid; - if (sscanf(line.c_str(), "drm-memory-gtt: %lu", &mem) != 1) - continue; + if (sscanf(line.c_str(), "pasid: %d", &pasid) != 1) + continue; - info.mem += mem * 1024; - info.memory_usage.gtt_mem += mem * 1024; - } else if (line.find("drm-memory-cpu:") != std::string::npos) { - unsigned long mem; + auto it = std::find(pasids.begin(), pasids.end(), pasid); - if (sscanf(line.c_str(), "drm-memory-cpu: %lu", &mem) != 1) - continue; + if (it == pasids.end()) + pasids.push_back(pasid); + } else if (line.find("drm-memory-gtt:") != std::string::npos) { + unsigned long mem; - info.mem += mem * 1024; - info.memory_usage.cpu_mem += mem * 1024; - } else if (line.find("drm-memory-vram:") != std::string::npos) { - unsigned long mem; + if (sscanf(line.c_str(), "drm-memory-gtt: %lu", &mem) != 1) + continue; - if (sscanf(line.c_str(), "drm-memory-vram: %lu", &mem) != 1) - continue; + info.mem += mem * 1024; + info.memory_usage.gtt_mem += mem * 1024; + } else if (line.find("drm-memory-cpu:") != std::string::npos) { + unsigned long mem; - info.mem += mem * 1024; - info.memory_usage.vram_mem += mem * 1024; - } else if (line.find("drm-engine-gfx") != std::string::npos) { - uint64_t engine_gfx; + if (sscanf(line.c_str(), "drm-memory-cpu: %lu", &mem) != 1) + continue; - if (sscanf(line.c_str(), "drm-engine-gfx: %lu", &engine_gfx) != 1) - continue; + info.mem += mem * 1024; + info.memory_usage.cpu_mem += mem * 1024; + } else if (line.find("drm-memory-vram:") != std::string::npos) { + unsigned long mem; - info.engine_usage.gfx = engine_gfx; - } else if (line.find("drm-engine-enc") != std::string::npos) { - uint64_t engine_enc; + if (sscanf(line.c_str(), "drm-memory-vram: %lu", &mem) != 1) + continue; - if (sscanf(line.c_str(), "drm-engine-enc: %lu", &engine_enc) != 1) - continue; + info.mem += mem * 1024; + info.memory_usage.vram_mem += mem * 1024; + } else if (line.find("drm-engine-gfx") != std::string::npos) { + uint64_t engine_gfx; - info.engine_usage.enc = engine_enc; + if (sscanf(line.c_str(), "drm-engine-gfx: %lu", &engine_gfx) != 1) + continue; + + info.engine_usage.gfx = engine_gfx; + } else if (line.find("drm-engine-enc") != std::string::npos) { + uint64_t engine_enc; + + if (sscanf(line.c_str(), "drm-engine-enc: %lu", &engine_enc) != 1) + continue; + + info.engine_usage.enc = engine_enc; + } + } + } } } } From 800af9bf556f70c06296bb5c6b23b1206b4a2e86 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Thu, 18 May 2023 15:53:48 -0500 Subject: [PATCH 92/95] SWDEV-397381 - Corrected ECC per block reporting Change-Id: If666e2f1a4b13dd08b6a19f08f3c01297515712c Signed-off-by: Maisam Arif [ROCm/amdsmi commit: fe64f426d8109075037b516f42bff8e05e0e6ccd] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 51 ++++++++++--------- projects/amdsmi/amdsmi_cli/amdsmi_helpers.py | 17 +++---- projects/amdsmi/amdsmi_cli/amdsmi_logger.py | 29 ++++++----- .../amdsmi/py-interface/amdsmi_interface.py | 4 +- 4 files changed, 52 insertions(+), 49 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index e44ab1aede..1669590aa7 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -263,16 +263,15 @@ class AMDSMICommands(): static_dict['vbios'] = e.get_error_info() if not self.all_arguments: raise e - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if args.board: try: board_info = amdsmi_interface.amdsmi_get_gpu_board_info(args.gpu) board_info['serial_number'] = hex(board_info['serial_number']) + board_info['model_number'] = board_info['model_number'].strip() board_info['product_serial'] = '0x' + board_info['product_serial'] - - if self.logger.is_gpuvsmi_compatibility(): - board_info['product_number'] = board_info.pop('product_serial') - board_info['product_name'] = board_info.pop('product_name') + board_info['product_name'] = board_info['product_name'].strip() + board_info['manufacturer_name'] = board_info['manufacturer_name'].strip() static_dict['board'] = board_info except amdsmi_exception.AmdSmiLibraryException as e: @@ -337,7 +336,7 @@ class AMDSMICommands(): static_dict['driver'] = e.get_error_info() if not self.all_arguments: raise e - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if args.ras: try: static_dict['ras'] = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu) @@ -373,7 +372,7 @@ class AMDSMICommands(): # Convert and store output by pid for csv format if self.logger.is_csv_format(): # expand if ras blocks are populated - if (self.helpers.is_linux() and self.helpers.is_baremetal() and args.ras): + if self.helpers.is_linux() and self.helpers.is_baremetal() and args.ras: if isinstance(static_dict['ras'], list): ras_dicts = static_dict.pop('ras') multiple_devices_csv_override = True @@ -385,7 +384,7 @@ class AMDSMICommands(): else: # Store values if ras has an error self.logger.store_output(args.gpu, 'values', static_dict) - if (self.helpers.is_linux() and self.helpers.is_virtual_os()): + if self.helpers.is_linux() and self.helpers.is_virtual_os(): self.logger.store_output(args.gpu, 'values', static_dict) else: self.logger.store_output(args.gpu, 'values', static_dict) @@ -663,7 +662,7 @@ class AMDSMICommands(): if mem_usage: args.mem_usage = mem_usage - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if usage: args.usage = usage if power: @@ -736,11 +735,11 @@ class AMDSMICommands(): raise IndexError("args.gpu should not be an empty list") # Check if any of the options have been set, if not then set them all to true - if (self.helpers.is_linux() and self.helpers.is_virtual_os()): + if self.helpers.is_linux() and self.helpers.is_virtual_os(): if not any([args.fb_usage, args.replay_count, args.mem_usage]): args.fb_usage = args.replay_count = args.mem_usage = self.all_arguments = True - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if not any([args.usage, args.fb_usage, args.power, args.clock, args.temperature, args.ecc, args.ecc_block, args.pcie, args.voltage, args.fan, args.voltage_curve, args.overdrive, args.mem_overdrive, args.perf_level, args.replay_count, args.xgmi_err, args.energy, args.mem_usage]): @@ -750,7 +749,7 @@ class AMDSMICommands(): # Add timestamp and store values for specified arguments values_dict = {} - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if args.usage: try: engine_usage = amdsmi_interface.amdsmi_get_gpu_activity(args.gpu) @@ -789,7 +788,7 @@ class AMDSMICommands(): if not self.all_arguments: raise e - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if args.power: power_dict = {} try: @@ -880,6 +879,7 @@ class AMDSMICommands(): if not self.all_arguments: raise e if args.ecc: + ecc_count = {} try: ecc_count = amdsmi_interface.amdsmi_get_gpu_ecc_error_count(args.gpu) ecc_count['correctable'] = ecc_count.pop('correctable_count') @@ -899,18 +899,21 @@ class AMDSMICommands(): if args.ecc_block: ecc_dict = {} try: - if self.helpers.has_ras_support(args.gpu): - ras_states = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu) - for state in ras_states: - if state['status'] == amdsmi_interface.AmdSmiRasErrState.ENABLED: - gpu_block = amdsmi_interface.AmdSmiGpuBlock[state['block']] + ras_states = amdsmi_interface.amdsmi_get_ras_block_features_enabled(args.gpu) + for state in ras_states: + if state['status'] == amdsmi_interface.AmdSmiRasErrState.ENABLED.name: + gpu_block = amdsmi_interface.AmdSmiGpuBlock[state['block']] + try: ecc_count = amdsmi_interface.amdsmi_get_gpu_ecc_count(args.gpu, gpu_block) ecc_dict[state['block']] = {'correctable' : ecc_count['correctable_count'], - 'uncorrectable': ecc_count['uncorrectable_count']} - if not ecc_dict: - ecc_dict['correctable_per_block'] = 'N/A' - ecc_dict['uncorrectable_per_block'] = 'N/A' + 'uncorrectable': ecc_count['uncorrectable_count']} + except amdsmi_exception.AmdSmiLibraryException as e: + ecc_count = e.get_error_info() + if self.logger.is_gpuvsmi_compatibility(): + ecc_count = "N/A" + ecc_dict[state['block']] = {'correctable' : ecc_count, + 'uncorrectable': ecc_count} values_dict['ecc_block'] = ecc_dict except amdsmi_exception.AmdSmiLibraryException as e: values_dict['ecc_block'] = e.get_error_info() @@ -989,7 +992,7 @@ class AMDSMICommands(): else: frequency = 0 voltage = 0 - voltage_point_dict[f'voltage_point_{point}'] = f"{frequency}Mhz {voltage}mV" + voltage_point_dict[f'voltage_point_{point}'] = f"{frequency} Mhz {voltage} mV" values_dict['voltage_curve'] = voltage_point_dict except amdsmi_exception.AmdSmiLibraryException as e: @@ -1027,7 +1030,7 @@ class AMDSMICommands(): values_dict['replay_count'] = e.get_error_info() if not self.all_arguments: raise e - if (self.helpers.is_linux() and self.helpers.is_baremetal()): + if self.helpers.is_linux() and self.helpers.is_baremetal(): if args.xgmi_err: try: values_dict['xgmi_err'] = amdsmi_interface.amdsmi_gpu_xgmi_error_status(args.gpu) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py index f97417fa90..f5df6c72db 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py @@ -61,6 +61,7 @@ class AMDSMIHelpers(): else: self._is_virtual_os = True + def os_info(self, string_format=True): """Return operating_system and type information ex. (Linux, Baremetal) params: @@ -386,13 +387,9 @@ class AMDSMIHelpers(): return False, profile_presets.values() - def has_ras_support(self, device_handle): - try: - caps_info = amdsmi_interface.amdsmi_get_caps_info(device_handle) - - if caps_info['ras_supported']: - return True - else: - return False - except amdsmi_exception.AmdSmiLibraryException: - return False + def convert_bytes_to_readable(self, bytes_input): + for unit in ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB"]: + if abs(bytes_input) < 1024: + return f"{bytes_input:3.1f} {unit}" + bytes_input /= 1024 + return f"{bytes_input:.1f} YB" diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_logger.py b/projects/amdsmi/amdsmi_cli/amdsmi_logger.py index e8e2e7fd8c..100747bb91 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_logger.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_logger.py @@ -48,6 +48,7 @@ class AMDSMILogger(): csv = 'csv' human_readable = 'human_readable' + class LoggerCompatibility(Enum): """Enum for logger compatibility""" amdsmi = 'amdsmi' @@ -55,6 +56,17 @@ class AMDSMILogger(): gpuvsmi = 'gpuvsmi' + class CsvStdoutBuilder(object): + def __init__(self): + self.csv_string = [] + + def write(self, row): + self.csv_string.append(row) + + def __str__(self): + return ''.join(self.csv_string) + + def is_json_format(self): return self.format == self.LoggerFormat.json.value @@ -79,17 +91,6 @@ class AMDSMILogger(): return self.compatibility == self.LoggerCompatibility.gpuvsmi.value - class CsvStdoutBuilder(object): - def __init__(self): - self.csv_string = [] - - def write(self, row): - self.csv_string.append(row) - - def __str__(self): - return ''.join(self.csv_string) - - def _capitalize_keys(self, input_dict): output_dict = {} for key in input_dict.keys(): @@ -239,7 +240,6 @@ class AMDSMILogger(): else: self.output[argument] = data elif self.is_csv_format(): - # New way is in gpuvsmi func self.output['gpu'] = int(gpu_id) if argument == 'values' or isinstance(data, dict): @@ -416,6 +416,7 @@ class AMDSMILogger(): human_readable_output = '' for output in self.multiple_device_output: human_readable_output += self._convert_json_to_human_readable(output) + human_readable_output += '\n' else: human_readable_output = self._convert_json_to_human_readable(self.output) @@ -432,7 +433,7 @@ class AMDSMILogger(): human_readable_output = '' for output in self.watch_output: human_readable_output += self._convert_json_to_human_readable(output) - output_file.write(human_readable_output) + output_file.write(human_readable_output + '\n') else: with self.destination.open('a') as output_file: - output_file.write(human_readable_output) + output_file.write(human_readable_output + '\n') diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 700f3b543b..cafe277edb 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -787,8 +787,10 @@ def amdsmi_get_gpu_board_info( return { "serial_number": board_info.serial_number, + "model_number": board_info.model_number.decode("utf-8"), "product_serial": board_info.product_serial.decode("utf-8"), "product_name": board_info.product_name.decode("utf-8"), + "manufacturer_name" : board_info.product_name.decode("utf-8") } @@ -803,7 +805,7 @@ def amdsmi_get_gpu_ras_block_features_enabled( ras_state = amdsmi_wrapper.amdsmi_ras_err_state_t() ras_states = [] for gpu_block in AmdSmiGpuBlock: - if gpu_block.name == "RESERVED": + if gpu_block.name == "RESERVED" or gpu_block.name == "INVALID": continue if gpu_block.name == "LAST": gpu_block.name = "FUSE" From 8110af6487606732307b4fbf6e0e6e6f99d13e40 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Tue, 16 May 2023 10:14:39 -0500 Subject: [PATCH 93/95] SWDEV-396262 - Fixed units for AMDSMI CLI process Change-Id: Ib85cfb9fe313cfc2eb5cd1d1437426786a99abd9 Signed-off-by: Maisam Arif [ROCm/amdsmi commit: 2f18ec7539a7c04dd4a30f4bbf7764e524d1c5ee] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 17 ++++------------- projects/amdsmi/amdsmi_cli/amdsmi_helpers.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 1669590aa7..4aacf829eb 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -1206,24 +1206,15 @@ class AMDSMICommands(): process_info['mem_usage'] = process_info.pop('mem') process_info['usage'] = process_info.pop('engine_usage') - # Convert mem_usage to megabytes - - mem_usage_mb = (process_info['mem_usage']//1024) // 1024 - if mem_usage_mb < 0: - process_info['mem_usage'] = process_info['mem_usage']//1024 - mem_usage_unit = 'B' - else: - process_info['mem_usage'] = mem_usage_mb - if self.logger.is_human_readable_format(): - mem_usage_unit = 'MB' - engine_usage_unit = '%' - process_info['mem_usage'] = f"{process_info['mem_usage']} {mem_usage_unit}" + process_info['mem_usage'] = self.helpers.convert_bytes_to_readable(process_info['mem_usage']) + engine_usage_unit = "ns" for usage_metric in process_info['usage']: process_info['usage'][usage_metric] = f"{process_info['usage'][usage_metric]} {engine_usage_unit}" + for usage_metric in process_info['memory_usage']: - process_info['memory_usage'][usage_metric] = f"{process_info['memory_usage'][usage_metric]} {engine_usage_unit}" + process_info['memory_usage'][usage_metric] = self.helpers.convert_bytes_to_readable(process_info['memory_usage'][usage_metric]) filtered_process_values.append({'process_info': process_info}) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py index f5df6c72db..3bb0f1cce2 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py @@ -387,6 +387,18 @@ class AMDSMIHelpers(): return False, profile_presets.values() + def has_ras_support(self, device_handle): + try: + caps_info = amdsmi_interface.amdsmi_get_caps_info(device_handle) + + if caps_info['ras_supported']: + return True + else: + return False + except amdsmi_exception.AmdSmiLibraryException: + return False + + def convert_bytes_to_readable(self, bytes_input): for unit in ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB"]: if abs(bytes_input) < 1024: From c94f66bbb6b1ef532061121c0b81940a3ed37417 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Thu, 18 May 2023 16:00:45 -0500 Subject: [PATCH 94/95] AMD-SMI-CLI - Packaging updates Added fallback in amdsmi_init.py to access /opt/rocm/share/amd_smi if python package is not installed Made libamd_smi.so detection more reliable Added PyYaml dependency to pyproject.toml Added python3-clang dependency in CMakeLists Updated python3 version dependency in CMakeLists Update Readme Added Release Notes Change-Id: Ie3b85fde7563dd84dce499f229aac1f94bcc2989 Signed-off-by: Maisam Arif [ROCm/amdsmi commit: da50f4f078fb5d011379c1382e54850dab6ca28b] --- projects/amdsmi/CMakeLists.txt | 15 ++++---- projects/amdsmi/amdsmi_cli/README.md | 35 +++++++++++++++---- projects/amdsmi/amdsmi_cli/Release Notes.md | 33 +++++++++++++++++ projects/amdsmi/amdsmi_cli/amdsmi_init.py | 3 +- .../amdsmi/py-interface/amdsmi_wrapper.py | 14 ++++---- projects/amdsmi/py-interface/pyproject.toml | 5 ++- projects/amdsmi/tools/generator.py | 10 +++--- 7 files changed, 89 insertions(+), 26 deletions(-) create mode 100644 projects/amdsmi/amdsmi_cli/Release Notes.md diff --git a/projects/amdsmi/CMakeLists.txt b/projects/amdsmi/CMakeLists.txt index 552b68741a..3702f31253 100755 --- a/projects/amdsmi/CMakeLists.txt +++ b/projects/amdsmi/CMakeLists.txt @@ -208,9 +208,10 @@ set(CPACK_DEBIAN_ASAN_PACKAGE_RECOMMENDS "sudo, libdrm-dev") set(CPACK_DEBIAN_DEV_PACKAGE_RECOMMENDS "sudo, libdrm-dev") set(CPACK_DEBIAN_ASAN_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}-asan") set(CPACK_DEBIAN_DEV_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3") -set(CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS "python3") -set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "python3") +#Python 3.7.9 is the first stable build post the python bugfix window +set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3 (>= 3.7.9), python3-clang, python3-yaml") +set(CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS "python3 (>= 3.7.9), python3-clang, python3-yaml") +set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "python3 (>= 3.7.9), python3-clang, python3-yaml") ## Process the Debian install/remove scripts to update the CPACK variables configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst.in DEBIAN/postinst @ONLY) @@ -227,11 +228,12 @@ endif() set(CPACK_RPM_PACKAGE_PROVIDES "amd-smi") set(CPACK_RPM_DEV_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}") set(CPACK_RPM_ASAN_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}-asan") -set(CPACK_RPM_PACKAGE_REQUIRES "python3") +#Python 3.7.9 is the first stable build post the python bugfix window +set(CPACK_RPM_PACKAGE_REQUIRES "python38, python3-clang, python3-pyyaml") # don't terminate if bytecompile of python files fails set(CPACK_RPM_SPEC_MORE_DEFINE "%define _python_bytecompile_errors_terminate_build 0") -set(CPACK_RPM_DEV_PACKAGE_REQUIRES "python3") -set(CPACK_RPM_ASAN_PACKAGE_REQUIRES "python3") +set(CPACK_RPM_DEV_PACKAGE_REQUIRES "python38, python3-clang, python3-pyyaml") +set(CPACK_RPM_ASAN_PACKAGE_REQUIRES "python38, python3-clang, python3-pyyaml") # Add rocm-core dependency if -DROCM_DEP_ROCMCORE=ON is passed if(ROCM_DEP_ROCMCORE) @@ -243,7 +245,6 @@ if(ROCM_DEP_ROCMCORE) string(APPEND CPACK_RPM_PACKAGE_REQUIRES ", rocm-core") endif() - ## Enable Component Mode and set component specific flags set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_DEBIAN_DEV_PACKAGE_NAME "${AMD_SMI_PACKAGE}") diff --git a/projects/amdsmi/amdsmi_cli/README.md b/projects/amdsmi/amdsmi_cli/README.md index 7fe72510d3..bcaa1d9659 100644 --- a/projects/amdsmi/amdsmi_cli/README.md +++ b/projects/amdsmi/amdsmi_cli/README.md @@ -1,4 +1,5 @@ # AMD System Management Interface + This tool acts as a command line interface for manipulating and monitoring the amdgpu kernel, and is intended to replace and deprecate the existing rocm_smi CLI tool & gpuv-smi tool. @@ -6,27 +7,47 @@ It uses Ctypes to call the amd_smi_lib API. Recommended: At least one AMD GPU with AMD driver installed ## Requirements -* python 3.7+ 64-bit -* driver must be loaded for amdsmi_init() to pass + +- python 3.7+ 64-bit +- driver must be loaded for amdsmi_init() to pass ## Installation + - Install amdgpu driver -- Through package manager install amd-smi-lib +- Install amd-smi-lib package through package manager - cd /opt//share/amd_smi - pip install . -- /opt//bin/amd-smi + +or + +- pip3 install . +- /opt//bin/amd-smi --help + +### RHEL 8 + +The default python version in RHEL 8 is python 3.6.8 + +To install the python library you need to upgrade to python 3.7+ + +The package's dependency manager will attempt to install python 3.8+ + +Verify that your pip version is 3.7+ and if not you can use pip3.8 instead ### Example of Ubuntu 22.04 post amdgpu driver install + ``` shell apt install amd-smi-lib cd /opt/rocm/share/amd_smi pip install . /opt/rocm/bin/amd-smi ``` -Add /opt/rocm/bin to your local path to access amd-smi via the cmdline + +Add /opt/rocm/bin to your shell's path to access amd-smi via the cmdline ## Usage + amd-smi will report the version and current platform detected when running the command without arguments: + ``` bash amd-smi usage: amd-smi [-h] ... @@ -51,12 +72,15 @@ AMD-SMI Commands: set Set options for devices. reset Reset options for devices. ``` + More detailed verison information can be give when running `amd-smi version` Each command will have detailed information via `amd-smi [command] --help` ## Commands + For convenience, here is the help output for each command + ``` bash amd-smi discovery --help usage: amd-smi discovery [-h] [--json | --csv] [--file FILE] @@ -330,4 +354,3 @@ The information contained herein is for informational purposes only, and is subj AMD, the AMD Arrow logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies. Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All rights reserved. - diff --git a/projects/amdsmi/amdsmi_cli/Release Notes.md b/projects/amdsmi/amdsmi_cli/Release Notes.md new file mode 100644 index 0000000000..8f4ff9ceb9 --- /dev/null +++ b/projects/amdsmi/amdsmi_cli/Release Notes.md @@ -0,0 +1,33 @@ +# Release Notes + +## Documentation + +Documentation for AMDSMI-CLI is available post install in /opt//libexec/amdsmi_cli/README.md + +## AMDSMI-CLI 0.0.4 + +### Added + +- AMDSMI-CLI tool enabled for Linux Baremetal & Guest +- Added CSV & Watch modifier +- Added topology subcommand + +### Known Issues + +- not all ecc fields are currently supported +- RHEL 8 has extra install steps + +## AMDSMI-CLI 0.0.2 + +### Added + +- AMDSMI-CLI tool enabled for Linux Baremetal & Guest + +### Known Issues + +- ecc & ras subcommands will report N/A even if RAS is enabled +- process vram_mem's unit is listed as percentage vs bytes +- csv modifier does not work +- topology information is not yet enabled +- watch modifier not fully enabled +- limited guest support \ No newline at end of file diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_init.py b/projects/amdsmi/amdsmi_cli/amdsmi_init.py index 602b366ee4..cb0656252e 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_init.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_init.py @@ -29,7 +29,8 @@ import sys from pathlib import Path -sys.path.append(f'{Path(__file__).resolve().parent}/../../share/amd_smi') +sys.path.append(f"{Path(__file__).resolve().parent}/../../share/amd_smi") +sys.path.append("/opt/rocm/share/amd_smi") from amdsmi import amdsmi_interface from amdsmi import amdsmi_exception diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 2d6b693a26..c69f13d1b5 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -165,26 +165,28 @@ def char_pointer_cast(string, encoding='utf-8'): return ctypes.cast(string, ctypes.POINTER(ctypes.c_char)) - +### Match edits in generator.py from start to end +### Start match _libraries = {} from pathlib import Path -libamd_smi_optrocm = Path(__file__).parents[3] / "/lib/libamd_smi.so" libamd_smi_cpack = Path("@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/libamd_smi.so") +libamd_smi_optrocm = Path("/opt/rocm/lib/libamd_smi.so") libamd_smi_parent_dir = Path(__file__).resolve().parent / "libamd_smi.so" libamd_smi_cwd = Path.cwd() / "libamd_smi.so" -if libamd_smi_optrocm.is_file(): - # try /opt/rocm/lib as a fallback - _libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_optrocm) -elif libamd_smi_cpack.is_file(): +if libamd_smi_cpack.is_file(): # try to find library in install directory provided by CMake _libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_cpack) +elif libamd_smi_optrocm.is_file(): + # try /opt/rocm/lib as a fallback + _libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_optrocm) elif libamd_smi_parent_dir.is_file(): # try to fall back to parent directory _libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_parent_dir) else: # lastly - search in current working directory _libraries['libamd_smi.so'] = ctypes.CDLL(libamd_smi_cwd) +### End match diff --git a/projects/amdsmi/py-interface/pyproject.toml b/projects/amdsmi/py-interface/pyproject.toml index ce8aa66a12..15174141e3 100644 --- a/projects/amdsmi/py-interface/pyproject.toml +++ b/projects/amdsmi/py-interface/pyproject.toml @@ -10,11 +10,14 @@ name = "amdsmi" authors = [ {name = "AMD", email = "amd-smi.support@amd.com"}, ] -version = '0.3' +version = '0.4' license = {file = "amdsmi/LICENSE"} readme = {file = "amdsmi/README.md", content-type = "text/markdown"} description = "SMI LIB - AMD GPU Monitoring Library" requires-python = ">=3.7" +dependencies = [ + 'PyYAML >= 5.0', +] [project.urls] "Homepage" = "https://github.com/RadeonOpenCompute/amdsmi" diff --git a/projects/amdsmi/tools/generator.py b/projects/amdsmi/tools/generator.py index 1e9d8aa588..d3771512d4 100644 --- a/projects/amdsmi/tools/generator.py +++ b/projects/amdsmi/tools/generator.py @@ -106,17 +106,17 @@ def main(): library_path = os.path.join(os.path.dirname(__file__), library) line_to_replace = "_libraries['{}'] = ctypes.CDLL('{}')".format(library_name, library_path) new_line = f"""from pathlib import Path -libamd_smi_optrocm = Path(__file__).parents[3] / "/lib/{library_name}" libamd_smi_cpack = Path("@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/{library_name}") +libamd_smi_optrocm = Path("/opt/rocm/lib/{library_name}") libamd_smi_parent_dir = Path(__file__).resolve().parent / "{library_name}" libamd_smi_cwd = Path.cwd() / "{library_name}" -if libamd_smi_optrocm.is_file(): - # try /opt/rocm/lib as a fallback - _libraries['{library_name}'] = ctypes.CDLL(libamd_smi_optrocm) -elif libamd_smi_cpack.is_file(): +if libamd_smi_cpack.is_file(): # try to find library in install directory provided by CMake _libraries['{library_name}'] = ctypes.CDLL(libamd_smi_cpack) +elif libamd_smi_optrocm.is_file(): + # try /opt/rocm/lib as a fallback + _libraries['{library_name}'] = ctypes.CDLL(libamd_smi_optrocm) elif libamd_smi_parent_dir.is_file(): # try to fall back to parent directory _libraries['{library_name}'] = ctypes.CDLL(libamd_smi_parent_dir) From 88ff2a1ee0480a1e7e4bf5937aa7ee1eae9ef338 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Tue, 23 May 2023 17:31:59 -0500 Subject: [PATCH 95/95] Updated AMD-SMI README.md with CLI install instructions Updated amd-smi-lib README with CLI install instructions Updated version of the python interface and the CLI tool to 0.1.0 due to the ESMI header changes Change-Id: If175cdcb9ce0352b6e7e7ce4cc0940a80c11501b Signed-off-by: Maisam Arif [ROCm/amdsmi commit: 72638192f79e126fabc6393d80be3c51ede051e6] --- projects/amdsmi/README.md | 29 +++++++++++++++++++-- projects/amdsmi/amdsmi_cli/_version.py | 2 +- projects/amdsmi/py-interface/pyproject.toml | 2 +- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/projects/amdsmi/README.md b/projects/amdsmi/README.md index 44d103ae5d..a017f40f30 100755 --- a/projects/amdsmi/README.md +++ b/projects/amdsmi/README.md @@ -157,7 +157,32 @@ int main() { } ``` -# Python wrapper +# Insall Python Library and CLI Tool + +## Requirements + +- python 3.7+ 64-bit +- driver must be loaded for amdsmi_init() to pass + +## Installation + +- Install amdgpu driver +- Install amd-smi-lib package through package manager +- cd /opt//share/amd_smi +- pip install . + +or + +- pip3 install . +- /opt//bin/amd-smi --help + +Add /opt//bin to your shell's path to call amd-smi from the cmdline + +## Documentation + +Documentation for AMDSMI-CLI is available post install in /opt//libexec/amdsmi_cli/README.md + +## Rebuilding Python wrapper The python wrapper (binding) is an auto-generated file `py-interface/amdsmi_wrapper.py` Wrapper should be re-generated on each C++ API change, by doing: @@ -173,7 +198,7 @@ Note: To be able to re-generate python wrapper you need several tools installed Note: python_wrapper is NOT automatically re-generated. You must run `cmake` with `-DBUILD_WRAPPER=on` argument. -## DISCLAIMER +# DISCLAIMER The information contained herein is for informational purposes only, and is subject to change without notice. In addition, any stated support is planned and is also subject to change. While every precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular purposes, with respect to the operation or use of AMD hardware, software or other products described herein. diff --git a/projects/amdsmi/amdsmi_cli/_version.py b/projects/amdsmi/amdsmi_cli/_version.py index 81f0fdeccf..3dc1f76bc6 100644 --- a/projects/amdsmi/amdsmi_cli/_version.py +++ b/projects/amdsmi/amdsmi_cli/_version.py @@ -1 +1 @@ -__version__ = "0.0.4" +__version__ = "0.1.0" diff --git a/projects/amdsmi/py-interface/pyproject.toml b/projects/amdsmi/py-interface/pyproject.toml index 15174141e3..d7f95a869a 100644 --- a/projects/amdsmi/py-interface/pyproject.toml +++ b/projects/amdsmi/py-interface/pyproject.toml @@ -10,7 +10,7 @@ name = "amdsmi" authors = [ {name = "AMD", email = "amd-smi.support@amd.com"}, ] -version = '0.4' +version = '1.0' license = {file = "amdsmi/LICENSE"} readme = {file = "amdsmi/README.md", content-type = "text/markdown"} description = "SMI LIB - AMD GPU Monitoring Library"