From 06821b5f1b5cb14aa3443e305c78d84f3c1bca01 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Wed, 6 Jul 2022 17:25:13 +0800 Subject: [PATCH] docs: add section separators in README.md Signed-off-by: Xuehai Pan --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aba8b74..f2f3ad5 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ An interactive NVIDIA-GPU process viewer, the one-stop solution for GPU process - [Screenshots](#screenshots) - [License](#license) +------ + This project is inspired by [nvidia-htop](https://github.com/peci1/nvidia-htop) and [nvtop](https://github.com/Syllo/nvtop) for monitoring, and [gpustat](https://github.com/wookayin/gpustat) for application integration. [nvidia-htop](https://github.com/peci1/nvidia-htop) is a tool for enriching the output of `nvidia-smi`. It uses regular expressions to read the output of `nvidia-smi` from a subprocess, which is inefficient. In the meanwhile, there is a powerful interactive GPU monitoring tool called [nvtop](https://github.com/Syllo/nvtop). But [nvtop](https://github.com/Syllo/nvtop) is written in *C*, which makes it lack of portability. And what is really inconvenient is that you should compile it yourself during the installation. Therefore, I made this repo. I got a lot help when reading the source code of [ranger](https://github.com/ranger/ranger), the console file manager. Some files in this repo are modified from [ranger](https://github.com/ranger/ranger) under the **GPLv3 License**. @@ -60,6 +62,8 @@ If this repo is useful to you, please star ⭐️ it to let more people know Compare to nvidia-smi.

+------ + ## Features - **Informative and fancy output**: show more information than `nvidia-smi` with colorized fancy box drawing. @@ -91,6 +95,8 @@ If this repo is useful to you, please star ⭐️ it to let more people know (SHELL: PowerShell / TERM: Windows Terminal / OS: Windows 10 / Locale: en-US)

+------ + ## Requirements - Python 3.5+ (with `pip>=10.0`) @@ -122,6 +128,8 @@ Run `bash install-nvidia-driver.sh --help` for more information. * 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 support. +------ + ## Installation Install from PyPI ([![PyPI](https://img.shields.io/pypi/v/nvitop?label=PyPI)](https://pypi.org/project/nvitop) / ![Status](https://img.shields.io/pypi/status/nvitop?label=Status)): @@ -160,6 +168,8 @@ You can specified the version of `nvidia-ml-py` while installing `nvitop` as: pip3 install 'nvitop[pynvml-11.450.51]' # or 'nvitop[cuda10]' ``` +------ + ## Usage ### Device and Process Status @@ -380,6 +390,8 @@ echo 'set -gx NVITOP_MONITOR_MODE "full"' >> ~/.config/fish/config.fish **HINT:** It's recommended to terminate or kill a process in the tree-view screen (shortcut: t). +------ + ### Callback Functions for Machine Learning Frameworks `nvitop` provides two builtin callbacks for [TensorFlow (Keras)](https://www.tensorflow.org) and [PyTorch Lightning](https://pytorchlightning.ai). @@ -416,6 +428,8 @@ trainer = Trainer(gpus=[..], logger=True, callbacks=[gpu_stats]) Please refer to [Resource Metric Collector](#resource-metric-collector) for an example. +------ + ### More than a Monitor `nvitop` can be easily integrated into other applications. You can use `nvitop` to make your own monitoring tools. The full API references host at . @@ -499,6 +513,8 @@ for device in devices: An example monitoring script built with APIs from nvitop.

+------ + #### Status Snapshot `nvitop` provides a helper function to retrieve the status of both GPU devices and GPU processes at once. You can type `help(nvitop.take_snapshots)` in Python REPL for detailed documentation. @@ -572,6 +588,8 @@ SnapshotResult( Please refer to section [Low-level APIs](#low-level-apis) for more information. +------ + #### Resource Metric Collector `ResourceMetricCollector` is a class that collects resource metrics for host, GPUs and processes running on the GPUs. All metrics will be collected in an asynchronous manner. You can type `help(nvitop.ResourceMetricCollector)` in Python REPL for detailed documentation. @@ -706,6 +724,8 @@ df.insert(0, 'time', df['resources/timestamp'].map(datetime.datetime.fromtimesta df.to_csv('results.csv', index=False) ``` +------ + #### Low-level APIs The full API references can be found at . @@ -1013,7 +1033,7 @@ In [45]: host.swap_percent() Out[45]: 0.0 ``` ---- +------ ## Screenshots @@ -1052,6 +1072,8 @@ Environment variable screen (shortcut: e): Environment Screen

+------ + ## License `nvitop` is released under the **GNU General Public License, version 3 (GPLv3)**.