Open rbonghi opened 1 month ago
Experienced the same issue, I'll post some details here in case you would find any information useful.
Jtop crashes when trying to check CPU information (switching to CPU tab)
jtop
commandAlways reproducible. Recently switched to new board and new Jetpack version (see below), didn't experience the issue before.
Traceback from the error:
Traceback (most recent call last):
File "/usr/local/bin/jtop", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/jtop/__main__.py", line 160, in main
curses.wrapper(JTOPGUI, jetson, pages, init_page=args.page,
File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python3.10/dist-packages/jtop/gui/jtopgui.py", line 100, in __init__
self.run(loop, seconds)
File "/usr/local/lib/python3.10/dist-packages/jtop/gui/jtopgui.py", line 129, in run
self.draw()
File "/usr/local/lib/python3.10/dist-packages/jtop/gui/jtopgui.py", line 143, in draw
page.draw(self.key, self.mouse)
File "/usr/local/lib/python3.10/dist-packages/jtop/gui/pcpu.py", line 138, in draw
step_height, step_width, size_columns, size_rows = cpu_grid(
File "/usr/local/lib/python3.10/dist-packages/jtop/gui/pcpu.py", line 78, in cpu_grid
print_cpu(stdscr, idx, cpu, start_y + idx_row * step_height, start_x + idx_column * step_width, step_height - 1, step_width - 1)
File "/usr/local/lib/python3.10/dist-packages/jtop/gui/pcpu.py", line 122, in print_cpu
freq = cpu['freq']
KeyError: 'freq'
Error after Aug 05 09:32:14
multiple times
One more thing: I was experimenting with the power mode settings and the issue seems related to it.
By default my board had the 15W
power mode, which means that (if I understand correctly) out of the 8 CPU cores only 4 cores were active. While this power mode was active, the crash described above always happened.
However, when I changed the power mode to MAXN
the issue no longer occurred. In this power mode all the CPU cores were active in my case.
Experienced the same on an Nvidia Orin NX 16 GB developer kit with Jetpack 5.1.2 (L4T 35.4.1), following soyszala's advice and changing the power mode (which by default was 15W) to MAXN fixed the issue for me as well.
I believe this problem occurs when some CPUs are offline. I've fixed it with the following patch:
--- jtop/gui/pcpu.py 2024-09-10 05:59:46.172062761 +0000
+++ jtop/gui/pcpu.py.fixed 2024-09-10 05:59:27.839832496 +0000
@@ -119,13 +119,14 @@
except curses.error:
pass
# Print info
- freq = cpu['freq']
- freq['online'] = cpu['online']
- freq['name'] = "Frq"
- try:
- freq_gauge(stdscr, pos_y + size_h, pos_x, size_w, cpu['freq'])
- except curses.error:
- pass
+ if 'freq' in cpu:
+ freq = cpu['freq']
+ freq['online'] = cpu['online']
+ freq['name'] = "Frq"
+ try:
+ freq_gauge(stdscr, pos_y + size_h, pos_x, size_w, cpu['freq'])
+ except curses.error:
+ pass
def draw(self, key, mouse):
# Screen size
Now you can see no 'Frq` gauge for offline CPUs.
Key error on Freq CPU
Forum post: https://forums.developer.nvidia.com/t/orin-nx-jtop-read-cpu-crash/301611