mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-21 06:45:24 -06:00
docs: add section separators in README.md
Signed-off-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
This commit is contained in:
parent
2d2b16acc3
commit
06821b5f1b
1 changed files with 23 additions and 1 deletions
24
README.md
24
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 <code>nvidia-smi</code>.
|
||||
</p>
|
||||
|
||||
------
|
||||
|
||||
## 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: <code>en-US</code>)
|
||||
</p>
|
||||
|
||||
------
|
||||
|
||||
## Requirements
|
||||
|
||||
- Python 3.5+ (with `pip>=10.0`)
|
||||
|
|
@ -122,6 +128,8 @@ Run `bash install-nvidia-driver.sh --help` for more information.
|
|||
|
||||
<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 support.
|
||||
|
||||
------
|
||||
|
||||
## Installation
|
||||
|
||||
Install from PyPI ([](https://pypi.org/project/nvitop) / ):
|
||||
|
|
@ -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: <kbd>t</kbd>).
|
||||
|
||||
------
|
||||
|
||||
### 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 <https://nvitop.readthedocs.io>.
|
||||
|
|
@ -499,6 +513,8 @@ for device in devices:
|
|||
An example monitoring script built with APIs from <code>nvitop</code>.
|
||||
</p>
|
||||
|
||||
------
|
||||
|
||||
#### 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 <https://nvitop.readthedocs.io>.
|
||||
|
|
@ -1013,7 +1033,7 @@ In [45]: host.swap_percent()
|
|||
Out[45]: 0.0
|
||||
```
|
||||
|
||||
---
|
||||
------
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
|
@ -1052,6 +1072,8 @@ Environment variable screen (shortcut: <kbd>e</kbd>):
|
|||
<img width="100%" src="https://user-images.githubusercontent.com/16078332/123914881-7a0cd700-d9b2-11eb-8da1-26f7a3a7c2b6.png" alt="Environment Screen">
|
||||
</p>
|
||||
|
||||
------
|
||||
|
||||
## License
|
||||
|
||||
`nvitop` is released under the **GNU General Public License, version 3 (GPLv3)**.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue