2023-04-21 05:42:38 +00:00
|
|
|
# amdgpu_stats
|
|
|
|
|
2023-04-26 02:18:43 +00:00
|
|
|
A simple Python module/TUI _(using [Textual](https://textual.textualize.io/))_ that shows AMD GPU statistics
|
2023-04-23 16:07:06 +00:00
|
|
|
|
2023-04-23 22:20:46 +00:00
|
|
|
![Screenshot of main screen](https://raw.githubusercontent.com/joshlay/amdgpu_stats/master/screens/main.png "Main screen")
|
2023-04-23 16:07:06 +00:00
|
|
|
|
2023-04-23 22:20:46 +00:00
|
|
|
![Screenshot of log screen](https://raw.githubusercontent.com/joshlay/amdgpu_stats/master/screens/logging.png "Logging screen")
|
2023-04-23 16:07:06 +00:00
|
|
|
|
2023-04-25 02:41:50 +00:00
|
|
|
The GPU and temperature nodes (`edge`/`junction`/etc.) are discovered automatically.
|
|
|
|
|
2023-04-23 16:07:06 +00:00
|
|
|
Statistics are not logged; only toggling Dark/light mode and the stat names / source files.
|
|
|
|
|
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-04-21 16:57:37 +00:00
|
|
|
## Requirements
|
2023-04-21 17:46:51 +00:00
|
|
|
Only `Linux` is supported. Information is _completely_ sourced from interfaces in `sysfs`.
|
2023-04-21 17:39:34 +00:00
|
|
|
|
2023-04-22 14:35:52 +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.
|
2023-04-25 02:41:50 +00:00
|
|
|
|
|
|
|
## Installation / Usage
|
|
|
|
```
|
|
|
|
pip install amdgpu-stats
|
|
|
|
```
|
|
|
|
Once installed, run `amdgpu-stats` in your terminal of choice
|
|
|
|
|
|
|
|
## Module
|
|
|
|
|
2023-04-25 03:17:39 +00:00
|
|
|
*Rudimentary* support as a module exists; functions / variables offered can be found in `amdgpu_stats.utils`
|
2023-04-25 02:41:50 +00:00
|
|
|
|
2023-04-25 06:20:12 +00:00
|
|
|
Demonstration:
|
2023-04-25 02:41:50 +00:00
|
|
|
```
|
2023-04-25 06:20:12 +00:00
|
|
|
In [1]: import amdgpu_stats.utils
|
|
|
|
|
|
|
|
In [2]: print(amdgpu_stats.utils.get_core_stats())
|
|
|
|
{'sclk': 0, 'mclk': 1000000000, 'voltage': 0.01, 'util_pct': 0}
|
2023-04-25 02:41:50 +00:00
|
|
|
|
2023-04-25 06:20:12 +00:00
|
|
|
In [3]: print(amdgpu_stats.utils.get_power_stats())
|
|
|
|
{'limit': 281, 'average': 35, 'capability': 323, 'default': 281}
|
2023-04-25 02:41:50 +00:00
|
|
|
|
2023-04-25 06:20:12 +00:00
|
|
|
In [4]: print(amdgpu_stats.utils.get_temp_stats())
|
|
|
|
{'edge': 33, 'junction': 36, 'mem': 42}
|
2023-04-25 02:41:50 +00:00
|
|
|
|
2023-04-25 06:20:12 +00:00
|
|
|
In [5]: print(amdgpu_stats.utils.get_fan_stats())
|
|
|
|
{'fan_rpm': 0, 'fan_rpm_target': 0}
|
2023-04-25 02:41:50 +00:00
|
|
|
```
|
2023-04-26 03:34:42 +00:00
|
|
|
## Documentation
|
|
|
|
|
|
|
|
For more information on the module, see:
|
|
|
|
- `help('amdgpu_stats.utils')` in your interpreter
|
|
|
|
- [ReadTheDocs](https://amdgpu-stats.readthedocs.io/en/latest/)
|
|
|
|
- [the module source](https://github.com/joshlay/amdgpu_stats/blob/master/src/amdgpu_stats/utils.py) for more info
|