amdsmi


Nameamdsmi JSON
Version 6.2.4 PyPI version JSON
download
home_pagehttps://github.com/RadeonOpenCompute/amdsmi
SummaryAMDSMI Python LIB - AMD GPU Monitoring Library
upload_time2024-11-09 05:12:52
maintainerNone
docs_urlNone
authorAMD
requires_python>=3.6
licenseCopyright (c) 2019-2023 Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            This is an unofficial distribution of the official Python wrapper for amdsmi. See https://github.com/ml-energy/amdsmi for distribution scripts and source code.

AMD -- Please contact Parth Raut (<praut@umich.edu>) and Jae-Won Chung (<jwnchung@umich.edu>) to take over the repository when you would like to distribute official bindings under this project name.


# AMD SMI Python Library

## Requirements

* Python 3.6+ 64-bit
* Driver must be loaded for amdsmi_init() to pass

## Overview

### Folder structure

File Name | Note
---|---
`__init__.py` | Python package initialization file
`amdsmi_interface.py` | Amdsmi library python interface
`amdsmi_wrapper.py` | Python wrapper around amdsmi binary
`amdsmi_exception.py` | Amdsmi exceptions python file
`README.md` | Documentation

### Usage

`amdsmi` folder should be copied and placed next to importing script. It should be imported as:

```python
from amdsmi import *

try:
    amdsmi_init()

    # amdsmi calls ...

except AmdSmiException as e:
    print(e)
finally:
    try:
        amdsmi_shut_down()
    except AmdSmiException as e:
        print(e)
```

To initialize amdsmi lib, amdsmi_init() must be called before all other calls to amdsmi lib.

To close connection to driver, amdsmi_shut_down() must be the last call.

### Exceptions

All exceptions are in `amdsmi_exception.py` file.
Exceptions that can be thrown are:

* `AmdSmiException`: base amdsmi exception class
* `AmdSmiLibraryException`: derives base `AmdSmiException` class and represents errors that can occur in amdsmi-lib.
When this exception is thrown, `err_code` and `err_info` are set. `err_code` is an integer that corresponds to errors that can occur
in amdsmi-lib and `err_info` is a string that explains the error that occurred.
Example:

```python
try:
    num_of_GPUs = len(amdsmi_get_processor_handles())
    if num_of_GPUs == 0:
        print("No GPUs on machine")
except AmdSmiException as e:
    print("Error code: {}".format(e.err_code))
    if e.err_code == amdsmi_wrapper.AMDSMI_STATUS_RETRY:
        print("Error info: {}".format(e.err_info))
```

* `AmdSmiRetryException` : Derives `AmdSmiLibraryException` class and signals device is busy and call should be retried.
* `AmdSmiTimeoutException` : Derives `AmdSmiLibraryException` class and represents that call had timed out.
* `AmdSmiParameterException`: Derives base `AmdSmiException` class and represents errors related to invaild parameters passed to functions. When this exception is thrown, err_msg is set and it explains what is the actual and expected type of the parameters.
* `AmdSmiBdfFormatException`: Derives base `AmdSmiException` class and represents invalid bdf format.

## API

### amdsmi_init

Description: Initialize amdsmi with AmdSmiInitFlags

Input parameters: AmdSmiInitFlags

Output: `None`

Exceptions that can be thrown by `amdsmi_init` function:

* `AmdSmiLibraryException`

Initialize GPUs only example:

```python
try:
    # by default we initalize with AmdSmiInitFlags.INIT_AMD_GPUS
    ret = amdsmi_init()
    # continue with amdsmi
except AmdSmiException as e:
    print("Init GPUs failed")
    print(e)
```

Initialize CPUs only example:

```python
try:
    ret = amdsmi_init(AmdSmiInitFlags.INIT_AMD_CPUS)
    # continue with amdsmi
except AmdSmiException as e:
    print("Init CPUs failed")
    print(e)
```

Initialize both GPUs and CPUs example:

```python
try:
    ret = amdsmi_init(AmdSmiInitFlags.INIT_AMD_APUS)
    # continue with amdsmi
except AmdSmiException as e:
    print("Init both GPUs & CPUs failed")
    print(e)
```

### amdsmi_shut_down

Description: Finalize and close connection to driver

Input parameters: `None`

Output: `None`

Exceptions that can be thrown by `amdsmi_shut_down` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    amdsmi_init()
    amdsmi_shut_down()
except AmdSmiException as e:
    print("Shut down failed")
    print(e)
```

### amdsmi_get_processor_type

Description: Checks the type of device with provided handle.

Input parameters: device handle as an instance of `amdsmi_processor_handle`

Output: Integer, type of gpu

Exceptions that can be thrown by `amdsmi_get_processor_type` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    type_of_GPU = amdsmi_get_processor_type(processor_handle)
    if type_of_GPU == 1:
        print("This is an AMD GPU")
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_processor_handles

Description: Returns list of GPU device handle objects on current machine

Input parameters: `None`

Output: List of GPU device handle objects

Exceptions that can be thrown by `amdsmi_get_processor_handles` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    devices = amdsmi_get_processor_handles()
    if len(devices) == 0:
        print("No GPUs on machine")
    else:
        for device in devices:
            print(amdsmi_get_gpu_device_uuid(device))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_socket_handles

**Note: CURRENTLY HARDCODED TO RETURN DUMMY DATA**

Description: Returns list of socket device handle objects on current machine

Input parameters: `None`

Output: List of socket device handle objects

Exceptions that can be thrown by `amdsmi_get_socket_handles` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    sockets = amdsmi_get_socket_handles()
    print('Socket numbers: {}'.format(len(sockets)))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_socket_info

**Note: CURRENTLY HARDCODED TO RETURN EMPTY VALUES**

Description: Return socket name

Input parameters:
`socket_handle` socket handle

Output: Socket name

Exceptions that can be thrown by `amdsmi_get_socket_info` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    socket_handles = amdsmi_get_socket_handles()
    if len(socket_handles) == 0:
        print("No sockets on machine")
    else:
        for socket in socket_handles:
            print(amdsmi_get_socket_info(socket))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_processor_handle_from_bdf

Description: Returns device handle from the given BDF

Input parameters: bdf string in form of either `<domain>:<bus>:<device>.<function>` or `<bus>:<device>.<function>` in hexcode format.
Where:

* `<domain>` is 4 hex digits long from 0000-FFFF interval
* `<bus>` is 2 hex digits long from 00-FF interval
* `<device>` is 2 hex digits long from 00-1F interval
* `<function>` is 1 hex digit long from 0-7 interval

Output: device handle object

Exceptions that can be thrown by `amdsmi_get_processor_handle_from_bdf` function:

* `AmdSmiLibraryException`
* `AmdSmiBdfFormatException`

Example:

```python
try:
    device = amdsmi_get_processor_handle_from_bdf("0000:23:00.0")
    print(amdsmi_get_gpu_device_uuid(device))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_device_bdf

Description: Returns BDF of the given device

Input parameters:

* `processor_handle` dev for which to query

Output: BDF string in form of `<domain>:<bus>:<device>.<function>` in hexcode format.
Where:

* `<domain>` is 4 hex digits long from 0000-FFFF interval
* `<bus>` is 2 hex digits long from 00-FF interval
* `<device>` is 2 hex digits long from 00-1F interval
* `<function>` is 1 hex digit long from 0-7 interval

Exceptions that can be thrown by `amdsmi_get_gpu_device_bdf` function:

* `AmdSmiParameterException`
* `AmdSmiLibraryException`

Example:

```python
try:
    device = amdsmi_get_processor_handles()[0]
    print("Device's bdf:", amdsmi_get_gpu_device_bdf(device))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_device_uuid

Description: Returns the UUID of the device

Input parameters:

* `processor_handle` dev for which to query

Output: UUID string unique to the device

Exceptions that can be thrown by `amdsmi_get_gpu_device_uuid` function:

* `AmdSmiParameterException`
* `AmdSmiLibraryException`

Example:

```python
try:
    device = amdsmi_get_processor_handles()[0]
    print("Device UUID: ", amdsmi_get_gpu_device_uuid(device))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_driver_info

Description: Returns the info of the driver

Input parameters:

* `processor_handle` dev for which to query

Output: Dictionary with fields

Field | Content
---|---
`driver_name` |  driver name
`driver_version` |  driver_version
`driver_date` |  driver_date

Exceptions that can be thrown by `amdsmi_get_gpu_driver_info` function:

* `AmdSmiParameterException`
* `AmdSmiLibraryException`

Example:

```python
try:
    device = amdsmi_get_processor_handles()[0]
    print("Driver info: ", amdsmi_get_gpu_driver_info(device))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_asic_info

Description: Returns asic information for the given GPU

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Content
---|---
`market_name` |  market name
`vendor_id` |  vendor id
`vendor_name` |  vendor name
`device_id` |  device id
`rev_id` |  revision id
`asic_serial` | asic serial
`oam_id` | oam id

Exceptions that can be thrown by `amdsmi_get_gpu_asic_info` 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:
            asic_info = amdsmi_get_gpu_asic_info(device)
            print(asic_info['market_name'])
            print(hex(asic_info['vendor_id']))
            print(asic_info['vendor_name'])
            print(hex(asic_info['device_id']))
            print(hex(asic_info['rev_id']))
            print(asic_info['asic_serial'])
            print(asic_info['oam_id'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_power_cap_info

Description: Returns dictionary of power capabilities as currently configured
on the given GPU. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Description | Units
---|---|---
`power_cap` |  power capability | uW
`dpm_cap` |  dynamic power management capability | MHz
`default_power_cap` |  default power capability | uW
`min_power_cap` | min power capability | uW
`max_power_cap` | max power capability | uW

Exceptions that can be thrown by `amdsmi_get_power_cap_info` 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:
            power_info = amdsmi_get_power_cap_info(device)
            print(power_info['power_cap'])
            print(power_info['dpm_cap'])
            print(power_info['default_power_cap'])
            print(power_info['min_power_cap'])
            print(power_info['max_power_cap'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_vram_info

Description: Returns dictionary of vram information for the given GPU.

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Description
---|---
`vram_type` |  vram type
`vram_vendor` |  vram vendor
`vram_size` |  vram size in mb

Exceptions that can be thrown by `amdsmi_get_gpu_vram_info` 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:
            vram_info = amdsmi_get_gpu_vram_info(device)
            print(vram_info['vram_type'])
            print(vram_info['vram_vendor'])
            print(vram_info['vram_size'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_cache_info

Description: Returns a list of dictionaries containing cache information for the given GPU.

Input parameters:

* `processor_handle` device which to query

Output: List of Dictionaries containing cache information following the schema below:
Schema:

```JSON
{
    cache_properties:
        {
            "type" : "array",
            "items" : {"type" : "string"}
        },
    cache_size: {"type" : "number"},
    cache_level: {"type" : "number"},
    max_num_cu_shared: {"type" : "number"},
    num_cache_instance: {"type" : "number"}
}
```

Field | Description
---|---
`cache_properties` | list of up to 4 cache property type strings. Ex. data ("DATA_CACHE"), instruction ("INST_CACHE"), CPU ("CPU_CACHE"), or SIMD ("SIMD_CACHE").
`cache_size` | size of cache in KB
`cache_level` | level of cache
`max_num_cu_shared` |  max number of compute units shared
`num_cache_instance` | number of cache instances

Exceptions that can be thrown by `amdsmi_get_gpu_cache_info` 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:
            cache_info = amdsmi_get_gpu_cache_info(device)
            for cache_index, cache_values in cache_info.items():
                print(cache_values['cache_properties'])
                print(cache_values['cache_size'])
                print(cache_values['cache_level'])
                print(cache_values['max_num_cu_shared'])
                print(cache_values['num_cache_instance'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_vbios_info

Description:  Returns the static information for the VBIOS on the device.

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Description
---|---
`name` | vbios name
`build_date` | vbios build date
`part_number` | vbios part number
`version` | vbios version string

Exceptions that can be thrown by `amdsmi_get_gpu_vbios_info` 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:
            vbios_info = amdsmi_get_gpu_vbios_info(device)
            print(vbios_info['name'])
            print(vbios_info['build_date'])
            print(vbios_info['part_number'])
            print(vbios_info['version'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_fw_info

Description:  Returns GPU firmware related information.

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Description
---|---
`fw_list` | List of dictionaries that contain information about a certain firmware block

Exceptions that can be thrown by `amdsmi_get_fw_info` 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:
            firmware_list = amdsmi_get_fw_info(device)['fw_list']
            for firmware_block in firmware_list:
                print(firmware_block['fw_name'])
                # String formated hex or decimal value ie: 21.00.00.AC or 130
                print(firmware_block['fw_version'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_activity

Description: Returns the engine usage for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary of activites to their respective usage percentage or 'N/A' if not supported

Field | Description
---|---
`gfx_activity` | graphics engine usage percentage (0 - 100)
`umc_activity` | memory engine usage percentage (0 - 100)
`mm_activity` | average multimedia engine usages in percentage (0 - 100)

Exceptions that can be thrown by `amdsmi_get_gpu_activity` 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:
            engine_usage = amdsmi_get_gpu_activity(device)
            print(engine_usage['gfx_activity'])
            print(engine_usage['umc_activity'])
            print(engine_usage['mm_activity'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_power_info

Description: Returns the current power and voltage for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Description
---|---
`current_socket_power` | current socket power
`average_socket_power` | average socket power
`gfx_voltage` | voltage gfx
`soc_voltage` | voltage soc
`mem_voltage` | voltage mem
`power_limit` | power limit

Exceptions that can be thrown by `amdsmi_get_power_info` 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:
            power_measure = amdsmi_get_power_info(device)
            print(power_measure['current_socket_power'])
            print(power_measure['average_socket_power'])
            print(power_measure['gfx_voltage'])
            print(power_measure['soc_voltage'])
            print(power_measure['mem_voltage'])
            print(power_measure['power_limit'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_vram_usage

Description: Returns total VRAM and VRAM in use

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Description
---|---
`vram_total` | VRAM total
`vram_used` | VRAM currently in use

Exceptions that can be thrown by `amdsmi_get_gpu_vram_usage` 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:
            vram_usage = amdsmi_get_gpu_vram_usage(device)
            print(vram_usage['vram_used'])
            print(vram_usage['vram_total'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_clock_info

Description: Returns the clock measure for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query
* `clock_type` one of `AmdSmiClkType` enum values:

Field | Description
---|---
`SYS` | SYS clock type
`GFX` | GFX clock type
`DF` | DF clock type
`DCEF` | DCEF clock type
`SOC` | SOC clock type
`MEM` | MEM clock type
`PCIE` | PCIE clock type
`VCLK0` | VCLK0 clock type
`VCLK1` | VCLK1 clock type
`DCLK0` | DCLK0 clock type
`DCLK1` | DCLK1 clock type

Output: Dictionary with fields

Field | Description
---|---
`clk` | Current clock for given clock type
`min_clk` | Minimum clock for given clock type
`max_clk` | Maximum clock for given clock type
`clk_locked` | flag only supported on GFX clock domain
`clk_deep_sleep` | clock deep sleep mode flag

Exceptions that can be thrown by `amdsmi_get_clock_info` 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:
            clock_measure = amdsmi_get_clock_info(device, AmdSmiClkType.GFX)
            print(clock_measure['clk'])
            print(clock_measure['min_clk'])
            print(clock_measure['max_clk'])
            print(clock_measure['clk_locked'])
            print(clock_measure['clk_deep_sleep'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_pcie_info

Description: Returns the pcie metric and static information for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with 2 fields `pcie_static` and `pcie_metric`

Fields | Description
---|---
`pcie_static` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`max_pcie_width`</td><td>Maximum number of pcie lanes available</td></tr><tr><td>`max_pcie_speed`</td><td>Maximum capable pcie speed in GT/s</td></tr><tr><td>`pcie_interface_version`</td><td>PCIe generation ie. 3,4,5...</td></tr><tr><td>`slot_type`</td><td>The type of form factor of the slot: OAM, PCIE, CEM, or Unknown</td></tr></tbody></table>
`pcie_metric` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`pcie_width`</td><td>Current number of pcie lanes available</td></tr><tr><td>`pcie_speed`</td><td>Current pcie speed capable in GT/s</td></tr><tr><td>`pcie_bandwidth`</td><td>Current instantaneous bandwidth usage in Mb/s</td></tr><tr><td>`pcie_replay_count`</td><td>Total number of PCIe replays (NAKs)</td></tr><tr><td>`pcie_l0_to_recovery_count`</td><td>PCIE L0 to recovery state transition accumulated count</td></tr><tr><td>`pcie_replay_roll_over_count`</td><td>PCIe Replay accumulated count</td></tr><tr><td>`pcie_nak_sent_count`</td><td>PCIe NAK sent accumulated count</td></tr><tr><td>`pcie_nak_received_count`</td><td>PCIe NAK received accumulated count</td></tr></tbody></table>

Exceptions that can be thrown by `amdsmi_get_pcie_info` 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:
            pcie_info = amdsmi_get_pcie_info(device)
            print(pcie_info["pcie_static"])
            print(pcie_info["pcie_metric"])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_bad_page_info

Description:  Returns bad page info for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: List consisting of dictionaries with fields for each bad page found; can be an empty list

Field | Description
---|---
`value` | Value of page
`page_address` | Address of bad page
`page_size` | Size of bad page
`status` | Status of bad page

Exceptions that can be thrown by `amdsmi_get_gpu_bad_page_info` 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:
            bad_page_info = amdsmi_get_gpu_bad_page_info(device)
            if not bad_page_info: # Can be empty list
                print("No bad pages found")
                continue
            for bad_page in bad_page_info:
                print(bad_page["value"])
                print(bad_page["page_address"])
                print(bad_page["page_size"])
                print(bad_page["status"])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_memory_reserved_pages

Description: Returns reserved memory page info for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: List consisting of dictionaries with fields for each reserved memory page found; can be an empty list

Field | Description
---|---
`value` | Value of memory reserved page
`page_address` | Address of memory reserved page
`page_size` | Size of memory reserved page
`status` | Status of memory reserved page

Exceptions that can be thrown by `amdsmi_get_gpu_memory_reserved_pages` 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:
            reserved_memory_page_info = amdsmi_get_gpu_memory_reserved_pages(device)
            if not reserved_memory_page_info: # Can be empty list
                print("No memory reserved pages found")
                continue
            for reserved_memory_page in reserved_memory_page_info:
                print(reserved_memory_page["value"])
                print(reserved_memory_page["page_address"])
                print(reserved_memory_page["page_size"])
                print(reserved_memory_page["status"])
except AmdSmiException as e:
    print(e)
```


