skillfed

pynvml

Python utilities for the NVIDIA Management Library

pynvml v13.0.1 3.5M downloads/30d#2,603 on PyPI275
Permissive license BSD-3-Clause AGING released

What it is and what it does

pynvml is a deprecated Python utility wrapper around NVIDIA's Management Library (NVML) that lets you query GPU device information programmatically. It depends on the official nvidia-ml-py bindings and exposes utilities that mimic the command-line nvidia-smi tool, allowing you to retrieve GPU memory, utilization, and other hardware metrics. The package is no longer actively maintained and is marked for deprecation; the project explicitly recommends using nvidia-ml-py directly instead.

The main entry point provides a DeviceQuery method that accepts filter strings matching nvidia-smi's query API. It is intended for demonstration and monitoring tasks rather than production use, and there is no guarantee of long-term support or maintenance.

Use it for:

  • Monitor available GPU memory and total memory capacity on a system during development or testing.
  • Query GPU device properties and utilization metrics in a Python script without shelling out to nvidia-smi.
  • Prototype GPU monitoring or resource-tracking tools before committing to a maintained library.
  • Retrieve structured GPU information for logging or diagnostic purposes in legacy codebases.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python utilities for querying NVIDIA GPU device information through the NVIDIA Management Library (NVML).

No. The package is explicitly deprecated and unmaintained as of version 13.0.1. The project's own documentation warns it is for demonstration only and recommends migrating directly to nvidia-ml-py. Unless you are maintaining legacy code that already depends on it, use nvidia-ml-py instead.

Install

pynvml on PyPI

pip

pip install pynvml

uv

uv add pynvml

poetry

poetry add pynvml

Installing pynvml

Before you install

Low install friction with a single pure-Python dependency. However, the package is explicitly deprecated as of version 13.0.1 and marked as inactive; maintenance is not guaranteed.

License in practice

BSD-3-Clause is permissive and imposes no significant restrictions on use or redistribution.

Quickstart

pip install pynvml
from pynvml_utils import nvidia_smi
nvsmi = nvidia_smi.getInstance()
result = nvsmi.DeviceQuery('memory.free, memory.total')

Requires NVIDIA GPU drivers and nvidia-ml-py (>=12.0.0) to be installed; NVML library must be accessible on the system.

Verify before relying

  • Whether the deprecated status means the package will receive security updates or bug fixes in the future.
  • Compatibility with specific NVIDIA driver versions or CUDA versions beyond the stated dependency on nvidia-ml-py>=12.0.0.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — nvidia-ml-py
Maintenance aging — 343 days since the last release
Last repo commit
First released
Downloads 3,491,659/month — #2,603 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pynvml-13.0.1-py3-none-any.whl

Development Status :: 7 - InactiveIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: BSD LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: HardwareTopic :: System :: Systems Administration

Tags

nvidia gpu monitoring pythonnvml python bindingsgpu device querynvidia-smi python wrappergpu memory monitoringnvidia management librarygpu information retrieval
gpu-monitoringdeprecatednvidia

More Python Modules packages

Further reading