Ricks-Lab / gpu-utils

A set of utilities for monitoring and customizing GPU performance
GNU General Public License v3.0
133 stars 23 forks source link

index out of bound error #123

Closed ZaidaZadkiel closed 2 years ago

ZaidaZadkiel commented 2 years ago

getting and index out of bound error int line 609 of GPUmodules/Gpumodule.py at line 609 apparently the split is not returning the proper value for some reason, didnt debug further so i just threw and exception check

            mask = ''
            ps_key = 'NA'
            for ps_val in value:
                if not mask:
                    mask = ps_val.split(':')[0].strip()
                else:
                    mask += ',' + ps_val.split(':')[0].strip()
                mclk_ps = ps_val.strip('*').strip().split(': ')

               #added these lines
                mclk_ps_data = "uninit"
                try: 
                    mclk_ps_data = mclk_ps[1]
                except IndexError:
                    mclk_ps_data = "baddata"

                if mclk_ps[0].isnumeric():
                    ps_key = int(mclk_ps[0])
                self.mclk_dpm_state.update({ps_key: mclk_ps_data}) # <-- changed direct index mclk_ps[1]
                if '*' in ps_val:
                    self.prm.mclk_ps[0] = ps_key
                    self.prm.mclk_ps[1] = mclk_ps_data # <-- changed direct index mclk_ps[1]
                self.prm.mclk_mask = mask
            LOGGER.debug('Mask: [%s], ps: [%s, %s]', mask, self.prm.mclk_ps[0], self.prm.mclk_ps[1])
Ricks-Lab commented 2 years ago

Can you confirm the version you are using with 'gpu-ls --about'

ZaidaZadkiel commented 2 years ago

$ gpu-ls --about gpu-ls - Displays details about installed and compatible GPUs [...] License: GNU General Public License Version: 3.6.1 Install Type: debian Maintainer: RueiKe Status: Development Status :: 5 - Production/Stable

$ aptitude versions rickslab-gpu-utils Package rickslab-gpu-utils:
i 3.6.1-1

oi, it seems the package with linux mint is old

Ricks-Lab commented 2 years ago

This is an issue that came up with a change in Kernel and/or python a while ago. It should be fixed in 3.6.1. Not sure why you are seeing it unless a recent kernel update broke it again.

Ricks-Lab commented 2 years ago

Another user also had this problem. Found that it was related to an older GPU reporting back invalid data for p-states. The latest commit fixes this.