### amdsmi_get_gpu_process_list

Description: Returns the list of processes running on the target GPU; Requires root level access to display root process names; otherwise will return "N/A"

Input parameters:

* `processor_handle` device which to query

Output: List of Dictionaries with the corresponding fields; empty list if no running process are detected

Field | Description
---|---
`name` | Name of process. If user does not have permission this will be "N/A"
`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>

Exceptions that can be thrown by `amdsmi_get_gpu_process_list` 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:
            processes = amdsmi_get_gpu_process_list(device)
            if len(processes) == 0:
                print("No processes running on this GPU")
            else:
                for process in processes:
                    print(process)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_total_ecc_count

Description: Returns the ECC error count for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Description
---|---
`correctable_count` | Correctable ECC error count
`uncorrectable_count` | Uncorrectable ECC error count
`deferred_count` | Deferred ECC error count

Exceptions that can be thrown by `amdsmi_get_gpu_total_ecc_count` 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:
            ecc_error_count = amdsmi_get_gpu_total_ecc_count(device)
            print(ecc_error_count["correctable_count"])
            print(ecc_error_count["uncorrectable_count"])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_board_info

Description: Returns board info for the given GPU

Input parameters:

* `processor_handle` device which to query

Output:  Dictionary with fields correctable and uncorrectable

Field | Description
---|---
`model_number` | Board serial number
`product_serial` | Product serial
`fru_id` | FRU ID
`product_name` | Product name
`manufacturer_name` | Manufacturer name

Exceptions that can be thrown by `amdsmi_get_gpu_board_info` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`

Example:

```python
try:
    device = amdsmi_get_processor_handle_from_bdf("0000:23.00.0")
    board_info = amdsmi_get_gpu_board_info(device)
    print(board_info["model_number"])
    print(board_info["product_serial"])
    print(board_info["fru_id"])
    print(board_info["product_name"])
    print(board_info["manufacturer_name"])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_ras_feature_info

Description: Returns RAS version and schema information
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: List containing dictionaries with fields

Field | Description
---|---
`eeprom_version` | eeprom version
`parity_schema` | parity schema
`single_bit_schema` | single bit schema
`double_bit_schema` | double bit schema
`poison_schema` | poison schema

Exceptions that can be thrown by `amdsmi_get_gpu_ras_feature_info` 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:
            ras_info = amdsmi_get_gpu_ras_feature_info(device)
            print(ras_info)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_ras_block_features_enabled

Description: Returns status of each RAS block for the given GPU.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: List containing dictionaries with fields for each RAS block

Field | Description
---|---
`block` | RAS block
`status` | RAS block status

Exceptions that can be thrown by `amdsmi_get_gpu_ras_block_features_enabled` 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:
            ras_block_features = amdsmi_get_gpu_ras_block_features_enabled(device)
            print(ras_block_features)
except AmdSmiException as e:
    print(e)
```

### AmdSmiEventReader class

Description: Providing methods for event monitoring. This is context manager class.
Can be used with `with` statement for automatic cleanup.

Methods:

#### Constructor

Description: Allocates a new event reader notifier to monitor different types of events for the given GPU

Input parameters:

* `processor_handle` device handle corresponding to the device on which to listen for events
* `event_types` list of event types from AmdSmiEvtNotificationType enum. Specifying which events to collect for the given device.

Event Type | Description
---|------
`VMFAULT` | VM page fault
`THERMAL_THROTTLE` | thermal throttle
`GPU_PRE_RESET` | gpu pre reset
`GPU_POST_RESET` | gpu post reset
`RING_HANG` | ring hang event

#### read

Description: Reads events on the given device. When event is caught, device handle, message and event type are returned. Reading events stops when timestamp passes without event reading.

Input parameters:

* `timestamp` number of milliseconds to wait for an event to occur. If event does not happen monitoring is finished
* `num_elem` number of events. This is optional parameter. Default value is 10.

#### stop

Description: Any resources used by event notification for the the given device will be freed with this function. This can be used explicitly or
automatically using `with` statement, like in the examples below. This should be called either manually or automatically for every created AmdSmiEventReader object.

Input parameters: `None`

Example with manual cleanup of AmdSmiEventReader:

```python
try:
    devices = amdsmi_get_processor_handles()
    if len(devices) == 0:
        print("No GPUs on machine")
    else:
        event = AmdSmiEventReader(device[0], AmdSmiEvtNotificationType.GPU_PRE_RESET, AmdSmiEvtNotificationType.GPU_POST_RESET)
        event.read(10000)
except AmdSmiException as e:
    print(e)
finally:
    event.stop()
```

Example with automatic cleanup using `with` statement:

```python
try:
    devices = amdsmi_get_processor_handles()
    if len(devices) == 0:
        print("No GPUs on machine")
    else:
        with AmdSmiEventReader(device[0], AmdSmiEvtNotificationType.GPU_PRE_RESET, AmdSmiEvtNotificationType.GPU_POST_RESET) as event:
            event.read(10000)
except AmdSmiException as e:
    print(e)

```

### amdsmi_set_gpu_pci_bandwidth

Description: Control the set of allowed PCIe bandwidths that can be used
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `bw_bitmask` A bitmask indicating the indices of the bandwidths that are
to be enabled (1) and disabled (0)

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_pci_bandwidth` 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_gpu_pci_bandwidth(device, 0)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_power_cap

Description: Set the power cap value. It is not supported on virtual machine
guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_ind` a 0-based sensor index. Normally, this will be 0. If a
device has more than one sensor, it could be greater than 0
* `cap` int that indicates the desired power cap, in microwatts

Output: None

Exceptions that can be thrown by `amdsmi_set_power_cap` 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:
            power_cap = 250 * 1000000
             amdsmi_set_power_cap(device, 0, power_cap)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_power_profile

Description: Set the power profile. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `reserved` Not currently used, set to 0
* `profile` a amdsmi_power_profile_preset_masks_t that hold the mask of
the desired new power profile

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_power_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:
            profile = ...
             amdsmi_set_gpu_power_profile(device, 0, profile)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_clk_range

Description: This function sets the clock range information.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `min_clk_value` minimum clock value for desired clock range
* `max_clk_value` maximum clock value for desired clock range
* `clk_type`AMDSMI_CLK_TYPE_SYS | AMDSMI_CLK_TYPE_MEM range type

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_clk_range` 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_gpu_clk_range(device, 0, 1000, AmdSmiClkType.AMDSMI_CLK_TYPE_SYS)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_bdf_id

Description: Get the unique PCI device identifier associated for a device

Input parameters:

* `processor_handle` device which to query

Output: device bdf
The format of bdfid will be as follows:

BDFID = ((DOMAIN & 0xffffffff) << 32) | ((BUS & 0xff) << 8) |
                       ((DEVICE & 0x1f) <<3 ) | (FUNCTION & 0x7)

| Name     | Field   |
---------- | ------- |
| Domain   | [64:32] |
| Reserved | [31:16] |
| Bus      | [15: 8] |
| Device   | [ 7: 3] |
| Function | [ 2: 0] |

Exceptions that can be thrown by `amdsmi_get_gpu_bdf_id` 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:
            bdfid = amdsmi_get_gpu_bdf_id(device)
            print(bdfid)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_pci_bandwidth

Description: Get the list of possible PCIe bandwidths that are available.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with the possible T/s values and associated number of lanes

Field | Content
---|---
`transfer_rate` |  transfer_rate dictionary
`lanes` | lanes

transfer_rate dictionary

Field | Content
---|---
`num_supported` |  num_supported
`current` | current
`frequency` | list of frequency

Exceptions that can be thrown by `amdsmi_get_gpu_pci_bandwidth` 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:
            bandwidth = amdsmi_get_gpu_pci_bandwidth(device)
            print(bandwidth)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_pci_throughput

Description: Get PCIe traffic information. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with the fields

Field | Content
---|---
`sent` | number of bytes sent in 1 second
`received` | the number of bytes received
`max_pkt_sz` | maximum packet size

Exceptions that can be thrown by `amdsmi_get_gpu_pci_throughput` 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:
            pci = amdsmi_get_gpu_pci_throughput(device)
            print(pci)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_pci_replay_counter

Description: Get PCIe replay counter

Input parameters:

* `processor_handle` device which to query

Output: counter value
The sum of the NAK's received and generated by the GPU

Exceptions that can be thrown by `amdsmi_get_gpu_pci_replay_counter` 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:
            counter =  amdsmi_get_gpu_pci_replay_counter(device)
            print(counter)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_topo_numa_affinity

Description: Get the NUMA node associated with a device

Input parameters:

* `processor_handle` device which to query

Output: NUMA node value

Exceptions that can be thrown by `amdsmi_get_gpu_topo_numa_affinity` 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:
            numa_node = amdsmi_get_gpu_topo_numa_affinity(device)
            print(numa_node)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_energy_count

Description: Get the energy accumulator counter of the device.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query

Output: Dictionary with fields

Field | Content
---|---
`power` |  power
`counter_resolution` |  counter resolution
`timestamp` |  timestamp

Exceptions that can be thrown by `amdsmi_get_energy_count` 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:
            power = amdsmi_get_energy_count(device)
            print(power)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_memory_total

Description: Get the total amount of memory that exists

Input parameters:

* `processor_handle` device which to query
* `mem_type` enum AmdSmiMemoryType

Output: total amount of memory

Exceptions that can be thrown by `amdsmi_get_gpu_memory_total` 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:
            vram_memory_total = amdsmi_get_gpu_memory_total(device, amdsmi_interface.AmdSmiMemoryType.VRAM)
            print(vram_memory_total)
            vis_vram_memory_total = amdsmi_get_gpu_memory_total(device, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM)
            print(vis_vram_memory_total)
            gtt_memory_total = amdsmi_get_gpu_memory_total(device, amdsmi_interface.AmdSmiMemoryType.GTT)
            print(gtt_memory_total)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_od_clk_info

Description: This function sets the clock frequency information
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `level` AMDSMI_FREQ_IND_MIN|AMDSMI_FREQ_IND_MAX to set the minimum (0)
or maximum (1) speed
* `clk_value` value to apply to the clock range
* `clk_type` AMDSMI_CLK_TYPE_SYS | AMDSMI_CLK_TYPE_MEM range type

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_od_clk_info` 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_gpu_od_clk_info(
                device,
                AmdSmiFreqInd.AMDSMI_FREQ_IND_MAX,
                1000,
                AmdSmiClkType.AMDSMI_CLK_TYPE_SYS
            )
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_memory_usage

Description: Get the current memory usage

Input parameters:

* `processor_handle` device which to query
* `mem_type` enum AmdSmiMemoryType

Output: the amount of memory currently being used

Exceptions that can be thrown by `amdsmi_get_gpu_memory_usage` 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:
            vram_memory_usage = amdsmi_get_gpu_memory_usage(device, amdsmi_interface.AmdSmiMemoryType.VRAM)
            print(vram_memory_usage)
            vis_vram_memory_usage = amdsmi_get_gpu_memory_usage(device, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM)
            print(vis_vram_memory_usage)
            gtt_memory_usage = amdsmi_get_gpu_memory_usage(device, amdsmi_interface.AmdSmiMemoryType.GTT)
            print(gtt_memory_usage)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_od_volt_info

Description: This function sets  1 of the 3 voltage curve points.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `vpoint` voltage point [0|1|2] on the voltage curve
* `clk_value` clock value component of voltage curve point
* `volt_value` voltage value component of voltage curve point

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_od_volt_info` 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_gpu_od_volt_info(device, 1, 1000, 980)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_fan_rpms

Description: Get the fan speed in RPMs of the device with the specified device
handle and 0-based sensor index. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has
more than one sensor, it could be greater than 0.

Output: Fan speed in rpms as integer

Exceptions that can be thrown by `amdsmi_get_gpu_fan_rpms` 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:
            fan_rpm = amdsmi_get_gpu_fan_rpms(device, 0)
            print(fan_rpm)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_fan_speed

Description: Get the fan speed for the specified device as a value relative to
AMDSMI_MAX_FAN_SPEED. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has
more than one sensor, it could be greater than 0.

Output: Fan speed in relative to MAX

Exceptions that can be thrown by `amdsmi_get_gpu_fan_speed` 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:
            fan_speed = amdsmi_get_gpu_fan_speed(device, 0)
            print(fan_speed)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_fan_speed_max

Description: Get the max fan speed of the device with provided device handle.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has
more than one sensor, it could be greater than 0.

Output: Max fan speed as integer

Exceptions that can be thrown by `amdsmi_get_gpu_fan_speed_max` 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:
            max_fan_speed = amdsmi_get_gpu_fan_speed_max(device, 0)
            print(max_fan_speed)
except AmdSmiException as e:
    print(e)
```

### amdsmi_is_gpu_power_management_enabled

Description: Returns is power management enabled

Input parameters:

* `processor_handle` GPU device which to query

Output: Bool true if power management enabled else false

Exceptions that can be thrown by `amdsmi_is_gpu_power_management_enabled` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`

Example:

```python
try:
    devices = amdsmi_get_processor_handles()
    if len(devices) == 0:
        print("No GPUs on machine")
    else:
        for processor in devices:
            is_power_management_enabled = amdsmi_is_gpu_power_management_enabled(processor)
            print(is_power_management_enabled)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_temp_metric

Description: Get the temperature metric value for the specified metric, from the
specified temperature sensor on the specified device. It is not supported on virtual
machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_type` part of device from which temperature should be obtained
* `metric` enum indicated which temperature value should be retrieved

Output: Temperature as integer in millidegrees Celcius

Exceptions that can be thrown by `amdsmi_get_temp_metric` 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:
            temp_metric =  amdsmi_get_temp_metric(device, AmdSmiTemperatureType.EDGE,
                            AmdSmiTemperatureMetric.CURRENT)
            print(temp_metric)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_volt_metric

Description: Get the voltage metric value for the specified metric, from the
specified voltage sensor on the specified device. It is not supported on virtual
machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_type` part of device from which voltage should be obtained
* `metric` enum indicated which voltage value should be retrieved

Output: Voltage as integer in millivolts

Exceptions that can be thrown by `amdsmi_get_gpu_volt_metric` 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:
            voltage =  amdsmi_get_gpu_volt_metric(device, AmdSmiVoltageType.VDDGFX,
                        AmdSmiVoltageMetric.AVERAGE)
            print(voltage)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_utilization_count

Description: Get coarse grain utilization counter of the specified device

Input parameters:

* `processor_handle` handle for the given device
* `counter_types` variable number of counter types desired

Output: List containing dictionaries with fields

Field | Description
---|---
`timestamp` | The timestamp when the counter is retreived - Resolution: 1 ns
`Dictionary for each counter` | <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`type`</td><td>Type of utilization counter</td></tr><tr><td>`value`</td><td>Value gotten for utilization counter</td></tr></tbody></table>

Exceptions that can be thrown by `amdsmi_get_utilization_count` 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:
            utilization = amdsmi_get_utilization_count(
                            device,
                            AmdSmiUtilizationCounterType.COARSE_GRAIN_GFX_ACTIVITY
                            )
            print(utilization)
            utilization = amdsmi_get_utilization_count(
                            device,
                            AmdSmiUtilizationCounterType.COARSE_GRAIN_GFX_ACTIVITY,
                            AmdSmiUtilizationCounterType.COARSE_GRAIN_MEM_ACTIVITY
                            )
            print(utilization)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_perf_level

Description: Get the performance level of the device with provided device handle.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device

Output: Performance level as enum value of dev_perf_level_t

Exceptions that can be thrown by `amdsmi_get_gpu_perf_level` 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:
            perf_level = amdsmi_get_gpu_perf_level(dev)
            print(perf_level)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_perf_determinism_mode

