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
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.4.tar.gz
(11.4 kB
view details)
Built Distribution
File details
Details for the file gpu_waiter-0.1.4.tar.gz
.
File metadata
- Download URL: gpu_waiter-0.1.4.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 | 8d1e28ce72e8ba73b7ab21157649803c36904886e08dc500ffb24e82b8eaa0d0 |
|
MD5 | 0525d356b65724a7925dc2b8641a6fc6 |
|
BLAKE2b-256 | 7fa8183ebce2ee559d90202331130eae66cc38c524e88e4d12dcef548678c222 |
File details
Details for the file gpu_waiter-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: gpu_waiter-0.1.4-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 | 7039f9addbcbec967fd146f26f246ffb1cf202de117591de66966d413d04b66f |
|
MD5 | 64a8f9a8247fd812325a98e51781153d |
|
BLAKE2b-256 | 4eb71c4044a1e7287c24319f2fdc65b92aa0ee51e10c864fb2a4984d0a5e699a |