{"id":4959,"library":"gputil","title":"GPUtil","description":"GPUtil is a Python module designed to query the status of NVIDIA GPUs using the `nvidia-smi` command-line utility. It provides access to metrics like GPU load, memory usage, temperature, and UUID. The current version is 1.4.0, and releases occur intermittently, focusing on bug fixes, expanded platform support (e.g., Windows), and new features.","status":"active","version":"1.4.0","language":"en","source_language":"en","source_url":"https://github.com/anderskm/gputil","tags":["gpu","nvidia","monitoring","system-information","hardware"],"install":[{"cmd":"pip install GPUtil","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The library name on PyPI is `GPUtil`, and the module itself is typically imported directly as `GPUtil`.","wrong":"from gputil import GPUtil","symbol":"GPUtil","correct":"import GPUtil"},{"note":"Accessed directly from the imported GPUtil module.","symbol":"getGPUs","correct":"GPUtil.getGPUs()"}],"quickstart":{"code":"import GPUtil\n\ntry:\n    gpus = GPUtil.getGPUs()\n    if not gpus:\n        print(\"No NVIDIA GPUs found or nvidia-smi is not in PATH.\")\n    for i, gpu in enumerate(gpus):\n        print(f\"--- GPU {i} ---\")\n        print(f\"  Name: {gpu.name}\")\n        print(f\"  Load: {gpu.load * 100:.2f}%\")\n        print(f\"  Memory Total: {gpu.memoryTotal} MB\")\n        print(f\"  Memory Used: {gpu.memoryUsed} MB\")\n        print(f\"  Memory Free: {gpu.memoryFree} MB\")\n        print(f\"  Temperature: {gpu.temperature} °C\")\n        print(f\"  UUID: {gpu.uuid}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure NVIDIA drivers are installed and nvidia-smi is accessible in your system's PATH.\")","lang":"python","description":"This quickstart demonstrates how to import GPUtil and retrieve information for all available NVIDIA GPUs. It iterates through each GPU, printing key metrics like name, load, memory usage, temperature, and UUID. It includes basic error handling for when `nvidia-smi` is not found."},"warnings":[{"fix":"Update your import statements from `import GPUstats` to `import GPUtil` and adjust any module-specific references accordingly. Ensure your `pip install` command is `pip install GPUtil`.","message":"The project was renamed from `GPUstats` to `GPUtil` in version 1.2.0. Code using `import GPUstats` or other `GPUstats` specific imports will break.","severity":"breaking","affected_versions":"< 1.2.0"},{"fix":"Install the appropriate NVIDIA display drivers for your GPU. Verify `nvidia-smi` is callable from your terminal. If not, add its installation directory (e.g., `C:\\Program Files\\NVIDIA Corporation\\NVSMI` on Windows or `/usr/bin` on Linux) to your system's PATH.","message":"GPUtil relies on the NVIDIA System Management Interface (`nvidia-smi`) executable. This utility must be installed as part of your NVIDIA display driver package and be accessible within your system's PATH environment variable.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to GPUtil version 1.4.0 or newer to access GPU temperature information and improved compatibility on Windows: `pip install --upgrade GPUtil`.","message":"GPU temperature reporting and robust Windows support were significantly improved and added in version 1.4.0. Users on older versions will not have access to the `gpu.temperature` attribute or may experience issues on Windows.","severity":"gotcha","affected_versions":"< 1.4.0"},{"fix":"If using Python 2.x, ensure you are on GPUtil version 1.2.3 or newer. Alternatively, upgrade to Python 3.x, where this issue was not present.","message":"For Python 2.x users, versions of GPUtil prior to 1.2.3 had a bug that caused GPU memory utilization to always show as 0% due to integer division issues. This bug was not present in Python 3.x.","severity":"gotcha","affected_versions":"Python 2.x versions < 1.2.3"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}