nvtop README

The project's README from github.com/Syllo/nvtop. As one markdown file: README.md.

NVTOP

What is NVTOP?

NVTOP stands for Neat Videocard TOP, a (h)top like task monitor for GPUs and accelerators. It can handle multiple GPUs and print information about them in a htop-familiar way.

Currently supported vendors are AMD (Linux amdgpu driver), Apple (limited M1 & M2 support), Huawei (Ascend), Intel (Linux i915/Xe drivers), NVIDIA (Linux proprietary divers), Qualcomm Adreno (Linux MSM driver), Broadcom VideoCore (Linux v3d driver), Rockchip, MetaX (MXSML driver), Enflame (Linux EFML driver), Tenstorrent (Linux tt-kmd driver). Rockchip, MetaX (MXSML driver), Enflame (Linux EFML driver), Iluvatar CoreX (ixML / libixml).

Because a picture is worth a thousand words:

NVTOP interface

Table of Contents

NVTOP Options and Interactive Commands

Interactive Setup Window

NVTOP has a builtin setup utility that provides a way to specialize the interface to your needs. Simply press F2 and select the options that are the best for you.

In the Chart section you can choose which metrics are plotted, including GPU and memory utilization, temperature, power, clocks, and the PCIe RX / TX load (the receive and transmit throughput as a percentage of the maximum link bandwidth).

NVTOP Setup Window

Saving Preferences

You can save the preferences set in the setup window by pressing F12. The preferences will be loaded the next time you run nvtop.

NVTOP Manual and Command line Options

NVTOP comes with a manpage!

man nvtop

For quick command line arguments help

nvtop -h
nvtop --help

GPU Support

AMD

NVTOP supports AMD GPUs using the amdgpu driver and the legacy radeon driver (legacy GPUs, limited support) through the exposed DRM and sysfs interface.

The radeon provides limited metrics compared to amdgpu.

AMD introduced the fdinfo interface in kernel 5.14 (browse kernel source). Hence, you will need a kernel with a version greater or equal to 5.14 to see the processes using AMD GPUs.

Support for recent GPUs are regularly mainlined into the linux kernel, so please use a recent-enough kernel for your GPU.

Intel

NVTOP supports Intel GPUs using the i915 or xe linux driver.

Intel introduced the fdinfo interface in kernel 5.19 (browse kernel source). Hence, you will need a kernel with a version greater or equal to 5.19 to see the processes using Intel GPUs.

Intel requires CAP_PERFMON or CAP_SYS_ADMIN capabilities to access the total memory usage, you can run sudo setcap cap_perfmon=ep nvtop to grant the necessary permissions or run nvtop as root.

NVIDIA

The NVML library does not support some of the queries for GPUs coming before the Kepler microarchitecture. Anything starting at GeForce 600, GeForce 800M and successor should work fine. For more information about supported GPUs please take a look at the NVML documentation.

Adreno

NVTOP supports Adreno GPUs using the msm linux driver.

msm introduced the fdinfo interface in kernel 6.0 (browse kernel source). Hence, you will need a kernel with a version greater or equal to 6.0 to see the processes using Adreno GPUs.

Apple

NVTOP includes some initial support for Apple using Metal. This is only supported when building for Apple, and when building for Apple only this vendor is supported.

APPLE SUPPORT STATUS

Ascend

NVTOP supports Ascend (testing on Altas 800 (910B)) by DCMI API (version 6.0.0).

Currently, the DCMI only supports limited APIs, missing PCIe generation, tx/rx throughput info, max power draw etc.

Iluvatar CoreX

NVTOP supports Iluvatar CoreX GPUs through the ixML library.

The backend dynamically loads libixml.so from /usr/local/corex/lib, /usr/local/corex/lib64, or the default dynamic loader search path. The ixML runtime exposes an NVML-compatible API surface used by NVTOP to query device, power, PCIe, clock, temperature, memory, and process information.

VideoCore

NVTOP supports VideoCore (testing on raspberrypi 4B).

Supports GPU frequency, temperature, utilization, per-process utilization, GPU memory usage, and H264 decoding utilization.

On non-raspberry pi os, you need to use the linux-rpi 6.12.y kernel and above, and ensure the presence of the /dev/vcio device.

Rockchip

NVTOP supports Rockchip (testing on orangepi 5 plus).

Supports NPU frequency, temperature, utilization.

MetaX

NVTOP supports MetaX (testing on MXC500) by MXSML LIBRARY.

For more information about GPUs please take a look at the METAX documentation

Enflame

NVTOP supports Enflame GCUs (testing on Enflame S60, Enflame L300 and Enflame L600) by EFML LIBRARY

GCU, which refers to General Compute Unit, is a type of accelerator card that is used to perform general-purpose computing tasks just like GPGPU.

Tenstorrent

NVTOP supports Tenstorrent AI accelerators (Blackhole, Wormhole, Grayskull) through the tt-kmd kernel driver.

Supports temperature, power draw, AI clock, fan RPM, PCIe link info, and process listing. No external libraries required -- all data is read from sysfs, hwmon, and procfs.

Build

