When jtop is started with a custom single-cpu power model (other cores deactivated) it will crash when changing to the CPU pane. It seems to be an edge case not handled correctly. I'm pretty sure it can be fixed easily :-)
To Reproduce
Add a custom power mode, as described in NVIDIAs documentation, i.e. edit /etc/nvpmodel.conf and append:
Restart jetson_stats, i.e. sudo systemctl restart jetson_stats
Open jtop
Goto CPU pane
Crash!
Traceback (most recent call last):
File "/usr/local/bin/jtop", line 11, in <module>
load_entry_point('jetson-stats==3.1.2', 'console_scripts', 'jtop')()
File "/usr/local/lib/python3.6/dist-packages/jtop/__main__.py", line 148, 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/lib/common.py", line 120, in wrapped
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/jtop/gui/pcpu.py", line 94, in draw
x_size = (width - x_offset - 6) // (n_cpu // 2)
ZeroDivisionError: integer division or modulo by zero
When jtop is started with a custom single-cpu power model (other cores deactivated) it will crash when changing to the CPU pane. It seems to be an edge case not handled correctly. I'm pretty sure it can be fixed easily :-)
To Reproduce
/etc/nvpmodel.conf
and append:sudo systemctl restart jetson_stats
Additional context