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 sentence; 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.5.tar.gz
(11.4 kB
view details)
Built Distribution
File details
Details for the file gpu_waiter-0.1.5.tar.gz
.
File metadata
- Download URL: gpu_waiter-0.1.5.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 | 0103385585d682e6d5698cbb54adb5a0158892f022ec66827c88d0812b8c4ccf |
|
MD5 | 859a0902624d83e94c62f6dea08f4497 |
|
BLAKE2b-256 | f2f48d3269b94b0f1219b82841ea8e77192ee33a2daec9691381b3f343f3a2e7 |
File details
Details for the file gpu_waiter-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: gpu_waiter-0.1.5-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 | e472c30680d09626c3a912b100e1d7d048a42c5a3a4445ec65868ce75f63ae93 |
|
MD5 | 2621b7572a798a9db816b8222fca98d7 |
|
BLAKE2b-256 | 7d3e6cd6138bdf76d8ff5531a4dd367c27eb236df0e8afa3b92f6d2aac24b51f |