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.1.tar.gz
(10.2 kB
view details)
Built Distribution
File details
Details for the file gpu_waiter-0.0.1.tar.gz
.
File metadata
- Download URL: gpu_waiter-0.0.1.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 | c71c3261211f6d591349235e1f328e44c2a158e86dd597f0cfb94679f4c0b804 |
|
MD5 | 39766cf88f6b745beb93453689161339 |
|
BLAKE2b-256 | 08a75a6f89d2659feefe6eaf625f8a8ba8031239f9cbb7c97d6c1f17d0ed15dc |
File details
Details for the file gpu_waiter-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: gpu_waiter-0.0.1-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 | 9f5695eff4cb2f4185f749cd8992985793b52b74519d48b54c9957780b7d366d |
|
MD5 | 01197c0852bb09d0313c0f26e707c1f6 |
|
BLAKE2b-256 | 5bca3cfa6d8068cc11d876bd6d6a4c3ba90225338b81f9d0e31b20dd9dcfbfe0 |