Merge amd-staging into amd-master 20230609

Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: Ica2eeeb2e63bfdfb41d6e3cac9dac61d41830204
This commit is contained in:
Hao Zhou
2023-06-09 09:40:14 +08:00
23 changed files with 584 additions and 266 deletions
+8 -10
View File
@@ -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)
+35 -20
View File
@@ -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/<rocm_instance>/share/amd_smi
- python3 -m pip install --upgrade pip
- python3 -m pip install --user .
- /opt/<rocm_instance>/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/<rocm_instance>/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.
+10 -10
View File
@@ -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/<rocm_instance>/share/amd_smi
- python3 -m pip install --upgrade pip
- python3 -m pip install --user .
- /opt/<rocm_instance>/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
+2 -2
View File
@@ -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:
+2
View File
@@ -0,0 +1,2 @@
```{include} ../amdsmi_cli/README.md
```
+9 -5
View File
@@ -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"
+1 -1
View File
@@ -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
+2
View File
@@ -0,0 +1,2 @@
```{include} ../README.md
```
-2
View File
@@ -1,2 +0,0 @@
.. include:: ../README.md
:parser: myst_parser.sphinx_
+2
View File
@@ -0,0 +1,2 @@
```{include} ../py-interface/README.md
```
+9 -3
View File
@@ -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
+1 -1
View File
@@ -1 +1 @@
rocm-docs-core[api_reference]==0.10.3
rocm-docs-core[api_reference]==0.13.3
+6 -3
View File
@@ -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
+3 -3
View File
@@ -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);
/**
+449 -161
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -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
+27 -27
View File
@@ -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)
)
)
+8 -8
View File
@@ -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',
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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);
@@ -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);
}
}
@@ -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);
@@ -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);