Skip to content

Commit 4a8f1ad

Browse files
authored
Merge amd-staging into amd-mainline 20251028 (#793)
Signed-off-by: Maisam Arif <[email protected]>
2 parents e5b3269 + 9739611 commit 4a8f1ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2440
-2463
lines changed

CHANGELOG.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr
88

99
### Added
1010

11-
- **Added the following API's to amdsmi_interface.py**.
11+
- **Added the following C API's to amdsmi_interface.py**.
1212
- amdsmi_get_cpu_handle()
1313
- amdsmi_get_esmi_err_msg()
1414
- amdsmi_get_gpu_event_notification()
@@ -24,6 +24,37 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr
2424
- The entry `policies` is added to the end of the dictionary to match API definition.
2525
- The entry `plpds` is marked for deprecation as it has the same information as `policies`.
2626

27+
- **Added pcie levels to `amd-smi static --bus` command**.
28+
- The static --bus option has been updated to include the range of pcie levels that one may set a device to.
29+
- Levels are a 2-tuple composed of the PCIE speed and bandwidth.
30+
31+
```console
32+
$ amd-smi static --bus
33+
GPU: 0
34+
BUS:
35+
BDF: 0000:43:00.0
36+
MAX_PCIE_WIDTH: 16
37+
MAX_PCIE_SPEED: 16 GT/s
38+
PCIE_LEVELS:
39+
0: (2.5 GT/s, 1)
40+
1: (5.0 GT/s, 4)
41+
2: (16.0 GT/s, 16)
42+
PCIE_INTERFACE_VERSION: Gen 4
43+
SLOT_TYPE: CEM
44+
```
45+
46+
- **Added evicted_time metric for kfd processes**.
47+
- Time that queues are evicted on a GPU in milliseconds
48+
- Added to CLI in `amd-smi monitor -q` and `amd-smi process`
49+
- Added to C API and Python API:
50+
- amdsmi_get_gpu_process_list()
51+
- amdsmi_get_gpu_compute_process_info()
52+
- amdsmi_get_gpu_compute_process_info_by_pid()
53+
54+
- **Added new VRAM types to `amdsmi_vram_type_t`**.
55+
- `amd-smi static --vram` & `amdsmi_get_gpu_vram_info()` now support the following types:
56+
- DDR5, LPDDR4, LPDDR5, and HBM3E
57+
2758
### Changed
2859

2960
- N/A
@@ -1211,9 +1242,9 @@ Updated `amdsmi_get_gpu_metrics_info()` and structure `amdsmi_gpu_metrics_t` to
12111242
GPU: 0
12121243
CLK_LEVEL: Successfully changed sclk perf level(s) to 5, 6
12131244

1214-
GPU: 1
1215-
CLK_LEVEL: level(s) 5, 6 is/are greater than performance levels supported for device
1216-
```
1245+
GPU: 1
1246+
CLK_LEVEL: clock level(s) 5, 6 is/are greater than sclk frequency levels supported for device GPU ID: 1 BDF:0000:46:00.0
1247+
```
12171248

12181249
- **Added new command `amd-smi static -C/--clock`**.
12191250
- This new command displays the clock frequency performance levels for the selected GPUs and clocks.

DEBIAN/postinst.in

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,20 @@ do_install_amdsmi_python_lib() {
176176
export PIP_BREAK_SYSTEM_PACKAGES="$PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES"
177177

178178
# only try to activate argcomplete if such command exists
179+
# python3-argcomplete is recommended but optional, we handle its absence gracefully
179180
if command -v activate-global-python-argcomplete &>/dev/null; then
180-
activate-global-python-argcomplete
181+
activate-global-python-argcomplete 2>/dev/null || {
182+
echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete"
183+
}
181184
else
182185
# try older argcomplete3 version
183186
if command -v activate-global-python-argcomplete3 &>/dev/null; then
184-
activate-global-python-argcomplete3
187+
activate-global-python-argcomplete3 2>/dev/null || {
188+
echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete3"
189+
}
185190
else
186-
echo "[WARNING] Could not find argcomplete or argcomplete3. "\
187-
"Argument completion will not work..."
191+
echo "[WARNING] Could not find argcomplete activation command. "\
192+
"Argument completion will not work. Install python3-argcomplete package to enable it."
188193
fi
189194
fi
190195
}

README.md

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ for more information.
3030

3131
The following are required to install and use the AMD SMI library through its language interfaces and CLI.
3232

33-
* `amdgpu` driver must be loaded for [`amdsmi_init()`](./docs/how-to/amdsmi-cpp-lib#hello-amd-smi) to work.
33+
* `amdgpu` driver must be loaded for [`amdsmi_init()`](./docs/how-to/amdsmi-cpp-lib#hello-amd-smi) to work. Refer to the [Instinct documentation](https://instinct.docs.amd.com/projects/amdgpu-docs/en/latest/install/detailed-install/prerequisites.html) for installation instructions.
3434
* Export `LD_LIBRARY_PATH` to the `amdsmi` installation directory.
3535

3636
```bash
@@ -51,51 +51,6 @@ sudo python3 -m pip install more_itertools
5151

5252
* Go version 1.20 or greater
5353

54-
## Install amdgpu driver and AMD SMI with ROCm
55-
56-
1. Get the `amdgpu-install` installer following the instructions for your Linux distribution at
57-
[Installation via AMDGPU installer](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/amdgpu-install.html#installation).
58-
59-
2. Use `amdgpu-install` to install the `amdgpu` driver and ROCm packages with
60-
AMD SMI included.
61-
62-
``` shell
63-
sudo amdgpu-install --usecase=rocm
64-
```
65-
66-
The `amdgpu-install --usecase=rocm` option triggers both an `amdgpu` driver
67-
update and AMD SMI packages to be installed on your device.
68-
69-
3. Verify your installation.
70-
71-
```shell
72-
amd-smi --help
73-
```
74-
75-
## Install AMD SMI without ROCm
76-
77-
The following are example steps to install the AMD SMI libraries and CLI tool on
78-
Ubuntu 22.04.
79-
80-
1. Install the library.
81-
82-
```shell
83-
sudo apt install amd-smi-lib
84-
```
85-
86-
2. Add the installation directory to your PATH. If installed with ROCm, ignore
87-
this step.
88-
89-
```shell
90-
export PATH="${PATH:+${PATH}:}~/opt/rocm/bin"
91-
```
92-
93-
3. Verify your installation.
94-
95-
```shell
96-
amd-smi --help
97-
```
98-
9954
## AMD SMI basic usage
10055

10156
### C++ library
@@ -175,6 +130,10 @@ during development; earlier versions are not guaranteed to work.
175130
* libdrm-dev (for Ubuntu and Debian)
176131
* libdrm-devel (for RPM-based distributions)
177132

133+
To build the tests, the following additional dependency is required:
134+
135+
* Google Test (libgtest-dev for Ubuntu/Debian, gtest-devel for RPM-based distributions)
136+
178137
In order to build the AMD SMI Python package, the following components are required:
179138

180139
* Python (3.6.8 or later)

RPM/post.in

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,20 @@ do_install_amdsmi_python_lib() {
178178
export PIP_BREAK_SYSTEM_PACKAGES="$PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES"
179179

180180
# only try to activate argcomplete if such command exists
181+
# python3-argcomplete is recommended but optional, we handle its absence gracefully
181182
if command -v activate-global-python-argcomplete &>/dev/null; then
182-
activate-global-python-argcomplete
183+
activate-global-python-argcomplete 2>/dev/null || {
184+
echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete"
185+
}
183186
else
184187
# try older argcomplete3 version
185188
if command -v activate-global-python-argcomplete3 &>/dev/null; then
186-
activate-global-python-argcomplete3
189+
activate-global-python-argcomplete3 2>/dev/null || {
190+
echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete3"
191+
}
187192
else
188-
echo "[WARNING] Could not find argcomplete or argcomplete3. "\
189-
"Argument completion will not work..."
193+
echo "[WARNING] Could not find argcomplete activation command. "\
194+
"Argument completion will not work. Install python3-argcomplete package to enable it."
190195
fi
191196
fi
192197
}

0 commit comments

Comments
 (0)