XuehaiPan / nvitop

An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management.
https://nvitop.readthedocs.io
Apache License 2.0
4.72k stars 148 forks source link

[BUG] curser error init display on ubuntu 22.10 #108

Open julienlau opened 10 months ago

julienlau commented 10 months ago

Required prerequisites

What version of nvitop are you using?

1.3.1

Operating system and version

ubuntu 22.10

NVIDIA driver version

535.129.03

NVIDIA-SMI

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03             Driver Version: 535.129.03   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 3060 ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   50C    P0              N/A /  80W |      9MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      3956      G   /usr/lib/xorg/Xorg                            4MiB |
+---------------------------------------------------------------------------------------+

Python environment

[tool.poetry.dependencies] python = "^3.11" numpy = "1.24.4" sentencepiece = "0.1.98" gguf = ">=0.1.0" ctransformers = {extras = ["cuda"], version = "^0.2.27"} nvitop = "^1.3.1"

Problem description

I tried on several terminal (tilix, terminator, default console) and I have the same error everytime:

ERROR: Failed to initialize `curses` (curs_set() returned ERR)

I think this may be the same error : https://github.com/zalando/pg_view/issues/3

$ nvitop
╒═════════════════════════════════════════════════════════════════════════════╕
│ NVITOP 1.3.1      Driver Version: 535.129.03      CUDA Driver Version: 12.2 │
├───────────────────────────────┬──────────────────────┬──────────────────────┤
│ GPU  Name        Persistence-M│ Bus-Id        Disp.A │ Volatile Uncorr. ECC │
│ Fan  Temp  Perf  Pwr:Usage/Cap│         Memory-Usage │ GPU-Util  Compute M. │
╞═══════════════════════════════╪══════════════════════╪══════════════════════╪═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╕
│   0  .. 3060 Laptop GPU  Off  │ 00000000:01:00.0 Off │                  N/A │ MEM: ▎ 0.2%                                                                                                   │
│ N/A   51C    P8     11W / N/A │    9.44MiB / 6144MiB │      0%      Default │ UTL: ▏ 0%                                                                                                     │
╘═══════════════════════════════╧══════════════════════╧══════════════════════╧═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╛
[ CPU: ████████▍ 5.9%                                                                                                                    UPTIME: 1:32:27 ]  ( Load Average:  1.00  1.01  0.91 )
[ MEM: ██████████████████████▍ 15.9%                                                                                                       USED: 4.91GiB ]  [ SWP: ▏ 0.0%                     ]

╒═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╕
│ Processes:                                                                                                                                                                       jlu@susm16 │
│ GPU     PID      USER  GPU-MEM %SM  %CPU  %MEM     TIME  COMMAND                                                                                                                            │
╞═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│   0    3956 G     jlu  4.46MiB   0   0.0   0.4  1:32:11  /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1001/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtsw.. │
╘═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╛
ERROR: Failed to initialize `curses` (curs_set() returned ERR)

Steps to Reproduce

The Python snippets (if any):

Command lines:

Traceback

No response

Logs

No response

Expected behavior

No response

Additional context

No response

XuehaiPan commented 10 months ago

Hi @julienlau, have you ever tried to install nvitop in an isolated environment? I have seem this error many times when users install nvitop in a conda environment. You can try to install nvitop via pipx:

pip3 install --upgrade pipx
pipx run nvitop
NaiveInvestigator commented 1 month ago

I also get this error when i try to use nvitop on ssh.

i fixed it by setting the term variable to xterm-256color

I found the fix here: https://github.com/isontheline/pro.webssh.net/issues/709

If you're in bash, add this line to your .bashrc:

export TERM=xterm-256color