From 642986764b8bb89d57f94081330ef6624a46caef Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:39:10 -0500 Subject: [PATCH] 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 "