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. 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
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.1.1.tar.gz
(11.4 kB
view details)
Built Distribution
File details
Details for the file gpu_waiter-0.1.1.tar.gz
.
File metadata
- Download URL: gpu_waiter-0.1.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0346d65508a813735fd7863860afe02af7eab3bd86f24cbe4077a5282de5a4cf |
|
MD5 | 9197ec2cacaeb2c7a0ead9213869e519 |
|
BLAKE2b-256 | 9a6b9d112afe7a5d010b3326ddbd2bb89658ee67b6fdd313158eef07b26eab18 |
File details
Details for the file gpu_waiter-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: gpu_waiter-0.1.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5de681407e2c94169d68dad390fb2643a1994ad37ffade2ca83aea01a2c4dbfb |
|
MD5 | f90b287dfcbb37ff1d701be012cfb60a |
|
BLAKE2b-256 | 2c5b44a5a717bfd36b78b46689deb13330d277a701865d8aa1c3bbb88fd1b8a6 |