{"id":6403,"library":"nvitop","title":"nvitop - Interactive NVIDIA GPU Process Viewer","description":"nvitop is an interactive NVIDIA GPU device and process monitoring tool written in Python. It provides a colorful and informative interface that continuously updates the status of GPUs and processes, offering more details and interactivity than the default `nvidia-smi`. Beyond its CLI, it exposes a comprehensive Python API for custom monitoring and integrates with tools like Grafana via `nvitop-exporter`. The current version is 1.6.2, with a regular release cadence addressing new `nvidia-ml-py` versions, features, and bug fixes.","status":"active","version":"1.6.2","language":"en","source_language":"en","source_url":"https://github.com/XuehaiPan/nvitop","tags":["gpu-monitoring","nvidia","cli-tool","system-management","nvml","cuda","process-viewer","interactive","exporter"],"install":[{"cmd":"pip install nvitop","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install 'nvitop[cudaXX]' # Replace XX with your CUDA major version (e.g., cuda11, cuda12)","lang":"bash","label":"Install with specific nvidia-ml-py version"}],"dependencies":[{"reason":"Requires Python 3.8 or newer for core functionality.","package":"python","optional":false},{"reason":"Core dependency for interacting with NVIDIA GPUs via NVML. Specific versions are handled by 'nvitop[cudaXX]' extras.","package":"nvidia-ml-py","optional":false},{"reason":"Required for TUI functionality on Windows operating systems.","package":"windows-curses","optional":true}],"imports":[{"symbol":"Device","correct":"from nvitop import Device"},{"symbol":"HostProcess","correct":"from nvitop.process import HostProcess"},{"symbol":"take_snapshots","correct":"from nvitop import take_snapshots"},{"symbol":"select_devices","correct":"from nvitop import select_devices"}],"quickstart":{"code":"import os\nfrom nvitop import Device, take_snapshots\n\n# It's recommended to set CUDA_DEVICE_ORDER for consistent device indexing\nos.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'\n\nprint(\"--- Device Overview ---\")\ndevices = Device.all()\nif not devices:\n    print(\"No NVIDIA GPUs found or NVML not initialized.\")\nelse:\n    for device in devices:\n        print(f\"Device {device.index}: {device.name()}\")\n        print(f\"  - Fan speed: {device.fan_speed() if device.fan_speed() is not None else 'N/A'}%\")\n        print(f\"  - Temperature: {device.temperature()}C\")\n        print(f\"  - GPU Utilization: {device.gpu_utilization()}% (SM), {device.memory_utilization()}% (Memory)\")\n        print(f\"  - Total Memory: {device.total_memory_human()}\")\n\nprint(\"\\n--- Running GPU Processes ---\")\nsnapshots = take_snapshots()\nif not snapshots.gpu_processes:\n    print(\"No GPU processes found.\")\nelse:\n    for gpu_process in snapshots.gpu_processes:\n        print(f\"PID: {gpu_process.pid}, Name: {gpu_process.name()}, GPU: {gpu_process.device.index}, Mem: {gpu_process.gpu_memory_human()}\")\n","lang":"python","description":"This quickstart script demonstrates how to get an overview of your NVIDIA GPUs and list the processes currently utilizing them using nvitop's Python API. It fetches device details like temperature, utilization, and memory, then lists active GPU processes with their respective memory usage."},"warnings":[{"fix":"Upgrade Python to version 3.8 or higher.","message":"Python 3.7 support was officially dropped in nvitop v1.5.0. Users on Python 3.7 or older must upgrade their Python environment to at least 3.8 to use nvitop v1.5.0 or newer.","severity":"breaking","affected_versions":">=1.5.0"},{"fix":"Refactor code to use nvitop's core API directly or explore other integration patterns for machine learning frameworks.","message":"The `nvitop.callbacks` module was officially deprecated in v1.5.0 and is now unmaintained. Users relying on these callbacks should migrate to alternative integration methods or the core API.","severity":"deprecated","affected_versions":">=1.5.0"},{"fix":"Update installation commands to use `pip install 'nvitop[cudaXX]'` syntax for specific NVIDIA driver compatibility.","message":"The recommended way to install `nvidia-ml-py` with `nvitop` changed in v1.5.3. Instead of using per-version install extras like `nvitop[nvml-11.450.129]`, users should now use `nvitop[cudaXX]` where `XX` is the major CUDA version (e.g., `nvitop[cuda11]`).","severity":"gotcha","affected_versions":">=1.5.3"},{"fix":"Ensure that a compatible NVIDIA display driver (or CUDA Toolkit) is installed and that the NVML library is accessible on your system.","message":"nvitop relies on the NVIDIA Management Library (NVML), which is part of the NVIDIA display driver or CUDA Toolkit. Without a properly installed and functional NVIDIA driver, nvitop will not be able to detect GPUs or collect metrics.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install `windows-curses` via `pip install windows-curses`. For best TUI experience on Windows, consider using a compatible terminal emulator.","message":"On Windows, the TUI (Terminal User Interface) features of nvitop require the `windows-curses` package. Inconsistent behavior may occur on different terminal emulators, such as missing mouse support, even with the package installed.","severity":"gotcha","affected_versions":"All versions on Windows"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}