undervolt icon indicating copy to clipboard operation
undervolt copied to clipboard

PermissionError: [Errno 13] Permission denied: '/dev/cpu/0/msr'

Open germanp24 opened this issue 3 years ago • 9 comments

I installed undervolt and the command "undervolt" worked fine, when I tried "undervolt --r" I received that output on the terminal:

Traceback (most recent call last): File "/home/german/.local/bin/undervolt", line 8, in sys.exit(main()) File "/home/german/.local/lib/python3.8/site-packages/undervolt.py", line 439, in main temp = read_temperature(msr) File "/home/german/.local/lib/python3.8/site-packages/undervolt.py", line 191, in read_temperature return (read_msr(msr.addr_temp) & (127 << 24)) >> 24 File "/home/german/.local/lib/python3.8/site-packages/undervolt.py", line 88, in read_msr f = os.open(n, os.O_RDONLY) PermissionError: [Errno 13] Permission denied: '/dev/cpu/0/msr'

I have secure boot disabled.

germanp24 avatar Feb 03 '22 12:02 germanp24

you need to run as su- sudo undervolt -r

georgewhewell avatar Feb 03 '22 13:02 georgewhewell

I tried but I receive that output:

sudo: undervolt: command not found

germanp24 avatar Feb 03 '22 13:02 germanp24

you can try sudo -E undervolt or sudo $(which undervolt)

georgewhewell avatar Feb 03 '22 14:02 georgewhewell

With the first command I get that output:

sudo: undervolt: command not found

With the second:

usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [] usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...

germanp24 avatar Feb 03 '22 14:02 germanp24

the output of the second command implies undervolt is not on your PATH.. weird.. anyway, it says in your first comment the script is at /home/german/.local/lib/python3.8/site-packages/undervolt.py, so just sudo python /home/german/.local/lib/python3.8/site-packages/undervolt.py should work

georgewhewell avatar Feb 03 '22 14:02 georgewhewell

I tried that, I also verified the directory appears in the PATH:

When I run echo $PATH ~/.local/lib/python3.8/site-packages:/home/german/.local/bin:/home/german/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

When I run sudo python /home/german/.local/lib/python3.8/site-packages/undervolt.py:

sudo: python: command not found

EDIT: I'm using a Lenovo Legion Y540-15IRH (RTX2060 I7-9750H), I share it in case you find it useful.

germanp24 avatar Feb 03 '22 21:02 germanp24

When I run sudo python /home/german/.local/lib/python3.8/site-packages/undervolt.py:

sudo: python: command not found

Can you try using python3? sudo python3 /home/german/.local/lib/python3.8/site-packages/undervolt.py

sudharsan2000 avatar Apr 22 '22 04:04 sudharsan2000

A (generally inadvisable) alternative would be to install undervolt with sudo, i.e. sudo pip3 install undervolt.

IceCereal avatar Sep 29 '22 09:09 IceCereal

Same issue here fsamur@asus-gl552vw:~$ sudo $(which undervolt)

Traceback (most recent call last): File "/home/fsamur/.local/bin/undervolt", line 5, in <module> from undervolt import main ModuleNotFoundError: No module named 'undervolt'

CygnusTerminal avatar Mar 27 '23 13:03 CygnusTerminal