https://github.com/pmav99/nvsmi
A (user-)friendly wrapper to nvdia-smi
https://github.com/pmav99/nvsmi
Last synced: about 2 months ago
JSON representation
A (user-)friendly wrapper to nvdia-smi
- Host: GitHub
- URL: https://github.com/pmav99/nvsmi
- Owner: pmav99
- License: mit
- Created: 2019-08-08T08:29:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-17T10:54:58.000Z (about 1 year ago)
- Last Synced: 2025-04-11T17:52:07.524Z (about 2 months ago)
- Language: Python
- Size: 46.9 KB
- Stars: 29
- Watchers: 2
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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 nvsminvsmi.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](https://github.com/pipxproject/pipx).
More specifically, you can install `nvsmi` for your user with:``` shell
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
```