[SWDEV-453922] AMD SMI to provide mapping feature of other enumeration methods (#51)

Added enumeration mapping for 
- drm render
- drm card
- hsa id 
- hip id
- hip uuid (rocminfo uuid)

Signed-off-by: AL Musaffar, Yazen <Yazen.ALMusaffar@amd.com>
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Co-authored-by: Maisam Arif <Maisam.Arif@amd.com>
This commit is contained in:
AL Musaffar, Yazen
2025-03-07 09:09:12 -06:00
committed by GitHub
parent d5b2763aba
commit 2936e00fed
11 changed files with 417 additions and 88 deletions
+40
View File
@@ -274,6 +274,46 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_enumeration_info
Description: Returns enumeration information for the given GPU
Input parameters:
* `processor_handle` device which to query
Output: Dictionary with fields
Field | Content
---|---
`drm_render` | DRM render ID
`drm_card` | DRM card ID
`hsa_id` | HSA ID
`hip_id` | HIP ID
`hip_uuid` | HIP UUID
Exceptions that can be thrown by `amdsmi_get_gpu_enumeration_info` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
Example:
```python
try:
devices = amdsmi_get_processor_handles()
for device in devices:
info = amdsmi_get_gpu_enumeration_info(device)
print("DRM Render ID:", info['drm_render'])
print("DRM Card ID:", info['drm_card'])
print("HSA ID:", info['hsa_id'])
print("HIP ID:", info['hip_id'])
print("HIP UUID:", info['hip_uuid'])
except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_driver_info
Description: Returns the info of the driver