Documented and adjusted APIs for asic info, vram info, and P2P topology

Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: I7ac9a868148e29c92299b21540e057f64cb4123e
Šī revīzija ir iekļauta:
gabrpham
2024-11-11 19:17:28 -06:00
revīziju iesūtīja Maisam Arif
vecāks 4d26db84ca
revīzija 19cc4718c0
2 mainīti faili ar 47 papildinājumiem un 6 dzēšanām
+42 -1
Parādīt failu
@@ -444,6 +444,7 @@ Field | Description
`vram_type` | vram type
`vram_vendor` | vram vendor
`vram_size` | vram size in mb
`vram_bit_width` | vram bit width
Exceptions that can be thrown by `amdsmi_get_gpu_vram_info` function:
@@ -464,6 +465,7 @@ try:
print(vram_info['vram_type'])
print(vram_info['vram_vendor'])
print(vram_info['vram_size'])
print(vram_info['vram_bit_width'])
except AmdSmiException as e:
print(e)
```
@@ -2411,7 +2413,7 @@ try:
print("No GPUs on machine")
else:
for device in devices:
print(amdsmi_get_gpu_reg_table_info(device, AmdSmiRegType.USR1))
print(amdsmi_get_gpu_reg_table_info(device, AmdSmiRegType.PCIE))
except AmdSmiException as e:
print(e)
```
@@ -3627,6 +3629,45 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_get_P2P_status
Description: Retrieve the connection type and P2P capabilities between 2 GPUs
Input parameters:
* `processor_handle_src` the source device handle
* `processor_handle_dest` the destination device handle
Output: Dictionary with fields:
Fields | Description
---|---
`type` | AmdSmiIoLinkType
`cap` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`is_iolink_coherent`</td><td>1 == True; 0 == False; Uint_max = Undefined</td></tr><tr><td>`is_iolink_atomics_32bit`</td><td>Supports 32bit atomics</td></tr><tr><td>`is_iolink_atomics_64bit`</td><td>Supports 64bit atomics</td></tr><tr><td>`is_iolink_dma`</td><td>Supports DMA</td></tr><tr><td>`is_iolink_bi_directional`</td><td>Is the IOLink Bidirectional</td></tr></tbody></table>
Exceptions that can be thrown by `amdsmi_get_P2P_status` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
Example:
```python
try:
devices = amdsmi_get_processor_handles()
if len(devices) == 0:
print("No GPUs on machine")
else:
processor_handle_src = devices[0]
processor_handle_dest = devices[1]
link_type = amdsmi_get_P2P_status(processor_handle_src, processor_handle_dest)
print(link_type['type'])
print(link_type['caps'])
except AmdSmiException as e:
print(e)
```
### amdsmi_is_P2P_accessible
Description: Return P2P availability status between 2 GPUs
+5 -5
Parādīt failu
@@ -1753,8 +1753,8 @@ def amdsmi_get_gpu_pm_metrics_info(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
)
pm_metrics = ctypes.POINTER(struct_amdsmi_name_value_t);
num_mets = ctypes.c_uint32;
pm_metrics = ctypes.POINTER(amdsmi_wrapper.amdsmi_name_value_t)
num_mets = ctypes.c_uint32
_check_res(
amdsmi_wrapper.amdsmi_get_gpu_pm_metrics_info(
@@ -1782,8 +1782,8 @@ def amdsmi_get_gpu_reg_table_info(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
)
reg_metrics = ctypes.POINTER(struct_amdsmi_name_value_t);
num_regs = ctypes.c_uint32;
reg_metrics = ctypes.POINTER(amdsmi_wrapper.amdsmi_name_value_t)
num_regs = ctypes.c_uint32
_check_res(
amdsmi_wrapper.amdsmi_get_gpu_reg_table_info(
@@ -1798,7 +1798,7 @@ def amdsmi_get_gpu_reg_table_info(
'value': reg_metrics[i].value
}
results.append(item)
amdsmi_wrapper.amdsmi_free_name_value_pairs(pm_metrics)
amdsmi_wrapper.amdsmi_free_name_value_pairs(reg_metrics)
return results