Skip to main content

Linux Hardware Monitor

A comprehensive Python-based system monitoring tool for Linux that provides real-time hardware metrics similar to hwinfo64. Features both text-based and graphical interfaces for monitoring CPU, GPU, memory, disk, and network usage.

Features

Real-time Monitoring

  • CPU Information: Model name, core count, frequency, per-core usage, and temperature
  • GPU Support: NVIDIA and AMD GPU detection with utilization, memory, temperature, and power draw
  • Memory Monitoring: System RAM usage with detailed statistics
  • Disk I/O: Real-time disk usage, I/O statistics, and filesystem information
  • Network: Upload/download bandwidth, total and per interface (physical interfaces only, so docker/bridge/VPN traffic isn't double counted)
  • Historical Data: 2-minute rolling history for all metrics

Display Modes

  • Standard Mode: Detailed text-based display with color-coded usage bars
  • Graph Mode: Real-time line graphs showing metric trends over time
  • Neofetch Mode: System information display in neofetch-like format
  • CSV Recording: Export metrics to CSV files for analysis

Advanced GPU Detection

  • NVIDIA: Full support via nvidia-smi with temperature, utilization, memory, and power
  • AMD: Multi-layer detection system:
    • Vendor ID checking via /sys/class/drm/card*/device/vendor
    • lspci fallback detection
    • Reads VRAM usage, temperature, power, fan speed and core clock straight from the amdgpu driver's sysfs files, no extra tools needed
    • ROCm (rocm-smi) as a fallback for VRAM usage
    • Sysfs fallback for basic utilization

Installation

Install from PyPI as a standalone tool:

pipx install linux-hwinfo64     # or: uv tool install linux-hwinfo64
linux-hwinfo64 --graph

Requirements

Core Dependencies

  • Python 3.10+ with psutil and distro

GPU Support (Optional)

  • NVIDIA GPUs: nvidia-smi command-line tool
  • AMD GPUs: Nothing extra with the amdgpu driver. rocm-smi is only used as a fallback for VRAM usage

Usage

Running the Application

From an installed package, use the linux-hwinfo64 command with the same arguments. From a source checkout:

uv run main.py                   # Standard monitoring mode
uv run main.py --graph           # Graph mode with historical data
uv run main.py --neofetch        # Display system info in neofetch-like format
uv run main.py --record          # Record metrics to CSV
uv run main.py --output file.csv # Custom CSV output file

CLI Arguments

  • --graph or -g: Run in graph mode with historical charts
  • --neofetch or -n: Display system information in neofetch-like format
  • --record or -r: Record metrics to CSV file for analysis
  • --output or -o: Specify output CSV filename (default: hw_metrics.csv)

Graph Mode Features

Real-time line graphs showing 2-minute historical data:

  • CPU usage trends
  • Memory usage patterns
  • GPU utilization history (if available)
  • GPU memory usage trends (if available)
  • Disk usage monitoring
  • Network upload and download bandwidth (MB/s, auto-scaled)

Screenshot of tool running in graph mode

Screenshot of the tool running in the terminal

Technical Implementation

Architecture

  • SystemMonitor Class: Core hardware detection and metrics collection
  • Caching System: 60-second GPU detection cache to minimize system calls
  • Graceful Degradation: Missing GPU tools don't crash the application
  • Multi-source Data: Combines multiple system interfaces for comprehensive metrics

GPU Detection Logic

  1. NVIDIA Detection: Uses nvidia-smi for comprehensive metrics
  2. AMD Detection: Multi-layered approach:
    • Primary: Vendor ID verification via sysfs
    • Secondary: lspci parsing for device identification
    • Metrics: amdgpu sysfs files (mem_info_vram_*, gpu_busy_percent, the card's hwmon sensors), rocm-smi fallback for VRAM

Performance Features

  • Efficient Polling: 1-second refresh rate with minimal system impact
  • Terminal Safety: Automatic bounds checking and resize handling
  • Memory Efficient: Rolling deque for historical data storage

Development

Code Quality

uv sync                 # Install dependencies, including the dev group (ruff)
uv run ruff check .     # Lint code
uv run ruff format .    # Format code

Releasing

CI (.github/workflows/python-package.yml) lints, smoke-tests and build-checks every push and PR to main. Publishing to PyPI is handled by .github/workflows/python-publish.yml:

  1. Bump version in pyproject.toml and merge to main
  2. Create a GitHub Release with a tag matching that version (e.g. v0.1.4)
  3. The workflow builds the package, verifies it installs, and uploads it to PyPI via Trusted Publishing

Logging

The application logs GPU detection issues and errors to ~/.local/state/linux-hwinfo64/hw_monitor.log (or $XDG_STATE_HOME/linux-hwinfo64/ if set) for debugging. --help shows the exact path.

Compatibility Notes

AMD GPU Support

AMD GPU metrics availability depends on your specific hardware and drivers:

  • Temperature: Varies by card model and hwmon support
  • Memory Usage: Read from mem_info_vram_used/mem_info_vram_total, falls back to ROCm tools if those aren't available
  • Power, Fan, Clock: Read from the card's hwmon sensors, availability varies by card and kernel version
  • GPU Utilization: May not be available on older cards/drivers
  • Device Detection: Automatically handles multiple GPU cards

System Requirements

  • Minimum Terminal: 80x25 for standard mode, 100x35 for graph mode. Standard mode cuts off sections that don't fit and shows how many lines are hidden (around 50 rows shows everything on a 12-thread CPU). Graph mode skips graphs that don't fit, so all of them (including network) need roughly 60-70 rows depending on which GPU metrics are available
  • Permissions: Some GPU metrics may require elevated permissions
  • Dependencies: Works with standard Linux utilities, enhanced with GPU tools

Metadata

Release files for linux-hwinfo64 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for linux-hwinfo64 0.3.0
File Size Uploaded Provenance
linux_hwinfo64-0.3.0.tar.gz 29.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for linux-hwinfo64 0.3.0
File Interpreter ABI Platform
linux_hwinfo64-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.9 kB

Release files / linux_hwinfo64-0.3.0.tar.gz

Download URL linux_hwinfo64-0.3.0.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3ea3bf8dc1c8f70196bdcdde791aa7b9c4e802375d8f85dad2f1dd7379737ad3
BLAKE2b-256 checksum
How to use checksums
cb1d584a02a62aa8b73db4ba39b7b2a23194589a96ac3fefe217ac5e99eef1df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / linux_hwinfo64-0.3.0-py3-none-any.whl

Download URL linux_hwinfo64-0.3.0-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88a3939ff7accca2296a3929b4722134612d08a64b862f40d238a4e63bd6c65f
BLAKE2b-256 checksum
How to use checksums
44e4d4e546992aa102a29c14b2f9fac28b05375b51992a6fc88a074a9dee4052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for linux-hwinfo64 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for linux_hwinfo64-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page