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.4.9.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.4.9.tar.gz.
File metadata
- Download URL: gpu_wait-0.4.9.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 |
b4f103fd9fd06ba4b6d1cac5fc5c14a4a6d060dd5c4d4ff45426a452c0f1ea59
|
|
| MD5 |
2aec113070d7daaf0b1dbb3a5e32ba68
|
|
| BLAKE2b-256 |
3433abb83163abaafcf9c33b2bebc9e7663db63914a2b193419da6c92f1e4b5c
|
File details
Details for the file gpu_wait-0.4.9-py3-none-any.whl.
File metadata
- Download URL: gpu_wait-0.4.9-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 |
f4dbda67370ce9baeb17b12784eab6e96162b6fba59d4f9cee678ae7ac648eb2
|
|
| MD5 |
0de99983c02e01b9cecd190dd0897c23
|
|
| BLAKE2b-256 |
8d10888c27e5ca3b9f0e6c987e4dc9e74081c77391db89849a25b88a4c08b8ac
|