amanusk / s-tui

Terminal-based CPU stress and monitoring utility
https://amanusk.github.io/s-tui/
GNU General Public License v2.0
4.01k stars 139 forks source link

Crash on RISC-V #174

Closed archanox closed 1 year ago

archanox commented 2 years ago

Step 1: Describe your environment

Step 2: Describe the problem:

Observed Results:

Debug Results, output of s-tui -d created in a file _s-tui.log:

root@RVBoards:~# s-tui -d
Traceback (most recent call last):
  File "/usr/bin/s-tui", line 33, in <module>
    sys.exit(load_entry_point('s-tui==1.0.2', 'console_scripts', 's-tui')())
  File "/usr/lib/python3/dist-packages/s_tui/s_tui.py", line 903, in main
    graph_controller = GraphController(args)
  File "/usr/lib/python3/dist-packages/s_tui/s_tui.py", line 715, in __init__
    possible_sources = self._load_config(args.t_thresh)
  File "/usr/lib/python3/dist-packages/s_tui/s_tui.py", line 648, in _load_config
    FreqSource(),
  File "/usr/lib/python3/dist-packages/s_tui/sources/freq_source.py", line 50, in __init__
    self.top_freq = psutil.cpu_freq().max
AttributeError: 'NoneType' object has no attribute 'max'
root@RVBoards:~#  cat _s-tui.log
2021-07-23 14:32:48,555 [_load_config()] [DEBUG]  Config file not found
2021-07-23 14:32:48,556 [_load_config()] [DEBUG]  No refresh rate configed
2021-07-23 14:32:48,557 [_load_config()] [DEBUG]  No user config for utf8
2021-07-23 14:32:48,559 [_load_config()] [DEBUG]  No user config for temp threshold
2021-07-23 14:32:48,597 [__init__()] [DEBUG]  Temp sensor name Cpu_Thermal_Zone,0
amanusk commented 2 years ago

Thanks for opening the issue and the interst in the project.

I would be very surprised it if would just work with RISC-V out of the box :), but the crash should not happen anyway.

Can you please try running with the latest version and report if the crash happens? Also, if by any chance you know how to impelement reading CPU frequency in RISC-V, PRs to here or to pstuil would be welcome.

archanox commented 1 year ago

Tested successfully on the LicheePi4A