skillfed

GPUtil

GPUtil is a Python module for getting the GPU status from NVIDA GPUs using nvidia-smi.

gputil v1.4.0 742.5K downloads/30d#5,180 on PyPI1,214
Permissive license MIT Active released

What it is and what it does

GPUtil is a thin Python wrapper around nvidia-smi that detects available NVIDIA GPUs and ranks them by current load and memory consumption. It was designed to help deep learning frameworks automatically select idle GPUs, but works for any task needing GPU availability data. The module has no external dependencies beyond Python's standard library, making it lightweight to install—but it only works on systems with NVIDIA hardware and drivers installed.

The package provides two main functions: getAvailable() returns a filtered, ordered list of GPU device IDs based on load and memory thresholds, and getFirstAvailable() blocks until a GPU meeting those criteria becomes available, with configurable retry logic. It also includes utility functions to display current GPU status. Since its last release in 2018, the package has not been updated despite ongoing repository activity, which may affect compatibility with newer NVIDIA driver versions or Python releases.

Use it for:

  • Automatically select an idle GPU before launching a deep learning training job to avoid resource conflicts.
  • Monitor GPU utilization in a separate thread and log or alert when specific GPUs exceed load or memory thresholds.
  • Implement a queue system that waits for a GPU to become available before starting a compute task, with configurable retry intervals.
  • Rank multiple GPUs by current memory usage to assign workloads to the least-loaded device.
  • Exclude specific GPUs from selection (by ID or UUID) to reserve them for other processes or tasks.

Worth the install?

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

GPUtil queries NVIDIA GPU status and availability by wrapping nvidia-smi, returning ordered lists of GPUs filtered by current load and memory usage.

Yes, if you have NVIDIA hardware and need lightweight GPU availability detection. The package is stable, has no external dependencies, and works well for its narrow purpose. However, be cautious: it has not been updated since 2018, so compatibility with very recent NVIDIA drivers or Python versions is unverified. For production systems or modern deep learning frameworks, verify first that it works with your specific CUDA and driver versions.

Install

gputil on PyPI

pip

pip install gputil

uv

uv add gputil

poetry

poetry add gputil

Installing GPUtil

Before you install

No runtime dependencies beyond Python standard library, but requires an NVIDIA GPU with nvidia-smi installed on the system. Package has been inactive since 2018 (latest release 2018-12-18) despite recent repository activity, which may indicate maintenance gaps for newer CUDA/driver versions.

License in practice

MIT license is permissive; you can use, modify, and distribute GPUtil with minimal restrictions, provided you retain the license notice.

Quickstart

pip install gputil

import GPUtil
deviceIDs = GPUtil.getAvailable(order='first', limit=1, maxLoad=0.5, maxMemory=0.5)
print(deviceIDs)

Requires NVIDIA GPU with nvidia-smi installed and accessible in PATH; will fail on non-NVIDIA systems or without proper NVIDIA drivers.

Verify before relying

  • Compatibility with modern CUDA versions and recent NVIDIA driver releases (last package release was 2018).
  • Whether the package works reliably on current Python versions beyond 3.5 (tested version noted in description).
  • Support status for multi-GPU selection patterns in contemporary deep learning frameworks.

Package facts

License MIT (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance actively maintained — 2,796 days since the last release
Last repo commit
First released
Downloads 742,526/month — #5,180 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: GPUtil-1.4.0.tar.gz

Keywords: gpu, utilization, load, memory, available, usage, free, select, nvidia

Tags

nvidia gpu status querygpu availability selectiongpu memory load monitoringselect available gpunvidia-smi wrapper pythongpu utilization checkdeep learning gpu picker
gpu-selectionnvidia-smi-wrapperhardware-monitoring

More Monitoring packages