Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

add_available_signal: KeyError: ' ' #66

Open
ghost opened this issue May 8, 2019 · 13 comments
Open

add_available_signal: KeyError: ' ' #66

ghost opened this issue May 8, 2019 · 13 comments

Comments

@ghost
Copy link

ghost commented May 8, 2019

Hello. I am encountering the following error with RX 570 and Linux kernel 5.1.0:

Traceback (most recent call last):
  File "run.py", line 23, in <module>
    wattman.main()
  File "WattmanGTK/wattman.py", line 174, in main
    Plot0 = Handler0.init_plot(0, maxpoints, precision, linux_kernelmain, linux_kernelsub)
  File "WattmanGTK/handler.py", line 72, in init_plot
    self.plot = Plot(self.builder, self.GPUs, maxpoints, precision, linux_kernelmain, linux_kernelsub)
  File "WattmanGTK/plot.py", line 58, in __init__
    self.Plotsignals = self.init_signals(self.GPU)
  File "WattmanGTK/plot.py", line 100, in init_signals
    self.add_available_signal(GPU.sensors, Plotsignals, hwmonpath=GPU.hwmonpath)
  File "WattmanGTK/plot.py", line 156, in add_available_signal
    self.add_available_signal(value, Plotsignals, hwmonpath=hwmonpath, subsystem=subsystem, stop_recursion = stop_recursion)
  File "WattmanGTK/plot.py", line 156, in add_available_signal
    self.add_available_signal(value, Plotsignals, hwmonpath=hwmonpath, subsystem=subsystem, stop_recursion = stop_recursion)
  File "WattmanGTK/plot.py", line 151, in add_available_signal
    Plotsignals.append(Plotsignal(signallabel, subsystem_unit_color[subsystem]["unit"],
KeyError: ''

Adding a check at line 151:

if subsystem != "":

resolves the issue, but I am not sure whether this is the best way to fix this.

Wattman version: git

@confuzled-dev
Copy link

I also have this issue

@confuzled-dev
Copy link

Please explain your solution further, do i just create a new line containing [if subsystem != "":] at line 151 and push the 151 line to 152.

Doing this still gives me the same error

@ghost
Copy link
Author

ghost commented May 14, 2019

I am using the following patch:

add_available_signal_keyerror.diff.gz

@confuzled-dev
Copy link

I added
if subsystem != "":
Plotsignals.append(Plotsignal(signallabel, subsystem_unit_color[subsystem]["unit"],
signalmax,signalmin, signalpath, True, True,
subsystem_unit_color[subsystem]["color"], read))
to my file at your start point, but it still didnt work. Maybe there is some automated way to use this .diff file, but I dont know how.

@ghost
Copy link
Author

ghost commented May 14, 2019

In a terminal, try changing to the directory which contains plot.py, remove your local changes from plot.py, and run:

 zcat add_available_signal_keyerror.diff.gz | patch -p2

@confuzled-dev
Copy link

did that and it patched. but it still wont run...

@ghost
Copy link
Author

ghost commented May 15, 2019

What is the full output of run.py when you run it?

@confuzled-dev
Copy link

Traceback (most recent call last):
File "run.py", line 20, in
from WattmanGTK import wattman
File "/home/doug/WattmanGTK-master/WattmanGTK/wattman.py", line 103
print(f"Unsupported kernel ({linux}), make sure you are using linux kernel 4.8 or higher. ")
^
SyntaxError: invalid syntax

@ghost
Copy link
Author

ghost commented May 15, 2019

You should run run.py with Python 3.x, not Python 2.7:

$ head -n1 run.py
#!/usr/bin/env python3

$ python3 run.py -o overdrive

Unfortunately, Python 2.7 is currently unable to notify the user when a source code should be run with Python 3.x.

@qwertychouskie
Copy link

@atomsymbol It is possible:

import sys
if sys.version_info[0] < 3:
    raise Exception("Must be using Python 3")

https://stackoverflow.com/a/9079062

Feel free to make a PR.

@confuzled-dev
Copy link

running with
python3 run.py

everything works.

However trying to launch by running wattmangtk from any locations does not work

@hyperactivated
Copy link

Having the same issue with my Vega 64 on kernel 5.1.5.
Adding the if statement at line 151 resolves the issue.
Not sure if it helps, but the value of key (which I believe would be the value of subsystem if there was a color mapping) which causes the error is "input".

@rx580user
Copy link

rx580user commented Jun 6, 2019

(Arch user here.)
Thanks @atomsymbol, changing

                    Plotsignals.append(Plotsignal(signallabel, subsystem_unit_color[subsystem]["unit"],

to

                    if subsystem != "":
                        Plotsignals.append(Plotsignal(signallabel, subsystem_unit_color[subsystem]["unit"],

fixed the start for me also.

And re-running sudo python3 setup.py install also fixes $ wattmanGTK (@dougshell)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants