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
This commit is contained in:
committed by
Naveen Krishna Chatradhi
parent
5ed24711c7
commit
20222f771e
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -288,7 +288,7 @@ class Formatter:
|
||||
| """ + self.style.header("COMMANDS:") + """ |
|
||||
| |
|
||||
| """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_dev_get_vendor_name <bdf>") + """ |
|
||||
| """ + self.style.text(" 2 Get device id. Api: amdsmi_dev_get_id <bdf>") + """ |
|
||||
| """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id <bdf>") + """ |
|
||||
| """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor <bdf>") + """ |
|
||||
| """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor <bdf>") + """ |
|
||||
| """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id <bdf>") + """ |
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user