MatthiasSchinzel / sysmon

Graphical system monitor for linux, including information about CPU, GPU, Memory, HDD/SDD and your network connections. Similar to windows task manager.
GNU General Public License v3.0
294 stars 25 forks source link

IndexError: index 4 is out of bounds for axis 0 with size 4 #17

Closed normanr closed 3 years ago

normanr commented 3 years ago
$ python3 sysmon.py 
Traceback (most recent call last):
  File "sysmon.py", line 613, in <module>
    main()
  File "sysmon.py", line 607, in main
    main = MainWindow()
  File "sysmon.py", line 111, in __init__
    self.plot_cpuinfo()
  File "sysmon.py", line 250, in plot_cpuinfo
    self.cpuinfo[-1, :] = self.s.refresh_stat() * 100
  File "/home/normanr/src/sysmon/src/gather_data.py", line 363, in refresh_stat
    self.get_cpu_clock_speed()
  File "/home/normanr/src/sysmon/src/gather_data.py", line 221, in get_cpu_clock_speed
    self.cpu_clock[id] = int(process)
IndexError: index 4 is out of bounds for axis 0 with size 4

For reasons I don't 100% understand: hyper-threading gets disabled when I suspect my laptop (at least I think that's the cause). Here's is the relevant content from /proc:

$ grep cpu /proc/stat
cpu  34033640 1471565 10952807 109402392 849655 0 2428715 0 0 0
cpu0 8490780 365253 2703973 54197827 470961 0 884506 0 0 0
cpu1 8481464 364768 2779510 15137870 125679 0 672644 0 0 0
cpu2 8494726 367270 2686477 15116227 125507 0 530925 0 0 0
cpu3 8536774 371814 2769030 15122729 126505 0 340520 0 0 0
$ grep ^ /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:654043
/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq:753403
/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq:792496
/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq:785235
/sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq:2100262
/sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq:2100005
/sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq:2100014
/sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq:2100004
$ grep ^ /sys/devices/system/cpu/cpu*/cpufreq/affected_cpus 
/sys/devices/system/cpu/cpu0/cpufreq/affected_cpus:0
/sys/devices/system/cpu/cpu1/cpufreq/affected_cpus:1
/sys/devices/system/cpu/cpu2/cpufreq/affected_cpus:2
/sys/devices/system/cpu/cpu3/cpufreq/affected_cpus:3
/sys/devices/system/cpu/cpu4/cpufreq/affected_cpus:
/sys/devices/system/cpu/cpu5/cpufreq/affected_cpus:
/sys/devices/system/cpu/cpu6/cpufreq/affected_cpus:
/sys/devices/system/cpu/cpu7/cpufreq/affected_cpus: