Skip to main content

a gpu device moniter could automaticly run command if device available, just for nvidia gpu.

Project description

gpu-waiter

1. Overview

a gpu device moniter could automaticly run command if device available, just for nvidia gpu.

2. Install & Usage

2.1 install

pip install gpu-waiter

2.2 usage

$ waiter -g 2 -m 40G ls -alh /usr/local
$ waiter -g 2 -m 40G -c ls -alh /usr/local
$ waiter -g 2 -m 40G -c "ls -alh /usr/local"
$ waiter -c "ls -alh /usr/local" -g 2 -m 40G

$ waiter -h
usage: waiter [-h] [-c CMD] [-g GPU] [-m MEM] [-s] [-t TIME] [-vvv]

options:
  -h, --help            show this help message and exit.
  -c CMD, --cmd CMD     command to run; -c could to be not specified; -c could be ignored but command should be posed at the end of shell setence; command
                        could be not string only if -c is ignored.
  -g GPU, --gpu GPU     amount of gpu required.
  -m MEM, --mem MEM     memory size required.
  -s, --single_user     not use gpu if already has user.
  -t TIME, --time TIME  time of peried between check.
  -vvv, --verbose       dump all log.
#/bin/python3
from gpu_waiter import Tasker, Waiter
from gpu_waiter import NVGPU

if __name__ == "__main__":
    nv = NVGPU(2, "23GiB", False)
    nv.check()

    task = Tasker(
        [
            "ls",
            "-alh",
            "/usr/local/",
        ],
        msg_level=1,
        devices=nv
    )

    wt = Waiter(3, task)
    wt.do_wait()
    
    wt = Waiter(3)
    wt.add_task(task)
    wt.do_wait()

3. Develop

git clone https://github.com/lijunjie2232/gpu_waiter.git
cd gpu_waiter
pip install -e .

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_waiter-0.1.3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

gpu_waiter-0.1.3-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file gpu_waiter-0.1.3.tar.gz.

File metadata

  • Download URL: gpu_waiter-0.1.3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for gpu_waiter-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6b67bc26de7e9f5acc1770393d4a917370cb51b48b480dcad7a7eedcdd8b960d
MD5 9d238fb94fb921dbfbc6d51c978c1f99
BLAKE2b-256 6be55445c4f49eea63aed7d0f48d513760336366473f4d0e97f508a16a5b228f

See more details on using hashes here.

File details

Details for the file gpu_waiter-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gpu_waiter-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for gpu_waiter-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 885f2cc68d41b0b07ff8a95b3afe42e101ff4cfbf8c9d716eece76a5c519cff9
MD5 948a2d6670e5d244d93b37006a9042b4
BLAKE2b-256 1f26b97f3965c5d551fec5622a0f8ce2ddfaddd233a9e15dd749299a5ddc9da6

See more details on using hashes here.

Supported by

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