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.2.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.2-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: linux_hwinfo64-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 b5ad851cee7efe0607825fbf4e7f7496835530125ac220daba7934fbe5f8e8f4
MD5 3481cdd3963d48c23fc99e63da9c5457
BLAKE2b-256 92da55618cd303fbdc087a6935e7661706fed6ff0f06286292757c8670ef9014

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for linux_hwinfo64-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d963a7f6257cf240d59928406a365af0989a0d219f389b47074ff5a145762eb
MD5 27f4c25fece2e21762cd6ba4eee12b5a
BLAKE2b-256 024b9ac4f6fc42d8f6e5fbc3c098539d92c0420fdcab9db23b14365086e19395

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