Get and set the XGMI PLPD

Update the API and CLI to support XGMI Per-Link Power Down Policy.

Change-Id: Iaf04a771eb8bb0829a5b3088d803a7355a8dfd0b
This commit is contained in:
Bill(Shuzhou) Liu
2024-03-20 12:06:24 -05:00
committed by Maisam Arif
parent 1ac1ee4b9a
commit e4085c6414
11 changed files with 467 additions and 50 deletions
+70 -2
View File
@@ -909,8 +909,8 @@ Field | Description
`name` | Name of process
`pid` | Process ID
`mem` | Process memory usage
`engine_usage`| <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gfx`</td><td>GFX engine usage in ns</td></tr><tr><td>`enc`</td><td>Encode engine usage in ns</td></tr></tbody></table>
`memory_usage`| <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gtt_mem`</td><td>GTT memory usage</td></tr><tr><td>`cpu_mem`</td><td>CPU memory usage</td></tr><tr><td>`vram_mem`</td><td>VRAM memory usage</td></tr> </tbody></table>
`engine_usage` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gfx`</td><td>GFX engine usage in ns</td></tr><tr><td>`enc`</td><td>Encode engine usage in ns</td></tr></tbody></table>
`memory_usage` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gtt_mem`</td><td>GTT memory usage</td></tr><tr><td>`cpu_mem`</td><td>CPU memory usage</td></tr><tr><td>`vram_mem`</td><td>VRAM memory usage</td></tr> </tbody></table>
Exceptions that can be thrown by `amdsmi_get_gpu_process_info` function:
@@ -2612,6 +2612,74 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_set_xgmi_plpd
Description: Set the xgmi per-link power down policy parameter for the processor
Input parameters:
* `processor_handle` handle for the given device
* `policy_id` the xgmi plpd id to set.
Output: None
Exceptions that can be thrown by `amdsmi_set_xgmi_plpd` 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:
amdsmi_set_xgmi_plpd(device, 0)
except AmdSmiException as e:
print(e)
```
### amdsmi_get_xgmi_plpd
Description: Get the xgmi per-link power down policy parameter for the processor
Input parameters:
* `processor_handle` handle for the given device
Output: Dict containing information about xgmi per-link power down policy
Field | Description
---|---
`num_supported` | The number of supported policies
`current_id` | The current policy index
`plpds` | List of policies.
Exceptions that can be thrown by `amdsmi_get_xgmi_plpd` 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:
xgmi_plpd = amdsmi_get_xgmi_plpd(device)
print(xgmi_plpd)
except AmdSmiException as e:
print(e)
```
### amdsmi_set_gpu_overdrive_level
Description: **deprecated** Set the overdrive percent associated with the