Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot is bad on ubuntu 18.04 #36

Closed
boileaum opened this issue Mar 6, 2019 · 4 comments
Closed

Plot is bad on ubuntu 18.04 #36

boileaum opened this issue Mar 6, 2019 · 4 comments

Comments

@boileaum
Copy link

boileaum commented Mar 6, 2019

Installed on ubuntu 18.04 with CUDA 10.1 and the recommended ncurses libraries:

dpkg -l |grep libncurses
ii  libncurses5:amd64                     6.1-1ubuntu1.18.04                          amd64        shared libraries for terminal handling
ii  libncurses5-dev:amd64                 6.1-1ubuntu1.18.04                          amd64        developer's libraries for ncurses
ii  libncursesw5:amd64                    6.1-1ubuntu1.18.04                          amd64        shared libraries for terminal handling (wide character support)
ii  libncursesw5-dev:amd64                6.1-1ubuntu1.18.04                          amd64        developer's libraries for ncursesw

The plot looks bad:

 GPU 135MHz  MEM 877MHz  TEMP  37øC FAN N/A% POW  24 / 250 W
 GPU[                               0%] MEM[                      0.0G/16.9G]
   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
100³                                                                               GPU 0³
   ³                                                                                 MEM³
   ³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
75%³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
50%³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
25%³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
   ³                                                                                    ³
 0%³ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄij
   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  PID USER GPU    TYPE       GPU MEM    CPU  HOST MEM Command

The build warned with:

make
[ 12%] Building C object src/CMakeFiles/nvtop.dir/nvtop.c.o
[ 25%] Building C object src/CMakeFiles/nvtop.dir/interface.c.o
/tmp/nvtop-master/src/interface.c: In function ‘draw_gpu_info_ncurses’:
/tmp/nvtop-master/src/interface.c:1221:26: warning: ‘%6llu’ directive output may be truncated writing between 6 and 14 bytes into a region of size 9 [-Wformat-truncation=]
     snprintf(memory, 9, "%6lluMB", proc[i].used_memory / 1048576);
                          ^~~~~
/tmp/nvtop-master/src/interface.c:1221:25: note: directive argument in the range [0, 17592186044415]
     snprintf(memory, 9, "%6lluMB", proc[i].used_memory / 1048576);
                         ^~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/curses.h:183,
                 from /tmp/nvtop-master/include/nvtop/plot.h:25,
                 from /tmp/nvtop-master/src/interface.c:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 9 and 17 bytes into a destination of size 9
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 37%] Building C object src/CMakeFiles/nvtop.dir/interface_layout_selection.c.o
[ 50%] Building C object src/CMakeFiles/nvtop.dir/get_process_info_linux.c.o
[ 62%] Building C object src/CMakeFiles/nvtop.dir/extract_gpuinfo.c.o
[ 75%] Building C object src/CMakeFiles/nvtop.dir/time.c.o
[ 87%] Building C object src/CMakeFiles/nvtop.dir/plot.c.o
[100%] Linking C executable nvtop
[100%] Built target nvtop
@Syllo
Copy link
Owner

Syllo commented Mar 6, 2019

From the characters used in your post, it seems like the program is not using ncursesw.
Can you please check that the return of ldd build/src/nvtop contains libncursesw.

If you updated the repository from a prior version or installed the libncursesw after calling CMake, try deleting the build directory and do a clean build.

Otherwise which terminal emulator are you using and what is the TERM variable value (echo $TERM).

@boileaum
Copy link
Author

boileaum commented Mar 7, 2019

ldd returns:

ldd build/src/nvtop
	linux-vdso.so.1 (0x00007ffe7e8e6000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc6577b9000)
	libnvidia-ml.so.1 => /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 (0x00007fc65716f000)
	libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5 (0x00007fc656f40000)
	libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fc656d16000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc656925000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fc657d67000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc656706000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc656502000)

so nvtop seems to be actually linked with libncursesw.

TERM contains:

echo $TERM
ansi

@Iamanorange
Copy link

Iamanorange commented Mar 7, 2019

vt100
VT100 VT102 VT220 VT320

linux
Linux

ansi
ANSI

scoansi
SCOANSI

Tested on :
Client: Xshell 6 on Win10
Server: Ubuntu 16.04 & Ubuntu 18.04.

The problem is terminal type. ANSI cann't display the plot correctly. Only xterm works in Xshell.

Update: the ldd returns same as boileaum's on my Ubuntu 18.04.

@Syllo
Copy link
Owner

Syllo commented Mar 9, 2019

@Iamanorange exactly, the problem lies in the TERM variable being ansi.
Ncurses thinks that the terminal has no support for the characters used for drawing the plot and replaces it with some "equivalent characters" 😆

I already pointed the problem to @boileaum, who fixed it with the good TERM environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants