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.2.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.2.0.tar.gz.
File metadata
- Download URL: gpu_wait-0.2.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 |
c9aac70f22d479871cb13e9b0afa01a47de96b15dc8618a255ff73c4f1d5b1aa
|
|
| MD5 |
b7bffa46bc7649900d0defb64f2f2c28
|
|
| BLAKE2b-256 |
409208ae44ce853354a24f4e637f9bd1f82a777fdd929242f1831d192706a33d
|
File details
Details for the file gpu_wait-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gpu_wait-0.2.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 |
72c87afdfe2d9a017e9f48ddf72f81f5a7ce7a5bd4ffe95056c0b2fdf5e4e45e
|
|
| MD5 |
29f969ce99b8a3c1bf8aadedb07d939a
|
|
| BLAKE2b-256 |
64c392dcca62607e51aad1c9ca3941ddef45852b4d6572514485409002b3a301
|