Moved partition_id from static --asic-info to static --partition.

partition_id also removed from the `amdsmi_asic_info_t` struct and
supporting API has been added for querying partition information.

Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: Id5a6291a77d11bb97a1c7a200fc465898e86e081
This commit is contained in:
gabrpham
2024-09-18 19:53:32 -05:00
committed by Maisam Arif
parent 3b7f661e71
commit c9a489d437
10 changed files with 351 additions and 155 deletions
+40 -1
View File
@@ -2102,6 +2102,7 @@ except AmdSmiException as e:
```
### amdsmi_set_gpu_process_isolation
Description: Enable/disable the system Process Isolation for the given device handle.
Input parameters:
@@ -2132,6 +2133,7 @@ except AmdSmiException as e:
```
### amdsmi_clean_gpu_local_data
Description: Clear the SRAM data of the given device. This can be called between user logins to prevent information leak.
Input parameters:
@@ -2160,7 +2162,6 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_overdrive_level
Description: Get the overdrive percent associated with the device with provided
@@ -3826,6 +3827,44 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_accelerator_partition_profile
**Note: CURRENTLY HARDCODED TO RETURN EMPTY VALUES**
Description: Get partition information for target device
Input parameters:
* `processor_handle` the device handle
Output: Dictionary with fields:
Field | Description
---|---
`partition_id` | ID of the partition on the GPU provided
`partition_profile` | Dict containing partition data (TBD)
Exceptions that can be thrown by `amdsmi_get_gpu_accelerator_partition_profile` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
Example:
```python
try:
devices = amdsmi_get_processor_handles()
if len(devices) == 0:
print("No GPUs on machine")
else:
for device in devices:
partition_id = amdsmi_get_gpu_accelerator_partition_profile(device)["partition_id"]
print(partition_id)
except AmdSmiException as e:
print(e)
```
### amdsmi_get_xgmi_info
Description: Returns XGMI information for the GPU.