Skip to content

Repository files navigation

Remote GPU Server Monitor

A lightweight, agentless multi-server GPU monitoring tool and usage dashboard.

English中文说明


Overview

This is a lightweight tool for monitoring multiple remote GPU servers from a single dashboard.

It connects to remote Linux servers over SSH, runs nvidia-smi commands, identifies which Linux user owns each GPU process, and saves the data into a local SQLite database. A web interface built with Streamlit displays real-time GPU statistics and historical usage timelines.

No client-side software or agent is required on the GPU servers. As long as the servers have SSH and nvidia-smi, they can be monitored.


Screenshots

Web Dashboard

Dashboard Preview

System Flow

System Architecture


Features

  • No Agent Needed: Uses standard SSH connections to fetch nvidia-smi metrics. No background daemons needed on the remote machines.
  • Process & User Identification: Correlates GPU processes with Linux usernames, making it easy to see who is currently using which GPU.
  • Real-time Metrics: Displays GPU model, memory usage, utilization percentage, and power draw in a clean card layout.
  • Historical Timeline: Visualizes past GPU usage over 1 to 28 days using interactive Plotly Gantt charts.
  • Lightweight Storage: Stores metrics locally in SQLite with low overhead.
  • Demo Mode Included: Comes with a demo data generator to test the interface without remote servers.

Installation

Prerequisites

  • Python 3.8 or higher
git clone https://github.com/Tison6/Remote-GPU-Monitor.git
cd Remote-GPU-Monitor
pip install -r requirements.txt

Quick Start

1. Test with Demo Data (Optional)

If you want to view the interface before configuring real servers:

# Generate sample data
python generate_demo_data.py

# Launch web dashboard
streamlit run monitor_gpu_viewer.py

Switch the database path in the sidebar to ./data/demo_gpu_history.db.


2. Monitor Real Servers

Step 1: Configuration

Copy config.example.json to config.json:

# Linux / macOS
cp config.example.json config.json

# Windows
copy config.example.json config.json

Edit config.json with your server connection details:

{
  "database": {
    "path": "./data/gpu_history.db"
  },
  "servers": [
    {
      "id": "Server-1",
      "host": "192.168.1.101",
      "port": 22,
      "username": "ubuntu",
      "auth_type": "key",
      "key_path": "~/.ssh/id_rsa"
    },
    {
      "id": "Server-2",
      "host": "192.168.1.102",
      "port": 22,
      "username": "admin",
      "auth_type": "password",
      "password": "your_password"
    }
  ],
  "user_mapping": {
    "user_a": "Alice",
    "user_b": "Bob"
  }
}

Note: config.json is listed in .gitignore so your private credentials and hostnames will not be committed to Git.

Step 2: Start Background Logger

# Windows
start_logger.bat
# or: python monitor_gpu_logger.py

# Linux / macOS
chmod +x start_logger.sh
./start_logger.sh
# or: python3 monitor_gpu_logger.py

Step 3: Start Web Dashboard

# Windows
start_viewer.bat
# or: streamlit run monitor_gpu_viewer.py

# Linux / macOS
chmod +x start_viewer.sh
./start_viewer.sh

Open http://localhost:8501 in your browser.


Configuration Reference

Option Description Default
database.path SQLite database file location ./data/gpu_history.db
monitor.refresh_interval_sec Frequency of polling real-time metrics 5
monitor.history_log_interval_sec Frequency of archiving history snapshots 60
monitor.busy_memory_threshold_mb VRAM threshold (MB) to classify GPU as busy 1024
servers[].id Display name for the server -
servers[].host Server IP address or hostname -
servers[].port SSH port 22
servers[].auth_type Authentication method ("key" or "password") "key"
servers[].key_path Private key path if using key auth -
user_mapping Optional mapping from Linux usernames to display names {}

License

This project is licensed under the MIT License.

About

A lightweight, agentless multi-server GPU monitoring tool and timeline dashboard using SSH, SQLite, and Streamlit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages