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.3.tar.gz (14.4 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.3-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for linux_hwinfo64-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5acfa1baa7ca83488489a1e8c5bd4d0d3e6d23ce041ef82b748879d232e59a14
MD5 79811189c264a409be8b9f4c26e63bfb
BLAKE2b-256 296d1fb7188ab026dc449433b55b24edba93e45c2b1b12999e8276cff803c5dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for linux_hwinfo64-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 54f162572a5399906f4b9562a0b8573f03ad7e944a7a3c58653accd675b24c4e
MD5 1754830fa4ce8052a19762d00f98a29f
BLAKE2b-256 fdcb82b0e0ee46bcdb5e106949f9381a565eceac070c5ddbcbab5666ec06f9f7

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