New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nvsmi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nvsmi

A (user-)friendly wrapper to nvidia-smi

0.4.2
PyPI
Maintainers
1

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

Keywords

packaging

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts