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
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_waiter-0.0.3.tar.gz
(10.2 kB
view details)
Built Distribution
File details
Details for the file gpu_waiter-0.0.3.tar.gz
.
File metadata
- Download URL: gpu_waiter-0.0.3.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b21468e7b2b440cd6a9d06e2b87c40ace234bd471c64b281cacae81997c2ee7 |
|
MD5 | 28318372938e786b28284dc9303086f3 |
|
BLAKE2b-256 | ee63341b5690d2f2032baa12eff16f0e5c40cfb2b33323323618ce9bf3acaa7c |
File details
Details for the file gpu_waiter-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: gpu_waiter-0.0.3-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | eac4df4ab26194fd0d3b0792aaa23fdcb57f1fce39c7abd8008b21228272c217 |
|
MD5 | 6470842c61bea288dc0ac6531d02431e |
|
BLAKE2b-256 | f5aa3ac17965010bf5664c28271c821343a3f400098fbdc7ba21b6cc53019b75 |