lestofante/ksysguard-gpu

nvidia-smi line parsing exception

TECHNOFAB11 opened this issue · 3 comments

I get this error after running the script manually, as i wondered why i couldnt connect to it via ksysguard:

intel_gpu_top: executable not found
radeontop: executable not found
nvidia-smi: found and running
nvidia-smi: exception while parsing the line, please report the bug b'0, 46, 9 %, 6 %, P8, 20.97 W, 139 MHz, 405 MHz, 139 MHz\n'
Traceback (most recent call last):
  File "/usr/bin/gpuStatsServer.py", line 187, in run
    self.parser.parseLine(line)
  File "/usr/bin/gpuStatsServer.py", line 150, in parseLine
    self.allGpu[gpuName+"."+self.header[index]] = value[0]
AttributeError: 'Nvidia' object has no attribute 'header'
intel_gpu_top: terminated
radeontop: terminated
nvidia-smi: found and running
nvidia-smi: exception while parsing the line, please report the bug b'0, 46, 0 %, 5 %, P8, 21.65 W, 139 MHz, 405 MHz, 139 MHz\n'
Traceback (most recent call last):
  File "/usr/bin/gpuStatsServer.py", line 187, in run
    self.parser.parseLine(line)
  File "/usr/bin/gpuStatsServer.py", line 150, in parseLine
    self.allGpu[gpuName+"."+self.header[index]] = value[0]
AttributeError: 'Nvidia' object has no attribute 'header'
nvidia-smi: found and running
nvidia-smi: exception while parsing the line, please report the bug b'0, 46, 0 %, 5 %, P8, 21.07 W, 139 MHz, 405 MHz, 139 MHz\n'
Traceback (most recent call last):
  File "/usr/bin/gpuStatsServer.py", line 187, in run
    self.parser.parseLine(line)
  File "/usr/bin/gpuStatsServer.py", line 150, in parseLine
    self.allGpu[gpuName+"."+self.header[index]] = value[0]
AttributeError: 'Nvidia' object has no attribute 'header'
^CTraceback (most recent call last):
  File "/usr/bin/gpuStatsServer.py", line 244, in <module>
    time.sleep(0.5)
KeyboardInterrupt
nvidia-smi: found and running
nvidia-smi: exception while parsing the line, please report the bug b'0, 46, 0 %, 5 %, P8, 20.58 W, 139 MHz, 405 MHz, 139 MHz\n'
Traceback (most recent call last):
  File "/usr/bin/gpuStatsServer.py", line 187, in run
    self.parser.parseLine(line)
  File "/usr/bin/gpuStatsServer.py", line 150, in parseLine
    self.allGpu[gpuName+"."+self.header[index]] = value[0]
AttributeError: 'Nvidia' object has no attribute 'header'
^CException ignored in: <module 'threading' from '/usr/lib64/python3.6/threading.py'>
Traceback (most recent call last):
  File "/usr/lib64/python3.6/threading.py", line 1294, in _shutdown
    t.join()
  File "/usr/lib64/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "/usr/lib64/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt

I just pushed a patch, can you try it? Thanks!

nvidia-smi: exception while parsing the line, please report the bug b'0, 54, 1 %, 3 %, P5, 27.34 W, 1139 MHz, 810 MHz, 1139 MHz\n'
Traceback (most recent call last):
  File "gpuStatsServer.py", line 189, in run
    self.parser.parseLine(line)
  File "gpuStatsServer.py", line 152, in parseLine
    self.allGpu[gpuName+"."+self.header[index]] = value[0]
IndexError: list index out of range

Now getting this. It tries to get the header array value at index 8, while there are only 8 (0->7).
Got it fixed by changing the following:

...
for index, parameter in enumerate(parameters):
    if index is 0: continue
    value = [s for s in parameter.split(' ') if s]
    ...

So it ignores the index 0 completely, which is not needed here.

this should have been fixed by later pr, if still happen pls reopen this issue