Archived
1
1
Fork 0
A Python module/TUI that provides AMD GPU statistics
This repository has been archived on 2024-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2023-04-24 22:20:14 -05:00
.github/workflows Create pylint.yml 2023-04-23 17:02:45 -05:00
screens recommit 0.1.2 bits, merging to master 2023-04-23 17:45:36 -05:00
src/amdgpu_stats touch up linting after shuffling 2023-04-24 22:05:09 -05:00
.gitignore start packaging 2023-04-23 13:39:03 -05:00
LICENSE.md Create LICENSE.md 2023-04-23 13:40:45 -05:00
pyproject.toml bump ver 2023-04-24 22:20:14 -05:00
README.md fix utils.py link in README, for pypi benefit 2023-04-24 22:17:39 -05:00
requirements.txt add requirements.txt w/ tested versions 2023-04-21 11:57:37 -05:00
todo.md vram note 2023-04-24 22:14:38 -05:00

amdgpu_stats

Simple TUI (using Textual) that shows AMD GPU statistics

Screenshot of main screen

Screenshot of log screen

The GPU and temperature nodes (edge/junction/etc.) are discovered automatically.

Statistics are not logged; only toggling Dark/light mode and the stat names / source files.

Tested only on RX6000 series cards; APUs and more may be supported. Please file an issue if finding incompatibility!

Requirements

Only Linux is supported. Information is completely sourced from interfaces in sysfs.

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 for context.

Installation / Usage

pip install amdgpu-stats

Once installed, run amdgpu-stats in your terminal of choice

Module

Rudimentary support as a module exists; functions / variables offered can be found in amdgpu_stats.utils

Of most interest:

  • The function find_card which returns a tuple; the discovered card and hwmon directory
  • The variables SRC_FILES and TEMP_FILES, dictionaries of hwmon-driven statistics

Example usage:

In [1]: from amdgpu_stats.utils import find_card, SRC_FILES, TEMP_FILES

In [2]: print(find_card())
('card0', '/sys/class/drm/card0/device/hwmon/hwmon9')

In [3]: print(SRC_FILES)
{'pwr_limit': '/sys/class/drm/card0/device/hwmon/hwmon9/power1_cap', 'pwr_average': '/sys/class/drm/card0/device/hwmon/hwmon9/power1_average',
[...]

In [4]: print(TEMP_FILES)
{'edge': '/sys/class/drm/card0/device/hwmon/hwmon9/temp1_input', 'junction': '/sys/class/drm/card0/device/hwmon/hwmon9/temp2_input', 'mem': '/sys/class/drm/card0/device/hwmon/hwmon9/temp3_input'}

Latest Source file