Description: Enter performance determinism mode with provided device handle.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `clkvalue` softmax value for GFXCLK in MHz

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_perf_determinism_mode` 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_gpu_perf_determinism_mode(device, 1333)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_process_isolation

Description: Get the status of the Process Isolation

Input parameters:

* `processor_handle` handle for the given device

Output: integer corresponding to isolation_status; 0 - disabled, 1 - enabled

Exceptions that can be thrown by `amdsmi_get_gpu_process_isolation` 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:
            isolate = amdsmi_get_gpu_process_isolation(device)
            print("Process Isolation Status: ", isolate)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_process_isolation
Description: Enable/disable the system Process Isolation for the given device handle.

Input parameters:

* `processor_handle` handle for the given device
* `pisolate` the process isolation status to set. 0 is the process isolation disabled, and 1 is the process isolation enabled.

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_process_isolation` 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_gpu_process_isolation(device, 1)
except AmdSmiException as e:
    print(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:

* `processor_handle` handle for the given device

Output: None

Exceptions that can be thrown by `amdsmi_clean_gpu_local_data` 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_clean_gpu_local_data(device)
except AmdSmiException as e:
    print(e)
```


### amdsmi_get_gpu_overdrive_level

Description: Get the overdrive percent associated with the device with provided
device handle. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device

Output: Overdrive percentage as integer

Exceptions that can be thrown by `amdsmi_get_gpu_overdrive_level` 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:
            od_level = amdsmi_get_gpu_overdrive_level(dev)
            print(od_level)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_clk_freq

Description: Get the list of possible system clock speeds of device for a
specified clock type. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `clk_type` the type of clock for which the frequency is desired

Output: Dictionary with fields

Field | Description
---|---
`num_supported` | The number of supported frequencies
`current` | The current frequency index
`frequency` | List of frequencies, only the first num_supported frequencies are valid

Exceptions that can be thrown by `amdsmi_get_clk_freq` 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_get_clk_freq(device, AmdSmiClkType.SYS)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_od_volt_info

Description: This function retrieves the voltage/frequency curve information.
If the num_regions is 0 then the voltage curve is not supported.
It is not supported on virtual machine guest.

Input parameters:

* `processor_handle` handle for the given device

Output: Dictionary with fields

Field | Description
---|---
`curr_sclk_range` | <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound sclk range</td></tr><tr><td>`upper_bound`</td><td>upper bound sclk range</td></tr></tbody></table>
`curr_mclk_range` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound mclk range</td></tr><tr><td>`upper_bound`</td><td>upper bound mclk range</td></tr></tbody></table>
`sclk_freq_limits` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound sclk range limt</td></tr><tr><td>`upper_bound`</td><td>upper bound sclk range limit</td></tr></tbody></table>
`mclk_freq_limits` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound mclk range limit</td></tr><tr><td>`upper_bound`</td><td>upper bound mclk range limit</td></tr></tbody></table>
`curve.vc_points` | List of voltage curve points
`num_regions` | The number of voltage curve regions

Exceptions that can be thrown by `amdsmi_get_gpu_od_volt_info` 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_get_gpu_od_volt_info(dev)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_metrics_info

Description: This function retrieves the gpu metrics information. It is not
supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device

Output: Dictionary with fields

| Field | Description |Unit|
|-------|-------------|----|
`temperature_edge` | Edge temperature value | Celsius (C)
`temperature_hotspot` | Hotspot (aka junction) temperature value | Celsius (C)
`temperature_mem` | Memory temperature value | Celsius (C)
`temperature_vrgfx` | vrgfx temperature value | Celsius (C)
`temperature_vrsoc` | vrsoc temperature value | Celsius (C)
`temperature_vrmem` | vrmem temperature value | Celsius (C)
`average_gfx_activity` | Average gfx activity | %
`average_umc_activity` | Average umc (Universal Memory Controller) activity | %
`average_mm_activity` | Average mm (multimedia) engine activity | %
`average_socket_power` | Average socket power | W
`energy_accumulator` | Energy accumulated with a 15.3 uJ resolution over 1ns | uJ
`system_clock_counter` | System clock counter | ns
`average_gfxclk_frequency` | Average gfx clock frequency | MHz
`average_socclk_frequency` | Average soc clock frequency | MHz
`average_uclk_frequency` | Average uclk frequency | MHz
`average_vclk0_frequency` | Average vclk0 frequency | MHz
`average_dclk0_frequency` | Average dclk0 frequency | MHz
`average_vclk1_frequency` | Average vclk1 frequency | MHz
`average_dclk1_frequency` | Average dclk1 frequency | MHz
`current_gfxclk` | Current gfx clock | MHz
`current_socclk` | Current soc clock | MHz
`current_uclk` | Current uclk | MHz
`current_vclk0` | Current vclk0 | MHz
`current_dclk0` | Current dclk0 | MHz
`current_vclk1` | Current vclk1 | MHz
`current_dclk1` | Current dclk1 | MHz
`throttle_status` | Current throttle status | bool
`current_fan_speed` | Current fan speed | RPM
`pcie_link_width` | PCIe link width (number of lanes) | lanes
`pcie_link_speed` | PCIe link speed in 0.1 GT/s (Giga Transfers per second) | GT/s
`padding` | padding
`gfx_activity_acc` | gfx activity accumulated | %
`mem_activity_acc` | Memory activity accumulated | %
`temperature_hbm` | list of hbm temperatures | Celsius (C)
`firmware_timestamp` | timestamp from PMFW (10ns resolution) | ns
`voltage_soc` | soc voltage | mV
`voltage_gfx` | gfx voltage | mV
`voltage_mem` | mem voltage | mV
`indep_throttle_status` | ASIC independent throttle status (see drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h for bit flags) |
`current_socket_power` | Current socket power (also known as instant socket power) | W
`vcn_activity` | List of VCN encode/decode engine utilization per AID | %
`gfxclk_lock_status` | Clock lock status. Bits 0:7 correspond to each gfx clock engine instance. Bits 0:5 for APU/AID devices |
`xgmi_link_width` | XGMI bus width | lanes
`xgmi_link_speed` | XGMI bitrate | GB/s
`pcie_bandwidth_acc` | PCIe accumulated bandwidth | GB/s
`pcie_bandwidth_inst` | PCIe instantaneous bandwidth | GB/s
`pcie_l0_to_recov_count_acc` | PCIe L0 to recovery state transition accumulated count |
`pcie_replay_count_acc` | PCIe replay accumulated count |
`pcie_replay_rover_count_acc` | PCIe replay rollover accumulated count |
`xgmi_read_data_acc` | XGMI accumulated read data transfer size (KiloBytes) | KB
`xgmi_write_data_acc` | XGMI accumulated write data transfer size (KiloBytes) | KB
`current_gfxclks` | List of current gfx clock frequencies | MHz
`current_socclks` | List of current soc clock frequencies | MHz
`current_vclk0s` | List of current v0 clock frequencies | MHz
`current_dclk0s` | List of current d0 clock frequencies | MHz
`pcie_nak_sent_count_acc` | PCIe NAC sent count accumulated |
`pcie_nak_rcvd_count_acc` | PCIe NAC received count accumulated |
`jpeg_activity` | List of JPEG engine activity | %

Exceptions that can be thrown by `amdsmi_get_gpu_metrics_info` 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_get_gpu_metrics_info(dev)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_od_volt_curve_regions

Description: This function will retrieve the current valid regions in the
frequency/voltage space. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `num_regions` number of freq volt regions

Output: List containing a dictionary with fields for each freq volt region

Field | Description
---|---
`freq_range` | <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound freq range</td></tr><tr><td>`upper_bound`</td><td>upper bound freq range</td></tr></tbody></table>
`volt_range` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound volt range</td></tr><tr><td>`upper_bound`</td><td>upper bound volt range</td></tr></tbody></table>

Exceptions that can be thrown by `amdsmi_get_gpu_od_volt_curve_regions` 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_get_gpu_od_volt_curve_regions(device, 3)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_power_profile_presets

Description:  Get the list of available preset power profiles and an indication of
which profile is currently active. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_idx` number of freq volt regions

Output: Dictionary with fields

Field | Description
---|---
`available_profiles` | Which profiles are supported by this system
`current` | Which power profile is currently active
`num_profiles` | How many power profiles are available

Exceptions that can be thrown by `amdsmi_get_gpu_power_profile_presets` 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_get_gpu_power_profile_presets(device, 0)
except AmdSmiException as e:
    print(e)
```

### amdsmi_gpu_counter_group_supported

Description: Tell if an event group is supported by a given device.
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` device which to query
* `event_group` event group being checked for support

Output: None

Exceptions that can be thrown by `amdsmi_gpu_counter_group_supported` 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_gpu_counter_group_supported(device, AmdSmiEventGroup.XGMI)
except AmdSmiException as e:
    print(e)
```

### amdsmi_gpu_create_counter

Description: Creates a performance counter object

Input parameters:

* `processor_handle` device which to query
* `event_type` event group being checked for support

Output: An event handle of the newly created performance counter object

Exceptions that can be thrown by `amdsmi_gpu_create_counter` 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:
            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI)
except AmdSmiException as e:
    print(e)
```

### amdsmi_gpu_destroy_counter

Description: Destroys a performance counter object

Input parameters:

* `event_handle` event handle of the performance counter object

Output: None

Exceptions that can be thrown by `amdsmi_gpu_destroy_counter` 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:
            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI)
            amdsmi_gpu_destroy_counter(event_handle)
except AmdSmiException as e:
    print(e)
```

### amdsmi_gpu_control_counter

Description: Issue performance counter control commands. It is not supported
on virtual machine guest

Input parameters:

* `event_handle` event handle of the performance counter object
* `counter_command` command being passed to counter as AmdSmiCounterCommand

Output: None

Exceptions that can be thrown by `amdsmi_gpu_control_counter` 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:
            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX)
            amdsmi_gpu_control_counter(event_handle, AmdSmiCounterCommand.CMD_START)
except AmdSmiException as e:
    print(e)
```

### amdsmi_gpu_read_counter

Description: Read the current value of a performance counter

Input parameters:

* `event_handle` event handle of the performance counter object

Output: Dictionary with fields

Field | Description
---|---
`value` | Counter value
`time_enabled` | Time that the counter was enabled in nanoseconds
`time_running` | Time that the counter was running in nanoseconds

Exceptions that can be thrown by `amdsmi_gpu_read_counter` 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:
            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX)
            amdsmi_gpu_read_counter(event_handle)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_available_counters

Description: Get the number of currently available counters. It is not supported
on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `event_group` event group being checked as AmdSmiEventGroup

Output: Number of available counters for the given device of the inputted event group

Exceptions that can be thrown by `amdsmi_get_gpu_available_counters` 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:
            available_counters =  amdsmi_get_gpu_available_counters(device, AmdSmiEventGroup.XGMI)
            print(available_counters)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_perf_level

Description: Set a desired performance level for given device. It is not
supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `perf_level` performance level being set as AmdSmiDevPerfLevel

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_perf_level` 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_gpu_perf_level(device, AmdSmiDevPerfLevel.STABLE_PEAK)
except AmdSmiException as e:
    print(e)
```

### amdsmi_reset_gpu

Description: Reset the gpu associated with the device with provided device handle
It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device

Output: None

Exceptions that can be thrown by `amdsmi_reset_gpu` 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_reset_gpu(device)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_fan_speed

Description: Set the fan speed for the specified device with the provided speed,
in RPMs. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_idx` sensor index as integer
* `fan_speed` the speed to which the function will attempt to set the fan

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_fan_speed` 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_gpu_fan_speed(device, 0, 1333)
except AmdSmiException as e:
    print(e)
```

### amdsmi_reset_gpu_fan

Description: Reset the fan to automatic driver control. It is not
supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `sensor_idx` sensor index as integer

Output: None

Exceptions that can be thrown by `amdsmi_reset_gpu_fan` 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_reset_gpu_fan(device, 0)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_clk_freq

Description: Control the set of allowed frequencies that can be used for the
specified clock. It is not supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `clk_type` the type of clock for which the set of frequencies will be modified
as AmdSmiClkType
* `freq_bitmask`  bitmask indicating the indices of the frequencies that are to
be enabled (1) and disabled (0). Only the lowest ::amdsmi_frequencies_t.num_supported
bits of this mask are relevant.

Output: None

Exceptions that can be thrown by `amdsmi_set_clk_freq` 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:
            freq_bitmask = 0
             amdsmi_set_clk_freq(device, AmdSmiClkType.GFX, freq_bitmask)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_soc_pstate

Description: Get dpm policy information.

Input parameters:

* `processor_handle` handle for the given device
* `policy_id` the policy id to set.

Output: Dictionary with fields

Field | Description
---|---
`num_supported` | total number of supported policies
`current_id` | current policy id
`policies` | list of dictionaries containing possible policies

Exceptions that can be thrown by `amdsmi_get_soc_pstate` 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:
            dpm_policies = amdsmi_get_soc_pstate(device)
            print(dpm_policies)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_soc_pstate

Description: Set the dpm policy to corresponding policy_id. Typically following: 0(default),1,2,3

Input parameters:

* `processor_handle` handle for the given device
* `policy_id` the policy id to set.

Output: None

Exceptions that can be thrown by `amdsmi_set_soc_pstate` 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_soc_pstate(device, 0)
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
device with provided device handle with the provided value. It is not
supported on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `overdrive_value` value to which the overdrive level should be set

Output: None

Exceptions that can be thrown by `amdsmi_set_gpu_overdrive_level` 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_gpu_overdrive_level(device, 0)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_ecc_count

Description: Retrieve the error counts for a GPU block. It is not supported
on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `block` The block for which error counts should be retrieved

Output: Dict containing information about error counts

Field | Description
---|---
`correctable_count` | Count of correctable errors
`uncorrectable_count` | Count of uncorrectable errors
`deferred_count` | Count of deferred errors

Exceptions that can be thrown by `amdsmi_get_gpu_ecc_count` 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:
            ecc_count =  amdsmi_get_gpu_ecc_count(device, AmdSmiGpuBlock.UMC)
            print(ecc_count)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_ecc_enabled

Description: Retrieve the enabled ECC bit-mask. It is not supported on virtual
machine guest

Input parameters:

* `processor_handle` handle for the given device

Output: Enabled ECC bit-mask

Exceptions that can be thrown by `amdsmi_get_gpu_ecc_enabled` 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:
            enabled =  amdsmi_get_gpu_ecc_enabled(device)
            print(enabled)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_ecc_status

Description: Retrieve the ECC status for a GPU block. It is not supported
on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device
* `block` The block for which ECC status should be retrieved

Output: ECC status for a requested GPU block

Exceptions that can be thrown by `amdsmi_get_gpu_ecc_status` 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:
            status =  amdsmi_get_gpu_ecc_status(device, AmdSmiGpuBlock.UMC)
            print(status)
except AmdSmiException as e:
    print(e)
```

### amdsmi_status_code_to_string

Description: Get a description of a provided AMDSMI error status

Input parameters:

* `status` The error status for which a description is desired

Output: String description of the provided error code

Exceptions that can be thrown by `amdsmi_status_code_to_string` function:

* `AmdSmiParameterException`

Example:

```python
try:
    status_str = amdsmi_status_code_to_string(ctypes.c_uint32(0))
    print(status_str)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_compute_process_info

Description: Get process information about processes currently using GPU

Input parameters: None

Output: List of python dicts each containing a process information

Field | Description
---|---
`process_id` | Process ID
`pasid` | PASID
`vram_usage` | VRAM usage
`sdma_usage` | SDMA usage in microseconds
`cu_occupancy` | Compute Unit usage in percents

Exceptions that can be thrown by `amdsmi_get_gpu_compute_process_info` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`

Example:

```python
try:
    procs = amdsmi_get_gpu_compute_process_info()
    for proc in procs:
        print(proc)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_compute_process_info_by_pid

Description: Get process information about processes currently using GPU

Input parameters:

* `pid` The process ID for which process information is being requested

Output: Dict containing a process information

Field | Description
---|---
`process_id` | Process ID
`pasid` | PASID
`vram_usage` | VRAM usage
`sdma_usage` | SDMA usage in microseconds
`cu_occupancy` | Compute Unit usage in percents

Exceptions that can be thrown by `amdsmi_get_gpu_compute_process_info_by_pid` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`

Example:

```python
try:
    pid = 0 # << valid pid here
    proc = amdsmi_get_gpu_compute_process_info_by_pid(pid)
    print(proc)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_compute_process_gpus

Description: Get the device indices currently being used by a process

Input parameters:

* `pid` The process id of the process for which the number of gpus currently being used is requested

Output: List of indices of devices currently being used by the process

Exceptions that can be thrown by `amdsmi_get_gpu_compute_process_gpus` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`

Example:

```python
try:
    pid = 0 # << valid pid here
    indices = amdsmi_get_gpu_compute_process_gpus(pid)
    print(indices)
except AmdSmiException as e:
    print(e)
```

### amdsmi_gpu_xgmi_error_status

Description: Retrieve the XGMI error status for a device. It is not supported on
virtual machine guest

Input parameters:

* `processor_handle` handle for the given device

Output: XGMI error status for a requested device

Exceptions that can be thrown by `amdsmi_gpu_xgmi_error_status` 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:
            status = amdsmi_gpu_xgmi_error_status(device)
            print(status)
except AmdSmiException as e:
    print(e)
```

### amdsmi_reset_gpu_xgmi_error

Description: Reset the XGMI error status for a device. It is not supported
on virtual machine guest

Input parameters:

* `processor_handle` handle for the given device

Output: None

Exceptions that can be thrown by `amdsmi_reset_gpu_xgmi_error` 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_reset_gpu_xgmi_error(device)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_vendor_name

Description: Returns the device vendor name

Input parameters:

* `processor_handle` device which to query

Output: device vendor name

Exceptions that can be thrown by `amdsmi_get_gpu_vendor_name` 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:
            vendor_name = amdsmi_get_gpu_vendor_name(device)
            print(vendor_name)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_id

Description: Get the device id associated with the device with provided device handler

Input parameters:

* `processor_handle` device which to query

Output: device id

Exceptions that can be thrown by `amdsmi_get_gpu_id` 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:
            dev_id = amdsmi_get_gpu_id(device)
            print(dev_id)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_vram_vendor

Description: Get the vram vendor string of a gpu device.

Input parameters:

* `processor_handle` device which to query

Output: vram vendor

Exceptions that can be thrown by `amdsmi_get_gpu_vram_vendor` 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:
            vram_vendor = amdsmi_get_gpu_vram_vendor(device)
            print(vram_vendor)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_subsystem_id

Description: Get the subsystem device id associated with the device with provided device handle.

Input parameters:

* `processor_handle` device which to query

Output: subsystem device id

Exceptions that can be thrown by `amdsmi_get_gpu_subsystem_id` 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:
            id = amdsmi_get_gpu_subsystem_id(device)
            print(id)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_subsystem_name

Description: Get the name string for the device subsytem

Input parameters:

* `processor_handle` device which to query

Output: device subsytem

Exceptions that can be thrown by `amdsmi_get_gpu_subsystem_name` 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:
            subsystem_nam = amdsmi_get_gpu_subsystem_name(device)
            print(subsystem_nam)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_lib_version

Description: Get the build version information for the currently running build of AMDSMI.

Output: amdsmi build version

Exceptions that can be thrown by `amdsmi_get_lib_version` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`

Example:

```python
try:
    version = amdsmi_get_lib_version()
    print(version)
except AmdSmiException as e:
    print(e)
```

### amdsmi_topo_get_numa_node_number

Description: Retrieve the NUMA CPU node number for a device

Input parameters:

* `processor_handle` device which to query

Output: node number of NUMA CPU for the device

Exceptions that can be thrown by `amdsmi_topo_get_numa_node_number` 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:
            node_number = amdsmi_topo_get_numa_node_number()
            print(node_number)
except AmdSmiException as e:
    print(e)
```

### amdsmi_topo_get_link_weight

Description: Retrieve the weight for a connection between 2 GPUs.

Input parameters:

* `processor_handle_src` the source device handle
* `processor_handle_dest` the destination device handle

Output: the weight for a connection between 2 GPUs

Exceptions that can be thrown by `amdsmi_topo_get_link_weight` 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]
        weight = amdsmi_topo_get_link_weight(processor_handle_src, processor_handle_dest)
        print(weight)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_minmax_bandwidth_between_processors

Description: Retreive minimal and maximal io link bandwidth between 2 GPUs.

Input parameters:

* `processor_handle_src` the source device handle
* `processor_handle_dest` the destination device handle

Output:  Dictionary with fields:

Field | Description
---|---
`min_bandwidth` | minimal bandwidth for the connection
`max_bandwidth` | maximal bandwidth for the connection

Exceptions that can be thrown by `amdsmi_get_minmax_bandwidth_between_processors` 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]
        bandwidth =  amdsmi_get_minmax_bandwidth_between_processors(processor_handle_src, processor_handle_dest)
        print(bandwidth['min_bandwidth'])
        print(bandwidth['max_bandwidth'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_topo_get_link_type

Description: Retrieve the hops and the connection type between 2 GPUs

Input parameters:

* `processor_handle_src` the source device handle
* `processor_handle_dest` the destination device handle

Output:  Dictionary with fields:

Field | Description
---|---
`hops` | number of hops
`type` | the connection type

Exceptions that can be thrown by `amdsmi_topo_get_link_type` 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_topo_get_link_type(processor_handle_src, processor_handle_dest)
        print(link_type['hops'])
        print(link_type['type'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_is_P2P_accessible

Description: Return P2P availability status between 2 GPUs

Input parameters:

* `processor_handle_src` the source device handle
* `processor_handle_dest` the destination device handle

Output: P2P availability status between 2 GPUs

Exceptions that can be thrown by `amdsmi_is_P2P_accessible` 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]
        accessible = amdsmi_is_P2P_accessible(processor_handle_src, processor_handle_dest)
        print(accessible)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_compute_partition

Description: Get the compute partition from the given GPU

Input parameters:

* `processor_handle` the device handle

Output: String of the partition type

Exceptions that can be thrown by `amdsmi_get_gpu_compute_partition` 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:
            compute_partition_type = amdsmi_get_gpu_compute_partition(device)
            print(compute_partition_type)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_compute_partition

Description: Set the compute partition to the given GPU

Input parameters:

* `processor_handle` the device handle
* `compute_partition` the type of compute_partition to set

Output: String of the partition type

Exceptions that can be thrown by `amdsmi_set_gpu_compute_partition` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`

