2023-04-21 05:42:38 +00:00
|
|
|
# amdgpu_stats
|
|
|
|
|
2023-04-30 02:17:28 +00:00
|
|
|
A Python module/TUI for AMD GPU statistics
|
2023-04-23 16:07:06 +00:00
|
|
|
|
2023-04-25 02:41:50 +00:00
|
|
|
Tested _only_ on `RX6000` series cards; APUs and more _may_ be supported. Please file an issue if finding incompatibility!
|
2023-04-21 05:47:54 +00:00
|
|
|
|
2023-08-30 02:49:06 +00:00
|
|
|
## Screenshots
|
|
|
|
|
|
|
|
<details open>
|
|
|
|
<summary>Main screen / stats</summary>
|
|
|
|
![Screenshot of the main stats table](https://git.init3.us/BraveTraveler/amdgpu_stats/raw/branch/master/screens/main.svg "Main screen")
|
|
|
|
</details>
|
|
|
|
<details>
|
|
|
|
<summary>Usage graphs</summary>
|
|
|
|
![Screenshot of the 'graphing' scroll bars](https://git.init3.us/BraveTraveler/amdgpu_stats/raw/branch/master/screens/graphs.svg "Graphs")
|
|
|
|
</details>
|
|
|
|
<details>
|
|
|
|
<summary>Logs</summary>
|
|
|
|
![Screenshot of the 'Logs' tab pane](https://git.init3.us/BraveTraveler/amdgpu_stats/raw/branch/master/screens/logs.svg "Logs")
|
|
|
|
</details>
|
|
|
|
|
2023-04-28 04:48:50 +00:00
|
|
|
## Installation
|
2023-05-12 02:24:18 +00:00
|
|
|
```bash
|
2023-04-25 02:41:50 +00:00
|
|
|
pip install amdgpu-stats
|
|
|
|
```
|
2023-04-28 04:48:50 +00:00
|
|
|
To use the _TUI_, run `amdgpu-stats` in your terminal of choice. For the _module_, see below!
|
2023-04-25 02:41:50 +00:00
|
|
|
|
|
|
|
## Module
|
|
|
|
|
2023-04-28 04:48:50 +00:00
|
|
|
Introduction:
|
2023-05-12 02:24:18 +00:00
|
|
|
```python
|
2023-04-25 06:20:12 +00:00
|
|
|
In [1]: import amdgpu_stats.utils
|
|
|
|
|
2023-04-27 04:00:51 +00:00
|
|
|
In [2]: amdgpu_stats.utils.AMDGPU_CARDS
|
|
|
|
Out[2]: {'card0': '/sys/class/drm/card0/device/hwmon/hwmon9'}
|
2023-04-25 02:41:50 +00:00
|
|
|
|
2023-04-27 04:00:51 +00:00
|
|
|
In [3]: amdgpu_stats.utils.get_core_stats('card0')
|
|
|
|
Out[3]: {'sclk': 640000000, 'mclk': 1000000000, 'voltage': 0.79, 'util_pct': 65}
|
2023-04-25 02:41:50 +00:00
|
|
|
|
2023-04-28 04:48:50 +00:00
|
|
|
In [4]: amdgpu_stats.utils.get_clock('core', format_freq=True)
|
2023-04-27 04:00:51 +00:00
|
|
|
Out[4]: '659 MHz'
|
2023-04-25 02:41:50 +00:00
|
|
|
```
|
2023-04-28 04:48:50 +00:00
|
|
|
|
|
|
|
For more information on what the module provides, please see:
|
|
|
|
- [ReadTheDocs](https://amdgpu-stats.readthedocs.io/en/latest/)
|
|
|
|
- `help('amdgpu_stats.utils')` in your interpreter
|
2023-08-30 02:40:27 +00:00
|
|
|
- [The module source](https://git.init3.us/BraveTraveler/amdgpu_stats/src/branch/master/src/amdgpu_stats/utils.py)
|
2023-04-28 04:48:50 +00:00
|
|
|
|
2023-08-30 02:40:27 +00:00
|
|
|
Feature requests [are encouraged](https://git.init3.us/BraveTraveler/amdgpu_stats/issues) 😀
|
2023-04-27 04:00:51 +00:00
|
|
|
|
2023-04-28 04:48:50 +00:00
|
|
|
## Requirements
|
|
|
|
Only `Linux` is supported. Information is _completely_ sourced from interfaces in `sysfs`.
|
2023-04-26 03:34:42 +00:00
|
|
|
|
2023-04-28 04:48:50 +00:00
|
|
|
It _may_ be necessary to update the `amdgpu.ppfeaturemask` parameter to enable metrics.
|
|
|
|
|
|
|
|
This is assumed present for *control* over the elements being monitored. Untested without.
|
|
|
|
|
|
|
|
See [this Arch Wiki entry](https://wiki.archlinux.org/title/AMDGPU#Boot_parameter) for context.
|