Skip to main content

gpu device moniter and automaticly run commond if device available, just for nvidia gpu.

Project description

gpu-waiter

1. Overview

gpu device moniter and automaticly run commond if device available, just for nvidia gpu.

2. Usage

2.1 init project

git clone https://github.com/lijunjie2232/gpu_waiter.git
pip install nvitop
pip install .

2.2 usage

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

options:
  -h, --help            show this help message and exit
  -m MEM, --mem MEM     memory size required
  -g GPU, --gpu GPU     amount of gpu required
  -s, --single_user     not use gpu if already has user
  -c CMD, --cmd CMD     command to run
  -t TIME, --time TIME  time of peried between check
  -vvv, --verbose       dump all log
#/bin/bash
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.add_task(task)
    wt.do_wait()

3. Develop


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

Uploaded Source

Built Distribution

gpu_waiter-0.0.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpu_waiter-0.0.2.tar.gz
  • Upload date:
  • Size: 10.2 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.0.2.tar.gz
Algorithm Hash digest
SHA256 825448649caea483c459345dc77044f01ef4a626d005bde3ac5afa1b255e7fcf
MD5 bcb32ae4cef5403dad1d062a61d64677
BLAKE2b-256 60db49692051ac55c94aaaa1ccc4b6a78d98b67d259824c30ce70e529f234225

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpu_waiter-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 26f33470d8683384d0d609dac60b118bc0ed6812a9cd2d1227e3f00d521fd619
MD5 9dbb3fa6eee9ea9ea3cbec59ab6c4671
BLAKE2b-256 3cb32e1213bc2bb7627bb6d68f1a89a49a0301142816567a226515387df4cd86

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