Example:

```python
try:
    compute_partition = AmdSmiComputePartitionType.SPX
    devices = amdsmi_get_processor_handles()
    if len(devices) == 0:
        print("No GPUs on machine")
    else:
        for device in devices:
            amdsmi_set_gpu_compute_partition(device, compute_partition)
except AmdSmiException as e:
    print(e)
```

### amdsmi_reset_gpu_compute_partition

Description: Reset the compute partitioning on the given GPU

Input parameters:

* `processor_handle` the device handle

Output: String of the partition type

Exceptions that can be thrown by `amdsmi_reset_gpu_compute_partition` 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_reset_gpu_compute_partition(device)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_gpu_memory_partition

Description: Get the memory partition from the given GPU

Input parameters:

* `processor_handle` the device handle

Output: String of the partition type

Exceptions that can be thrown by `amdsmi_get_gpu_memory_partition` 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:
            memory_partition_type = amdsmi_get_gpu_memory_partition(device)
            print(memory_partition_type)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_gpu_memory_partition

Description: Set the memory partition to the given GPU

Input parameters:

* `processor_handle` the device handle
* `memory_partition` the type of memory_partition to set

Output: String of the partition type

Exceptions that can be thrown by `amdsmi_set_gpu_memory_partition` function:

* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`

Example:

```python
try:
    memory_partition = AmdSmiMemoryPartitionType.NPS1
    devices = amdsmi_get_processor_handles()
    if len(devices) == 0:
        print("No GPUs on machine")
    else:
        for device in devices:
            amdsmi_set_gpu_memory_partition(device, memory_partition)
except AmdSmiException as e:
    print(e)
```

### amdsmi_reset_gpu_memory_partition

Description: Reset the memory partitioning on the given GPU

Input parameters:

* `processor_handle` the device handle

Output: String of the partition type

Exceptions that can be thrown by `amdsmi_reset_gpu_memory_partition` 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_reset_gpu_memory_partition(device)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_xgmi_info

Description: Returns XGMI information for the GPU.

Input parameters:

* `processor_handle`  device handle

Output:  Dictionary with fields:

Field | Description
---|---
`xgmi_lanes` |  xgmi lanes
`xgmi_hive_id` | xgmi hive id
`xgmi_node_id` | xgmi node id
`index` | index

Exceptions that can be thrown by `amdsmi_get_xgmi_info` 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_info = amdsmi_get_xgmi_info(device)
            print(xgmi_info['xgmi_lanes'])
            print(xgmi_info['xgmi_hive_id'])
            print(xgmi_info['xgmi_node_id'])
            print(xgmi_info['index'])
except AmdSmiException as e:
    print(e)
```

## CPU APIs

### amdsmi_get_processor_info

**Note: CURRENTLY HARDCODED TO RETURN EMPTY VALUES**

Description: Return processor name

Input parameters:
`processor_handle` processor handle

Output: Processor name

Exceptions that can be thrown by `amdsmi_get_processor_info` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_processor_handles()
    if len(processor_handles) == 0:
        print("No processors on machine")
    else:
        for processor in processor_handles:
            print(amdsmi_get_processor_info(processor))
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_hsmp_proto_ver

Description: Get the hsmp protocol version.

Output: amdsmi hsmp protocol version

Exceptions that can be thrown by `amdsmi_get_cpu_hsmp_proto_ver` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            version = amdsmi_get_cpu_hsmp_proto_ver(processor)
            print(version)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_smu_fw_version

Description: Get the SMU Firmware version.

Output: amdsmi SMU Firmware version

Exceptions that can be thrown by `amdsmi_get_cpu_smu_fw_version` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            version = amdsmi_get_cpu_smu_fw_version(processor)
            print(version['debug'])
            print(version['minor'])
            print(version['major'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_prochot_status

Description: Get the CPU's prochot status.

Output: amdsmi cpu prochot status

Exceptions that can be thrown by `amdsmi_get_cpu_prochot_status` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            prochot = amdsmi_get_cpu_prochot_status(processor)
            print(prochot)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_fclk_mclk

Description: Get the Data fabric clock and Memory clock in MHz.

Output: amdsmi data fabric clock and memory clock

Exceptions that can be thrown by `amdsmi_get_cpu_fclk_mclk` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            clk = amdsmi_get_cpu_fclk_mclk(processor)
            for fclk, mclk in clk.items():
                print(fclk)
                print(mclk)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_cclk_limit

Description: Get the core clock in MHz.

Output: amdsmi core clock

Exceptions that can be thrown by `amdsmi_get_cpu_cclk_limit` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            cclk_limit = amdsmi_get_cpu_cclk_limit(processor)
            print(cclk_limit)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_current_active_freq_limit

Description: Get current active frequency limit of the socket.

Output: amdsmi frequency value in MHz and frequency source name

Exceptions that can be thrown by `amdsmi_get_cpu_socket_current_active_freq_limit` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            freq_limit = amdsmi_get_cpu_socket_current_active_freq_limit(processor)
            for freq, src in freq_limit.items():
                print(freq)
                print(src)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_freq_range

Description: Get socket frequency range

Output: amdsmi maximum frequency and minimum frequency

Exceptions that can be thrown by `amdsmi_get_cpu_socket_freq_range` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            freq_range = amdsmi_get_cpu_socket_freq_range(processor)
            for fmax, fmin in freq_range.items():
                print(fmax)
                print(fmin)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_core_current_freq_limit

Description: Get socket frequency limit of the core

Output: amdsmi frequency

Exceptions that can be thrown by `amdsmi_get_cpu_core_current_freq_limit` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpucore_handles()
    if len(processor_handles) == 0:
        print("No CPU cores on machine")
    else:
        for processor in processor_handles:
            freq_limit = amdsmi_get_cpu_core_current_freq_limit(processor)
            print(freq_limit)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_power

Description: Get the socket power.

Output: amdsmi socket power

Exceptions that can be thrown by `amdsmi_get_cpu_socket_power` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            sock_power = amdsmi_get_cpu_socket_power(processor)
            print(sock_power)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_power_cap

Description: Get the socket power cap.

Output: amdsmi socket power cap

Exceptions that can be thrown by `amdsmi_get_cpu_socket_power_cap` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            sock_power = amdsmi_get_cpu_socket_power_cap(processor)
            print(sock_power)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_power_cap_max

Description: Get the socket power cap max.

Output: amdsmi socket power cap max

Exceptions that can be thrown by `amdsmi_get_cpu_socket_power_cap_max` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            sock_power = amdsmi_get_cpu_socket_power_cap_max(processor)
            print(sock_power)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_pwr_svi_telemetry_all_rails

Description: Get the SVI based power telemetry for all rails.

Output: amdsmi svi based power value

Exceptions that can be thrown by `amdsmi_get_cpu_pwr_svi_telemetry_all_rails` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            power = amdsmi_get_cpu_pwr_svi_telemetry_all_rails(processor)
            print(power)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_socket_power_cap

Description: Set the power cap value for a given socket.

Input: amdsmi socket power cap value

Exceptions that can be thrown by `amdsmi_set_cpu_socket_power_cap` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            power = amdsmi_set_cpu_socket_power_cap(processor, 1000)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_pwr_efficiency_mode

Description: Set the power efficiency profile policy.

Input: mode(0, 1, or 2)

Exceptions that can be thrown by `amdsmi_set_cpu_pwr_efficiency_mode` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            policy = amdsmi_set_cpu_pwr_efficiency_mode(processor, 0)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_core_boostlimit

Description: Get boost limit of the cpu core

Output: amdsmi frequency

Exceptions that can be thrown by `amdsmi_get_cpu_core_boostlimit` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpucore_handles()
    if len(processor_handles) == 0:
        print("No CPU cores on machine")
    else:
        for processor in processor_handles:
            boost_limit = amdsmi_get_cpu_core_boostlimit(processor)
            print(boost_limit)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_c0_residency

Description: Get the cpu socket C0 residency.

Output: amdsmi C0 residency value

Exceptions that can be thrown by `amdsmi_get_cpu_socket_c0_residency` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            c0_residency = amdsmi_get_cpu_socket_c0_residency(processor)
            print(c0_residency)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_core_boostlimit

Description: Set the cpu core boost limit.

Output: amdsmi boostlimit value

Exceptions that can be thrown by `amdsmi_set_cpu_core_boostlimit` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpucore_handles()
    if len(processor_handles) == 0:
        print("No CPU cores on machine")
    else:
        for processor in processor_handles:
            boost_limit = amdsmi_set_cpu_core_boostlimit(processor, 1000)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_socket_boostlimit

Description: Set the cpu socket boost limit.

Input: amdsmi boostlimit value

Exceptions that can be thrown by `amdsmi_set_cpu_socket_boostlimit` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            boost_limit = amdsmi_set_cpu_socket_boostlimit(processor, 1000)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_ddr_bw

Description: Get the CPU DDR Bandwidth.

Output: amdsmi ddr bandwidth data

Exceptions that can be thrown by `amdsmi_get_cpu_ddr_bw` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            ddr_bw = amdsmi_get_cpu_ddr_bw(processor)
            print(ddr_bw['max_bw'])
            print(ddr_bw['utilized_bw'])
            print(ddr_bw['utilized_pct'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_temperature

Description: Get the socket temperature.

Output: amdsmi temperature value

Exceptions that can be thrown by `amdsmi_get_cpu_socket_temperature` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            ptmon = amdsmi_get_cpu_socket_temperature(processor)
            print(ptmon)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_dimm_temp_range_and_refresh_rate

Description: Get DIMM temperature range and refresh rate.

Output: amdsmi dimm metric data

Exceptions that can be thrown by `amdsmi_get_cpu_dimm_temp_range_and_refresh_rate` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            dimm = amdsmi_get_cpu_dimm_temp_range_and_refresh_rate(processor)
            print(dimm['range'])
            print(dimm['ref_rate'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_dimm_power_consumption

Description: amdsmi_get_cpu_dimm_power_consumption.

Output: amdsmi dimm power consumption value

Exceptions that can be thrown by `amdsmi_get_cpu_dimm_power_consumption` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            dimm = amdsmi_get_cpu_dimm_power_consumption(processor)
            print(dimm['power'])
            print(dimm['update_rate'])
            print(dimm['dimm_addr'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_dimm_thermal_sensor

Description: Get DIMM thermal sensor value.

Output: amdsmi dimm temperature data

Exceptions that can be thrown by `amdsmi_get_cpu_dimm_thermal_sensor` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            dimm = amdsmi_get_cpu_dimm_thermal_sensor(processor)
            print(dimm['sensor'])
            print(dimm['update_rate'])
            print(dimm['dimm_addr'])
            print(dimm['temp'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_xgmi_width

Description:  Set xgmi width.

Input: amdsmi xgmi width

Exceptions that can be thrown by `amdsmi_set_cpu_xgmi_width` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            xgmi_width = amdsmi_set_cpu_xgmi_width(processor, 0, 100)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_gmi3_link_width_range

Description:  Set gmi3 link width range.

Input: minimum & maximum link width to be set.

Exceptions that can be thrown by `amdsmi_set_cpu_gmi3_link_width_range` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            gmi_link_width = amdsmi_set_cpu_gmi3_link_width_range(processor, 0, 100)
except AmdSmiException as e:
    print(e)
```

### amdsmi_cpu_apb_enable

Description:  Enable APB.

Input: amdsmi processor handle

Exceptions that can be thrown by `amdsmi_cpu_apb_enable` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            apb_enable = amdsmi_cpu_apb_enable(processor)
except AmdSmiException as e:
    print(e)
```

### amdsmi_cpu_apb_disable

Description:  Disable APB.

Input: pstate value

Exceptions that can be thrown by `amdsmi_cpu_apb_disable` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            apb_disable = amdsmi_cpu_apb_disable(processor, 0)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_socket_lclk_dpm_level

Description:  Set NBIO lclk dpm level value.

Input: nbio id, min value, max value

Exceptions that can be thrown by `amdsmi_set_cpu_socket_lclk_dpm_level` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for socket in socket_handles:
            nbio = amdsmi_set_cpu_socket_lclk_dpm_level(socket, 0, 0, 2)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_socket_lclk_dpm_level

Description: Get NBIO LCLK dpm level.

Output: nbio id

Exceptions that can be thrown by `amdsmi_get_cpu_socket_lclk_dpm_level` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            nbio = amdsmi_get_cpu_socket_lclk_dpm_level(processor)
            print(nbio['max_dpm_level'])
            print(nbio['max_dpm_level'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_pcie_link_rate

Description:  Set pcie link rate.

Input: rate control value

Exceptions that can be thrown by `amdsmi_set_cpu_pcie_link_rate` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            link_rate = amdsmi_set_cpu_pcie_link_rate(processor, 0, 0)
except AmdSmiException as e:
    print(e)
```

### amdsmi_set_cpu_df_pstate_range

Description:  Set df pstate range.

Input: max pstate, min pstate

Exceptions that can be thrown by `amdsmi_set_cpu_df_pstate_range` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            pstate_range = amdsmi_set_cpu_df_pstate_range(processor, 0, 2)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_current_io_bandwidth

Description: Get current input output bandwidth.

Output: link id and bw type to which io bandwidth to be obtained

Exceptions that can be thrown by `amdsmi_get_cpu_current_io_bandwidth` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            io_bw = amdsmi_get_cpu_current_io_bandwidth(processor)
            print(io_bw)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_current_xgmi_bw

Description: Get current xgmi bandwidth.

Output: amdsmi link id and bw type to which xgmi bandwidth to be obtained

Exceptions that can be thrown by `amdsmi_get_cpu_current_xgmi_bw` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            xgmi_bw = amdsmi_get_cpu_current_xgmi_bw(processor)
            print(xgmi_bw)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_hsmp_metrics_table_version

Description: Get HSMP metrics table version.

Output: amdsmi HSMP metrics table version

Exceptions that can be thrown by `amdsmi_get_hsmp_metrics_table_version` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            met_ver = amdsmi_get_hsmp_metrics_table_version(processor)
            print(met_ver)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_hsmp_metrics_table

Description: Get HSMP metrics table

Output: HSMP metric table data

Exceptions that can be thrown by `amdsmi_get_hsmp_metrics_table` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            mtbl = amdsmi_get_hsmp_metrics_table(processor)
            print(mtbl['accumulation_counter'])
            print(mtbl['max_socket_temperature'])
            print(mtbl['max_vr_temperature'])
            print(mtbl['max_hbm_temperature'])
            print(mtbl['socket_power_limit'])
            print(mtbl['max_socket_power_limit'])
            print(mtbl['socket_power'])
except AmdSmiException as e:
    print(e)
```

### amdsmi_first_online_core_on_cpu_socket

Description: Get first online core on cpu socket.

Output: first online core on cpu socket

Exceptions that can be thrown by `amdsmi_first_online_core_on_cpu_socket` function:

* `AmdSmiLibraryException`

Example:

```python
try:
    processor_handles = amdsmi_get_cpusocket_handles()
    if len(processor_handles) == 0:
        print("No CPU sockets on machine")
    else:
        for processor in processor_handles:
            pcore_ind = amdsmi_first_online_core_on_cpu_socket(processor)
            print(pcore_ind)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_family

Description: Get cpu family.

Output: cpu family

Exceptions that can be thrown by `amdsmi_get_cpu_family` function:

* `AmdSmiLibraryException`

Example:

```python
try:
     cpu_family = amdsmi_get_cpu_family()
     print(cpu_family)
except AmdSmiException as e:
    print(e)
```

### amdsmi_get_cpu_model

Description: Get cpu model.

Output: cpu model

Exceptions that can be thrown by `amdsmi_get_cpu_model` function:

* `AmdSmiLibraryException`

Example:

```python
try:
     cpu_model = amdsmi_get_cpu_model()
     print(cpu_model)
except AmdSmiException as e:
    print(e)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/RadeonOpenCompute/amdsmi",
    "name": "amdsmi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "AMD",
    "author_email": "AMD <amd-smi.support@amd.com>",
    "download_url": "https://files.pythonhosted.org/packages/6a/60/d6939d540b88583027bd821374d8372549ae9aa34691346257a687437d7e/amdsmi-6.2.4.tar.gz",
    "platform": null,
    "description": "This is an unofficial distribution of the official Python wrapper for amdsmi. See https://github.com/ml-energy/amdsmi for distribution scripts and source code.\n\nAMD -- Please contact Parth Raut (<praut@umich.edu>) and Jae-Won Chung (<jwnchung@umich.edu>) to take over the repository when you would like to distribute official bindings under this project name.\n\n\n# AMD SMI Python Library\n\n## Requirements\n\n* Python 3.6+ 64-bit\n* Driver must be loaded for amdsmi_init() to pass\n\n## Overview\n\n### Folder structure\n\nFile Name | Note\n---|---\n`__init__.py` | Python package initialization file\n`amdsmi_interface.py` | Amdsmi library python interface\n`amdsmi_wrapper.py` | Python wrapper around amdsmi binary\n`amdsmi_exception.py` | Amdsmi exceptions python file\n`README.md` | Documentation\n\n### Usage\n\n`amdsmi` folder should be copied and placed next to importing script. It should be imported as:\n\n```python\nfrom amdsmi import *\n\ntry:\n    amdsmi_init()\n\n    # amdsmi calls ...\n\nexcept AmdSmiException as e:\n    print(e)\nfinally:\n    try:\n        amdsmi_shut_down()\n    except AmdSmiException as e:\n        print(e)\n```\n\nTo initialize amdsmi lib, amdsmi_init() must be called before all other calls to amdsmi lib.\n\nTo close connection to driver, amdsmi_shut_down() must be the last call.\n\n### Exceptions\n\nAll exceptions are in `amdsmi_exception.py` file.\nExceptions that can be thrown are:\n\n* `AmdSmiException`: base amdsmi exception class\n* `AmdSmiLibraryException`: derives base `AmdSmiException` class and represents errors that can occur in amdsmi-lib.\nWhen this exception is thrown, `err_code` and `err_info` are set. `err_code` is an integer that corresponds to errors that can occur\nin amdsmi-lib and `err_info` is a string that explains the error that occurred.\nExample:\n\n```python\ntry:\n    num_of_GPUs = len(amdsmi_get_processor_handles())\n    if num_of_GPUs == 0:\n        print(\"No GPUs on machine\")\nexcept AmdSmiException as e:\n    print(\"Error code: {}\".format(e.err_code))\n    if e.err_code == amdsmi_wrapper.AMDSMI_STATUS_RETRY:\n        print(\"Error info: {}\".format(e.err_info))\n```\n\n* `AmdSmiRetryException` : Derives `AmdSmiLibraryException` class and signals device is busy and call should be retried.\n* `AmdSmiTimeoutException` : Derives `AmdSmiLibraryException` class and represents that call had timed out.\n* `AmdSmiParameterException`: Derives base `AmdSmiException` class and represents errors related to invaild parameters passed to functions. When this exception is thrown, err_msg is set and it explains what is the actual and expected type of the parameters.\n* `AmdSmiBdfFormatException`: Derives base `AmdSmiException` class and represents invalid bdf format.\n\n## API\n\n### amdsmi_init\n\nDescription: Initialize amdsmi with AmdSmiInitFlags\n\nInput parameters: AmdSmiInitFlags\n\nOutput: `None`\n\nExceptions that can be thrown by `amdsmi_init` function:\n\n* `AmdSmiLibraryException`\n\nInitialize GPUs only example:\n\n```python\ntry:\n    # by default we initalize with AmdSmiInitFlags.INIT_AMD_GPUS\n    ret = amdsmi_init()\n    # continue with amdsmi\nexcept AmdSmiException as e:\n    print(\"Init GPUs failed\")\n    print(e)\n```\n\nInitialize CPUs only example:\n\n```python\ntry:\n    ret = amdsmi_init(AmdSmiInitFlags.INIT_AMD_CPUS)\n    # continue with amdsmi\nexcept AmdSmiException as e:\n    print(\"Init CPUs failed\")\n    print(e)\n```\n\nInitialize both GPUs and CPUs example:\n\n```python\ntry:\n    ret = amdsmi_init(AmdSmiInitFlags.INIT_AMD_APUS)\n    # continue with amdsmi\nexcept AmdSmiException as e:\n    print(\"Init both GPUs & CPUs failed\")\n    print(e)\n```\n\n### amdsmi_shut_down\n\nDescription: Finalize and close connection to driver\n\nInput parameters: `None`\n\nOutput: `None`\n\nExceptions that can be thrown by `amdsmi_shut_down` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    amdsmi_init()\n    amdsmi_shut_down()\nexcept AmdSmiException as e:\n    print(\"Shut down failed\")\n    print(e)\n```\n\n### amdsmi_get_processor_type\n\nDescription: Checks the type of device with provided handle.\n\nInput parameters: device handle as an instance of `amdsmi_processor_handle`\n\nOutput: Integer, type of gpu\n\nExceptions that can be thrown by `amdsmi_get_processor_type` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    type_of_GPU = amdsmi_get_processor_type(processor_handle)\n    if type_of_GPU == 1:\n        print(\"This is an AMD GPU\")\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_processor_handles\n\nDescription: Returns list of GPU device handle objects on current machine\n\nInput parameters: `None`\n\nOutput: List of GPU device handle objects\n\nExceptions that can be thrown by `amdsmi_get_processor_handles` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            print(amdsmi_get_gpu_device_uuid(device))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_socket_handles\n\n**Note: CURRENTLY HARDCODED TO RETURN DUMMY DATA**\n\nDescription: Returns list of socket device handle objects on current machine\n\nInput parameters: `None`\n\nOutput: List of socket device handle objects\n\nExceptions that can be thrown by `amdsmi_get_socket_handles` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    sockets = amdsmi_get_socket_handles()\n    print('Socket numbers: {}'.format(len(sockets)))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_socket_info\n\n**Note: CURRENTLY HARDCODED TO RETURN EMPTY VALUES**\n\nDescription: Return socket name\n\nInput parameters:\n`socket_handle` socket handle\n\nOutput: Socket name\n\nExceptions that can be thrown by `amdsmi_get_socket_info` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    socket_handles = amdsmi_get_socket_handles()\n    if len(socket_handles) == 0:\n        print(\"No sockets on machine\")\n    else:\n        for socket in socket_handles:\n            print(amdsmi_get_socket_info(socket))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_processor_handle_from_bdf\n\nDescription: Returns device handle from the given BDF\n\nInput parameters: bdf string in form of either `<domain>:<bus>:<device>.<function>` or `<bus>:<device>.<function>` in hexcode format.\nWhere:\n\n* `<domain>` is 4 hex digits long from 0000-FFFF interval\n* `<bus>` is 2 hex digits long from 00-FF interval\n* `<device>` is 2 hex digits long from 00-1F interval\n* `<function>` is 1 hex digit long from 0-7 interval\n\nOutput: device handle object\n\nExceptions that can be thrown by `amdsmi_get_processor_handle_from_bdf` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiBdfFormatException`\n\nExample:\n\n```python\ntry:\n    device = amdsmi_get_processor_handle_from_bdf(\"0000:23:00.0\")\n    print(amdsmi_get_gpu_device_uuid(device))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_device_bdf\n\nDescription: Returns BDF of the given device\n\nInput parameters:\n\n* `processor_handle` dev for which to query\n\nOutput: BDF string in form of `<domain>:<bus>:<device>.<function>` in hexcode format.\nWhere:\n\n* `<domain>` is 4 hex digits long from 0000-FFFF interval\n* `<bus>` is 2 hex digits long from 00-FF interval\n* `<device>` is 2 hex digits long from 00-1F interval\n* `<function>` is 1 hex digit long from 0-7 interval\n\nExceptions that can be thrown by `amdsmi_get_gpu_device_bdf` function:\n\n* `AmdSmiParameterException`\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    device = amdsmi_get_processor_handles()[0]\n    print(\"Device's bdf:\", amdsmi_get_gpu_device_bdf(device))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_device_uuid\n\nDescription: Returns the UUID of the device\n\nInput parameters:\n\n* `processor_handle` dev for which to query\n\nOutput: UUID string unique to the device\n\nExceptions that can be thrown by `amdsmi_get_gpu_device_uuid` function:\n\n* `AmdSmiParameterException`\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    device = amdsmi_get_processor_handles()[0]\n    print(\"Device UUID: \", amdsmi_get_gpu_device_uuid(device))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_driver_info\n\nDescription: Returns the info of the driver\n\nInput parameters:\n\n* `processor_handle` dev for which to query\n\nOutput: Dictionary with fields\n\nField | Content\n---|---\n`driver_name` |  driver name\n`driver_version` |  driver_version\n`driver_date` |  driver_date\n\nExceptions that can be thrown by `amdsmi_get_gpu_driver_info` function:\n\n* `AmdSmiParameterException`\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    device = amdsmi_get_processor_handles()[0]\n    print(\"Driver info: \", amdsmi_get_gpu_driver_info(device))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_asic_info\n\nDescription: Returns asic information for the given GPU\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Content\n---|---\n`market_name` |  market name\n`vendor_id` |  vendor id\n`vendor_name` |  vendor name\n`device_id` |  device id\n`rev_id` |  revision id\n`asic_serial` | asic serial\n`oam_id` | oam id\n\nExceptions that can be thrown by `amdsmi_get_gpu_asic_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            asic_info = amdsmi_get_gpu_asic_info(device)\n            print(asic_info['market_name'])\n            print(hex(asic_info['vendor_id']))\n            print(asic_info['vendor_name'])\n            print(hex(asic_info['device_id']))\n            print(hex(asic_info['rev_id']))\n            print(asic_info['asic_serial'])\n            print(asic_info['oam_id'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_power_cap_info\n\nDescription: Returns dictionary of power capabilities as currently configured\non the given GPU. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Description | Units\n---|---|---\n`power_cap` |  power capability | uW\n`dpm_cap` |  dynamic power management capability | MHz\n`default_power_cap` |  default power capability | uW\n`min_power_cap` | min power capability | uW\n`max_power_cap` | max power capability | uW\n\nExceptions that can be thrown by `amdsmi_get_power_cap_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            power_info = amdsmi_get_power_cap_info(device)\n            print(power_info['power_cap'])\n            print(power_info['dpm_cap'])\n            print(power_info['default_power_cap'])\n            print(power_info['min_power_cap'])\n            print(power_info['max_power_cap'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_vram_info\n\nDescription: Returns dictionary of vram information for the given GPU.\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`vram_type` |  vram type\n`vram_vendor` |  vram vendor\n`vram_size` |  vram size in mb\n\nExceptions that can be thrown by `amdsmi_get_gpu_vram_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            vram_info = amdsmi_get_gpu_vram_info(device)\n            print(vram_info['vram_type'])\n            print(vram_info['vram_vendor'])\n            print(vram_info['vram_size'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_cache_info\n\nDescription: Returns a list of dictionaries containing cache information for the given GPU.\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: List of Dictionaries containing cache information following the schema below:\nSchema:\n\n```JSON\n{\n    cache_properties:\n        {\n            \"type\" : \"array\",\n            \"items\" : {\"type\" : \"string\"}\n        },\n    cache_size: {\"type\" : \"number\"},\n    cache_level: {\"type\" : \"number\"},\n    max_num_cu_shared: {\"type\" : \"number\"},\n    num_cache_instance: {\"type\" : \"number\"}\n}\n```\n\nField | Description\n---|---\n`cache_properties` | list of up to 4 cache property type strings. Ex. data (\"DATA_CACHE\"), instruction (\"INST_CACHE\"), CPU (\"CPU_CACHE\"), or SIMD (\"SIMD_CACHE\").\n`cache_size` | size of cache in KB\n`cache_level` | level of cache\n`max_num_cu_shared` |  max number of compute units shared\n`num_cache_instance` | number of cache instances\n\nExceptions that can be thrown by `amdsmi_get_gpu_cache_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            cache_info = amdsmi_get_gpu_cache_info(device)\n            for cache_index, cache_values in cache_info.items():\n                print(cache_values['cache_properties'])\n                print(cache_values['cache_size'])\n                print(cache_values['cache_level'])\n                print(cache_values['max_num_cu_shared'])\n                print(cache_values['num_cache_instance'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_vbios_info\n\nDescription:  Returns the static information for the VBIOS on the device.\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`name` | vbios name\n`build_date` | vbios build date\n`part_number` | vbios part number\n`version` | vbios version string\n\nExceptions that can be thrown by `amdsmi_get_gpu_vbios_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            vbios_info = amdsmi_get_gpu_vbios_info(device)\n            print(vbios_info['name'])\n            print(vbios_info['build_date'])\n            print(vbios_info['part_number'])\n            print(vbios_info['version'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_fw_info\n\nDescription:  Returns GPU firmware related information.\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`fw_list` | List of dictionaries that contain information about a certain firmware block\n\nExceptions that can be thrown by `amdsmi_get_fw_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            firmware_list = amdsmi_get_fw_info(device)['fw_list']\n            for firmware_block in firmware_list:\n                print(firmware_block['fw_name'])\n                # String formated hex or decimal value ie: 21.00.00.AC or 130\n                print(firmware_block['fw_version'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_activity\n\nDescription: Returns the engine usage for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary of activites to their respective usage percentage or 'N/A' if not supported\n\nField | Description\n---|---\n`gfx_activity` | graphics engine usage percentage (0 - 100)\n`umc_activity` | memory engine usage percentage (0 - 100)\n`mm_activity` | average multimedia engine usages in percentage (0 - 100)\n\nExceptions that can be thrown by `amdsmi_get_gpu_activity` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            engine_usage = amdsmi_get_gpu_activity(device)\n            print(engine_usage['gfx_activity'])\n            print(engine_usage['umc_activity'])\n            print(engine_usage['mm_activity'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_power_info\n\nDescription: Returns the current power and voltage for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`current_socket_power` | current socket power\n`average_socket_power` | average socket power\n`gfx_voltage` | voltage gfx\n`soc_voltage` | voltage soc\n`mem_voltage` | voltage mem\n`power_limit` | power limit\n\nExceptions that can be thrown by `amdsmi_get_power_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            power_measure = amdsmi_get_power_info(device)\n            print(power_measure['current_socket_power'])\n            print(power_measure['average_socket_power'])\n            print(power_measure['gfx_voltage'])\n            print(power_measure['soc_voltage'])\n            print(power_measure['mem_voltage'])\n            print(power_measure['power_limit'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_vram_usage\n\nDescription: Returns total VRAM and VRAM in use\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`vram_total` | VRAM total\n`vram_used` | VRAM currently in use\n\nExceptions that can be thrown by `amdsmi_get_gpu_vram_usage` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            vram_usage = amdsmi_get_gpu_vram_usage(device)\n            print(vram_usage['vram_used'])\n            print(vram_usage['vram_total'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_clock_info\n\nDescription: Returns the clock measure for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n* `clock_type` one of `AmdSmiClkType` enum values:\n\nField | Description\n---|---\n`SYS` | SYS clock type\n`GFX` | GFX clock type\n`DF` | DF clock type\n`DCEF` | DCEF clock type\n`SOC` | SOC clock type\n`MEM` | MEM clock type\n`PCIE` | PCIE clock type\n`VCLK0` | VCLK0 clock type\n`VCLK1` | VCLK1 clock type\n`DCLK0` | DCLK0 clock type\n`DCLK1` | DCLK1 clock type\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`clk` | Current clock for given clock type\n`min_clk` | Minimum clock for given clock type\n`max_clk` | Maximum clock for given clock type\n`clk_locked` | flag only supported on GFX clock domain\n`clk_deep_sleep` | clock deep sleep mode flag\n\nExceptions that can be thrown by `amdsmi_get_clock_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            clock_measure = amdsmi_get_clock_info(device, AmdSmiClkType.GFX)\n            print(clock_measure['clk'])\n            print(clock_measure['min_clk'])\n            print(clock_measure['max_clk'])\n            print(clock_measure['clk_locked'])\n            print(clock_measure['clk_deep_sleep'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_pcie_info\n\nDescription: Returns the pcie metric and static information for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with 2 fields `pcie_static` and `pcie_metric`\n\nFields | Description\n---|---\n`pcie_static` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`max_pcie_width`</td><td>Maximum number of pcie lanes available</td></tr><tr><td>`max_pcie_speed`</td><td>Maximum capable pcie speed in GT/s</td></tr><tr><td>`pcie_interface_version`</td><td>PCIe generation ie. 3,4,5...</td></tr><tr><td>`slot_type`</td><td>The type of form factor of the slot: OAM, PCIE, CEM, or Unknown</td></tr></tbody></table>\n`pcie_metric` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`pcie_width`</td><td>Current number of pcie lanes available</td></tr><tr><td>`pcie_speed`</td><td>Current pcie speed capable in GT/s</td></tr><tr><td>`pcie_bandwidth`</td><td>Current instantaneous bandwidth usage in Mb/s</td></tr><tr><td>`pcie_replay_count`</td><td>Total number of PCIe replays (NAKs)</td></tr><tr><td>`pcie_l0_to_recovery_count`</td><td>PCIE L0 to recovery state transition accumulated count</td></tr><tr><td>`pcie_replay_roll_over_count`</td><td>PCIe Replay accumulated count</td></tr><tr><td>`pcie_nak_sent_count`</td><td>PCIe NAK sent accumulated count</td></tr><tr><td>`pcie_nak_received_count`</td><td>PCIe NAK received accumulated count</td></tr></tbody></table>\n\nExceptions that can be thrown by `amdsmi_get_pcie_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            pcie_info = amdsmi_get_pcie_info(device)\n            print(pcie_info[\"pcie_static\"])\n            print(pcie_info[\"pcie_metric\"])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_bad_page_info\n\nDescription:  Returns bad page info for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: List consisting of dictionaries with fields for each bad page found; can be an empty list\n\nField | Description\n---|---\n`value` | Value of page\n`page_address` | Address of bad page\n`page_size` | Size of bad page\n`status` | Status of bad page\n\nExceptions that can be thrown by `amdsmi_get_gpu_bad_page_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            bad_page_info = amdsmi_get_gpu_bad_page_info(device)\n            if not bad_page_info: # Can be empty list\n                print(\"No bad pages found\")\n                continue\n            for bad_page in bad_page_info:\n                print(bad_page[\"value\"])\n                print(bad_page[\"page_address\"])\n                print(bad_page[\"page_size\"])\n                print(bad_page[\"status\"])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_memory_reserved_pages\n\nDescription: Returns reserved memory page info for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: List consisting of dictionaries with fields for each reserved memory page found; can be an empty list\n\nField | Description\n---|---\n`value` | Value of memory reserved page\n`page_address` | Address of memory reserved page\n`page_size` | Size of memory reserved page\n`status` | Status of memory reserved page\n\nExceptions that can be thrown by `amdsmi_get_gpu_memory_reserved_pages` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            reserved_memory_page_info = amdsmi_get_gpu_memory_reserved_pages(device)\n            if not reserved_memory_page_info: # Can be empty list\n                print(\"No memory reserved pages found\")\n                continue\n            for reserved_memory_page in reserved_memory_page_info:\n                print(reserved_memory_page[\"value\"])\n                print(reserved_memory_page[\"page_address\"])\n                print(reserved_memory_page[\"page_size\"])\n                print(reserved_memory_page[\"status\"])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n\n### amdsmi_get_gpu_process_list\n\nDescription: Returns the list of processes running on the target GPU; Requires root level access to display root process names; otherwise will return \"N/A\"\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: List of Dictionaries with the corresponding fields; empty list if no running process are detected\n\nField | Description\n---|---\n`name` | Name of process. If user does not have permission this will be \"N/A\"\n`pid` | Process ID\n`mem` | Process memory usage\n`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>\n`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>\n\nExceptions that can be thrown by `amdsmi_get_gpu_process_list` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            processes = amdsmi_get_gpu_process_list(device)\n            if len(processes) == 0:\n                print(\"No processes running on this GPU\")\n            else:\n                for process in processes:\n                    print(process)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_total_ecc_count\n\nDescription: Returns the ECC error count for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`correctable_count` | Correctable ECC error count\n`uncorrectable_count` | Uncorrectable ECC error count\n`deferred_count` | Deferred ECC error count\n\nExceptions that can be thrown by `amdsmi_get_gpu_total_ecc_count` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            ecc_error_count = amdsmi_get_gpu_total_ecc_count(device)\n            print(ecc_error_count[\"correctable_count\"])\n            print(ecc_error_count[\"uncorrectable_count\"])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_board_info\n\nDescription: Returns board info for the given GPU\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput:  Dictionary with fields correctable and uncorrectable\n\nField | Description\n---|---\n`model_number` | Board serial number\n`product_serial` | Product serial\n`fru_id` | FRU ID\n`product_name` | Product name\n`manufacturer_name` | Manufacturer name\n\nExceptions that can be thrown by `amdsmi_get_gpu_board_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    device = amdsmi_get_processor_handle_from_bdf(\"0000:23.00.0\")\n    board_info = amdsmi_get_gpu_board_info(device)\n    print(board_info[\"model_number\"])\n    print(board_info[\"product_serial\"])\n    print(board_info[\"fru_id\"])\n    print(board_info[\"product_name\"])\n    print(board_info[\"manufacturer_name\"])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_ras_feature_info\n\nDescription: Returns RAS version and schema information\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: List containing dictionaries with fields\n\nField | Description\n---|---\n`eeprom_version` | eeprom version\n`parity_schema` | parity schema\n`single_bit_schema` | single bit schema\n`double_bit_schema` | double bit schema\n`poison_schema` | poison schema\n\nExceptions that can be thrown by `amdsmi_get_gpu_ras_feature_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            ras_info = amdsmi_get_gpu_ras_feature_info(device)\n            print(ras_info)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_ras_block_features_enabled\n\nDescription: Returns status of each RAS block for the given GPU.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: List containing dictionaries with fields for each RAS block\n\nField | Description\n---|---\n`block` | RAS block\n`status` | RAS block status\n\nExceptions that can be thrown by `amdsmi_get_gpu_ras_block_features_enabled` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            ras_block_features = amdsmi_get_gpu_ras_block_features_enabled(device)\n            print(ras_block_features)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### AmdSmiEventReader class\n\nDescription: Providing methods for event monitoring. This is context manager class.\nCan be used with `with` statement for automatic cleanup.\n\nMethods:\n\n#### Constructor\n\nDescription: Allocates a new event reader notifier to monitor different types of events for the given GPU\n\nInput parameters:\n\n* `processor_handle` device handle corresponding to the device on which to listen for events\n* `event_types` list of event types from AmdSmiEvtNotificationType enum. Specifying which events to collect for the given device.\n\nEvent Type | Description\n---|------\n`VMFAULT` | VM page fault\n`THERMAL_THROTTLE` | thermal throttle\n`GPU_PRE_RESET` | gpu pre reset\n`GPU_POST_RESET` | gpu post reset\n`RING_HANG` | ring hang event\n\n#### read\n\nDescription: Reads events on the given device. When event is caught, device handle, message and event type are returned. Reading events stops when timestamp passes without event reading.\n\nInput parameters:\n\n* `timestamp` number of milliseconds to wait for an event to occur. If event does not happen monitoring is finished\n* `num_elem` number of events. This is optional parameter. Default value is 10.\n\n#### stop\n\nDescription: Any resources used by event notification for the the given device will be freed with this function. This can be used explicitly or\nautomatically using `with` statement, like in the examples below. This should be called either manually or automatically for every created AmdSmiEventReader object.\n\nInput parameters: `None`\n\nExample with manual cleanup of AmdSmiEventReader:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        event = AmdSmiEventReader(device[0], AmdSmiEvtNotificationType.GPU_PRE_RESET, AmdSmiEvtNotificationType.GPU_POST_RESET)\n        event.read(10000)\nexcept AmdSmiException as e:\n    print(e)\nfinally:\n    event.stop()\n```\n\nExample with automatic cleanup using `with` statement:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        with AmdSmiEventReader(device[0], AmdSmiEvtNotificationType.GPU_PRE_RESET, AmdSmiEvtNotificationType.GPU_POST_RESET) as event:\n            event.read(10000)\nexcept AmdSmiException as e:\n    print(e)\n\n```\n\n### amdsmi_set_gpu_pci_bandwidth\n\nDescription: Control the set of allowed PCIe bandwidths that can be used\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `bw_bitmask` A bitmask indicating the indices of the bandwidths that are\nto be enabled (1) and disabled (0)\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_pci_bandwidth` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_pci_bandwidth(device, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_power_cap\n\nDescription: Set the power cap value. It is not supported on virtual machine\nguest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_ind` a 0-based sensor index. Normally, this will be 0. If a\ndevice has more than one sensor, it could be greater than 0\n* `cap` int that indicates the desired power cap, in microwatts\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_power_cap` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            power_cap = 250 * 1000000\n             amdsmi_set_power_cap(device, 0, power_cap)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_power_profile\n\nDescription: Set the power profile. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `reserved` Not currently used, set to 0\n* `profile` a amdsmi_power_profile_preset_masks_t that hold the mask of\nthe desired new power profile\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_power_profile` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            profile = ...\n             amdsmi_set_gpu_power_profile(device, 0, profile)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_clk_range\n\nDescription: This function sets the clock range information.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `min_clk_value` minimum clock value for desired clock range\n* `max_clk_value` maximum clock value for desired clock range\n* `clk_type`AMDSMI_CLK_TYPE_SYS | AMDSMI_CLK_TYPE_MEM range type\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_clk_range` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_clk_range(device, 0, 1000, AmdSmiClkType.AMDSMI_CLK_TYPE_SYS)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_bdf_id\n\nDescription: Get the unique PCI device identifier associated for a device\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: device bdf\nThe format of bdfid will be as follows:\n\nBDFID = ((DOMAIN & 0xffffffff) << 32) | ((BUS & 0xff) << 8) |\n                       ((DEVICE & 0x1f) <<3 ) | (FUNCTION & 0x7)\n\n| Name     | Field   |\n---------- | ------- |\n| Domain   | [64:32] |\n| Reserved | [31:16] |\n| Bus      | [15: 8] |\n| Device   | [ 7: 3] |\n| Function | [ 2: 0] |\n\nExceptions that can be thrown by `amdsmi_get_gpu_bdf_id` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            bdfid = amdsmi_get_gpu_bdf_id(device)\n            print(bdfid)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_pci_bandwidth\n\nDescription: Get the list of possible PCIe bandwidths that are available.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with the possible T/s values and associated number of lanes\n\nField | Content\n---|---\n`transfer_rate` |  transfer_rate dictionary\n`lanes` | lanes\n\ntransfer_rate dictionary\n\nField | Content\n---|---\n`num_supported` |  num_supported\n`current` | current\n`frequency` | list of frequency\n\nExceptions that can be thrown by `amdsmi_get_gpu_pci_bandwidth` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            bandwidth = amdsmi_get_gpu_pci_bandwidth(device)\n            print(bandwidth)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_pci_throughput\n\nDescription: Get PCIe traffic information. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with the fields\n\nField | Content\n---|---\n`sent` | number of bytes sent in 1 second\n`received` | the number of bytes received\n`max_pkt_sz` | maximum packet size\n\nExceptions that can be thrown by `amdsmi_get_gpu_pci_throughput` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            pci = amdsmi_get_gpu_pci_throughput(device)\n            print(pci)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_pci_replay_counter\n\nDescription: Get PCIe replay counter\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: counter value\nThe sum of the NAK's received and generated by the GPU\n\nExceptions that can be thrown by `amdsmi_get_gpu_pci_replay_counter` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            counter =  amdsmi_get_gpu_pci_replay_counter(device)\n            print(counter)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_topo_numa_affinity\n\nDescription: Get the NUMA node associated with a device\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: NUMA node value\n\nExceptions that can be thrown by `amdsmi_get_gpu_topo_numa_affinity` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            numa_node = amdsmi_get_gpu_topo_numa_affinity(device)\n            print(numa_node)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_energy_count\n\nDescription: Get the energy accumulator counter of the device.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: Dictionary with fields\n\nField | Content\n---|---\n`power` |  power\n`counter_resolution` |  counter resolution\n`timestamp` |  timestamp\n\nExceptions that can be thrown by `amdsmi_get_energy_count` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            power = amdsmi_get_energy_count(device)\n            print(power)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_memory_total\n\nDescription: Get the total amount of memory that exists\n\nInput parameters:\n\n* `processor_handle` device which to query\n* `mem_type` enum AmdSmiMemoryType\n\nOutput: total amount of memory\n\nExceptions that can be thrown by `amdsmi_get_gpu_memory_total` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            vram_memory_total = amdsmi_get_gpu_memory_total(device, amdsmi_interface.AmdSmiMemoryType.VRAM)\n            print(vram_memory_total)\n            vis_vram_memory_total = amdsmi_get_gpu_memory_total(device, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM)\n            print(vis_vram_memory_total)\n            gtt_memory_total = amdsmi_get_gpu_memory_total(device, amdsmi_interface.AmdSmiMemoryType.GTT)\n            print(gtt_memory_total)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_od_clk_info\n\nDescription: This function sets the clock frequency information\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `level` AMDSMI_FREQ_IND_MIN|AMDSMI_FREQ_IND_MAX to set the minimum (0)\nor maximum (1) speed\n* `clk_value` value to apply to the clock range\n* `clk_type` AMDSMI_CLK_TYPE_SYS | AMDSMI_CLK_TYPE_MEM range type\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_od_clk_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_od_clk_info(\n                device,\n                AmdSmiFreqInd.AMDSMI_FREQ_IND_MAX,\n                1000,\n                AmdSmiClkType.AMDSMI_CLK_TYPE_SYS\n            )\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_memory_usage\n\nDescription: Get the current memory usage\n\nInput parameters:\n\n* `processor_handle` device which to query\n* `mem_type` enum AmdSmiMemoryType\n\nOutput: the amount of memory currently being used\n\nExceptions that can be thrown by `amdsmi_get_gpu_memory_usage` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            vram_memory_usage = amdsmi_get_gpu_memory_usage(device, amdsmi_interface.AmdSmiMemoryType.VRAM)\n            print(vram_memory_usage)\n            vis_vram_memory_usage = amdsmi_get_gpu_memory_usage(device, amdsmi_interface.AmdSmiMemoryType.VIS_VRAM)\n            print(vis_vram_memory_usage)\n            gtt_memory_usage = amdsmi_get_gpu_memory_usage(device, amdsmi_interface.AmdSmiMemoryType.GTT)\n            print(gtt_memory_usage)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_od_volt_info\n\nDescription: This function sets  1 of the 3 voltage curve points.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `vpoint` voltage point [0|1|2] on the voltage curve\n* `clk_value` clock value component of voltage curve point\n* `volt_value` voltage value component of voltage curve point\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_od_volt_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_od_volt_info(device, 1, 1000, 980)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_fan_rpms\n\nDescription: Get the fan speed in RPMs of the device with the specified device\nhandle and 0-based sensor index. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has\nmore than one sensor, it could be greater than 0.\n\nOutput: Fan speed in rpms as integer\n\nExceptions that can be thrown by `amdsmi_get_gpu_fan_rpms` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            fan_rpm = amdsmi_get_gpu_fan_rpms(device, 0)\n            print(fan_rpm)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_fan_speed\n\nDescription: Get the fan speed for the specified device as a value relative to\nAMDSMI_MAX_FAN_SPEED. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has\nmore than one sensor, it could be greater than 0.\n\nOutput: Fan speed in relative to MAX\n\nExceptions that can be thrown by `amdsmi_get_gpu_fan_speed` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            fan_speed = amdsmi_get_gpu_fan_speed(device, 0)\n            print(fan_speed)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_fan_speed_max\n\nDescription: Get the max fan speed of the device with provided device handle.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has\nmore than one sensor, it could be greater than 0.\n\nOutput: Max fan speed as integer\n\nExceptions that can be thrown by `amdsmi_get_gpu_fan_speed_max` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            max_fan_speed = amdsmi_get_gpu_fan_speed_max(device, 0)\n            print(max_fan_speed)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_is_gpu_power_management_enabled\n\nDescription: Returns is power management enabled\n\nInput parameters:\n\n* `processor_handle` GPU device which to query\n\nOutput: Bool true if power management enabled else false\n\nExceptions that can be thrown by `amdsmi_is_gpu_power_management_enabled` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for processor in devices:\n            is_power_management_enabled = amdsmi_is_gpu_power_management_enabled(processor)\n            print(is_power_management_enabled)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_temp_metric\n\nDescription: Get the temperature metric value for the specified metric, from the\nspecified temperature sensor on the specified device. It is not supported on virtual\nmachine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_type` part of device from which temperature should be obtained\n* `metric` enum indicated which temperature value should be retrieved\n\nOutput: Temperature as integer in millidegrees Celcius\n\nExceptions that can be thrown by `amdsmi_get_temp_metric` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            temp_metric =  amdsmi_get_temp_metric(device, AmdSmiTemperatureType.EDGE,\n                            AmdSmiTemperatureMetric.CURRENT)\n            print(temp_metric)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_volt_metric\n\nDescription: Get the voltage metric value for the specified metric, from the\nspecified voltage sensor on the specified device. It is not supported on virtual\nmachine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_type` part of device from which voltage should be obtained\n* `metric` enum indicated which voltage value should be retrieved\n\nOutput: Voltage as integer in millivolts\n\nExceptions that can be thrown by `amdsmi_get_gpu_volt_metric` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            voltage =  amdsmi_get_gpu_volt_metric(device, AmdSmiVoltageType.VDDGFX,\n                        AmdSmiVoltageMetric.AVERAGE)\n            print(voltage)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_utilization_count\n\nDescription: Get coarse grain utilization counter of the specified device\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `counter_types` variable number of counter types desired\n\nOutput: List containing dictionaries with fields\n\nField | Description\n---|---\n`timestamp` | The timestamp when the counter is retreived - Resolution: 1 ns\n`Dictionary for each counter` | <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`type`</td><td>Type of utilization counter</td></tr><tr><td>`value`</td><td>Value gotten for utilization counter</td></tr></tbody></table>\n\nExceptions that can be thrown by `amdsmi_get_utilization_count` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            utilization = amdsmi_get_utilization_count(\n                            device,\n                            AmdSmiUtilizationCounterType.COARSE_GRAIN_GFX_ACTIVITY\n                            )\n            print(utilization)\n            utilization = amdsmi_get_utilization_count(\n                            device,\n                            AmdSmiUtilizationCounterType.COARSE_GRAIN_GFX_ACTIVITY,\n                            AmdSmiUtilizationCounterType.COARSE_GRAIN_MEM_ACTIVITY\n                            )\n            print(utilization)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_perf_level\n\nDescription: Get the performance level of the device with provided device handle.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: Performance level as enum value of dev_perf_level_t\n\nExceptions that can be thrown by `amdsmi_get_gpu_perf_level` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            perf_level = amdsmi_get_gpu_perf_level(dev)\n            print(perf_level)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_perf_determinism_mode\n\nDescription: Enter performance determinism mode with provided device handle.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `clkvalue` softmax value for GFXCLK in MHz\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_perf_determinism_mode` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_perf_determinism_mode(device, 1333)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_process_isolation\n\nDescription: Get the status of the Process Isolation\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: integer corresponding to isolation_status; 0 - disabled, 1 - enabled\n\nExceptions that can be thrown by `amdsmi_get_gpu_process_isolation` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            isolate = amdsmi_get_gpu_process_isolation(device)\n            print(\"Process Isolation Status: \", isolate)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_process_isolation\nDescription: Enable/disable the system Process Isolation for the given device handle.\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `pisolate` the process isolation status to set. 0 is the process isolation disabled, and 1 is the process isolation enabled.\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_process_isolation` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_process_isolation(device, 1)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_clean_gpu_local_data\nDescription: Clear the SRAM data of the given device. This can be called between user logins to prevent information leak.\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_clean_gpu_local_data` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_clean_gpu_local_data(device)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n\n### amdsmi_get_gpu_overdrive_level\n\nDescription: Get the overdrive percent associated with the device with provided\ndevice handle. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: Overdrive percentage as integer\n\nExceptions that can be thrown by `amdsmi_get_gpu_overdrive_level` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            od_level = amdsmi_get_gpu_overdrive_level(dev)\n            print(od_level)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_clk_freq\n\nDescription: Get the list of possible system clock speeds of device for a\nspecified clock type. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `clk_type` the type of clock for which the frequency is desired\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`num_supported` | The number of supported frequencies\n`current` | The current frequency index\n`frequency` | List of frequencies, only the first num_supported frequencies are valid\n\nExceptions that can be thrown by `amdsmi_get_clk_freq` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_get_clk_freq(device, AmdSmiClkType.SYS)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_od_volt_info\n\nDescription: This function retrieves the voltage/frequency curve information.\nIf the num_regions is 0 then the voltage curve is not supported.\nIt is not supported on virtual machine guest.\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`curr_sclk_range` | <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound sclk range</td></tr><tr><td>`upper_bound`</td><td>upper bound sclk range</td></tr></tbody></table>\n`curr_mclk_range` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound mclk range</td></tr><tr><td>`upper_bound`</td><td>upper bound mclk range</td></tr></tbody></table>\n`sclk_freq_limits` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound sclk range limt</td></tr><tr><td>`upper_bound`</td><td>upper bound sclk range limit</td></tr></tbody></table>\n`mclk_freq_limits` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound mclk range limit</td></tr><tr><td>`upper_bound`</td><td>upper bound mclk range limit</td></tr></tbody></table>\n`curve.vc_points` | List of voltage curve points\n`num_regions` | The number of voltage curve regions\n\nExceptions that can be thrown by `amdsmi_get_gpu_od_volt_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_get_gpu_od_volt_info(dev)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_metrics_info\n\nDescription: This function retrieves the gpu metrics information. It is not\nsupported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: Dictionary with fields\n\n| Field | Description |Unit|\n|-------|-------------|----|\n`temperature_edge` | Edge temperature value | Celsius (C)\n`temperature_hotspot` | Hotspot (aka junction) temperature value | Celsius (C)\n`temperature_mem` | Memory temperature value | Celsius (C)\n`temperature_vrgfx` | vrgfx temperature value | Celsius (C)\n`temperature_vrsoc` | vrsoc temperature value | Celsius (C)\n`temperature_vrmem` | vrmem temperature value | Celsius (C)\n`average_gfx_activity` | Average gfx activity | %\n`average_umc_activity` | Average umc (Universal Memory Controller) activity | %\n`average_mm_activity` | Average mm (multimedia) engine activity | %\n`average_socket_power` | Average socket power | W\n`energy_accumulator` | Energy accumulated with a 15.3 uJ resolution over 1ns | uJ\n`system_clock_counter` | System clock counter | ns\n`average_gfxclk_frequency` | Average gfx clock frequency | MHz\n`average_socclk_frequency` | Average soc clock frequency | MHz\n`average_uclk_frequency` | Average uclk frequency | MHz\n`average_vclk0_frequency` | Average vclk0 frequency | MHz\n`average_dclk0_frequency` | Average dclk0 frequency | MHz\n`average_vclk1_frequency` | Average vclk1 frequency | MHz\n`average_dclk1_frequency` | Average dclk1 frequency | MHz\n`current_gfxclk` | Current gfx clock | MHz\n`current_socclk` | Current soc clock | MHz\n`current_uclk` | Current uclk | MHz\n`current_vclk0` | Current vclk0 | MHz\n`current_dclk0` | Current dclk0 | MHz\n`current_vclk1` | Current vclk1 | MHz\n`current_dclk1` | Current dclk1 | MHz\n`throttle_status` | Current throttle status | bool\n`current_fan_speed` | Current fan speed | RPM\n`pcie_link_width` | PCIe link width (number of lanes) | lanes\n`pcie_link_speed` | PCIe link speed in 0.1 GT/s (Giga Transfers per second) | GT/s\n`padding` | padding\n`gfx_activity_acc` | gfx activity accumulated | %\n`mem_activity_acc` | Memory activity accumulated | %\n`temperature_hbm` | list of hbm temperatures | Celsius (C)\n`firmware_timestamp` | timestamp from PMFW (10ns resolution) | ns\n`voltage_soc` | soc voltage | mV\n`voltage_gfx` | gfx voltage | mV\n`voltage_mem` | mem voltage | mV\n`indep_throttle_status` | ASIC independent throttle status (see drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h for bit flags) |\n`current_socket_power` | Current socket power (also known as instant socket power) | W\n`vcn_activity` | List of VCN encode/decode engine utilization per AID | %\n`gfxclk_lock_status` | Clock lock status. Bits 0:7 correspond to each gfx clock engine instance. Bits 0:5 for APU/AID devices |\n`xgmi_link_width` | XGMI bus width | lanes\n`xgmi_link_speed` | XGMI bitrate | GB/s\n`pcie_bandwidth_acc` | PCIe accumulated bandwidth | GB/s\n`pcie_bandwidth_inst` | PCIe instantaneous bandwidth | GB/s\n`pcie_l0_to_recov_count_acc` | PCIe L0 to recovery state transition accumulated count |\n`pcie_replay_count_acc` | PCIe replay accumulated count |\n`pcie_replay_rover_count_acc` | PCIe replay rollover accumulated count |\n`xgmi_read_data_acc` | XGMI accumulated read data transfer size (KiloBytes) | KB\n`xgmi_write_data_acc` | XGMI accumulated write data transfer size (KiloBytes) | KB\n`current_gfxclks` | List of current gfx clock frequencies | MHz\n`current_socclks` | List of current soc clock frequencies | MHz\n`current_vclk0s` | List of current v0 clock frequencies | MHz\n`current_dclk0s` | List of current d0 clock frequencies | MHz\n`pcie_nak_sent_count_acc` | PCIe NAC sent count accumulated |\n`pcie_nak_rcvd_count_acc` | PCIe NAC received count accumulated |\n`jpeg_activity` | List of JPEG engine activity | %\n\nExceptions that can be thrown by `amdsmi_get_gpu_metrics_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_get_gpu_metrics_info(dev)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_od_volt_curve_regions\n\nDescription: This function will retrieve the current valid regions in the\nfrequency/voltage space. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `num_regions` number of freq volt regions\n\nOutput: List containing a dictionary with fields for each freq volt region\n\nField | Description\n---|---\n`freq_range` | <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound freq range</td></tr><tr><td>`upper_bound`</td><td>upper bound freq range</td></tr></tbody></table>\n`volt_range` |  <table> <thead><tr><th> Subfield </th><th>Description</th></tr></thead><tbody><tr><td>`lower_bound`</td><td>lower bound volt range</td></tr><tr><td>`upper_bound`</td><td>upper bound volt range</td></tr></tbody></table>\n\nExceptions that can be thrown by `amdsmi_get_gpu_od_volt_curve_regions` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_get_gpu_od_volt_curve_regions(device, 3)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_power_profile_presets\n\nDescription:  Get the list of available preset power profiles and an indication of\nwhich profile is currently active. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_idx` number of freq volt regions\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`available_profiles` | Which profiles are supported by this system\n`current` | Which power profile is currently active\n`num_profiles` | How many power profiles are available\n\nExceptions that can be thrown by `amdsmi_get_gpu_power_profile_presets` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_get_gpu_power_profile_presets(device, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_gpu_counter_group_supported\n\nDescription: Tell if an event group is supported by a given device.\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` device which to query\n* `event_group` event group being checked for support\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_gpu_counter_group_supported` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_gpu_counter_group_supported(device, AmdSmiEventGroup.XGMI)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_gpu_create_counter\n\nDescription: Creates a performance counter object\n\nInput parameters:\n\n* `processor_handle` device which to query\n* `event_type` event group being checked for support\n\nOutput: An event handle of the newly created performance counter object\n\nExceptions that can be thrown by `amdsmi_gpu_create_counter` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_gpu_destroy_counter\n\nDescription: Destroys a performance counter object\n\nInput parameters:\n\n* `event_handle` event handle of the performance counter object\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_gpu_destroy_counter` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI)\n            amdsmi_gpu_destroy_counter(event_handle)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_gpu_control_counter\n\nDescription: Issue performance counter control commands. It is not supported\non virtual machine guest\n\nInput parameters:\n\n* `event_handle` event handle of the performance counter object\n* `counter_command` command being passed to counter as AmdSmiCounterCommand\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_gpu_control_counter` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX)\n            amdsmi_gpu_control_counter(event_handle, AmdSmiCounterCommand.CMD_START)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_gpu_read_counter\n\nDescription: Read the current value of a performance counter\n\nInput parameters:\n\n* `event_handle` event handle of the performance counter object\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`value` | Counter value\n`time_enabled` | Time that the counter was enabled in nanoseconds\n`time_running` | Time that the counter was running in nanoseconds\n\nExceptions that can be thrown by `amdsmi_gpu_read_counter` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX)\n            amdsmi_gpu_read_counter(event_handle)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_available_counters\n\nDescription: Get the number of currently available counters. It is not supported\non virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `event_group` event group being checked as AmdSmiEventGroup\n\nOutput: Number of available counters for the given device of the inputted event group\n\nExceptions that can be thrown by `amdsmi_get_gpu_available_counters` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            available_counters =  amdsmi_get_gpu_available_counters(device, AmdSmiEventGroup.XGMI)\n            print(available_counters)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_perf_level\n\nDescription: Set a desired performance level for given device. It is not\nsupported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `perf_level` performance level being set as AmdSmiDevPerfLevel\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_perf_level` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_perf_level(device, AmdSmiDevPerfLevel.STABLE_PEAK)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_reset_gpu\n\nDescription: Reset the gpu associated with the device with provided device handle\nIt is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_reset_gpu` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_reset_gpu(device)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_fan_speed\n\nDescription: Set the fan speed for the specified device with the provided speed,\nin RPMs. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_idx` sensor index as integer\n* `fan_speed` the speed to which the function will attempt to set the fan\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_fan_speed` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_fan_speed(device, 0, 1333)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_reset_gpu_fan\n\nDescription: Reset the fan to automatic driver control. It is not\nsupported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `sensor_idx` sensor index as integer\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_reset_gpu_fan` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_reset_gpu_fan(device, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_clk_freq\n\nDescription: Control the set of allowed frequencies that can be used for the\nspecified clock. It is not supported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `clk_type` the type of clock for which the set of frequencies will be modified\nas AmdSmiClkType\n* `freq_bitmask`  bitmask indicating the indices of the frequencies that are to\nbe enabled (1) and disabled (0). Only the lowest ::amdsmi_frequencies_t.num_supported\nbits of this mask are relevant.\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_clk_freq` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            freq_bitmask = 0\n             amdsmi_set_clk_freq(device, AmdSmiClkType.GFX, freq_bitmask)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_soc_pstate\n\nDescription: Get dpm policy information.\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `policy_id` the policy id to set.\n\nOutput: Dictionary with fields\n\nField | Description\n---|---\n`num_supported` | total number of supported policies\n`current_id` | current policy id\n`policies` | list of dictionaries containing possible policies\n\nExceptions that can be thrown by `amdsmi_get_soc_pstate` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            dpm_policies = amdsmi_get_soc_pstate(device)\n            print(dpm_policies)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_soc_pstate\n\nDescription: Set the dpm policy to corresponding policy_id. Typically following: 0(default),1,2,3\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `policy_id` the policy id to set.\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_soc_pstate` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_soc_pstate(device, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_xgmi_plpd\n\nDescription: Set the xgmi per-link power down policy parameter for the processor\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `policy_id` the xgmi plpd id to set.\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_xgmi_plpd` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_xgmi_plpd(device, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_xgmi_plpd\n\nDescription: Get the xgmi per-link power down policy parameter for the processor\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: Dict containing information about xgmi per-link power down policy\n\nField | Description\n---|---\n`num_supported` | The number of supported policies\n`current_id` | The current policy index\n`plpds` | List of policies.\n\nExceptions that can be thrown by `amdsmi_get_xgmi_plpd` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            xgmi_plpd =  amdsmi_get_xgmi_plpd(device)\n            print(xgmi_plpd)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_overdrive_level\n\nDescription: **deprecated** Set the overdrive percent associated with the\ndevice with provided device handle with the provided value. It is not\nsupported on virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `overdrive_value` value to which the overdrive level should be set\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_set_gpu_overdrive_level` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_overdrive_level(device, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_ecc_count\n\nDescription: Retrieve the error counts for a GPU block. It is not supported\non virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `block` The block for which error counts should be retrieved\n\nOutput: Dict containing information about error counts\n\nField | Description\n---|---\n`correctable_count` | Count of correctable errors\n`uncorrectable_count` | Count of uncorrectable errors\n`deferred_count` | Count of deferred errors\n\nExceptions that can be thrown by `amdsmi_get_gpu_ecc_count` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            ecc_count =  amdsmi_get_gpu_ecc_count(device, AmdSmiGpuBlock.UMC)\n            print(ecc_count)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_ecc_enabled\n\nDescription: Retrieve the enabled ECC bit-mask. It is not supported on virtual\nmachine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: Enabled ECC bit-mask\n\nExceptions that can be thrown by `amdsmi_get_gpu_ecc_enabled` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            enabled =  amdsmi_get_gpu_ecc_enabled(device)\n            print(enabled)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_ecc_status\n\nDescription: Retrieve the ECC status for a GPU block. It is not supported\non virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n* `block` The block for which ECC status should be retrieved\n\nOutput: ECC status for a requested GPU block\n\nExceptions that can be thrown by `amdsmi_get_gpu_ecc_status` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            status =  amdsmi_get_gpu_ecc_status(device, AmdSmiGpuBlock.UMC)\n            print(status)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_status_code_to_string\n\nDescription: Get a description of a provided AMDSMI error status\n\nInput parameters:\n\n* `status` The error status for which a description is desired\n\nOutput: String description of the provided error code\n\nExceptions that can be thrown by `amdsmi_status_code_to_string` function:\n\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    status_str = amdsmi_status_code_to_string(ctypes.c_uint32(0))\n    print(status_str)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_compute_process_info\n\nDescription: Get process information about processes currently using GPU\n\nInput parameters: None\n\nOutput: List of python dicts each containing a process information\n\nField | Description\n---|---\n`process_id` | Process ID\n`pasid` | PASID\n`vram_usage` | VRAM usage\n`sdma_usage` | SDMA usage in microseconds\n`cu_occupancy` | Compute Unit usage in percents\n\nExceptions that can be thrown by `amdsmi_get_gpu_compute_process_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n\nExample:\n\n```python\ntry:\n    procs = amdsmi_get_gpu_compute_process_info()\n    for proc in procs:\n        print(proc)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_compute_process_info_by_pid\n\nDescription: Get process information about processes currently using GPU\n\nInput parameters:\n\n* `pid` The process ID for which process information is being requested\n\nOutput: Dict containing a process information\n\nField | Description\n---|---\n`process_id` | Process ID\n`pasid` | PASID\n`vram_usage` | VRAM usage\n`sdma_usage` | SDMA usage in microseconds\n`cu_occupancy` | Compute Unit usage in percents\n\nExceptions that can be thrown by `amdsmi_get_gpu_compute_process_info_by_pid` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    pid = 0 # << valid pid here\n    proc = amdsmi_get_gpu_compute_process_info_by_pid(pid)\n    print(proc)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_compute_process_gpus\n\nDescription: Get the device indices currently being used by a process\n\nInput parameters:\n\n* `pid` The process id of the process for which the number of gpus currently being used is requested\n\nOutput: List of indices of devices currently being used by the process\n\nExceptions that can be thrown by `amdsmi_get_gpu_compute_process_gpus` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    pid = 0 # << valid pid here\n    indices = amdsmi_get_gpu_compute_process_gpus(pid)\n    print(indices)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_gpu_xgmi_error_status\n\nDescription: Retrieve the XGMI error status for a device. It is not supported on\nvirtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: XGMI error status for a requested device\n\nExceptions that can be thrown by `amdsmi_gpu_xgmi_error_status` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            status = amdsmi_gpu_xgmi_error_status(device)\n            print(status)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_reset_gpu_xgmi_error\n\nDescription: Reset the XGMI error status for a device. It is not supported\non virtual machine guest\n\nInput parameters:\n\n* `processor_handle` handle for the given device\n\nOutput: None\n\nExceptions that can be thrown by `amdsmi_reset_gpu_xgmi_error` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_reset_gpu_xgmi_error(device)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_vendor_name\n\nDescription: Returns the device vendor name\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: device vendor name\n\nExceptions that can be thrown by `amdsmi_get_gpu_vendor_name` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            vendor_name = amdsmi_get_gpu_vendor_name(device)\n            print(vendor_name)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_id\n\nDescription: Get the device id associated with the device with provided device handler\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: device id\n\nExceptions that can be thrown by `amdsmi_get_gpu_id` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            dev_id = amdsmi_get_gpu_id(device)\n            print(dev_id)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_vram_vendor\n\nDescription: Get the vram vendor string of a gpu device.\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: vram vendor\n\nExceptions that can be thrown by `amdsmi_get_gpu_vram_vendor` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            vram_vendor = amdsmi_get_gpu_vram_vendor(device)\n            print(vram_vendor)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_subsystem_id\n\nDescription: Get the subsystem device id associated with the device with provided device handle.\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: subsystem device id\n\nExceptions that can be thrown by `amdsmi_get_gpu_subsystem_id` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            id = amdsmi_get_gpu_subsystem_id(device)\n            print(id)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_subsystem_name\n\nDescription: Get the name string for the device subsytem\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: device subsytem\n\nExceptions that can be thrown by `amdsmi_get_gpu_subsystem_name` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            subsystem_nam = amdsmi_get_gpu_subsystem_name(device)\n            print(subsystem_nam)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_lib_version\n\nDescription: Get the build version information for the currently running build of AMDSMI.\n\nOutput: amdsmi build version\n\nExceptions that can be thrown by `amdsmi_get_lib_version` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    version = amdsmi_get_lib_version()\n    print(version)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_topo_get_numa_node_number\n\nDescription: Retrieve the NUMA CPU node number for a device\n\nInput parameters:\n\n* `processor_handle` device which to query\n\nOutput: node number of NUMA CPU for the device\n\nExceptions that can be thrown by `amdsmi_topo_get_numa_node_number` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            node_number = amdsmi_topo_get_numa_node_number()\n            print(node_number)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_topo_get_link_weight\n\nDescription: Retrieve the weight for a connection between 2 GPUs.\n\nInput parameters:\n\n* `processor_handle_src` the source device handle\n* `processor_handle_dest` the destination device handle\n\nOutput: the weight for a connection between 2 GPUs\n\nExceptions that can be thrown by `amdsmi_topo_get_link_weight` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        processor_handle_src = devices[0]\n        processor_handle_dest = devices[1]\n        weight = amdsmi_topo_get_link_weight(processor_handle_src, processor_handle_dest)\n        print(weight)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_minmax_bandwidth_between_processors\n\nDescription: Retreive minimal and maximal io link bandwidth between 2 GPUs.\n\nInput parameters:\n\n* `processor_handle_src` the source device handle\n* `processor_handle_dest` the destination device handle\n\nOutput:  Dictionary with fields:\n\nField | Description\n---|---\n`min_bandwidth` | minimal bandwidth for the connection\n`max_bandwidth` | maximal bandwidth for the connection\n\nExceptions that can be thrown by `amdsmi_get_minmax_bandwidth_between_processors` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        processor_handle_src = devices[0]\n        processor_handle_dest = devices[1]\n        bandwidth =  amdsmi_get_minmax_bandwidth_between_processors(processor_handle_src, processor_handle_dest)\n        print(bandwidth['min_bandwidth'])\n        print(bandwidth['max_bandwidth'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_topo_get_link_type\n\nDescription: Retrieve the hops and the connection type between 2 GPUs\n\nInput parameters:\n\n* `processor_handle_src` the source device handle\n* `processor_handle_dest` the destination device handle\n\nOutput:  Dictionary with fields:\n\nField | Description\n---|---\n`hops` | number of hops\n`type` | the connection type\n\nExceptions that can be thrown by `amdsmi_topo_get_link_type` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        processor_handle_src = devices[0]\n        processor_handle_dest = devices[1]\n        link_type = amdsmi_topo_get_link_type(processor_handle_src, processor_handle_dest)\n        print(link_type['hops'])\n        print(link_type['type'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_is_P2P_accessible\n\nDescription: Return P2P availability status between 2 GPUs\n\nInput parameters:\n\n* `processor_handle_src` the source device handle\n* `processor_handle_dest` the destination device handle\n\nOutput: P2P availability status between 2 GPUs\n\nExceptions that can be thrown by `amdsmi_is_P2P_accessible` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        processor_handle_src = devices[0]\n        processor_handle_dest = devices[1]\n        accessible = amdsmi_is_P2P_accessible(processor_handle_src, processor_handle_dest)\n        print(accessible)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_compute_partition\n\nDescription: Get the compute partition from the given GPU\n\nInput parameters:\n\n* `processor_handle` the device handle\n\nOutput: String of the partition type\n\nExceptions that can be thrown by `amdsmi_get_gpu_compute_partition` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            compute_partition_type = amdsmi_get_gpu_compute_partition(device)\n            print(compute_partition_type)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_compute_partition\n\nDescription: Set the compute partition to the given GPU\n\nInput parameters:\n\n* `processor_handle` the device handle\n* `compute_partition` the type of compute_partition to set\n\nOutput: String of the partition type\n\nExceptions that can be thrown by `amdsmi_set_gpu_compute_partition` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    compute_partition = AmdSmiComputePartitionType.SPX\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_compute_partition(device, compute_partition)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_reset_gpu_compute_partition\n\nDescription: Reset the compute partitioning on the given GPU\n\nInput parameters:\n\n* `processor_handle` the device handle\n\nOutput: String of the partition type\n\nExceptions that can be thrown by `amdsmi_reset_gpu_compute_partition` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_reset_gpu_compute_partition(device)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_gpu_memory_partition\n\nDescription: Get the memory partition from the given GPU\n\nInput parameters:\n\n* `processor_handle` the device handle\n\nOutput: String of the partition type\n\nExceptions that can be thrown by `amdsmi_get_gpu_memory_partition` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            memory_partition_type = amdsmi_get_gpu_memory_partition(device)\n            print(memory_partition_type)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_gpu_memory_partition\n\nDescription: Set the memory partition to the given GPU\n\nInput parameters:\n\n* `processor_handle` the device handle\n* `memory_partition` the type of memory_partition to set\n\nOutput: String of the partition type\n\nExceptions that can be thrown by `amdsmi_set_gpu_memory_partition` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    memory_partition = AmdSmiMemoryPartitionType.NPS1\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_set_gpu_memory_partition(device, memory_partition)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_reset_gpu_memory_partition\n\nDescription: Reset the memory partitioning on the given GPU\n\nInput parameters:\n\n* `processor_handle` the device handle\n\nOutput: String of the partition type\n\nExceptions that can be thrown by `amdsmi_reset_gpu_memory_partition` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            amdsmi_reset_gpu_memory_partition(device)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_xgmi_info\n\nDescription: Returns XGMI information for the GPU.\n\nInput parameters:\n\n* `processor_handle`  device handle\n\nOutput:  Dictionary with fields:\n\nField | Description\n---|---\n`xgmi_lanes` |  xgmi lanes\n`xgmi_hive_id` | xgmi hive id\n`xgmi_node_id` | xgmi node id\n`index` | index\n\nExceptions that can be thrown by `amdsmi_get_xgmi_info` function:\n\n* `AmdSmiLibraryException`\n* `AmdSmiRetryException`\n* `AmdSmiParameterException`\n\nExample:\n\n```python\ntry:\n    devices = amdsmi_get_processor_handles()\n    if len(devices) == 0:\n        print(\"No GPUs on machine\")\n    else:\n        for device in devices:\n            xgmi_info = amdsmi_get_xgmi_info(device)\n            print(xgmi_info['xgmi_lanes'])\n            print(xgmi_info['xgmi_hive_id'])\n            print(xgmi_info['xgmi_node_id'])\n            print(xgmi_info['index'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n## CPU APIs\n\n### amdsmi_get_processor_info\n\n**Note: CURRENTLY HARDCODED TO RETURN EMPTY VALUES**\n\nDescription: Return processor name\n\nInput parameters:\n`processor_handle` processor handle\n\nOutput: Processor name\n\nExceptions that can be thrown by `amdsmi_get_processor_info` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_processor_handles()\n    if len(processor_handles) == 0:\n        print(\"No processors on machine\")\n    else:\n        for processor in processor_handles:\n            print(amdsmi_get_processor_info(processor))\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_hsmp_proto_ver\n\nDescription: Get the hsmp protocol version.\n\nOutput: amdsmi hsmp protocol version\n\nExceptions that can be thrown by `amdsmi_get_cpu_hsmp_proto_ver` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            version = amdsmi_get_cpu_hsmp_proto_ver(processor)\n            print(version)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_smu_fw_version\n\nDescription: Get the SMU Firmware version.\n\nOutput: amdsmi SMU Firmware version\n\nExceptions that can be thrown by `amdsmi_get_cpu_smu_fw_version` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            version = amdsmi_get_cpu_smu_fw_version(processor)\n            print(version['debug'])\n            print(version['minor'])\n            print(version['major'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_prochot_status\n\nDescription: Get the CPU's prochot status.\n\nOutput: amdsmi cpu prochot status\n\nExceptions that can be thrown by `amdsmi_get_cpu_prochot_status` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            prochot = amdsmi_get_cpu_prochot_status(processor)\n            print(prochot)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_fclk_mclk\n\nDescription: Get the Data fabric clock and Memory clock in MHz.\n\nOutput: amdsmi data fabric clock and memory clock\n\nExceptions that can be thrown by `amdsmi_get_cpu_fclk_mclk` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            clk = amdsmi_get_cpu_fclk_mclk(processor)\n            for fclk, mclk in clk.items():\n                print(fclk)\n                print(mclk)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_cclk_limit\n\nDescription: Get the core clock in MHz.\n\nOutput: amdsmi core clock\n\nExceptions that can be thrown by `amdsmi_get_cpu_cclk_limit` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            cclk_limit = amdsmi_get_cpu_cclk_limit(processor)\n            print(cclk_limit)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_current_active_freq_limit\n\nDescription: Get current active frequency limit of the socket.\n\nOutput: amdsmi frequency value in MHz and frequency source name\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_current_active_freq_limit` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            freq_limit = amdsmi_get_cpu_socket_current_active_freq_limit(processor)\n            for freq, src in freq_limit.items():\n                print(freq)\n                print(src)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_freq_range\n\nDescription: Get socket frequency range\n\nOutput: amdsmi maximum frequency and minimum frequency\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_freq_range` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            freq_range = amdsmi_get_cpu_socket_freq_range(processor)\n            for fmax, fmin in freq_range.items():\n                print(fmax)\n                print(fmin)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_core_current_freq_limit\n\nDescription: Get socket frequency limit of the core\n\nOutput: amdsmi frequency\n\nExceptions that can be thrown by `amdsmi_get_cpu_core_current_freq_limit` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpucore_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU cores on machine\")\n    else:\n        for processor in processor_handles:\n            freq_limit = amdsmi_get_cpu_core_current_freq_limit(processor)\n            print(freq_limit)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_power\n\nDescription: Get the socket power.\n\nOutput: amdsmi socket power\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_power` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            sock_power = amdsmi_get_cpu_socket_power(processor)\n            print(sock_power)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_power_cap\n\nDescription: Get the socket power cap.\n\nOutput: amdsmi socket power cap\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_power_cap` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            sock_power = amdsmi_get_cpu_socket_power_cap(processor)\n            print(sock_power)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_power_cap_max\n\nDescription: Get the socket power cap max.\n\nOutput: amdsmi socket power cap max\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_power_cap_max` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            sock_power = amdsmi_get_cpu_socket_power_cap_max(processor)\n            print(sock_power)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_pwr_svi_telemetry_all_rails\n\nDescription: Get the SVI based power telemetry for all rails.\n\nOutput: amdsmi svi based power value\n\nExceptions that can be thrown by `amdsmi_get_cpu_pwr_svi_telemetry_all_rails` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            power = amdsmi_get_cpu_pwr_svi_telemetry_all_rails(processor)\n            print(power)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_socket_power_cap\n\nDescription: Set the power cap value for a given socket.\n\nInput: amdsmi socket power cap value\n\nExceptions that can be thrown by `amdsmi_set_cpu_socket_power_cap` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            power = amdsmi_set_cpu_socket_power_cap(processor, 1000)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_pwr_efficiency_mode\n\nDescription: Set the power efficiency profile policy.\n\nInput: mode(0, 1, or 2)\n\nExceptions that can be thrown by `amdsmi_set_cpu_pwr_efficiency_mode` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            policy = amdsmi_set_cpu_pwr_efficiency_mode(processor, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_core_boostlimit\n\nDescription: Get boost limit of the cpu core\n\nOutput: amdsmi frequency\n\nExceptions that can be thrown by `amdsmi_get_cpu_core_boostlimit` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpucore_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU cores on machine\")\n    else:\n        for processor in processor_handles:\n            boost_limit = amdsmi_get_cpu_core_boostlimit(processor)\n            print(boost_limit)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_c0_residency\n\nDescription: Get the cpu socket C0 residency.\n\nOutput: amdsmi C0 residency value\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_c0_residency` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            c0_residency = amdsmi_get_cpu_socket_c0_residency(processor)\n            print(c0_residency)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_core_boostlimit\n\nDescription: Set the cpu core boost limit.\n\nOutput: amdsmi boostlimit value\n\nExceptions that can be thrown by `amdsmi_set_cpu_core_boostlimit` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpucore_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU cores on machine\")\n    else:\n        for processor in processor_handles:\n            boost_limit = amdsmi_set_cpu_core_boostlimit(processor, 1000)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_socket_boostlimit\n\nDescription: Set the cpu socket boost limit.\n\nInput: amdsmi boostlimit value\n\nExceptions that can be thrown by `amdsmi_set_cpu_socket_boostlimit` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            boost_limit = amdsmi_set_cpu_socket_boostlimit(processor, 1000)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_ddr_bw\n\nDescription: Get the CPU DDR Bandwidth.\n\nOutput: amdsmi ddr bandwidth data\n\nExceptions that can be thrown by `amdsmi_get_cpu_ddr_bw` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            ddr_bw = amdsmi_get_cpu_ddr_bw(processor)\n            print(ddr_bw['max_bw'])\n            print(ddr_bw['utilized_bw'])\n            print(ddr_bw['utilized_pct'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_temperature\n\nDescription: Get the socket temperature.\n\nOutput: amdsmi temperature value\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_temperature` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            ptmon = amdsmi_get_cpu_socket_temperature(processor)\n            print(ptmon)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_dimm_temp_range_and_refresh_rate\n\nDescription: Get DIMM temperature range and refresh rate.\n\nOutput: amdsmi dimm metric data\n\nExceptions that can be thrown by `amdsmi_get_cpu_dimm_temp_range_and_refresh_rate` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            dimm = amdsmi_get_cpu_dimm_temp_range_and_refresh_rate(processor)\n            print(dimm['range'])\n            print(dimm['ref_rate'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_dimm_power_consumption\n\nDescription: amdsmi_get_cpu_dimm_power_consumption.\n\nOutput: amdsmi dimm power consumption value\n\nExceptions that can be thrown by `amdsmi_get_cpu_dimm_power_consumption` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            dimm = amdsmi_get_cpu_dimm_power_consumption(processor)\n            print(dimm['power'])\n            print(dimm['update_rate'])\n            print(dimm['dimm_addr'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_dimm_thermal_sensor\n\nDescription: Get DIMM thermal sensor value.\n\nOutput: amdsmi dimm temperature data\n\nExceptions that can be thrown by `amdsmi_get_cpu_dimm_thermal_sensor` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            dimm = amdsmi_get_cpu_dimm_thermal_sensor(processor)\n            print(dimm['sensor'])\n            print(dimm['update_rate'])\n            print(dimm['dimm_addr'])\n            print(dimm['temp'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_xgmi_width\n\nDescription:  Set xgmi width.\n\nInput: amdsmi xgmi width\n\nExceptions that can be thrown by `amdsmi_set_cpu_xgmi_width` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            xgmi_width = amdsmi_set_cpu_xgmi_width(processor, 0, 100)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_gmi3_link_width_range\n\nDescription:  Set gmi3 link width range.\n\nInput: minimum & maximum link width to be set.\n\nExceptions that can be thrown by `amdsmi_set_cpu_gmi3_link_width_range` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            gmi_link_width = amdsmi_set_cpu_gmi3_link_width_range(processor, 0, 100)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_cpu_apb_enable\n\nDescription:  Enable APB.\n\nInput: amdsmi processor handle\n\nExceptions that can be thrown by `amdsmi_cpu_apb_enable` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            apb_enable = amdsmi_cpu_apb_enable(processor)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_cpu_apb_disable\n\nDescription:  Disable APB.\n\nInput: pstate value\n\nExceptions that can be thrown by `amdsmi_cpu_apb_disable` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            apb_disable = amdsmi_cpu_apb_disable(processor, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_socket_lclk_dpm_level\n\nDescription:  Set NBIO lclk dpm level value.\n\nInput: nbio id, min value, max value\n\nExceptions that can be thrown by `amdsmi_set_cpu_socket_lclk_dpm_level` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for socket in socket_handles:\n            nbio = amdsmi_set_cpu_socket_lclk_dpm_level(socket, 0, 0, 2)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_socket_lclk_dpm_level\n\nDescription: Get NBIO LCLK dpm level.\n\nOutput: nbio id\n\nExceptions that can be thrown by `amdsmi_get_cpu_socket_lclk_dpm_level` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            nbio = amdsmi_get_cpu_socket_lclk_dpm_level(processor)\n            print(nbio['max_dpm_level'])\n            print(nbio['max_dpm_level'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_pcie_link_rate\n\nDescription:  Set pcie link rate.\n\nInput: rate control value\n\nExceptions that can be thrown by `amdsmi_set_cpu_pcie_link_rate` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            link_rate = amdsmi_set_cpu_pcie_link_rate(processor, 0, 0)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_set_cpu_df_pstate_range\n\nDescription:  Set df pstate range.\n\nInput: max pstate, min pstate\n\nExceptions that can be thrown by `amdsmi_set_cpu_df_pstate_range` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            pstate_range = amdsmi_set_cpu_df_pstate_range(processor, 0, 2)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_current_io_bandwidth\n\nDescription: Get current input output bandwidth.\n\nOutput: link id and bw type to which io bandwidth to be obtained\n\nExceptions that can be thrown by `amdsmi_get_cpu_current_io_bandwidth` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            io_bw = amdsmi_get_cpu_current_io_bandwidth(processor)\n            print(io_bw)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_current_xgmi_bw\n\nDescription: Get current xgmi bandwidth.\n\nOutput: amdsmi link id and bw type to which xgmi bandwidth to be obtained\n\nExceptions that can be thrown by `amdsmi_get_cpu_current_xgmi_bw` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            xgmi_bw = amdsmi_get_cpu_current_xgmi_bw(processor)\n            print(xgmi_bw)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_hsmp_metrics_table_version\n\nDescription: Get HSMP metrics table version.\n\nOutput: amdsmi HSMP metrics table version\n\nExceptions that can be thrown by `amdsmi_get_hsmp_metrics_table_version` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            met_ver = amdsmi_get_hsmp_metrics_table_version(processor)\n            print(met_ver)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_hsmp_metrics_table\n\nDescription: Get HSMP metrics table\n\nOutput: HSMP metric table data\n\nExceptions that can be thrown by `amdsmi_get_hsmp_metrics_table` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            mtbl = amdsmi_get_hsmp_metrics_table(processor)\n            print(mtbl['accumulation_counter'])\n            print(mtbl['max_socket_temperature'])\n            print(mtbl['max_vr_temperature'])\n            print(mtbl['max_hbm_temperature'])\n            print(mtbl['socket_power_limit'])\n            print(mtbl['max_socket_power_limit'])\n            print(mtbl['socket_power'])\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_first_online_core_on_cpu_socket\n\nDescription: Get first online core on cpu socket.\n\nOutput: first online core on cpu socket\n\nExceptions that can be thrown by `amdsmi_first_online_core_on_cpu_socket` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n    processor_handles = amdsmi_get_cpusocket_handles()\n    if len(processor_handles) == 0:\n        print(\"No CPU sockets on machine\")\n    else:\n        for processor in processor_handles:\n            pcore_ind = amdsmi_first_online_core_on_cpu_socket(processor)\n            print(pcore_ind)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_family\n\nDescription: Get cpu family.\n\nOutput: cpu family\n\nExceptions that can be thrown by `amdsmi_get_cpu_family` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n     cpu_family = amdsmi_get_cpu_family()\n     print(cpu_family)\nexcept AmdSmiException as e:\n    print(e)\n```\n\n### amdsmi_get_cpu_model\n\nDescription: Get cpu model.\n\nOutput: cpu model\n\nExceptions that can be thrown by `amdsmi_get_cpu_model` function:\n\n* `AmdSmiLibraryException`\n\nExample:\n\n```python\ntry:\n     cpu_model = amdsmi_get_cpu_model()\n     print(cpu_model)\nexcept AmdSmiException as e:\n    print(e)\n```\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2019-2023 Advanced Micro Devices, Inc.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  ",
    "summary": "AMDSMI Python LIB - AMD GPU Monitoring Library",
    "version": "6.2.4",
    "project_urls": {
        "Homepage": "https://github.com/RadeonOpenCompute/amdsmi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b93022d7f743ed3d28ca33a5466f18013203a121ad2f0e22f1902d4509f7ff37",
                "md5": "3c6527f784ffdac1b941d30f6829fcae",
                "sha256": "02429befc9f138c3a6bfd0359b44d5f31976804f9818c560f480dab05ac7937a"
            },
            "downloads": -1,
            "filename": "amdsmi-6.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3c6527f784ffdac1b941d30f6829fcae",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 70440,
            "upload_time": "2024-11-09T05:12:50",
            "upload_time_iso_8601": "2024-11-09T05:12:50.867424Z",
            "url": "https://files.pythonhosted.org/packages/b9/30/22d7f743ed3d28ca33a5466f18013203a121ad2f0e22f1902d4509f7ff37/amdsmi-6.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a60d6939d540b88583027bd821374d8372549ae9aa34691346257a687437d7e",
                "md5": "e374e73bd4cad27cb40fe2595771f8c7",
                "sha256": "5c1b34138038686c1e1b1c6b90708b858f8dc5d2d6af009fa5bd35fa3aa3bdfb"
            },
            "downloads": -1,
            "filename": "amdsmi-6.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "e374e73bd4cad27cb40fe2595771f8c7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 99993,
            "upload_time": "2024-11-09T05:12:52",
            "upload_time_iso_8601": "2024-11-09T05:12:52.781927Z",
            "url": "https://files.pythonhosted.org/packages/6a/60/d6939d540b88583027bd821374d8372549ae9aa34691346257a687437d7e/amdsmi-6.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-09 05:12:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RadeonOpenCompute",
    "github_project": "amdsmi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "amdsmi"
}
        
AMD
Elapsed time: 0.40813s