GPU Usage Alert is a Python script that continuously monitors GPU utilization and triggers a Twilio phone call if the GPU remains idle for a configurable duration. It helps you detect idle GPU resources and get instant phone notifications.
This script can run in the background via tmux or any terminal session.
- Monitors any GPU on the system using
nvidia-smi. - Configurable GPU index, check interval, and idle threshold.
- Sends a Twilio phone call when GPU usage is 0% for more than the configured duration.
- Python 3.8+
- NVIDIA GPU with
nvidia-smiinstalled - Twilio Python SDK (
pip3 install twilio) - Dotenv (
pip3 install python-dotenv) - Twilio account with a verified phone number
- Clone the repository:
git clone https://github.com/kartiksawant/gpu-usage-alert.git
cd gpu-usage-alert- Install the required packages:
pip3 install -r requirements.txtpython3 gpu_usage_alert.py --gpu 0 --interval 5 --threshold 60--gpu: GPU index to monitor (default: 0)--interval: Seconds between checks (default: 5)--threshold: Idle duration in seconds before alert (default: 60)
tmux new -s gpu_monitor
python3 gpu_usage_alert.py --gpu 0 --interval 5 --threshold 60
# Detach tmux session: Ctrl+B then DTo configure Twilio for phone call alerts, follow the detailed instructions in Twilio Setup README.