chore(cli): drop environment variable NVITOP_MONITOR_ALWAYS

Signed-off-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
This commit is contained in:
Xuehai Pan 2022-08-12 22:36:26 +08:00
parent 95ec16dd98
commit a2f7c2425c
2 changed files with 3 additions and 10 deletions

View file

@ -198,7 +198,7 @@ $ nvitop -1 -ov
$ nvitop -1 -c
```
When the `-1` switch is on, the result will be displayed **ONLY ONCE** (same as the default behavior of `nvidia-smi`). This is much faster and has lower resource usage. You can omit the `-1` option by setting the environment variable `NVITOP_MONITOR_ALWAYS=false` to have this behavior by default. See [Command Line Options](#command-line-options-and-environment-variables) for more command options.
When the `-1` switch is on, the result will be displayed **ONLY ONCE** (same as the default behavior of `nvidia-smi`). This is much faster and has lower resource usage. See [Command Line Options](#command-line-options-and-environment-variables) for more command options.
There is also a CLI tool called `nvisel` that ships with the `nvitop` PyPI package. See [CUDA Visible Devices Selection Tool](#cuda-visible-devices-selection-tool) for more information.
@ -344,7 +344,6 @@ process filtering:
| Name | Description | Valid Values | Default Value |
| -------------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------------- | ----------------- |
| `NVITOP_MONITOR_ALWAYS` | Always invoke the monitor mode | `true` / `yes` / `on` / `1`<br>`false` / `no` / `off` / `0` | `true` |
| `NVITOP_MONITOR_MODE` | The default display mode (a comma-separated string) | `auto` / `full` / `compact`<br>`plain` / `colorful`<br>`dark` / `light` | `auto,plain,dark` |
| `NVITOP_GPU_UTILIZATION_THRESHOLDS` | Thresholds of GPU utilization | `10,75` , `1,99`, ... | `10,75` |
| `NVITOP_MEMORY_UTILIZATION_THRESHOLDS` | Thresholds of GPU memory percent | `10,80` , `1,99`, ... | `10,80` |
@ -353,7 +352,6 @@ For example:
```bash
# Replace the following export statements if you are not using Bash / Zsh
export NVITOP_MONITOR_ALWAYS="true"
export NVITOP_MONITOR_MODE="full,light"
# Full monitor mode with light terminal tweaks

View file

@ -8,7 +8,7 @@ import curses
import os
import sys
from nvitop.core import HostProcess, boolify, libnvml
from nvitop.core import HostProcess, libnvml
from nvitop.gui import USERNAME, Device, Top, colored, libcurses, set_color, setlocale_utf8
from nvitop.version import __version__
@ -262,12 +262,7 @@ def main(): # pylint: disable=too-many-branches,too-many-statements,too-many-lo
messages.append('ERROR: Both `--once` and `--monitor` switches are on.')
del args.monitor
if (
not args.once
and not hasattr(args, 'monitor')
and TTY
and boolify(os.getenv('NVITOP_MONITOR_ALWAYS', 'true'), default=True)
):
if not args.once and not hasattr(args, 'monitor') and TTY:
args.monitor = None
if hasattr(args, 'monitor') and not TTY: