Skip to main content

A module/TUI for AMD GPU statistics

Project description

amdgpu_stats

A Python module/TUI for AMD GPU statistics. Please file an issue with feature requests or bug reports!

Screenshots

Main screen / stats

Screenshot of the main stats table

Usage graphs

Screenshot of the 'graphing' scroll bars

Logs

Screenshot of the 'Logs' tab pane

Requirements

Only Linux is supported. Information is completely sourced from the amdgpu driver via sysfs

Installation

pip install amdgpu-stats

To use the TUI, run amdgpu-stats in your terminal of choice. For the module, see below!

Module

Introduction:

In [1]: import amdgpu_stats.utils

In [2]: amdgpu_stats.utils.CARDS
Out[2]: {'card0': '/sys/class/drm/card0/device/hwmon/hwmon9'}

In [3]: amdgpu_stats.utils.get_core_stats('card0')
Out[3]: {'sclk': 640000000, 'mclk': 1000000000, 'voltage': 0.79, 'util_pct': 65}

In [4]: amdgpu_stats.utils.get_clock('core', format_freq=True)
Out[4]: '659 MHz' 

Attempts are made to provide guidance as ValueErrors. For example:

In [2]: amdgpu_stats.utils.CARDS
Out[2]: {'card1': '/sys/class/drm/card1/device/hwmon/hwmon3'}

In [3]: amdgpu_stats.utils.get_core_stats('card0')
[...]
File ~/.local/lib/python3.12/site-packages/amdgpu_stats/utils.py:82, in validate_card(card)
     80     raise ValueError("No AMD GPUs or hwmon directories found")
     81 # if 'card' was specified (not None) but invalid (not in 'CARDS'), raise a helpful error
---> 82 raise ValueError(f"Invalid card: '{card}'. Must be one of: {list(CARDS.keys())}")

ValueError: Invalid card: 'card0'. Must be one of: ['card1']

For more information on what the module provides, please see:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amdgpu_stats-0.1.24.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

amdgpu_stats-0.1.24-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file amdgpu_stats-0.1.24.tar.gz.

File metadata

  • Download URL: amdgpu_stats-0.1.24.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.3 Linux/6.8.11-300.fc40.x86_64

File hashes

Hashes for amdgpu_stats-0.1.24.tar.gz
Algorithm Hash digest
SHA256 741dc2d2311be6e4fde9cc0ed3dc1a3fa041c9b1c2906b1190249aaf1ab98aa1
MD5 a3ad6457d191773e1e42d2a1ed4e7358
BLAKE2b-256 0c7bd5e6cc7f8145dc71d59c3b532121c7acb442bbe684fd64c702a7e354260d

See more details on using hashes here.

File details

Details for the file amdgpu_stats-0.1.24-py3-none-any.whl.

File metadata

  • Download URL: amdgpu_stats-0.1.24-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.3 Linux/6.8.11-300.fc40.x86_64

File hashes

Hashes for amdgpu_stats-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 74769d8737f0e3489ad89d7c5e704bafb35f1a3966f51f794ecf14e84f900130
MD5 a8c4fbf479618d49c50ab732100fa395
BLAKE2b-256 140a433d9ce71a899e3616cf6bae7229e78203b0e2b59bd344ddd62a19a65787

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page