mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-15 14:15:55 -06:00
[GH-ISSUE #98] [BUG] Display issue when running in Docker environment #60
Labels
No labels
api
bug
bug
cli / tui
dependencies
documentation
documentation
documentation
duplicate
enhancement
exporter
invalid
pull-request
pynvml
question
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/nvitop#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GhostArtyom on GitHub (Sep 29, 2023).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/98
Originally assigned to: @XuehaiPan on GitHub.
Required prerequisites
What version of nvitop are you using?
nvitop 1.3.0
Operating system and version
Ubuntu 22.04.3 LTS
NVIDIA driver version
537.42
NVIDIA-SMI
Python environment
3.7.5 (default, May 29 2023, 13:54:16)
[GCC 7.5.0] linux
nvidia-ml-py==12.535.108
nvitop==1.3.0
Problem description
在WSL安装的Docker里面使用
nvitop会产生像乱码一样的界面按

q退出后却能正常显示Unicode字符使用

nvitop -U命令用ASCII字符是能正常显示的在WSL中用

nvitop就一切正常Steps to Reproduce
The Python snippets (if any):
Command lines:
Traceback
No response
Logs
Expected behavior
希望能正确显示Unicode版的nvitop不出乱码
Additional context
已经遍历地试过将
LANG和LC_ALL设为en_US.UTF-8或C.UTF-8,都能稳定复现出乱码@XuehaiPan commented on GitHub (Sep 29, 2023):
@GhostArtyom 可否提供一下 docker image 的相关信息以供问题复现。以及需要您确认一下是否安装了 ncursesw 库以实现 ncurses 的 Unicode 支持。
@GhostArtyom commented on GitHub (Sep 29, 2023):
安装的是 MindSpore 2.1.1 + CUDA 11.6 版本 https://www.mindspore.cn/install/
ncurses 和 ncursesw 库都已安装
@XuehaiPan commented on GitHub (Sep 30, 2023):
@GhostArtyom 感谢提供相关信息,我 docker container 进入后立刻运行
pip3 install nvitop可以复现该问题:我发现是 docker image 内 PATH 默认的 Python interpreter 构建时未使用 ncurses 导致的:
解决方案如下:
注:docker 内部的 NVML 会调用 host 系统的 NVIDIA 驱动,返回的 PID 也是 host 系统内的 PID。这导致上面 docker 内出现 No Such Process 错误。如果想显示正确的进程信息,在启动
docker run命令时需要加上--pid-host参数。@GhostArtyom commented on GitHub (Sep 30, 2023):
@XuehaiPan 感谢给出解决方案👍 nvitop 太好使了,已经推荐给很多人了
另外 No Such Process 错误或许是由 WSL 没法连接硬件导致的🤔 因为我在 WSL 里用
nvitop同样是 No Such Process@XuehaiPan commented on GitHub (Sep 30, 2023):
该问题是 WSL 上游导致的,参考 issue #49: