--- id: nvidia-ml-py version: "13.610.43" license: BSD license_treatment: permissive maintenance: active --- # nvidia-ml-py — Python Bindings for the NVIDIA Management Library License: permissive · Maintenance: active · Downloads: 21.0M/mo ## What it is and what it does nvidia-ml-py is a ctypes-based wrapper that translates NVIDIA's C Management Library (NVML) into Python methods and classes. It handles struct allocation, pointer passing, and converts NVML error codes into Python exceptions, making GPU queries and monitoring accessible from Python without direct C bindings. The library exposes the NVML API surface—driver version queries, device enumeration, memory info, temperature, power state, and other hardware metrics. It converts C output parameters into Python return values and C structs into Python objects with named attributes. Since its first release in 2012, it has tracked NVML versions through version 13.580, supporting both Python 2 and Python 3 syntax. Use it for: - Query GPU memory usage and availability for resource allocation in ML training or inference pipelines. - Monitor driver version and GPU device names at application startup for compatibility checks. - Build system monitoring dashboards that poll GPU temperature, power draw, or utilization metrics. - Validate GPU availability and count before launching GPU-accelerated workloads. - Implement health checks in containerized environments to detect GPU driver or hardware failures. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python wrapper around NVIDIA's Management Library that exposes GPU monitoring and management functions through a Pythonic interface, converting C library calls to Python methods and error codes to exceptions. Yes. This is a stable, dependency-free wrapper to a critical system library with no known vulnerabilities, active maintenance, and broad adoption (top 5000 PyPI packages). Install it if you need to query or monitor NVIDIA GPUs from Python; the only blocker is requiring NVIDIA drivers and NVML on the target system. ## Install pip install nvidia-ml-py uv add nvidia-ml-py poetry add nvidia-ml-py ## Installing nvidia-ml-py Before you install: Low friction installation as a pure wheel with no runtime dependencies. Actively maintained with a release 74 days ago and production-stable status. License in practice: BSD permissive license allows commercial and private use with minimal restrictions—retain copyright notice and disclaimer in redistributions. Quickstart: pip install nvidia-ml-py from nvidia_ml_py import * nvmlInit() deviceCount = nvmlDeviceGetCount() for i in range(deviceCount): handle = nvmlDeviceGetHandleByIndex(i) print(nvmlDeviceGetName(handle)) nvmlShutdown() Requires NVIDIA GPU drivers and NVML library installed on the system; will fail if neither is present. Verify before relying: - Exact Python version support (documentation mentions 2.5+ with ctypes, but requires_python is unspecified) - Whether ctypes is available in all target Python environments - Compatibility with non-NVIDIA GPUs or virtualized GPU environments ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 21.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags nvidia gpu monitoring python, nvml python bindings, gpu memory info python, nvidia driver version check, gpu device management library, nvidia gpu python wrapper, gpu-monitoring, nvidia-hardware, system-administration [View on SkillFed](https://skillfed.io/packages/nvidia-ml-py) · [View on PyPI](https://pypi.org/project/nvidia-ml-py/)