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();