pynvml
Python utilities for the NVIDIA Management Library
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 pynvmluv
uv add pynvmlpoetry
poetry add pynvmlInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
nvidia-ml-pyPython wrapper around NVIDIA's Management…
permissive · top 5,000 on PyPI
py3nvmlProvides Python 3 bindings to query NVIDIA GPU…
permissive · top 15,000 on PyPI
nvidia-ml-py3Provides Python bindings to NVIDIA's Management…
permissive · top 15,000 on PyPI
GPUtilGPUtil queries NVIDIA GPU status and…
permissive · top 15,000 on PyPI
nvitopInteractive terminal-based viewer for NVIDIA…
copyleft · top 15,000 on PyPI
nvgpuQueries and monitors NVIDIA GPUs on a machine,…
permissive · top 15,000 on PyPI
nvidia-curand-cu11Provides NVIDIA CURAND native runtime libraries…
unclear · top 5,000 on PyPI
nvidia-cuda-runtime-cu11Provides CUDA 11 runtime native libraries for…
unclear · top 5,000 on PyPI
nvidia-nvvmProvides the NVVM compiler IR library for…
unclear · top 5,000 on PyPI
nvidia-cuda-nvrtcProvides NVIDIA CUDA NVRTC (NVIDIA Runtime…
unclear · top 1,000 on PyPI