Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
germanp24 opened this issue Feb 3, 2022 · 9 comments
Open

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

germanp24 opened this issue Feb 3, 2022 · 9 comments

Comments

@germanp24
Copy link

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.

@georgewhewell
Copy link
Owner

you need to run as su- sudo undervolt -r

@germanp24
Copy link
Author

I tried but I receive that output:

sudo: undervolt: command not found

@georgewhewell
Copy link
Owner

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

@germanp24
Copy link
Author

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 ...

@georgewhewell
Copy link
Owner

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

@germanp24
Copy link
Author

germanp24 commented Feb 3, 2022

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.

@sudharsan2000
Copy link

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

@IceCereal
Copy link

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

@CygnusTerminal
Copy link

CygnusTerminal commented Mar 27, 2023

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'

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

No branches or pull requests

5 participants