nvsmi
A (user-)friendly wrapper to nvidia-smi.
It can be used to filter the GPUs based on resource usage (e.g. to choose the least utilized GPU on a multi-GPU system).
Usage
CLI
nvsmi --help
nvsmi ls --help
nvsmi ps --help
As a library
import nvsmi
nvsmi.get_gpus()
nvsmi.get_available_gpus()
nvsmi.get_gpu_processes()
Prerequisites
- An nvidia GPU
nvidia-smi- Python 2.7 or 3.6+
Installation
pipx
The recommended installation method is pipx.
More specifically, you can install nvsmi for your user with:
pipx install nvsmi
The above command will create a virtual environment in ~/.local/pipx/venvs/nvsmi and
add the nvsmi executable in ~/.local/bin.
pip
Alternatively you can use good old pip but this is more fragile than pipx:
pip install --user nvsmi
Release files for nvsmi 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nvsmi-0.4.2.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nvsmi-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / nvsmi-0.4.2.tar.gz
| Download URL | nvsmi-0.4.2.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1a391c7c4dadc6ec572909ff0372451d464ebadc144e5aa5fbbcc893dcb7bfa
|
|
BLAKE2b-256 checksum How to use checksums |
9d13c5da04d29f4e5f830a8558601b3e179163d0d94e0da06529d5a8e62eed9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.6.9 Linux/4.15.0-72-generic
|
Release files / nvsmi-0.4.2-py3-none-any.whl
| Download URL | nvsmi-0.4.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
718894c24bdf7b58b8ecdfd282dceb06ef120a4b4e0b8517193cba876174945e
|
|
BLAKE2b-256 checksum How to use checksums |
d2d56ec6d6410b434463ba76900d2363a1f75c474f3442a4365557b2588fa14b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.6.9 Linux/4.15.0-72-generic
|