Skip to main content

A lightweight, terminal-based system monitoring tool for Linux that provides real-time hardware metrics (CPU and GPU) in both text and graphical formats

Project description

Linux HWINFO64

Written in Python
This is a scaled down proof of concept. It's a simple script to output a system's hardware information and some simple metrics for the CPU and GPU In the future, I might expand this to include more of the features of hwinfo64, but it's a simple MVP for now

Requirements

  • nvidia-smi for Nvidia GPUs
  • rocm-smi for AMD GPUs

GPU Detection

It first checks for NVIDIA GPUs using nvidia-smi
Then it checks for AMD GPUs by:

  • Looking at vendor ID in /sys/class/drm/card0/device/vendor
  • Using lspci to search for AMD graphics adapters
  • The most accurate way to get usage is using rocm-smi, otherwise it relies on /sys/class/drm/card0/device/gpu_busy_percent[1]

Usage Notes:

CLI Arguments

  • --graph or -g: Run the monitor in graph mode
  • --record or -r: Record metrics to a CSV file for later analysis
  • --output or -o: Specify the output CSV file name (default: hw_metrics.csv)

Graph Mode

A new display mode that shows line graphs of your hardware metrics over the last 2 minutes

  • CPU usage history
  • Memory usage history
  • GPU utilization history (if available)
  • GPU memory usage history (if available)

Screenshot of tool running in graph mode

Notes

For AMD GPUs, some metrics might not be available depending on your specific card and drivers:

  • Temperature reading paths can vary between different AMD cards
  • Memory usage requires ROCm tools to be installed
  • GPU utilization might not be available on older cards/drivers

Screenshot of the tool running in the terminal

Additional requirements for AMD GPU support:

  • For basic detection: standard Linux utilities like lspci
  • For more detailed metrics: AMD's ROCm tools (rocm-smi)

Links:

[1] I don't know a lot about how linux determines device number, but it will increment the value for card0 if you ever change your graphics card (presumably it stores the previous device values / configs / whatever). I plan to investigate this further

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

linux_hwinfo64-0.1.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linux_hwinfo64-0.1.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file linux_hwinfo64-0.1.1.tar.gz.

File metadata

  • Download URL: linux_hwinfo64-0.1.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for linux_hwinfo64-0.1.1.tar.gz
Algorithm Hash digest
SHA256 86c773a6eb11e74d5e79c2cc827050367dcf2cb053e7bc085f5d0ddba513d85b
MD5 7b418bbf07c340d6006705b215771352
BLAKE2b-256 810f05d7a191ff821cf80427e3d2dc541749d292ed851014bac87ac1f327cae9

See more details on using hashes here.

File details

Details for the file linux_hwinfo64-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for linux_hwinfo64-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8920632e2bea4d8171e4393c021916370883c203a79fc9a1fb9660ec3374b1af
MD5 2b2b5986fae72e77be02632ad4c7072a
BLAKE2b-256 668eab9c6caeed7d138d227ec0fef5517a495c5159bca4b75d67b53680499b0f

See more details on using hashes here.

Supported by

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