Several libraries are required in order for NVTOP to display GPU info:

Distribution Specific Installation Process

Ubuntu / Debian

If your distribution provides the snap utility, follow the snap installation process to obtain an up-to-date version of nvtop.

A standalone application is available as AppImage.

Ubuntu Focal (20.04), Debian buster (stable) and more recent

sudo apt install nvtop

Ubuntu PPA

A PPA supporting Ubuntu 20.04 and newer is provided by Quentin Lienhardt that offers an up-to-date version of nvtop, enabled for NVIDIA, AMD and Intel.

sudo add-apt-repository ppa:quentiumyt/nvtop
sudo apt install nvtop

Older

Fedora / Red Hat / CentOS

A standalone application is available as AppImage.

Fedora 36 and newer

Red Hat Enterprise Linux 8 and 9

CentOS Stream, Rocky Linux, AlmaLinux

Build process for Fedora / Red Hat / CentOS:

OpenSUSE

A standalone application is available as an AppImage.

Build process for OpenSUSE:

Arch Linux

Gentoo

AppImage

An AppImage is a standalone application. Just download the AppImage, make it executable and run it!

If you are curious how that works, please visit the AppImage website.

Snap

Notice: The connect commands allow

Conda-forge

A conda-forge feedstock for nvtop is available.

conda / mamba / miniforge

conda install --channel conda-forge nvtop

pixi

pixi global install nvtop

Docker

WSL2

Nvtop support in WSL2 mostly boils down to GPU/Accelerator vendor support of WSL2. Nvtop should work out of the box for the following configurations:

NVTOP Build

git clone https://github.com/Syllo/nvtop.git
mkdir -p nvtop/build && cd nvtop/build
cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON
make

# Install globally on the system
sudo make install

# Alternatively, install without privileges at a location of your choosing
# cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON -DCMAKE_INSTALL_PREFIX=/path/to/your/dir
# make
# make install

If you use conda as environment manager and encounter an error while building NVTOP, try conda deactivate before invoking cmake.

The build system supports multiple build types (e.g. -DCMAKE_BUILD_TYPE=RelWithDebInfo):

Troubleshoot

License

NVTOP is licensed under the GPLv3 license or any later version. You will find a copy of the license inside the COPYING file of the repository or at the GNU website <www.gnu.org/licenses/>.

nvtop (Syllo/nvtop)

Searching Database…

11.1K ·GitHub
这是干什么的?NVTOP(Neat Videocard TOP)是一个类似 htop 的 GPU 和加速卡监控工具:它在终端里运行,可以同时管理多块 GPU,并显示每块设备的运行情况,包括哪些进程正在使用它。
它是图形界面程序还是终端工具?是一个终端工具:它用 ncurses 绘制类似 htop 的界面,带有交互式设置窗口(F2),并附带了说明命令行选项的 man 手册页。
除了它本身还需要什么?需要你 GPU 厂商的驱动——nvtop 通过驱动自带的管理库读取设备信息(NVIDIA 用 NVML,AMD 用 libdrm),界面部分则依赖 ncurses。如果要从源码编译,还需要 CMake 和 Git。
内核或权限方面有什么坑?按进程查看统计信息需要较新的内核:AMD 需要 5.14+,Intel 需要 5.19+,Adreno 需要 6.0+。在 Intel 上,查看总内存占用需要 CAP_PERFMON 权限(用 setcap 设置或以 root 运行)。NVIDIA 支持从 Kepler(GeForce 600)开始。
它能监控哪些 GPU 和加速卡?AMD(amdgpu 和老款 radeon)、Intel(i915/Xe)、NVIDIA(GeForce 600 及以上)、高通 Adreno、华为昇腾(Ascend)、Apple M1/M2、博通 VideoCore、瑞芯微 NPU,以及摩尔线程(MetaX)、燧原(Enflame)、天数(Tenstorrent)和天数智芯(Iluvatar CoreX)的加速卡。
每块 GPU 能看到哪些指标?利用率、显存占用、温度、功耗、频率和 PCIe 收发吞吐量,还会列出当前正在使用这块 GPU 的进程。哪些指标画成图表,可以在图表设置里自己选。
界面可以自定义吗?可以——按 F2 打开内置的设置窗口,选择要显示哪些指标和区块,然后按 F12 保存这些偏好,下次启动时会自动加载。
在 Apple Silicon 的 Mac 上能用吗?通过 Metal 对 M1 和 M2 提供了初步支持,但仍在开发中,可能会有一些 bug。Mac 版本只支持 Apple 的 GPU;其他厂商的设备需要 Linux 版本。
能在 WSL2 里运行吗?可以,前提是 GPU 厂商支持 WSL2——只要 Windows 正确暴露了驱动,NVIDIA 开箱即用。不要在 WSL2 里安装 NVIDIA 的 Linux 驱动,否则可能出现版本不匹配,nvtop 会悄悄无法工作。
What are similar projects?btop, g-helper, goaccess, lsoff, bottom, nvitop, nnn, bpytop
Creator
Syllo
Size
1.3 MB
Stars
11.1K
Age
9y
Commits · 90 Days