From a2f7c2425cf7f4edecbc1b701dd7ed979f5552fe Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 12 Aug 2022 22:36:26 +0800 Subject: [PATCH] chore(cli): drop environment variable `NVITOP_MONITOR_ALWAYS` Signed-off-by: Xuehai Pan --- README.md | 4 +--- nvitop/cli.py | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ce78b0c..1ad762e 100644 --- a/README.md +++ b/README.md @@ -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`
`false` / `no` / `off` / `0` | `true` | | `NVITOP_MONITOR_MODE` | The default display mode (a comma-separated string) | `auto` / `full` / `compact`
`plain` / `colorful`
`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 diff --git a/nvitop/cli.py b/nvitop/cli.py index 7a79fa6..9f9eeb6 100644 --- a/nvitop/cli.py +++ b/nvitop/cli.py @@ -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: