Skip to main content

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


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.6.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpu_wait-0.4.6-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file gpu_wait-0.4.6.tar.gz.

File metadata

  • Download URL: gpu_wait-0.4.6.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for gpu_wait-0.4.6.tar.gz
Algorithm Hash digest
SHA256 2455369c9918e901e471b2a157be1ab9f5c9d517e0f24122c42c46adcfb02356
MD5 d73c4c07a9b54b21ee2ace6fc9039717
BLAKE2b-256 b02d69069f28430a2fd33b6e1466023b7d2dacc05bb8ebd2ade0d19d58330ad4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpu_wait-0.4.6.tar.gz:

Publisher: publish.yml on dipta007/gpu-wait

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gpu_wait-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: gpu_wait-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for gpu_wait-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4e44242bba21108e0d1f5b08c240e1fa38d2188398cca9d747d6e3f6a7928381
MD5 39cd408fa954ed065ebb4d8fa7023a2b
BLAKE2b-256 d3dfbdca45cfbddb71d3096386aa803d1a89c85c347b235bbbb880f5f39c12cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpu_wait-0.4.6-py3-none-any.whl:

Publisher: publish.yml on dipta007/gpu-wait

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page