rbonghi / jetson_stats

šŸ“Š Simple package for monitoring and control your NVIDIA Jetson [Orin, Xavier, Nano, TX] series
https://rnext.it/jetson_stats
GNU Affero General Public License v3.0
2.16k stars 264 forks source link

when height is small in "4.MEM", program occur errer in 3.0.1 #75

Closed dongle94 closed 3 years ago

dongle94 commented 4 years ago

hello. I update jetson-stats to 3.0.1 version. In mode 4.MEM, i adjust terminal window's height. If lower than pixel 23, program occur error and exit.

Traceback (most recent call last):
  File "/usr/local/bin/jtop", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/jtop/__main__.py", line 146, in main
    curses.wrapper(JTOPGUI, jetson, [ALL, GPU, CPU, MEM, CTRL, INFO], init_page=args.page, loop=args.loop, seconds=LOOP_SECONDS)
  File "/usr/lib/python3.6/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python3.6/dist-packages/jtop/gui/jtopgui.py", line 109, in __init__
    self.run(loop, seconds)
  File "/usr/local/lib/python3.6/dist-packages/jtop/gui/jtopgui.py", line 138, in run
    self.draw()
  File "/usr/local/lib/python3.6/dist-packages/jtop/gui/lib/common.py", line 80, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/jtop/gui/jtopgui.py", line 153, in draw
    page.draw(self.key, self.mouse)
  File "/usr/local/lib/python3.6/dist-packages/jtop/gui/pmem.py", line 215, in draw
    self.memory_legend(line_counter + 1, height, width, first)
  File "/usr/local/lib/python3.6/dist-packages/jtop/gui/pmem.py", line 135, in memory_legend
    rectangle(self.stdscr, start_y, start_x, start_y + r_height, start_x + r_width)
  File "/usr/lib/python3.6/curses/textpad.py", line 16, in rectangle
    win.addch(lry, lrx, curses.ACS_LRCORNER)
_curses.error: addch() returned ERR

I checked this problem in Xavier AGX, Nano too

Thanks for your great tool.

rbonghi commented 4 years ago

Thank you @devDongle

I will fix soon! šŸ‘

Overall the minimum size for jtop right now is 80x24 I don't think that I can be able to reduce more the minimum size