Skip to main content

A (user-)friendly wrapper to nvidia-smi

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nvsmi-0.4.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

nvsmi-0.4.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file nvsmi-0.4.0.tar.gz.

File metadata

  • Download URL: nvsmi-0.4.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.6.9 Linux/4.15.0-72-generic

File hashes

Hashes for nvsmi-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7c0af83bb0930e2f4f25a75b7bed4177db995377d695a6d43479760cdffa9158
MD5 35816fe08b891fd40d670777911ec6a9
BLAKE2b-256 2819178dee422870da23e7c3db8ee5b2e4e5eb9477cb0cb5d27caacd7d323367

See more details on using hashes here.

Provenance

File details

Details for the file nvsmi-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: nvsmi-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.6.9 Linux/4.15.0-72-generic

File hashes

Hashes for nvsmi-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbf43fd42217053331666184db9631dda422fdc135b466a96ab2b359a7cee8e8
MD5 6b87c632e7d8e586ef7aa4966c813325
BLAKE2b-256 c211c94b56dc11467031ac9dd4abd845c31c9f1ba20404d738ea0bcddcbddbb1

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page