[GH-ISSUE #3] Rendering issues caused by locale settings #3

Closed
opened 2026-05-05 03:21:14 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @ninjaaron87 on GitHub (Jul 17, 2021).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/3

Runtime Environment

  • Operating system and version: Arch Linux x86_64
  • Terminal emulator and version: Alacritty 0.8.0 (a1b13e68)
  • Python version: Python 3.9.6
  • NVML/CUDA version: nvidia-smi: 465.31 / 11.3
  • nvitop version/commit: 0.3.5.6
  • python-ml-py version: 11.450.51
  • Locale: USA

Current Behavior

  1. After following installation instructions running nvitop command does not work, bash cannot find the command. However, python -m nvitop does work. Added /home/user_name/.local/bin to enable nvitop command to work.
  2. nvitop command prints as expected, however, nvitop -m colored graphs and formatting for CPU and MEM aren't showing correctly.

side x side comparison "nvitop -m"(left) vs "nvitop("right)
image

Expected Behavior

  1. nvitop install would set up env var so that command works immediately after install
  2. CPU and MEM graphical representation of % used would show and format would match that of nvitop command.

Possible Solutions

  1. nvitop install to check/add env var or ReadMe should note for the end-user to check this
  2. I'm not sure :(

Steps to reproduce

  1. Remove user-added env path, open terminal, and run nvitop

  2. Run nvitop -m or python3 -m nvitop -m

Originally created by @ninjaaron87 on GitHub (Jul 17, 2021). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/3 <!-- Thank you for contributing to nvitop by opening this issue. Please check through this list, so you can be as helpful as possible: 1. Was this issue already reported? Please do a quick search. 2. Maybe the problem is solved in the current master branch already? Simply clone nvitop's git repository and run ./nvitop.py to find out. 3. Provide all the relevant information, as outlined in this template. Feel free to remove any sections you don't need. --> #### Runtime Environment - Operating system and version: Arch Linux x86_64 - Terminal emulator and version: Alacritty 0.8.0 (a1b13e68) - Python version: Python 3.9.6 - NVML/CUDA version: nvidia-smi: 465.31 / 11.3 - `nvitop` version/commit: 0.3.5.6 - `python-ml-py` version: 11.450.51 - Locale: USA #### Current Behavior 1. After following installation instructions running `nvitop` command does not work, `bash` cannot find the command. However, `python -m nvitop` does work. Added `/home/user_name/.local/bin` to enable `nvitop` command to work. 2. `nvitop` command prints as expected, however, `nvitop -m` colored graphs and formatting for CPU and MEM aren't showing correctly. side x side comparison "nvitop -m"(left) vs "nvitop("right) ![image](https://user-images.githubusercontent.com/87574495/126050843-257292e4-85bf-4aa4-8d6a-5a3c0cb14f78.png) #### Expected Behavior 1. `nvitop` install would set up env var so that command works immediately after install 2. CPU and MEM graphical representation of % used would show and format would match that of `nvitop` command. #### Possible Solutions 1. `nvitop` install to check/add env var or ReadMe should note for the end-user to check this 2. I'm not sure :( #### Steps to reproduce 1. Remove user-added env path, open terminal, and run `nvitop` 2. Run `nvitop -m` or `python3 -m nvitop -m`
gitea-mirror 2026-05-05 03:21:14 -06:00
Author
Owner

@XuehaiPan commented on GitHub (Jul 20, 2021):

Thanks for the feedback!

For the first issue:

After following installation instructions running "nvitop" command does not work, bash cannot find command.

You shoud add the directory of nvitop's executable in your PATH, usually ~/.local/bin (for installed by pip3 install ...) or /usr/local/bin (for installed by sudo pip3 install ...).

For the second issue:

nvitop command prints as expected, however, nvitop -m colored graphs and formatting for CPU and MEM aren't showing correctly.

As the screenshot you have shown, the monitor mode of nvitop didn't display the box-drawing characters correctly. As Alacritty does support Unicode characters, does your ncurses library support Unicode (pacman -Ql ncurses | grep ncursesw)? nvitop will set the LC_ALL at startup:

b669fa39b1/nvitop/cli.py (L58-L64)

Possible solutions:

  1. set the environment variable LC_ALL='C.UTF-8' or LC_ALL='en_US.UTF-8' in your shell profile.
  2. use nvitop -m -U to use ASCII characters only.
<!-- gh-comment-id:883273936 --> @XuehaiPan commented on GitHub (Jul 20, 2021): Thanks for the feedback! For the first issue: > After following installation instructions running "nvitop" command does not work, bash cannot find command. You shoud add the directory of `nvitop`'s executable in your `PATH`, usually `~/.local/bin` (for installed by `pip3 install ...`) or `/usr/local/bin` (for installed by `sudo pip3 install ...`). For the second issue: > `nvitop` command prints as expected, however, `nvitop -m` colored graphs and formatting for CPU and MEM aren't showing correctly. As the screenshot you have shown, the monitor mode of `nvitop` didn't display the box-drawing characters correctly. As Alacritty does support Unicode characters, does your ncurses library support Unicode (`pacman -Ql ncurses | grep ncursesw`)? `nvitop` will set the `LC_ALL` at startup: https://github.com/XuehaiPan/nvitop/blob/b669fa39b161e7d482221ccee696d8dd82ed8910/nvitop/cli.py#L58-L64 Possible solutions: 1. set the environment variable `LC_ALL='C.UTF-8'` or `LC_ALL='en_US.UTF-8'` in your shell profile. 2. use `nvitop -m -U` to use ASCII characters only.
Author
Owner

@ninjaaron87 commented on GitHub (Jul 20, 2021):

Thanks! I've added your changes to the env path and set the LC_ALL env var and am able to see visualizations as expected!

<!-- gh-comment-id:883361419 --> @ninjaaron87 commented on GitHub (Jul 20, 2021): Thanks! I've added your changes to the env path and set the LC_ALL env var and am able to see visualizations as expected!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#3
No description provided.