{"repo":"XuehaiPan/nvitop","free":true,"listed":false,"github":"https://github.com/XuehaiPan/nvitop","clone":"git clone https://github.com/XuehaiPan/nvitop.git","description":"An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management.","language":"Python","stars":7104,"topics":["command-line-tool","console","cuda","curses","gpu","gpu-monitoring","grafana","grafana-dashboard","htop","monitoring","monitoring-tool","nvidia","nvidia-smi","nvml","process-monitoring","prometheus","prometheus-exporter","resource-monitor","top"],"license":"Apache-2.0","category":"dev_tool","readme_excerpt":"# nvitop\n\n<!-- markdownlint-disable html -->\n\n![Python 3.8+](https://img.shields.io/badge/Python-3.8%2B-brightgreen)\n[![PyPI](https://img.shields.io/pypi/v/nvitop?label=pypi&logo=pypi)](https://pypi.org/project/nvitop)\n[![conda-forge](https://img.shields.io/conda/vn/conda-forge/nvitop?label=conda&logo=condaforge)](https://anaconda.org/conda-forge/nvitop)\n[![Documentation Status](https://img.shields.io/readthedocs/nvitop?label=docs&logo=readthedocs)](https://nvitop.readthedocs.io)\n[![Downloads](https://static.pepy.tech/personalized-badge/nvitop?period=total&left_color=gray&right_color=blue&left_text=downloads)](https://pepy.tech/project/nvitop)\n[![GitHub Repo Stars](https://img.shields.io/github/stars/XuehaiPan/nvitop?label=stars&logo=github&color=brightgreen)](https://github.com/XuehaiPan/nvitop/stargazers)\n[![License](https://img.shields.io/github/license/XuehaiPan/nvitop?label=license&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi43NSAyLjc1YS43NS43NSAwIDAwLTEuNSAwVjQuNUg5LjI3NmExLjc1IDEuNzUgMCAwMC0uOTg1LjMwM0w2LjU5NiA1Ljk1N0EuMjUuMjUgMCAwMTY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DE4IDAgMDAyLjU1Ny42MzUgNS40MTggNS40MTggMCAwMDIuNTU3LS42MzVMNC43NSA5LjM2OGwtMi41NTcgNS44M3ptMTQuNTEtLjAyNGMuMDgyLjA0LjE3NC4wODMuMjc1LjEyNi41My4yMjMgMS4zMDUuNDUgMi4yNzIuNDVhNS44NDYgNS44NDYgMCAwMDIuNTQ3LS41NzZMMTkuMjUgOS4zNjdsLTIuNTQ3IDUuODA3eiI+PC9wYXRoPjwvc3ZnPgo=)](#license)\n\nAn interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management. The full API references host at <https://nvitop.readthedocs.io>.\n\n<p align=\"center\">\n  <img width=\"100%\" src=\"https://user-images.githubusercontent.com/16078332/171005261-1aad126e-dc27-4ed3-a89b-7f9c1c998bf7.png\" alt=\"Monitor\">\n  <br/>\n  Monitor mode of <code>nvitop</code>.\n  <br/>\n  (TERM: GNOME Terminal / OS: Ubuntu 16.04 LTS (over SSH) / Locale: <code>en_US.UTF-8</code>)\n</p>\n\n<p align=\"center\">\n  <a href=\"./nvitop-exporter\">\n    <img width=\"100%\" src=\"https://github.com/user-attachments/assets/e4867e64-2ca9-45bc-b524-929053f9673d\" alt=\"Grafana Dashboard\">\n  </a>\n  <br/>\n  A Grafana dashboard built on top of <code>nvitop-exporter</code>.\n</p>\n\n### Table of Contents  <!-- omit in toc --> <!-- markdownlint-disable heading-increment -->\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Device and Process Status](#device-and-process-status)\n  - [Resource Monitor](#resource-monitor)\n    - [For Docker Users](#for-docker-users)\n    - [For SSH Users](#for-ssh-users)\n    - [Command Line Options and Environment Variables](#command-line-options-and-environment-variables)\n    - [Keybindings for Monitor Mode](#keybindings-for-monitor-mode)\n  - [CUDA Visible Devices Selection Tool](#cuda-visible-devices-selection-tool)\n  - [More than a Monitor](#more-than-a-monitor)\n    - [Quick Start](#quick-start)\n    - [Status Snapshot](#status-snapshot)\n    - [Resource Metric Collector](#resource-metric-collector)\n    - [Low-level APIs](#low-level-apis)\n      - [Device](#device)\n      - [Process](#process)\n      - [Host (inherited from psutil)](#host-inherited-from-psutil)\n- [Screenshots](#screenshots)\n- [Changelog](#changelog)\n- [License](#license)\n  - [Copyright Notice](#copyright-notice)\n\n------\n\n`nvitop` is an interactive NVIDIA device and process monitoring tool. It has a colorful and informative interface that continuously updates the status of the devices and processes. As a resource monitor, it includes many features and options, such as tree-view, environment variable viewing, process filtering, process metrics monitoring, etc. Beyond that, the package also ships a [CUDA device selection tool `nvisel`](#cuda-visible-devices-selection-tool) for deep learning researchers. It also provides handy APIs that allow developers to write their own monitoring tools. Please refer to section [More than a Monitor](#more-than-a-monitor) and the full API references at <https://nvitop.readthedocs.io> for more information.\n\n<p align=\"center\">\n  <img width=\"100%\" src=\"https://user-images.githubusercontent.com/16078332/202362811-34f2c01d-97c8-49d2-b19b-0d7da648f2d5.png\" alt=\"Filter\">\n  <br/>\n  Process filtering and a more colorful interface.\n</p>\n\n<p align=\"center\">\n  <img width=\"100%\" src=\"https://user-images.githubusercontent.com/16078332/202362686-859bf4ad-6237-46ca-b2f7-f547d2f63213.png\" alt=\"Comparison\">\n  <br/>\n  Compare to <code>nvidia-smi</code>.\n</p>\n\n------\n\n## Features\n\n- **Informative and fancy output**: show more information than `nvidia-smi` with colorized fancy box drawing.\n- **Monitor mode**: can run as a resource monitor, rather than print the results only once.\n  - bar charts and history graphs\n  - process sorting\n  - process filtering\n  - send signals to processes with a keystroke\n  - tree-view screen for GPU processes and their parent processes\n  - environment variable screen\n  - help screen\n  - mouse support\n- **Interactive**: responsive for user input (from keyboard and/or mouse) in monitor mode. (vs. [gpustat](https://github.com/wookayin/gpustat) & [py3nvml](https://github.com/fbcotter/py3nvml))\n- **Efficient**:\n  - query device status using [*NVML Python bindings*](https://pypi.org/project/nvidia-ml-py) directly, instead of parsing the output of `nvidia-smi`. (vs. [nvidia-htop](https://github.com/peci1/nvidia-htop))\n  - support sparse query and cache results with `TTLCache` from [cachetools](https://github.com/tkem/cachetools). (vs. [gpustat](https://github.com/wookayin/gpustat))\n  - display information using the `curses` library rather than `print` with ANSI escape codes. (vs. [py3nvml](https://github.com/fbcotter/py3nvml))\n  - asynchronously gather information using multi-threading and correspond to user input much faster. (vs. [nvtop](https://github.com/Syllo/nvtop))\n- **Portable**: work on both Linux and Windows.\n  - get host process information using the cross-platform library [psutil](https://github.com/giampaolo/psutil) instead of calling `ps -p <pid>` in a subprocess. (vs. [nvidia-htop](https://github.com/peci1/nvidia-htop) & [py3nvml](https://github.com/fbcotter/py3nvml))\n  - written in pure Python, easy to install with `pip`. (vs. [nvtop](https://github.com/Syllo/nvtop))\n- **Integrable**: easy to integrate into other applications, more than monitoring. (vs. [nvidia-htop](https://github.com/peci1/nvidia-htop) & [nvtop](https://github.com/Syllo/nvtop))\n\n<p align=\"center\">\n  <img width=\"100%\" src=\"https://user-images.githubusercontent.com/16078332/129374533-fe06c01a-630d-4994-b54b-821cccd0d33c.png\" alt=\"Windows\">\n  <br/>\n  <code>nvitop</code> supports Windows!\n  <br/>\n  (SHELL: PowerShell / TERM: Windows Terminal / OS: Windows 10 / Locale: <code>en-US</code>)\n</p>\n\n------\n\n## Requirements\n\n- Python 3.8+\n- NVIDIA Management Library (NVML)\n- nvidia-ml-py\n- psutil\n- curses<sup>[*](#curses)</sup> (with `libncursesw`)\n\n**NOTE:** The [NVIDIA Management Library (*NVML*)](https://developer.nvidia.com/nvidia-management-library-nvml) is a C-based programmatic interface for monitoring and managing various states. The runtime version of the NVML library ships with the NVIDIA display driver (available at [Download Drivers | NVIDIA](https://www.nvidia.com/Download/index.aspx)), or can be downloaded as part of the NVIDIA CUDA Toolkit (available at [CUDA Toolkit | NVIDIA Developer](https://developer.nvidia.com/cuda-downloads)). The lists of OS platforms and NVIDIA-GPUs supported by the NVML library can be found in the [NVML API Reference](https://docs.nvidia.com/deploy/nvml-api/nvml-api-reference.html).\n\nThis repository contains a Bash script to install/upgrade the NVIDIA drivers for Ubuntu Linux. For example:\n\n```bash\ngit clone --depth=1 https://github.com/XuehaiPan/nvitop.git && cd nvitop\n\n# Change to tty3 console (required for desktop users with GUI (tty2))\n# Optional for SSH users\nsudo chvt 3  # or use keyboard shortcut: Ctrl-LeftAlt-F3\n\nbash install-nvidia-driver.sh --package=nvidia-driver-595  # install the R595 driver from ppa:graphics-drivers\nbash install-nvidia-driver.sh --latest                     # install the latest driver from ppa:graphics-drivers\nbash install-nvidia-driver.sh --latest --open              # install the latest open-kernel-module driver\n```\n\n<p align=\"center\">\n  <img width=\"100%\" src=\"https://user-images.githubusercontent.com/16078332/174480112-e9a35edc-8f42-438e-a103-1d0ce998b381.png\" alt=\"install-nvidia-driver\">\n  <br/>\n  NVIDIA driver installer for Ubuntu Linux.\n</p>\n\nRun `bash install-nvidia-driver.sh --help` for more information.\n\n<a name=\"curses\">*</a> The `curses` library is a built-in module of Python on Unix-like systems, and it is supported by a third-party package called `windows-curses` on Windows using PDCurses. Inconsistent behavior of `nvitop` may occur on different terminal emulators on Windows, such as missing mouse suppor","default_branch":"main","files":137,"tree":[".dockerignore",".editorconfig",".gitattributes",".github/FUNDING.yml",".github/ISSUE_TEMPLATE/bug-report.yaml",".github/ISSUE_TEMPLATE/config.yaml",".github/ISSUE_TEMPLATE/feature-request.yaml",".github/ISSUE_TEMPLATE/questions.yaml",".github/PULL_REQUEST_TEMPLATE.md",".github/dependabot.yml",".github/workflows/build.yaml",".github/workflows/docker.yaml",".github/workflows/lint.yaml",".gitignore",".pre-commit-config.yaml",".readthedocs.yaml","CHANGELOG.md","CODE_OF_CONDUCT.md","COPYING","Dockerfile","LICENSE","README.md","docs/Makefile","docs/README.md","docs/make.bat","docs/requirements.txt","docs/source/_static/.gitkeep","docs/source/_static/style.css","docs/source/_templates/.gitkeep","docs/source/api/caching.rst","docs/source/api/collector.rst","docs/source/api/device.rst","docs/source/api/host.rst","docs/source/api/libcuda.rst","docs/source/api/libcudart.rst","docs/source/api/libnvml.rst","docs/source/api/process.rst","docs/source/api/utils.rst","docs/source/conf.py","docs/source/fix-psutil-docstring.sh","docs/source/index.rst","docs/source/select.rst","docs/source/spelling_wordlist.txt","examples/README.md","examples/collector-background/README.md","examples/collector-background/collector_background.py","examples/collector-csv/README.md","examples/collector-csv/collector_csv.py","examples/collector-csv/requirements.txt","examples/collector-tensorboard/README.md","examples/collector-tensorboard/collector_tensorboard.py","examples/collector-tensorboard/requirements.txt","examples/ml-framework-callbacks/README.md","examples/ml-framework-callbacks/keras.py","examples/ml-framework-callbacks/lightning.py","examples/ml-framework-callbacks/requirements-keras.txt","examples/ml-framework-callbacks/requirements-lightning.txt","examples/ml-framework-callbacks/requirements-tensorboard.txt","examples/ml-framework-callbacks/tensorboard.py","examples/monitor-colored/README.md","examples/monitor-colored/monitor_colored.py","examples/monitor-minimal/README.md","examples/monitor-minimal/monitor_minimal.py","examples/monitor-web/README.md","examples/monitor-web/monitor_web.html","examples/monitor-web/monitor_web.py","examples/select-devices-api/README.md","examples/select-devices-api/select_devices_api.py","examples/take-snapshots/README.md","examples/take-snapshots/take_snapshots_demo.py","install-nvidia-driver.sh","nvitop-exporter/Dockerfile","nvitop-exporter/LICENSE","nvitop-exporter/README.md","nvitop-exporter/grafana/Dockerfile","nvitop-exporter/grafana/dashboard.json","nvitop-exporter/grafana/dashboard.yml","nvitop-exporter/grafana/datasource.yml","nvitop-exporter/grafana/docker-compose.yml","nvitop-exporter/grafana/prometheus.yml","nvitop-exporter/nvitop_exporter/__init__.py","nvitop-exporter/nvitop_exporter/__main__.py","nvitop-exporter/nvitop_exporter/cli.py","nvitop-exporter/nvitop_exporter/exporter.py","nvitop-exporter/nvitop_exporter/utils.py","nvitop-exporter/nvitop_exporter/version.py","nvitop-exporter/pyproject.toml","nvitop-exporter/requirements.txt","nvitop-exporter/setup.py","nvitop/__init__.py","nvitop/__main__.py","nvitop/api/LICENSE","nvitop/api/__init__.py","nvitop/api/caching.py","nvitop/api/collector.py","nvitop/api/device.py","nvitop/api/host.py","nvitop/api/libcuda.py","nvitop/api/libcudart.py","nvitop/api/libnvml.py","nvitop/api/process.py","nvitop/api/termcolor.py","nvitop/api/utils.py","nvitop/cli.py","nvitop/select.py","nvitop/tui/COPYING","nvitop/tui/__init__.py","nvitop/tui/library/__init__.py","nvitop/tui/library/device.py","nvitop/tui/library/displayable.py","nvitop/tui/library/history.py","nvitop/tui/library/host.py","nvitop/tui/library/keybinding.py","nvitop/tui/library/libcurses.py","nvitop/tui/library/messagebox.py","nvitop/tui/library/mouse.py","nvitop/tui/library/process.py","nvitop/tui/library/selection.py","nvitop/tui/library/utils.py","nvitop/tui/library/widestring.py","nvitop/tui/screens/__init__.py","nvitop/tui/screens/base.py","nvitop/tui/screens/environ.py","nvitop/tui/screens/help.py","nvitop/tui/screens/main/__init__.py","nvitop/tui/screens/main/panels/__init__.py","nvitop/tui/screens/main/panels/base.py","nvitop/tui/screens/main/panels/device.py","nvitop/tui/screens/main/panels/host.py","nvitop/tui/screens/main/panels/process.py","nvitop/tui/screens/metrics.py","nvitop/tui/screens/treeview.py","nvitop/tui/tui.py","nvitop/version.py","pyproject.toml","requirements.txt","setup.py"],"storefront":"/r/XuehaiPan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/XuehaiPan/nvitop/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}