A package to run commands when GPU resources are available
Project description
GPU Wait
A Python package that monitors GPU resources and executes commands when the GPU becomes available.
Installation
pip install gpu-wait
Usage
Command Line Interface
# Run a command when any GPU is available
gpu-wait python train.py
# Wait for specific GPU
gpu-wait -d 0 python train.py
# Customize memory threshold and polling interval
gpu-wait -t 0.8 -i 5 python train.py
# Enable verbose logging
gpu-wait -v python train.py
Python API
from gpu_wait import GPUMonitor, CommandRunner
# Create monitor with custom threshold
monitor = GPUMonitor(memory_threshold=0.8)
# Create command runner
runner = CommandRunner(monitor)
# Run command when GPU is available
runner.run_when_available(["python", "train.py"])
Features
- Monitor single or multiple GPUs
- Customizable memory threshold and polling interval
- Command line interface
- Python API
- Logging support
Requirements
- Python 3.6+
- NVIDIA GPU
- nvidia-ml-py
- psutil
- click
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gpu_wait-0.3.0.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gpu_wait-0.3.0.tar.gz.
File metadata
- Download URL: gpu_wait-0.3.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
046fd78bf4e15895887f84423fa0d1a24369259be314c8241737668ec6ee86e5
|
|
| MD5 |
969a870eebee4d26a6c4bbf5327d5062
|
|
| BLAKE2b-256 |
b8985516aaf6ff00c6f60be394144300b976d604d4e39b238c9e29715b6d3ba1
|
File details
Details for the file gpu_wait-0.3.0-py3-none-any.whl.
File metadata
- Download URL: gpu_wait-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1ae3dc8eb1e0134021f575ba61956dc6fedfd812d92a4ca711dcb3618cab63f
|
|
| MD5 |
87cb032c5280235325d8119da2b6561e
|
|
| BLAKE2b-256 |
a8065c67401a8dedc694b352425b69c627cc616c6b8179cd130630f01cf24bb2
|