A GPU metrics server that exposes temperature, power, utilization, and memory data over HTTP as JSON. Supports NVIDIA, AMD, and Intel GPUs.
- Python 3.8+
uvicorn,fastapi,xmltodict
python3 server.pyThe server listens on 0.0.0.0:8000 and exposes a single endpoint:
GET /gpu— returns an array of GPU metrics objects
[
{
"vendor": "nvidia",
"index": 0,
"name": "NVIDIA GeForce RTX 4090",
"temperature_c": 72.0,
"utilization_gpu_pct": 100.0,
"memory_used_mb": 20480.0,
"memory_total_mb": 24564.0,
"power_draw_w": 350.0
}
]Deploy the server as a systemd service on the GPU machine so it starts on boot and auto-restarts on failure.
# Copy files to the GPU machine
sudo mkdir -p /opt/gpu-monitor
sudo cp server.py /opt/gpu-monitor/
sudo cp deploy/gpu-monitor.service /etc/systemd/system/
# Install Python dependencies
sudo pip3 install uvicorn fastapi xmltodict
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable gpu-monitor.service
sudo systemctl start gpu-monitor.service
# Check status
sudo systemctl status gpu-monitor.service
journalctl -u gpu-monitor.service -fEnsure port 8000 is accessible from your development machine:
sudo ufw allow 8000/tcpA VSCode extension that monitors a remote GPU server and alerts you when thermal throttling is detected.
- Polls the GPU server at a configurable interval
- Tracks temperature, power draw, and GPU utilization
- Uses a state machine to detect throttling:
- NORMAL → HOT: Temperature hits threshold while power is high (GPU under full load at thermal limit)
- HOT → THROTTLING: Power draw drops while temperature stays high and utilization is still 100% (GPU is clock-throttling to shed heat)
- Recovery: Temperature drops below threshold minus 3°C hysteresis
- Warning (HOT): "GPU temperature has reached 87°C at 350W — near thermal limit"
- Error (THROTTLING): "GPU appears to be thermally throttling — power dropped from 350W to 280W while utilization remains at 100%. Performance is degraded."
Notifications have a configurable cooldown (default: 60s) to avoid spam.
Shows real-time GPU stats in the VS Code status bar:
- 🟢
✓ GPU: 65°C | 320W | 98%— Normal - 🟡
⚠ GPU: 87°C | 350W | 100%— Hot - 🔴
🔥 GPU: 89°C | 280W | 100%— Throttling
cd vscode-extension
npm install
npm run compileThen press F5 in VS Code to launch the extension in a development host, or package it:
npx vsce package
theia --install-extension gpu-thermal-monitor-0.1.0.vsixOpen VS Code Settings and search for "GPU Monitor":
| Setting | Default | Description |
|---|---|---|
gpuMonitor.serverUrl |
http://localhost:8000 |
URL of the GPU monitoring server |
gpuMonitor.pollIntervalMs |
2000 |
Polling interval in ms |
gpuMonitor.temperatureThreshold |
87 |
Temperature (°C) to trigger alerts |
gpuMonitor.powerHighThreshold |
300 |
Power (W) considered "high" at full load |
gpuMonitor.powerDropPercent |
15 |
% power drop that indicates throttling |
gpuMonitor.gpuIndex |
0 |
Which GPU to monitor |
gpuMonitor.notificationCooldownMs |
60000 |
Minimum time between repeated alerts |
GPU Monitor: Start Monitoring— begin pollingGPU Monitor: Stop Monitoring— stop pollingGPU Monitor: Show GPU Status— display current state summary
See LICENSE.