diff --git a/CMakeLists.txt b/CMakeLists.txt index 3702f31253..3fdd5137c3 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,14 +204,13 @@ endif() #Debian package specific variables set(CPACK_DEBIAN_PACKAGE_PROVIDES "amd-smi") set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "sudo, libdrm-dev") -set(CPACK_DEBIAN_ASAN_PACKAGE_RECOMMENDS "sudo, libdrm-dev") -set(CPACK_DEBIAN_DEV_PACKAGE_RECOMMENDS "sudo, libdrm-dev") +set(CPACK_DEBIAN_ASAN_PACKAGE_RECOMMENDS ${CPACK_DEBIAN_PACKAGE_RECOMMENDS}) +set(CPACK_DEBIAN_DEV_PACKAGE_RECOMMENDS ${CPACK_DEBIAN_PACKAGE_RECOMMENDS}) set(CPACK_DEBIAN_ASAN_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}-asan") set(CPACK_DEBIAN_DEV_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}") -#Python 3.7.9 is the first stable build post the python bugfix window -set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3 (>= 3.7.9), python3-clang, python3-yaml") -set(CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS "python3 (>= 3.7.9), python3-clang, python3-yaml") -set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "python3 (>= 3.7.9), python3-clang, python3-yaml") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3") +set(CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}) +set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}) ## Process the Debian install/remove scripts to update the CPACK variables configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst.in DEBIAN/postinst @ONLY) @@ -228,12 +227,11 @@ endif() set(CPACK_RPM_PACKAGE_PROVIDES "amd-smi") set(CPACK_RPM_DEV_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}") set(CPACK_RPM_ASAN_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}-asan") -#Python 3.7.9 is the first stable build post the python bugfix window -set(CPACK_RPM_PACKAGE_REQUIRES "python38, python3-clang, python3-pyyaml") +set(CPACK_RPM_PACKAGE_REQUIRES "python3") +set(CPACK_RPM_DEV_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES}) +set(CPACK_RPM_ASAN_PACKAGE_REQUIRES ${CPACK_RPM_PACKAGE_REQUIRES}) # don't terminate if bytecompile of python files fails set(CPACK_RPM_SPEC_MORE_DEFINE "%define _python_bytecompile_errors_terminate_build 0") -set(CPACK_RPM_DEV_PACKAGE_REQUIRES "python38, python3-clang, python3-pyyaml") -set(CPACK_RPM_ASAN_PACKAGE_REQUIRES "python38, python3-clang, python3-pyyaml") # Add rocm-core dependency if -DROCM_DEP_ROCMCORE=ON is passed if(ROCM_DEP_ROCMCORE) diff --git a/README.md b/README.md index a9e122cde8..9f15962120 100755 --- a/README.md +++ b/README.md @@ -16,10 +16,12 @@ installed to query firmware information and hardware IPs. ### Additional Required software for building In order to build the AMD SMI library, the following components are required. Note that the software versions listed are what was used in development. Earlier versions are not guaranteed to work: + * CMake (v3.11.0) - `pip3 install cmake` * g++ (5.4.0) In order to build the AMD SMI python package, the following components are required: + * clang (14.0 or above) * python (3.6 or above) * virtualenv - `pip3 install virtualenv` @@ -49,10 +51,6 @@ To build the rpm and deb packages follow the above steps with: make package ``` -### Documentation - -The reference manual, `refman.pdf` will be in the `latex` directory upon a successful build. - ### Building the Tests In order to verify the build and capability of AMD SMI on your system and to see an example of how AMD SMI can be used, you may build and run the tests that are available in the repo. To build the tests, follow these steps: @@ -157,29 +155,46 @@ int main() { } ``` -# Insall Python Library and CLI Tool +### Documentation -## Requirements +The reference manual, `AMD_SMI_Manual.pdf` will be in the /opt/rocm/share/doc/amd_smi directory upon a successful build. -- python 3.7+ 64-bit -- driver must be loaded for amdsmi_init() to pass +### Sphinx Documentation -## Installation +To build the documentation locally, run the commands below: -- Install amdgpu driver -- Install amd-smi-lib package through package manager -- cd /opt//share/amd_smi -- python3 -m pip install --upgrade pip -- python3 -m pip install --user . -- /opt//bin/amd-smi --help +``` bash +cd docs + +pip3 install -r sphinx/requirements.txt + +python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html +``` + +The output will be in `docs/_build/html`. + +For additional details, see the [ROCm Contributing Guide](https://rocm.docs.amd.com/en/latest/contributing.html#building-documentation) + +## Install Python Library and CLI Tool + +### Requirements + +* python 3.7+ 64-bit +* driver must be loaded for amdsmi_init() to pass + +### Installation + +* Install amdgpu driver +* Install amd-smi-lib package through package manager +* cd /opt/rocm/share/amd_smi +* python3 -m pip install --upgrade pip +* python3 -m pip install --user . +* /opt/rocm/bin/amd-smi --help Add /opt/rocm/bin to your shell's path to access amd-smi via the cmdline -## Documentation +### Rebuilding Python wrapper -Documentation for AMDSMI-CLI is available in /opt//libexec/amdsmi_cli/README.md - -## Rebuilding Python wrapper The python wrapper (binding) is an auto-generated file `py-interface/amdsmi_wrapper.py` Wrapper should be re-generated on each C++ API change, by doing: @@ -195,7 +210,7 @@ Note: To be able to re-generate python wrapper you need several tools installed Note: python_wrapper is NOT automatically re-generated. You must run `cmake` with `-DBUILD_WRAPPER=on` argument. -# DISCLAIMER +## DISCLAIMER The information contained herein is for informational purposes only, and is subject to change without notice. In addition, any stated support is planned and is also subject to change. While every precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular purposes, with respect to the operation or use of AMD hardware, software or other products described herein. diff --git a/amdsmi_cli/README.md b/amdsmi_cli/README.md index 3b2a3dc05f..ed8e224eaa 100644 --- a/amdsmi_cli/README.md +++ b/amdsmi_cli/README.md @@ -1,4 +1,4 @@ -# AMD System Management Interface +# AMD SMI CLI Tool This tool acts as a command line interface for manipulating and monitoring the amdgpu kernel, and is intended to replace @@ -8,17 +8,17 @@ Recommended: At least one AMD GPU with AMD driver installed ## Requirements -- python 3.7+ 64-bit -- driver must be loaded for amdsmi_init() to pass +* python 3.7+ 64-bit +* driver must be loaded for amdsmi_init() to pass ## Installation -- Install amdgpu driver -- Install amd-smi-lib package through package manager -- cd /opt//share/amd_smi -- python3 -m pip install --upgrade pip -- python3 -m pip install --user . -- /opt//bin/amd-smi --help +* Install amdgpu driver +* Install amd-smi-lib package through package manager +* cd /opt/rocm/share/amd_smi +* python3 -m pip install --upgrade pip +* python3 -m pip install --user . +* /opt/rocm/bin/amd-smi --help Add /opt/rocm/bin to your shell's path to access amd-smi via the cmdline @@ -34,7 +34,7 @@ Verify that your python version is 3.7+ and if not you can use python3.8 instead ### Example of Ubuntu 22.04 post amdgpu driver install -``` shell +``` bash apt install amd-smi-lib cd /opt/rocm/share/amd_smi python3 -m pip install --upgrade pip diff --git a/amdsmi_cli/amdsmi_commands.py b/amdsmi_cli/amdsmi_commands.py index a899e3b850..f3fb36f1bc 100644 --- a/amdsmi_cli/amdsmi_commands.py +++ b/amdsmi_cli/amdsmi_commands.py @@ -1446,8 +1446,8 @@ class AMDSMICommands(): src_gpu_link_type[dest_gpu_key] = e.get_error_info() try: - min_bw = amdsmi_interface.admsmi_get_minmax_bandwith_between_processors(src_gpu, dest_gpu)['min_bandwidth'] - max_bw = amdsmi_interface.admsmi_get_minmax_bandwith_between_processors(src_gpu, dest_gpu)['max_bandwidth'] + min_bw = amdsmi_interface.amdsmi_get_minmax_bandwith_between_processors(src_gpu, dest_gpu)['min_bandwidth'] + max_bw = amdsmi_interface.amdsmi_get_minmax_bandwith_between_processors(src_gpu, dest_gpu)['max_bandwidth'] src_gpu_link_type[dest_gpu_key] = f'{min_bw}-{max_bw}' except amdsmi_exception.AmdSmiLibraryException as e: diff --git a/docs/amdsmi_cli_readme_link.md b/docs/amdsmi_cli_readme_link.md new file mode 100644 index 0000000000..f2bd033d44 --- /dev/null +++ b/docs/amdsmi_cli_readme_link.md @@ -0,0 +1,2 @@ +```{include} ../amdsmi_cli/README.md +``` diff --git a/docs/conf.py b/docs/conf.py index f77158e731..bdfc6e486f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,11 +9,15 @@ import subprocess from rocm_docs import ROCmDocs -name = "AMD SMI" -get_version = r'sed -n -e "s/^get_package_version_number(.*\"\([0-9\.]\{1,\}\).*/\1/p" ../CMakeLists.txt' -version = subprocess.getoutput(get_version) -if len(version) > 0: - name = f"{name} {version}" +get_version_year = r'sed -n -e "s/^#define\ AMDSMI_LIB_VERSION_YEAR\ //p" ../include/amd_smi/amdsmi.h' +get_version_major = r'sed -n -e "s/^#define\ AMDSMI_LIB_VERSION_MAJOR\ //p" ../include/amd_smi/amdsmi.h' +get_version_minor = r'sed -n -e "s/^#define\ AMDSMI_LIB_VERSION_MINOR\ //p" ../include/amd_smi/amdsmi.h' +get_version_release = r'sed -n -e "s/^#define\ AMDSMI_LIB_VERSION_RELEASE\ //p" ../include/amd_smi/amdsmi.h' +version_year = subprocess.getoutput(get_version_year) +version_major = subprocess.getoutput(get_version_major) +version_minor = subprocess.getoutput(get_version_minor) +version_release = subprocess.getoutput(get_version_release) +name = f"AMD SMI {version_year}.{version_major}.{version_minor}.{version_release}" external_toc_path = "./sphinx/_toc.yml" diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index a35063a3ab..348570c3d7 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "ROCm SMI Reference Manual" +PROJECT_BRIEF = "AMD SMI Reference Manual" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000000..451bedaec2 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,2 @@ +```{include} ../README.md +``` diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 339dc8f42d..0000000000 --- a/docs/index.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../README.md - :parser: myst_parser.sphinx_ diff --git a/docs/py-interface_readme_link.md b/docs/py-interface_readme_link.md new file mode 100644 index 0000000000..c583458eb7 --- /dev/null +++ b/docs/py-interface_readme_link.md @@ -0,0 +1,2 @@ +```{include} ../py-interface/README.md +``` diff --git a/docs/sphinx/_toc.yml.in b/docs/sphinx/_toc.yml.in index 7d534c0601..386f63252e 100644 --- a/docs/sphinx/_toc.yml.in +++ b/docs/sphinx/_toc.yml.in @@ -5,10 +5,16 @@ defaults: maxdepth: 6 root: index subtrees: - - caption: API + - caption: AMD SMI APIs entries: - - file: doxygen/docBin/html/index - title: API + - file: doxygen/docBin/html/index + title: C + - file: py-interface_readme_link + title: Python + - caption: CLI Tools + entries: + - file: amdsmi_cli_readme_link + title: Python CLI Tool - caption: About entries: - file: license diff --git a/docs/sphinx/requirements.in b/docs/sphinx/requirements.in index 0c3a8febc3..fa5d0b479a 100644 --- a/docs/sphinx/requirements.in +++ b/docs/sphinx/requirements.in @@ -1 +1 @@ -rocm-docs-core[api_reference]==0.10.3 +rocm-docs-core[api_reference]==0.13.3 diff --git a/docs/sphinx/requirements.txt b/docs/sphinx/requirements.txt index 630360bde9..45eb5a313c 100644 --- a/docs/sphinx/requirements.txt +++ b/docs/sphinx/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile sphinx/requirements.in +# pip-compile requirements.in # accessible-pygments==0.0.4 # via pydata-sphinx-theme @@ -43,6 +43,8 @@ docutils==0.19 # sphinx doxysphinx==3.3.3 # via rocm-docs-core +fastjsonschema==2.17.1 + # via rocm-docs-core gitdb==4.0.10 # via gitpython gitpython==3.1.31 @@ -110,13 +112,14 @@ pytz==2023.3 pyyaml==6.0 # via # myst-parser + # rocm-docs-core # sphinx-external-toc requests==2.30.0 # via # pygithub # sphinx -rocm-docs-core[api_reference]==0.10.3 - # via -r sphinx/requirements.in +rocm-docs-core[api_reference]==0.13.3 + # via -r requirements.in smmap==5.0.0 # via gitdb snowballstemmer==2.2.0 diff --git a/include/amd_smi/amdsmi.h b/include/amd_smi/amdsmi.h index 2d8591ba0c..57a35518d3 100644 --- a/include/amd_smi/amdsmi.h +++ b/include/amd_smi/amdsmi.h @@ -1268,7 +1268,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr * @p id. This ID is an identification of the type of device, so calling this * function for different devices will give the same value if they are kind * of device. Consequently, this function should not be used to distinguish - * one device from another. admsmi_get_gpu_bdf_id() should be used to get a + * one device from another. amdsmi_get_gpu_bdf_id() should be used to get a * unique identifier. * * @param[in] processor_handle a processor handle @@ -1457,7 +1457,7 @@ amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pc * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t admsmi_get_gpu_bdf_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid); +amdsmi_status_t amdsmi_get_gpu_bdf_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid); /** * @brief Get the NUMA node associated with a device @@ -2971,7 +2971,7 @@ amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - admsmi_get_minmax_bandwith_between_processors(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, + amdsmi_get_minmax_bandwith_between_processors(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth); /** diff --git a/py-interface/README.md b/py-interface/README.md index 9ecec833f6..cfaacc90e6 100644 --- a/py-interface/README.md +++ b/py-interface/README.md @@ -1,9 +1,14 @@ -# Requirements +# AMD SMI Python Library + +## Requirements + * python 3.6 64-bit * driver must be loaded for amdsmi_init() to pass -# Overview -## Folder structure: +## Overview + +## Folder structure + File Name | Note ---|--- `__init__.py` | Python package initialization file @@ -12,9 +17,10 @@ File Name | Note `amdsmi_exception.py` | Amdsmi exceptions python file `README.md` | Documentation -## Usage: +## Usage `amdsmi` folder should be copied and placed next to importing script. It should be imported as: + ```python from amdsmi import * @@ -36,15 +42,17 @@ To initialize amdsmi lib, amdsmi_init() must be called before all other calls to To close connection to driver, amdsmi_shut_down() must be the last call. -# Exceptions +## 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()) @@ -55,14 +63,16 @@ except AmdSmiException as e: if e.err_code == AmdSmiRetCode.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 +## API + +### amdsmi_init -## amdsmi_init Description: Initialize amdsmi lib and connect to driver Input parameters: `None` @@ -70,9 +80,11 @@ Input parameters: `None` Output: `None` Exceptions that can be thrown by `amdsmi_init` function: + * `AmdSmiLibraryException` Example: + ```python try: amdsmi_init() @@ -82,7 +94,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_shut_down +### amdsmi_shut_down + Description: Finalize and close connection to driver Input parameters: `None` @@ -90,9 +103,11 @@ Input parameters: `None` Output: `None` Exceptions that can be thrown by `amdsmi_shut_down` function: + * `AmdSmiLibraryException` Example: + ```python try: amdsmi_init() @@ -102,7 +117,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_processor_type +### amdsmi_get_processor_type + Description: Checks the type of device with provided handle. Input parameters: device handle as an instance of `amdsmi_processor_handle` @@ -110,9 +126,11 @@ 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) @@ -122,7 +140,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_processor_handles +### amdsmi_get_processor_handles + Description: Returns list of GPU device handle objects on current machine Input parameters: `None` @@ -130,9 +149,11 @@ 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() @@ -145,7 +166,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_socket_handles +### amdsmi_get_socket_handles + **Note: CURRENTLY HARDCODED TO RETURN DUMMY DATA** Description: Returns list of socket device handle objects on current machine @@ -154,9 +176,11 @@ 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() @@ -165,7 +189,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_socket_info +### amdsmi_get_socket_info + **Note: CURRENTLY HARDCODED TO RETURN EMPTY VALUES** Description: Return socket name @@ -175,9 +200,11 @@ Input parameters: Output: Socket name Exceptions that can be thrown by `amdsmi_get_socket_info` function: + * `AmdSmiLibraryException` Example: + ```python try: socket_handles = amdsmi_get_socket_handles() @@ -190,12 +217,13 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_processor_handle_from_bdf -## amdsmi_get_processor_handle_from_bdf Description: Returns device handle from the given BDF Input parameters: bdf string in form of either `::.` or `:.` in hexcode format. Where: + * `` is 4 hex digits long from 0000-FFFF interval * `` is 2 hex digits long from 00-FF interval * `` is 2 hex digits long from 00-1F interval @@ -204,10 +232,12 @@ Where: 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") @@ -216,24 +246,29 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_device_bdf +### 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 `::.` in hexcode format. Where: + * `` is 4 hex digits long from 0000-FFFF interval * `` is 2 hex digits long from 00-FF interval * `` is 2 hex digits long from 00-1F interval * `` 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] @@ -242,19 +277,23 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_device_uuid +### 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] @@ -263,19 +302,23 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_driver_version +### amdsmi_get_gpu_driver_version + Description: Returns the version string of the driver Input parameters: + * `processor_handle` dev for which to query Output: Driver version string that is handling the device Exceptions that can be thrown by `amdsmi_get_gpu_driver_version` function: + * `AmdSmiParameterException` * `AmdSmiLibraryException` Example: + ```python try: device = amdsmi_get_processor_handles()[0] @@ -284,10 +327,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_asic_info +### 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 @@ -301,11 +346,13 @@ Field | Content `asic_serial` | asic serial Exceptions that can be thrown by `amdsmi_get_gpu_asic_info` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -322,11 +369,14 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_power_cap_info + +### amdsmi_get_power_cap_info + Description: Returns dictionary of power capabilities as currently configured on the given GPU Input parameters: + * `processor_handle` device which to query Output: Dictionary with fields @@ -340,11 +390,13 @@ Field | Description `max_power_cap` | max power capability Exceptions that can be thrown by `amdsmi_get_power_cap_info` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -362,11 +414,12 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_gpu_vbios_info -## 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 @@ -379,11 +432,13 @@ Field | Description `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() @@ -400,10 +455,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_fw_info +### amdsmi_get_fw_info + Description: Returns GPU firmware related information. Input parameters: + * `processor_handle` device which to query Output: Dictionary with fields @@ -413,11 +470,13 @@ 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() @@ -433,10 +492,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_activity +### amdsmi_get_gpu_activity + Description: Returns the engine usage for the given GPU Input parameters: + * `processor_handle` device which to query Output: Dictionary with fields @@ -448,11 +509,13 @@ Field | Description `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() @@ -467,10 +530,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_power_info + +### amdsmi_get_power_info + Description: Returns the current power and voltage for the given GPU Input parameters: + * `processor_handle` device which to query Output: Dictionary with fields @@ -482,11 +548,13 @@ Field | Description `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() @@ -501,10 +569,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_vram_usage + +### 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 @@ -515,11 +586,13 @@ Field | Description `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() @@ -533,10 +606,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_clock_info + +### amdsmi_get_clock_info + Description: Returns the clock measure for the given GPU Input parameters: + * `processor_handle` device which to query * `clock_type` one of `AmdSmiClkType` enum values: @@ -563,11 +639,13 @@ Field | Description `min_clk` | Minimum clock for given clock type Exceptions that can be thrown by `amdsmi_get_clock_info` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -583,7 +661,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_pcie_link_status +### amdsmi_get_pcie_link_status + Description: Returns the pcie link status for the given GPU Input parameters: @@ -598,11 +677,13 @@ Field | Description `pcie_speed`| current pcie speed Exceptions that can be thrown by `amdsmi_get_pcie_link_status` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -617,10 +698,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_pcie_link_caps +### amdsmi_get_pcie_link_caps + Description: Returns the max pcie link capabilities for the given GPU Input parameters: + * `processor_handle` device which to query Output: Dictionary with fields @@ -631,11 +714,13 @@ Field | Description `pcie_speed` | PCIe speed in MT/s Exceptions that can be thrown by `amdsmi_get_pcie_link_caps` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -650,10 +735,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_bad_page_info +### amdsmi_get_gpu_bad_page_info + Description: Returns bad page info for the given GPU Input parameters: + * `processor_handle` device which to query Output: List consisting of dictionaries with fields for each bad page found @@ -666,11 +753,13 @@ Field | Description `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() @@ -691,7 +780,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_target_frequency_range +### amdsmi_get_gpu_target_frequency_range + Description: Returns the supported frequency target range for the given GPU `Note: Not Supported` @@ -725,11 +815,13 @@ Field | Description `current_lower_bound` | Minimal value of target current frequency in MHz Exceptions that can be thrown by `amdsmi_get_gpu_target_frequency_range` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -762,7 +854,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_process_list +### amdsmi_get_gpu_process_list + Description: Returns the list of processes for the given GPU Input parameters: @@ -772,11 +865,13 @@ Input parameters: Output: List of process handles found Exceptions that can be thrown by `amdsmi_get_gpu_process_list` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -789,7 +884,9 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_process_info + +### amdsmi_get_gpu_process_info + Description: Returns the info for the given process Input parameters: @@ -808,11 +905,13 @@ Field | Description `memory_usage`|
Subfield Description
`gtt_mem`GTT memory usage
`cpu_mem`CPU memory usage
`vram_mem`VRAM memory usage
Exceptions that can be thrown by `amdsmi_get_gpu_process_info` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -827,7 +926,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_total_ecc_count +### amdsmi_get_gpu_total_ecc_count + Description: Returns the ECC error count for the given GPU Input parameters: @@ -842,11 +942,13 @@ Field | Description `uncorrectable_count`| Uncorrectable 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() @@ -861,7 +963,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_board_info +### amdsmi_get_gpu_board_info + Description: Returns board info for the given GPU Input parameters: @@ -877,11 +980,13 @@ Field | Description `product_name` | Product 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") @@ -893,7 +998,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_ras_block_features_enabled +### amdsmi_get_gpu_ras_block_features_enabled + Description: Returns status of each RAS block for the given GPU Input parameters: @@ -908,11 +1014,13 @@ Field | Description `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() @@ -925,14 +1033,15 @@ try: except AmdSmiException as e: print(e) ``` -## AmdSmiEventReader class + +### AmdSmiEventReader class Description: Providing methods for event monitoring. This is context manager class. Can be used with `with` statement for automatic cleanup. Methods: -## Constructor +### Constructor Description: Allocates a new event reader notifier to monitor different types of events for the given GPU @@ -948,7 +1057,7 @@ Event Type | Description `GPU_PRE_RESET` | gpu pre reset `GPU_POST_RESET` | gpu post reset -## read +### 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. @@ -957,7 +1066,7 @@ 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 +### 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. @@ -965,6 +1074,7 @@ automatically using `with` statement, like in the examples below. This should be Input parameters: `None` Example with manual cleanup of AmdSmiEventReader: + ```python try: devices = amdsmi_get_processor_handles() @@ -980,6 +1090,7 @@ finally: ``` Example with automatic cleanup using `with` statement: + ```python try: devices = amdsmi_get_processor_handles() @@ -993,23 +1104,26 @@ except AmdSmiException as e: ``` +### amdsmi_set_gpu_pci_bandwidth -## amdsmi_set_gpu_pci_bandwidth Description: Control the set of allowed PCIe bandwidths that can be used 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: +Exceptions that can be thrown by `amdsmi_set_gpu_pci_bandwidth` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1021,10 +1135,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_set_power_cap + +### amdsmi_set_power_cap + Description: Set the power cap value 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 @@ -1032,12 +1149,14 @@ device has more than one sensor, it could be greater than 0 Output: None -Exceptions that can be thrown by ` amdsmi_set_power_cap` function: +Exceptions that can be thrown by `amdsmi_set_power_cap` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1050,10 +1169,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_set_gpu_power_profile + +### amdsmi_set_gpu_power_profile + Description: Set the power profile 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 @@ -1061,12 +1183,14 @@ the desired new power profile Output: None -Exceptions that can be thrown by ` amdsmi_set_gpu_power_profile` function: +Exceptions that can be thrown by `amdsmi_set_gpu_power_profile` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1080,11 +1204,12 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_set_gpu_clk_range -## amdsmi_set_gpu_clk_range Description: This function sets the clock range information 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 @@ -1093,11 +1218,13 @@ Input parameters: 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() @@ -1110,8 +1237,8 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_gpu_bdf_id -## admsmi_get_gpu_bdf_id Description: Get the unique PCI device identifier associated for a device Input parameters: @@ -1132,13 +1259,14 @@ BDFID = ((DOMAIN & 0xffffffff) << 32) | ((BUS & 0xff) << 8) | | Device | [ 7: 3] | | Function | [ 2: 0] | +Exceptions that can be thrown by `amdsmi_get_gpu_bdf_id` function: -Exceptions that can be thrown by `admsmi_get_gpu_bdf_id` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = gpuvsmi_get_devices() @@ -1146,14 +1274,14 @@ try: print("No GPUs on machine") else: for device in devices: - bdfid = admsmi_get_gpu_bdf_id(device) + bdfid = amdsmi_get_gpu_bdf_id(device) print(bdfid) except AmdSmiException as e: print(e) ``` +### amdsmi_get_gpu_pci_bandwidth -## amdsmi_get_gpu_pci_bandwidth Description: Get the list of possible PCIe bandwidths that are available. Input parameters: @@ -1167,7 +1295,6 @@ Field | Content `transfer_rate` | transfer_rate dictionary `lanes` | lanes - transfer_rate dictionary Field | Content @@ -1177,11 +1304,13 @@ Field | Content `frequency` | list of frequency Exceptions that can be thrown by `amdsmi_get_gpu_pci_bandwidth` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = gpuvsmi_get_devices() @@ -1195,7 +1324,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_pci_throughput +### amdsmi_get_gpu_pci_throughput + Description: Get PCIe traffic information Input parameters: @@ -1211,11 +1341,13 @@ Field | Content `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 = gpuvsmi_get_devices() @@ -1229,7 +1361,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_pci_replay_counter +### amdsmi_get_gpu_pci_replay_counter Description: Get PCIe replay counter @@ -1240,12 +1372,14 @@ Input parameters: 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: +Exceptions that can be thrown by `amdsmi_get_gpu_pci_replay_counter` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = gpuvsmi_get_devices() @@ -1259,7 +1393,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_topo_numa_affinity +### amdsmi_get_gpu_topo_numa_affinity Description: Get the NUMA node associated with a device @@ -1270,11 +1404,13 @@ Input parameters: Output: NUMA node value Exceptions that can be thrown by `amdsmi_get_gpu_topo_numa_affinity` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = gpuvsmi_get_devices() @@ -1288,8 +1424,7 @@ except AmdSmiException as e: print(e) ``` - -## amdsmi_get_energy_count +### amdsmi_get_energy_count Description: Get the energy accumulator counter of the device. @@ -1306,11 +1441,13 @@ Field | Content `timestamp` | timestamp Exceptions that can be thrown by `amdsmi_get_energy_count` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = gpuvsmi_get_devices() @@ -1324,8 +1461,7 @@ except AmdSmiException as e: print(e) ``` - -## amdsmi_get_gpu_memory_total +### amdsmi_get_gpu_memory_total Description: Get the total amount of memory that exists @@ -1337,11 +1473,13 @@ Input parameters: Output: total amount of memory Exceptions that can be thrown by `amdsmi_get_gpu_memory_total` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = gpuvsmi_get_devices() @@ -1355,13 +1493,12 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_set_gpu_od_clk_info - - -## amdsmi_set_gpu_od_clk_info Description: This function sets the clock frequency information 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 @@ -1370,12 +1507,14 @@ or maximum (1) speed Output: None -Exceptions that can be thrown by ` amdsmi_set_gpu_od_clk_info` function: +Exceptions that can be thrown by `amdsmi_set_gpu_od_clk_info` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1393,8 +1532,7 @@ except AmdSmiException as e: print(e) ``` - -## amdsmi_get_gpu_memory_usage +### amdsmi_get_gpu_memory_usage Description: Get the current memory usage @@ -1406,11 +1544,13 @@ Input parameters: 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 = gpuvsmi_get_devices() @@ -1424,11 +1564,12 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_set_gpu_od_volt_info -## amdsmi_set_gpu_od_volt_info Description: This function sets 1 of the 3 voltage curve points 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 @@ -1436,12 +1577,14 @@ Input parameters: Output: None -Exceptions that can be thrown by ` amdsmi_set_gpu_od_volt_info` function: +Exceptions that can be thrown by `amdsmi_set_gpu_od_volt_info` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1454,12 +1597,13 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_gpu_fan_rpms -## 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. 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. @@ -1467,11 +1611,13 @@ 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() @@ -1484,11 +1630,14 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_fan_speed + +### amdsmi_get_gpu_fan_speed + Description: Get the fan speed for the specified device as a value relative to AMDSMI_MAX_FAN_SPEED 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. @@ -1496,11 +1645,13 @@ 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() @@ -1513,10 +1664,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_fan_speed_max + +### amdsmi_get_gpu_fan_speed_max + Description: Get the max fan speed of the device with provided device handle 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. @@ -1524,11 +1678,13 @@ 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() @@ -1541,23 +1697,28 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_temp_metric + +### amdsmi_get_temp_metric + Description: Get the temperature metric value for the specified metric, from the specified temperature sensor on the specified device 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: +Exceptions that can be thrown by `amdsmi_get_temp_metric` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1571,23 +1732,28 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_volt_metric + +### amdsmi_get_gpu_volt_metric + Description: Get the voltage metric value for the specified metric, from the specified voltage sensor on the specified device 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: +Exceptions that can be thrown by `amdsmi_get_gpu_volt_metric` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1602,10 +1768,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_utilization_count +### 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 @@ -1617,11 +1785,13 @@ Field | Description `Dictionary for each counter` |
Subfield Description
`type`Type of utilization counter
`value`Value gotten for utilization counter
Exceptions that can be thrown by `amdsmi_get_utilization_count` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1643,20 +1813,25 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_perf_level + +### amdsmi_get_gpu_perf_level + Description: Get the performance level of the device with provided device handle 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() @@ -1669,21 +1844,26 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_set_gpu_perf_determinism_mode + +### amdsmi_set_gpu_perf_determinism_mode + Description: Enter performance determinism mode with provided device handle 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() @@ -1695,21 +1875,26 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_overdrive_level + +### amdsmi_get_gpu_overdrive_level + Description: Get the overdrive percent associated with the device with provided device handle 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() @@ -1722,11 +1907,14 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_clk_freq + +### amdsmi_get_clk_freq + Description: Get the list of possible system clock speeds of device for a specified clock type Input parameters: + * `processor_handle` handle for the given device * `clk_type` the type of clock for which the frequency is desired @@ -1738,12 +1926,14 @@ Field | Description `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: +Exceptions that can be thrown by `amdsmi_get_clk_freq` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1755,10 +1945,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_od_volt_info + +### amdsmi_get_gpu_od_volt_info + Description: This function retrieves the voltage/frequency curve information Input parameters: + * `processor_handle` handle for the given device Output: Dictionary with fields @@ -1772,13 +1965,14 @@ Field | Description `curve.vc_points`| The number of supported frequencies `num_regions`| The current frequency index +Exceptions that can be thrown by `amdsmi_get_gpu_od_volt_info` function: -Exceptions that can be thrown by ` amdsmi_get_gpu_od_volt_info` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1790,10 +1984,13 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_metrics_info + +### amdsmi_get_gpu_metrics_info + Description: This function retrieves the gpu metrics information Input parameters: + * `processor_handle` handle for the given device Output: Dictionary with fields @@ -1835,12 +2032,14 @@ Field | Description `mem_actvity_acc` | mem activity acc `temperature_hbm` | hbm temperature -Exceptions that can be thrown by ` amdsmi_get_gpu_metrics_info` function: +Exceptions that can be thrown by `amdsmi_get_gpu_metrics_info` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1852,11 +2051,14 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_od_volt_curve_regions + +### amdsmi_get_gpu_od_volt_curve_regions + Description: This function will retrieve the current valid regions in the frequency/voltage space Input parameters: + * `processor_handle` handle for the given device * `num_regions` number of freq volt regions @@ -1867,12 +2069,14 @@ Field | Description `freq_range` |
Subfield Description
`lower_bound`lower bound freq range
`upper_bound`upper bound freq range
`volt_range` |
Subfield Description
`lower_bound`lower bound volt range
`upper_bound`upper bound volt range
-Exceptions that can be thrown by ` amdsmi_get_gpu_od_volt_curve_regions` function: +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() @@ -1884,11 +2088,14 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_power_profile_presets + +### amdsmi_get_gpu_power_profile_presets + Description: Get the list of available preset power profiles and an indication of which profile is currently active Input parameters: + * `processor_handle` handle for the given device * `sensor_idx` number of freq volt regions @@ -1900,12 +2107,14 @@ Field | Description `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: +Exceptions that can be thrown by `amdsmi_get_gpu_power_profile_presets` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -1918,7 +2127,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_gpu_counter_group_supported +### amdsmi_gpu_counter_group_supported + Description: Tell if an event group is supported by a given device Input parameters: @@ -1929,11 +2139,13 @@ Input parameters: 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() @@ -1946,7 +2158,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_gpu_create_counter +### amdsmi_gpu_create_counter + Description: Creates a performance counter object Input parameters: @@ -1957,11 +2170,13 @@ Input parameters: 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() @@ -1973,7 +2188,9 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_gpu_destroy_counter + +### amdsmi_gpu_destroy_counter + Description: Destroys a performance counter object Input parameters: @@ -1983,11 +2200,13 @@ Input parameters: Output: None Exceptions that can be thrown by `amdsmi_gpu_destroy_counter` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2000,7 +2219,9 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_gpu_control_counter + +### amdsmi_gpu_control_counter + Description: Issue performance counter control commands Input parameters: @@ -2011,11 +2232,13 @@ Input parameters: Output: None Exceptions that can be thrown by `amdsmi_gpu_control_counter` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2028,7 +2251,9 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_gpu_read_counter + +### amdsmi_gpu_read_counter + Description: Read the current value of a performance counter Input parameters: @@ -2044,11 +2269,13 @@ Field | Description `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() @@ -2061,7 +2288,9 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_available_counters + +### amdsmi_get_gpu_available_counters + Description: Get the number of currently available counters Input parameters: @@ -2071,12 +2300,14 @@ Input parameters: 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: +Exceptions that can be thrown by `amdsmi_get_gpu_available_counters` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2089,21 +2320,26 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_set_gpu_perf_level + +### amdsmi_set_gpu_perf_level + Description: Set a desired performance level for given device 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: +Exceptions that can be thrown by `amdsmi_set_gpu_perf_level` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2115,54 +2351,25 @@ try: 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. -Input parameters: -* `processor_handle` handle for the given device -* `sensor_idx` sensor index as integer +### amdsmi_reset_gpu -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: - status = amdsmi_get_gpu_power_profile_presets(device, 0) - print(status) -except AmdSmiException as e: - print(e) -``` -## amdsmi_reset_gpu Description: Reset the gpu associated with the device with provided device handle 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() @@ -2174,11 +2381,14 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_set_gpu_fan_speed + +### amdsmi_set_gpu_fan_speed + Description: Set the fan speed for the specified device with the provided speed, in RPMs 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 @@ -2186,11 +2396,13 @@ Input parameters: 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() @@ -2202,21 +2414,26 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_reset_gpu_fan + +### amdsmi_reset_gpu_fan + Description: Reset the fan to automatic driver control 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() @@ -2228,11 +2445,14 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_set_clk_freq + +### amdsmi_set_clk_freq + Description: Control the set of allowed frequencies that can be used for the specified clock 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 @@ -2242,12 +2462,14 @@ bits of this mask are relevant. Output: None -Exceptions that can be thrown by ` amdsmi_set_clk_freq` function: +Exceptions that can be thrown by `amdsmi_set_clk_freq` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2261,23 +2483,26 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_set_gpu_overdrive_level -## amdsmi_set_gpu_overdrive_level Description: **deprecated** Set the overdrive percent associated with the device with provided device handle with the provided value 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: +Exceptions that can be thrown by `amdsmi_set_gpu_overdrive_level` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2290,10 +2515,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_ecc_count +### amdsmi_get_gpu_ecc_count + Description: Retrieve the error counts for a GPU block Input parameters: + * `processor_handle` handle for the given device * `block` The block for which error counts should be retrieved @@ -2304,12 +2531,14 @@ Field | Description `correctable_count`| Count of correctable errors `uncorrectable_count`| Count of uncorrectable errors -Exceptions that can be thrown by ` amdsmi_get_gpu_ecc_count` function: +Exceptions that can be thrown by `amdsmi_get_gpu_ecc_count` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2323,20 +2552,24 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_ecc_enabled +### amdsmi_get_gpu_ecc_enabled + Description: Retrieve the enabled ECC bit-mask 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: +Exceptions that can be thrown by `amdsmi_get_gpu_ecc_enabled` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2350,21 +2583,25 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_ecc_status +### amdsmi_get_gpu_ecc_status + Description: Retrieve the ECC status for a GPU block 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: +Exceptions that can be thrown by `amdsmi_get_gpu_ecc_status` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2378,18 +2615,22 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_status_code_to_string +### 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)) @@ -2398,7 +2639,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_compute_process_info +### amdsmi_get_gpu_compute_process_info + Description: Get process information about processes currently using GPU Input parameters: None @@ -2414,10 +2656,12 @@ Field | Description `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() @@ -2427,10 +2671,12 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_compute_process_info_by_pid +### 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 @@ -2444,11 +2690,13 @@ Field | Description `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 @@ -2458,20 +2706,24 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_compute_process_gpus +### 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 @@ -2481,20 +2733,24 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_gpu_xgmi_error_status +### amdsmi_gpu_xgmi_error_status + Description: Retrieve the XGMI error status for a device 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() @@ -2508,20 +2764,24 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_reset_gpu_xgmi_error +### amdsmi_reset_gpu_xgmi_error + Description: Reset the XGMI error status for a device 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() @@ -2533,7 +2793,9 @@ try: except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_vendor_name + +### amdsmi_get_gpu_vendor_name + Description: Returns the device vendor name Input parameters: @@ -2543,11 +2805,13 @@ Input parameters: 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() @@ -2561,7 +2825,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_id +### amdsmi_get_gpu_id + Description: Get the device id associated with the device with provided device handler Input parameters: @@ -2571,11 +2836,13 @@ Input parameters: 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() @@ -2589,7 +2856,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_get_gpu_vram_vendor +### amdsmi_get_gpu_vram_vendor + Description: Get the vram vendor string of a gpu device. Input parameters: @@ -2599,11 +2867,13 @@ Input parameters: 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() @@ -2617,8 +2887,8 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_gpu_subsystem_id -## amdsmi_get_gpu_subsystem_id Description: Get the subsystem device id associated with the device with provided device handle. Input parameters: @@ -2628,11 +2898,13 @@ Input parameters: 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() @@ -2646,8 +2918,8 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_gpu_subsystem_name -## amdsmi_get_gpu_subsystem_name Description: Get the name string for the device subsytem Input parameters: @@ -2657,11 +2929,13 @@ Input parameters: 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() @@ -2675,18 +2949,20 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_lib_version -## 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: devices = amdsmi_get_processor_handles() @@ -2700,8 +2976,8 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_topo_get_numa_node_number -## amdsmi_topo_get_numa_node_number Description: Retrieve the NUMA CPU node number for a device Input parameters: @@ -2711,11 +2987,13 @@ Input parameters: 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() @@ -2729,7 +3007,8 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_topo_get_link_weight +### amdsmi_topo_get_link_weight + Description: Retrieve the weight for a connection between 2 GPUs. Input parameters: @@ -2740,11 +3019,13 @@ Input parameters: 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() @@ -2759,8 +3040,8 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_minmax_bandwith_between_processors -## admsmi_get_minmax_bandwith_between_processors Description: Retreive minimal and maximal io link bandwidth between 2 GPUs. Input parameters: @@ -2775,12 +3056,14 @@ Field | Description `min_bandwidth` | minimal bandwidth for the connection `max_bandwidth` | maximal bandwidth for the connection -Exceptions that can be thrown by `admsmi_get_minmax_bandwith_between_processors` function: +Exceptions that can be thrown by `amdsmi_get_minmax_bandwith_between_processors` function: + * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` Example: + ```python try: devices = amdsmi_get_processor_handles() @@ -2789,15 +3072,15 @@ try: else: processor_handle_src = devices[0] processor_handle_dest = devices[1] - bandwith = admsmi_get_minmax_bandwith_between_processors(processor_handle_src, processor_handle_dest) + bandwith = amdsmi_get_minmax_bandwith_between_processors(processor_handle_src, processor_handle_dest) print(bandwith['min_bandwidth']) print(bandwith['max_bandwidth']) except AmdSmiException as e: print(e) ``` +### amdsmi_topo_get_link_type -## amdsmi_topo_get_link_type Description: Retrieve the hops and the connection type between 2 GPUs Input parameters: @@ -2813,11 +3096,13 @@ Field | Description `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() @@ -2833,8 +3118,8 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_is_P2P_accessible -## amdsmi_is_P2P_accessible Description: Return P2P availability status between 2 GPUs Input parameters: @@ -2845,11 +3130,13 @@ Input parameters: 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() @@ -2864,8 +3151,8 @@ except AmdSmiException as e: print(e) ``` +### amdsmi_get_xgmi_info -## amdsmi_get_xgmi_info Description: Returns XGMI information for the GPU. Input parameters: @@ -2881,13 +3168,14 @@ Field | Description `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() diff --git a/py-interface/__init__.py b/py-interface/__init__.py index e7c939a8e5..8344faacca 100644 --- a/py-interface/__init__.py +++ b/py-interface/__init__.py @@ -126,7 +126,7 @@ from .amdsmi_interface import amdsmi_gpu_xgmi_error_status from .amdsmi_interface import amdsmi_reset_gpu_xgmi_error # # PCIE information -from .amdsmi_interface import admsmi_get_gpu_bdf_id +from .amdsmi_interface import amdsmi_get_gpu_bdf_id from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth from .amdsmi_interface import amdsmi_get_gpu_pci_throughput from .amdsmi_interface import amdsmi_get_gpu_pci_replay_counter @@ -156,7 +156,7 @@ from .amdsmi_interface import amdsmi_get_lib_version # # Hardware topology query from .amdsmi_interface import amdsmi_topo_get_numa_node_number from .amdsmi_interface import amdsmi_topo_get_link_weight -from .amdsmi_interface import admsmi_get_minmax_bandwith_between_processors +from .amdsmi_interface import amdsmi_get_minmax_bandwith_between_processors from .amdsmi_interface import amdsmi_topo_get_link_type from .amdsmi_interface import amdsmi_is_P2P_accessible from .amdsmi_interface import amdsmi_get_xgmi_info diff --git a/py-interface/amdsmi_interface.py b/py-interface/amdsmi_interface.py index 6c4f5e996b..5366ebb67d 100644 --- a/py-interface/amdsmi_interface.py +++ b/py-interface/amdsmi_interface.py @@ -351,14 +351,14 @@ class AmdSmiEventReader: mask |= (1 << (int(event_type) - 1)) _check_res(amdsmi_wrapper.amdsmi_init_gpu_event_notification(processor_handle)) - _check_res(amdsmi_wrapper. amdsmi_set_gpu_event_notification_mask( + _check_res(amdsmi_wrapper.amdsmi_set_gpu_event_notification_mask( processor_handle, ctypes.c_uint64(mask))) def read(self, timestamp, num_elem=10): self.event_info = ( amdsmi_wrapper.amdsmi_evt_notification_data_t * num_elem)() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_event_notification( + amdsmi_wrapper.amdsmi_get_gpu_event_notification( ctypes.c_int(timestamp), ctypes.byref(ctypes.c_uint32(num_elem)), self.event_info, @@ -1222,7 +1222,7 @@ def amdsmi_topo_get_link_weight( return weight.value -def admsmi_get_minmax_bandwith_between_processors( +def amdsmi_get_minmax_bandwith_between_processors( processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): @@ -1240,7 +1240,7 @@ def admsmi_get_minmax_bandwith_between_processors( max_bandwidth = ctypes.c_uint64() _check_res( - amdsmi_wrapper. admsmi_get_minmax_bandwith_between_processors( + amdsmi_wrapper.amdsmi_get_minmax_bandwith_between_processors( processor_handle_src, processor_handle_dst, ctypes.byref(min_bandwidth), @@ -1423,7 +1423,7 @@ def amdsmi_get_gpu_available_counters( available = ctypes.c_uint32() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_available_counters( + amdsmi_wrapper.amdsmi_get_gpu_available_counters( processor_handle, event_group, ctypes.byref(available) ) ) @@ -1442,7 +1442,7 @@ def amdsmi_set_gpu_perf_level( if not isinstance(perf_level, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_level, AmdSmiDevPerfLevel) - _check_res(amdsmi_wrapper. amdsmi_set_gpu_perf_level( + _check_res(amdsmi_wrapper.amdsmi_set_gpu_perf_level( processor_handle, perf_level)) @@ -1460,7 +1460,7 @@ def amdsmi_get_gpu_power_profile_presets( status = amdsmi_wrapper.amdsmi_power_profile_status_t() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_power_profile_presets( + amdsmi_wrapper.amdsmi_get_gpu_power_profile_presets( processor_handle, sensor_idx, ctypes.byref(status) ) ) @@ -1547,7 +1547,7 @@ def amdsmi_set_clk_freq( raise AmdSmiParameterException(freq_bitmask, int) freq_bitmask = ctypes.c_uint64(freq_bitmask) _check_res( - amdsmi_wrapper. amdsmi_set_clk_freq( + amdsmi_wrapper.amdsmi_set_clk_freq( processor_handle, clk_type, freq_bitmask ) ) @@ -1565,12 +1565,12 @@ def amdsmi_set_gpu_overdrive_level( overdrive_value = ctypes.c_uint32(overdrive_value) _check_res( - amdsmi_wrapper. amdsmi_set_gpu_overdrive_level( + amdsmi_wrapper.amdsmi_set_gpu_overdrive_level( processor_handle, overdrive_value) ) -def admsmi_get_gpu_bdf_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_bdf_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( processor_handle, amdsmi_wrapper.amdsmi_processor_handle @@ -1578,7 +1578,7 @@ def admsmi_get_gpu_bdf_id(processor_handle: amdsmi_wrapper.amdsmi_processor_hand bdfid = ctypes.c_uint64() _check_res( - amdsmi_wrapper.admsmi_get_gpu_bdf_id( + amdsmi_wrapper.amdsmi_get_gpu_bdf_id( processor_handle, ctypes.byref(bdfid)) ) @@ -1596,7 +1596,7 @@ def amdsmi_set_gpu_pci_bandwidth( raise AmdSmiParameterException(bitmask, int) _check_res( - amdsmi_wrapper. amdsmi_set_gpu_pci_bandwidth( + amdsmi_wrapper.amdsmi_set_gpu_pci_bandwidth( processor_handle, ctypes.c_uint64(bitmask) ) ) @@ -1662,7 +1662,7 @@ def amdsmi_get_gpu_pci_replay_counter(processor_handle: amdsmi_wrapper.amdsmi_pr counter = ctypes.c_uint64() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_pci_replay_counter( + amdsmi_wrapper.amdsmi_get_gpu_pci_replay_counter( processor_handle, ctypes.byref(counter)) ) @@ -1700,7 +1700,7 @@ def amdsmi_set_power_cap( raise AmdSmiParameterException(cap, int) _check_res( - amdsmi_wrapper. amdsmi_set_power_cap( + amdsmi_wrapper.amdsmi_set_power_cap( processor_handle, ctypes.c_uint32(sensor_ind), ctypes.c_uint64(cap) ) ) @@ -1723,7 +1723,7 @@ def amdsmi_set_gpu_power_profile( raise AmdSmiParameterException(profile, AmdSmiPowerProfilePresetMasks) _check_res( - amdsmi_wrapper. amdsmi_set_gpu_power_profile( + amdsmi_wrapper.amdsmi_set_gpu_power_profile( processor_handle, ctypes.c_uint32(reserved), profile ) ) @@ -1823,7 +1823,7 @@ def amdsmi_set_gpu_od_clk_info( raise AmdSmiParameterException(clk_type, AmdSmiClkType) _check_res( - amdsmi_wrapper. amdsmi_set_gpu_od_clk_info( + amdsmi_wrapper.amdsmi_set_gpu_od_clk_info( processor_handle, level, ctypes.c_uint64(value), clk_type ) ) @@ -1871,7 +1871,7 @@ def amdsmi_set_gpu_od_volt_info( raise AmdSmiParameterException(volt_value, int) _check_res( - amdsmi_wrapper. amdsmi_set_gpu_od_volt_info( + amdsmi_wrapper.amdsmi_set_gpu_od_volt_info( processor_handle, ctypes.c_uint32(vpoint), ctypes.c_uint64(clk_value), @@ -1954,7 +1954,7 @@ def amdsmi_get_temp_metric( temp_value = ctypes.c_int64() _check_res( - amdsmi_wrapper. amdsmi_get_temp_metric( + amdsmi_wrapper.amdsmi_get_temp_metric( processor_handle, sensor_type, metric, ctypes.byref(temp_value) ) ) @@ -1978,7 +1978,7 @@ def amdsmi_get_gpu_volt_metric( voltage = ctypes.c_int64() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_volt_metric( + amdsmi_wrapper.amdsmi_get_gpu_volt_metric( processor_handle, sensor_type, metric, ctypes.byref(voltage) ) ) @@ -2101,7 +2101,7 @@ def amdsmi_get_clk_freq( freq = amdsmi_wrapper.amdsmi_frequencies_t() _check_res( - amdsmi_wrapper. amdsmi_get_clk_freq( + amdsmi_wrapper.amdsmi_get_clk_freq( processor_handle, clk_type, ctypes.byref(freq) ) ) @@ -2123,7 +2123,7 @@ def amdsmi_get_gpu_od_volt_info( freq_data = amdsmi_wrapper.amdsmi_od_volt_freq_data_t() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_od_volt_info( + amdsmi_wrapper.amdsmi_get_gpu_od_volt_info( processor_handle, ctypes.byref(freq_data) ) ) @@ -2160,7 +2160,7 @@ def amdsmi_get_gpu_metrics_info( gpu_metrics = amdsmi_wrapper.amdsmi_gpu_metrics_t() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_metrics_info( + amdsmi_wrapper.amdsmi_get_gpu_metrics_info( processor_handle, ctypes.byref(gpu_metrics) ) ) @@ -2216,7 +2216,7 @@ def amdsmi_get_gpu_od_volt_curve_regions( region_count = ctypes.c_uint32(num_regions) buffer = (amdsmi_wrapper.amdsmi_freq_volt_region_t * num_regions)() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_od_volt_curve_regions( + amdsmi_wrapper.amdsmi_get_gpu_od_volt_curve_regions( processor_handle, ctypes.byref(region_count), buffer ) ) @@ -2254,7 +2254,7 @@ def amdsmi_get_gpu_power_profile_presets( status = amdsmi_wrapper.amdsmi_power_profile_status_t() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_power_profile_presets( + amdsmi_wrapper.amdsmi_get_gpu_power_profile_presets( processor_handle, sensor_idx, ctypes.byref(status) ) ) @@ -2279,7 +2279,7 @@ def amdsmi_get_gpu_ecc_count( ec = amdsmi_wrapper.amdsmi_error_count_t() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_ecc_count( + amdsmi_wrapper.amdsmi_get_gpu_ecc_count( processor_handle, block, ctypes.byref(ec)) ) @@ -2299,7 +2299,7 @@ def amdsmi_get_gpu_ecc_enabled( blocks = ctypes.c_uint64(0) _check_res( - amdsmi_wrapper. amdsmi_get_gpu_ecc_enabled( + amdsmi_wrapper.amdsmi_get_gpu_ecc_enabled( processor_handle, ctypes.byref(blocks)) ) @@ -2319,7 +2319,7 @@ def amdsmi_get_gpu_ecc_status( state = amdsmi_wrapper.amdsmi_ras_err_state_t() _check_res( - amdsmi_wrapper. amdsmi_get_gpu_ecc_status( + amdsmi_wrapper.amdsmi_get_gpu_ecc_status( processor_handle, block, ctypes.byref(state) ) ) diff --git a/py-interface/amdsmi_wrapper.py b/py-interface/amdsmi_wrapper.py index 5c65e7899f..a6516994c7 100644 --- a/py-interface/amdsmi_wrapper.py +++ b/py-interface/amdsmi_wrapper.py @@ -1418,9 +1418,9 @@ amdsmi_get_gpu_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTE amdsmi_get_gpu_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_bandwidth amdsmi_get_gpu_pci_bandwidth.restype = amdsmi_status_t amdsmi_get_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)] -admsmi_get_gpu_bdf_id = _libraries['libamd_smi.so'].admsmi_get_gpu_bdf_id -admsmi_get_gpu_bdf_id.restype = amdsmi_status_t -admsmi_get_gpu_bdf_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_gpu_bdf_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_bdf_id +amdsmi_get_gpu_bdf_id.restype = amdsmi_status_t +amdsmi_get_gpu_bdf_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] amdsmi_get_gpu_topo_numa_affinity = _libraries['libamd_smi.so'].amdsmi_get_gpu_topo_numa_affinity amdsmi_get_gpu_topo_numa_affinity.restype = amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)] @@ -1586,9 +1586,9 @@ amdsmi_topo_get_numa_node_number.argtypes = [amdsmi_processor_handle, ctypes.POI amdsmi_topo_get_link_weight = _libraries['libamd_smi.so'].amdsmi_topo_get_link_weight amdsmi_topo_get_link_weight.restype = amdsmi_status_t amdsmi_topo_get_link_weight.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)] -admsmi_get_minmax_bandwith_between_processors = _libraries['libamd_smi.so'].admsmi_get_minmax_bandwith_between_processors -admsmi_get_minmax_bandwith_between_processors.restype = amdsmi_status_t -admsmi_get_minmax_bandwith_between_processors.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] +amdsmi_get_minmax_bandwith_between_processors = _libraries['libamd_smi.so'].amdsmi_get_minmax_bandwith_between_processors +amdsmi_get_minmax_bandwith_between_processors.restype = amdsmi_status_t +amdsmi_get_minmax_bandwith_between_processors.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] amdsmi_topo_get_link_type = _libraries['libamd_smi.so'].amdsmi_topo_get_link_type amdsmi_topo_get_link_type.restype = amdsmi_status_t amdsmi_topo_get_link_type.argtypes = [amdsmi_processor_handle, amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(c__EA_AMDSMI_IO_LINK_TYPE)] @@ -1791,8 +1791,8 @@ __all__ = \ 'TEMPERATURE_TYPE_HBM_2', 'TEMPERATURE_TYPE_HBM_3', 'TEMPERATURE_TYPE_JUNCTION', 'TEMPERATURE_TYPE_PLX', 'TEMPERATURE_TYPE_VRAM', 'TEMPERATURE_TYPE__MAX', 'UNKNOWN', - 'admsmi_get_gpu_bdf_id', - 'admsmi_get_minmax_bandwith_between_processors', + 'amdsmi_get_gpu_bdf_id', + 'amdsmi_get_minmax_bandwith_between_processors', 'amd_metrics_table_header_t', 'amdsmi_asic_info_t', 'amdsmi_bdf_t', 'amdsmi_bit_field_t', 'amdsmi_board_info_t', 'amdsmi_clk_info_t', 'amdsmi_clk_type_t', diff --git a/py-interface/rocm_smi_tool.py b/py-interface/rocm_smi_tool.py index b478db80d8..5522b41e3b 100644 --- a/py-interface/rocm_smi_tool.py +++ b/py-interface/rocm_smi_tool.py @@ -563,7 +563,7 @@ def amdsmi_tool_event_notification_init(dev): def amdsmi_tool_event_notification_mask_set(dev, dic): mask = dic["mask"] - return smi_api.amdsmi_wrapper. amdsmi_set_gpu_event_notification_mask(dev, ctypes.c_uint64(mask)) + return smi_api.amdsmi_wrapper.amdsmi_set_gpu_event_notification_mask(dev, ctypes.c_uint64(mask)) def amdsmi_tool_event_notification_stop(dev): return smi_api.amdsmi_wrapper.amdsmi_stop_gpu_event_notification(dev) diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index 46b39ba5ff..94355f30bd 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -667,7 +667,7 @@ amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi } amdsmi_status_t - admsmi_get_minmax_bandwith_between_processors(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, + amdsmi_get_minmax_bandwith_between_processors(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth) { AMDSMI_CHECK_INIT(); @@ -1108,7 +1108,7 @@ amdsmi_status_t amdsmi_get_energy_count(amdsmi_processor_handle processor_handle power, counter_resolution, timestamp); } -amdsmi_status_t admsmi_get_gpu_bdf_id( +amdsmi_status_t amdsmi_get_gpu_bdf_id( amdsmi_processor_handle processor_handle, uint64_t *bdfid) { return rsmi_wrapper(rsmi_dev_pci_id_get, processor_handle, bdfid); diff --git a/tests/amd_smi_test/functional/id_info_read.cc b/tests/amd_smi_test/functional/id_info_read.cc index c4fea51a86..c22f127ac0 100755 --- a/tests/amd_smi_test/functional/id_info_read.cc +++ b/tests/amd_smi_test/functional/id_info_read.cc @@ -217,7 +217,7 @@ void TestIdInfoRead::Run(void) { ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = admsmi_get_gpu_bdf_id(processor_handles_[i], &val_ui64); + err = amdsmi_get_gpu_bdf_id(processor_handles_[i], &val_ui64); // Don't check for AMDSMI_STATUS_NOT_SUPPORTED since this should always be // supported. It is not based on a sysfs file. CHK_ERR_ASRT(err) @@ -226,7 +226,7 @@ void TestIdInfoRead::Run(void) { std::cout << " (" << std::dec << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = admsmi_get_gpu_bdf_id(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_bdf_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/mutual_exclusion.cc b/tests/amd_smi_test/functional/mutual_exclusion.cc index 8080bb3721..28b9f337f5 100755 --- a/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -215,7 +215,7 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_subsystem_id(processor_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = admsmi_get_gpu_bdf_id(processor_handles_[0], &dmy_ui64); + ret = amdsmi_get_gpu_bdf_id(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_get_gpu_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); diff --git a/tests/amd_smi_test/functional/sys_info_read.cc b/tests/amd_smi_test/functional/sys_info_read.cc index c3bb800db6..2851618d8c 100755 --- a/tests/amd_smi_test/functional/sys_info_read.cc +++ b/tests/amd_smi_test/functional/sys_info_read.cc @@ -128,14 +128,14 @@ void TestSysInfoRead::Run(void) { } } - err = admsmi_get_gpu_bdf_id(processor_handles_[i], &val_ui64); + err = amdsmi_get_gpu_bdf_id(processor_handles_[i], &val_ui64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**PCI ID (BDFID): 0x" << std::hex << val_ui64; std::cout << " (" << std::dec << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = admsmi_get_gpu_bdf_id(processor_handles_[i], nullptr); + err = amdsmi_get_gpu_bdf_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); err = amdsmi_get_gpu_topo_numa_affinity(processor_handles_[i], &val_ui32);