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

Uploaded Source

Built Distribution

gpu_waiter-0.0.4-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpu_waiter-0.0.4.tar.gz
  • Upload date:
  • Size: 11.1 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.4.tar.gz
Algorithm Hash digest
SHA256 d059d511dda3f6af965995e8de2689def9ee52c9bc9585590e1b2bd1a2e25080
MD5 84587c660f8813cc462d41b0cb5f4a60
BLAKE2b-256 059311974baa530956964580066199fa6e854caeb32119f24fcf51e06206a06f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpu_waiter-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b73726b6645d195d3602ad8edff39189d59584e3a90021437797b93b2236e048
MD5 afa71b7bf5bf023b088512ac8274d8c8
BLAKE2b-256 8670cfc092c71a987a4b3c995070db2c2cf9ea0e319336a19baa0850911a2773

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