Ricks-Lab / gpu-utils

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

ValueError: invalid literal for int() with base 10: #147

Closed SysAdminSmith closed 10 months ago

SysAdminSmith commented 12 months ago

Good evening: I have a AMD ATI Radeon RX 6600/6600 XT/6600M running on a Debian 12 box. Previously I had had no issues with gpu-utils. Unfortunately, I did a fresh OS install and now can't get your software to work. Here are my gpu-chk readouts:

Using rickslab-gpu-utils  3.8.2 
Using python 3.11.2
           Python version OK. 
Using Linux Kernel: 6.1.0-13-amd64
           OS kernel OK. 
Using system type: systemd
           System type has been Validated. 
Using Linux distribution: Debian GNU/Linux 12 (bookworm)
           Distro has been Validated. 
amdgpu/rocm version: UNKNOWN
           rickslab-gpu-utils can still be used. 
python3 venv is installed
           python3-venv OK. 
rickslab-gpu-utils-env is NOT available
           rickslab-gpu-utils-env can be configured per User Guide. 
Virtual Environment not configured. Only required by developers.
Not in rickslab-gpu-utils-env, (Only needed if you want to duplicate development env)
           rickslab-gpu-utils-env can be activated per User Guide. 
Checking apt-key keyring:
           rickslab repository is not using apt-key keyring. 

And this is the error I get when attempting to use gpu-ls:

AMD: amdgpu/rocm version: UNKNOWN
AMD: Wattman features enabled: 0xfffd7fff
Total of 1 GPU: 1 is rw, 0 are r-only, and 0 are w-only

Traceback (most recent call last):
  File "/usr/bin/gpu-ls", line 174, in <module>
    main()
  File "/usr/bin/gpu-ls", line 149, in main
    gpu_list.read_gpu_pstates()
  File "/usr/lib/python3/dist-packages/GPUmodules/GPUmodule.py", line 2503, in read_gpu_pstates
    gpu.read_gpu_pstates()
  File "/usr/lib/python3/dist-packages/GPUmodules/GPUmodule.py", line 1236, in read_gpu_pstates
    lineitems[0] = int(re.sub(':', '', lineitems[0]))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0

Any help would be greatly appreciated; thank you!

Ricks-Lab commented 12 months ago

This should be fixed in the version under development now. Can you clone the repository and test it out?

SysAdminSmith commented 12 months ago

This should be fixed in the version under development now. Can you clone the repository and test it out?

Trying now but having issues installing vext. May be because Im running python3.11.2? (my python skills are negligible)

Ricks-Lab commented 12 months ago

vext may not be needed. I have discovered that GtK seems to only work with the Native python version.

I have added a pip package. This will not require setting up a venv: pip test package

Make sure all of gpu-utils packages are uninstalled.

SysAdminSmith commented 12 months ago

Error:

Fatal error from pip prevented installation. Full pip output in file:
    /home/<domain>/<user>/.local/pipx/logs/cmd_2023-10-10_06.49.47_pip_errors.log

Some possibly relevant errors from pip install:
    ERROR: Could not find a version that satisfies the requirement rickslab-gpu-utils-3-8-3-py3-none-any-whl (from versions: none)
    ERROR: No matching distribution found for rickslab-gpu-utils-3-8-3-py3-none-any-whl

Error installing rickslab-gpu-utils-3-8-3-py3-none-any-whl.

Again, fully accept I may be python'ing wrong haha :/

Ricks-Lab commented 12 months ago

I have just installed it on one of my systems with no issues. It is running Ubuntu 22.04.3 LTS.

Make sure all other rickslab-gpu-utils packages are removed. Once the whl package is downloaded, in stall with the following command:

pip install rickslab_gpu_utils-3.8.3-py3-none-any.whl

Maybe you have an old version of pip which can be upgraded with the following command:

python3 -m pip install --upgrade pip

If you are on an old distro, you may need to run pip3 instead of pip.

SysAdminSmith commented 12 months ago

Sorry for the delay, Internet went out for 24 hours (seriously).

Unfortunately, I may not be the man to assist with this as I clearly can't pip correctly.

I did ensure all other gpu_utils are uninstalled and I did upgrade pip. Further, I 'su user.root -c "sudo -S rm -v /usr/lib/python3.11/EXTERNALLY-MANAGED"' so that I could install outside of the envelope. I still got:

$ pip install /home/domain.local/user/rickslab_gpu_utils-3.8.3-py3-none-any.whl
Defaulting to user installation because normal site-packages is not writeable
Processing ./rickslab_gpu_utils-3.8.3-py3-none-any.whl
ERROR: Wheel 'rickslab-gpu-utils' located at /home/domain.local/user/rickslab_gpu_utils-3.8.3-py3-none-any.whl is invalid.
seapoup commented 11 months ago

I had the same issue invalid literal for int() with base 10 as mentioned in the opening post, running Debian 12, using version 3.8.0 from the Debian repository. 0xfffd7fff enabled write access and most functions, but no access to gpu-pac. 0xfff7ffff as returned by my system did not enable write access, also no access to gpu-pac.

I cloned the repository and created the venv, though installing the requirements pip3 install --no-cache-dir -r requirements-venv.txt I managed to recreate the errors for vext. The software then runs fine, but gpu-pac and some other commands require vext.

What fixed it for me was installing the replacement as written in the error message inside the venv pip3 install --no-cache-dir --use-pep517 vext. Installation of vext-gi goes fine afterwards. Also had to install numpy system-wide afterwards. gpu-pac now works with featuremask 0xfff7ffff. Running python3.11 here. I have not touched the test package.

Ricks-Lab commented 11 months ago

Thanks for confirming that the current version on GitHub solves the original problem. I plan to finish testing and release a package to PyPI this weekend. I hope @seapoup and @SysAdminSmith can check it out when available. I will update here when it is released. Afterward, I will update the repository install instructions with your findings. I would like to verify if the --use-pep517 causes any other issues.

Ricks-Lab commented 11 months ago

PyPI has been updated with v3.8.3 which addresses this issue. Please check it out and let me know of any issues.

SysAdminSmith commented 11 months ago

PyPI has been updated with v3.8.3 which addresses this issue. Please check it out and let me know of any issues.

I can confirm that this appears to have fixed issues on my host. Thank you!

seapoup commented 10 months ago

PyPI has been updated with v3.8.3 which addresses this issue. Please check it out and let me know of any issues.

I can confirm that this appears to have fixed issues on my host. Thank you!

I can confirm that it the PyPi package works here as well. It works out of the box by breaking system packages: python3 -m pip install rickslab-gpu-utils --break-system-packages

If pipx is used, it complains about missing gi. python3 -m pipx install rickslab-gpu-utils, after which gi is not installed, despite it (and cairo) being installed system wide python3-gi is already the newest version (3.42.2-3+b1). I have not managed to make it work in pipx with my very limited Python knowledge.

Ricks-Lab commented 10 months ago

Issue fixed in v3.8.4 released to PyPI and debian package at rickslab.com.