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

Permission denied when running iuvolt #11

Closed
HorstBaerbel opened this issue Jun 1, 2018 · 10 comments
Closed

Permission denied when running iuvolt #11

HorstBaerbel opened this issue Jun 1, 2018 · 10 comments

Comments

@HorstBaerbel
Copy link
Contributor

First things first: Thanks for the tool! It has worked for me in the past, but now fails to. I'm running Ubuntu 16.04 LTS with kernel 4.13.0-43-generic. Secure boot is on if that matters in this case (I usually sign my modules if needed, but msr should be built-in into the kernel).
I "sudo modprobe msr" which works fine and the iuvolt:

sudo iuvolt -50 -50 -50
wrmsr: pwrite: Operation not permitted
wrmsr: pwrite: Operation not permitted
wrote failed, got: 0
wrmsr: pwrite: Operation not permitted
wrmsr: pwrite: Operation not permitted
wrote failed, got: 0
wrmsr: pwrite: Operation not permitted
wrmsr: pwrite: Operation not permitted
wrote failed, got: 0

Anything I could try?

@HorstBaerbel HorstBaerbel changed the title Permission denied Permission denied when running iuvolt Jun 1, 2018
@tiziw
Copy link
Owner

tiziw commented Jun 3, 2018

In the notebookreview thread linked in credits someone noted that if Secure Boot is enabled wrmsr does not work as the writes are blocked from userspace.

In order for it to still work you'll have to either recompile the msr module or recompile the whole kernel if the module built into the kernel. You will have to either disable Secure Boot or recompile msr with the the patch mentioned here.

@pgrycz
Copy link

pgrycz commented Jun 4, 2018

I have question about 'wrote failed, got...', what's that mean? settings are blocked by bios? in windows' Throttlestop I can change all core/cashe/gpu voltage offsets...

sudo iuvolt -85 -50 -85
wrote 0x80000011F5200000 successful to plane index 0
wrote failed, got: 100f9a00000
wrote failed, got: 200f5200000

@tiziw
Copy link
Owner

tiziw commented Jun 4, 2018

Each time iuvolt writes a voltage for a certain plane to the msr register, it follows it with a read to make sure that the value was written, actually got written. If it fails it means the write command did not throw an error, but for some reason the value in the register did not change.

I've seen it happen on a desktop cpu, but I dont know why it fails. Could you elaborate your specs? Did you run the command on a PC or a laptop, do you actually use the internal gpu for graphics or do you use a graphics card? What is your CPU model?

@pgrycz
Copy link

pgrycz commented Jun 5, 2018

notebook Asus haswell i7-4700HQ, internal Intel HD4600 + nVidia GT740M, Ubuntu 18.04 + kernel 4.16.12
under Windows either in XTU or Throttlestop it works well with these settings and definitelly Throttlestop works impressively with haswell, from noisy thing to complete silent

@HorstBaerbel
Copy link
Contributor Author

HorstBaerbel commented Jun 6, 2018

In order for it to still work you'll have to either recompile the msr module or recompile the whole kernel if the module built into the kernel. You will have to either disable Secure Boot or recompile msr with the the patch mentioned here.

Thanks. Kind of sucks, but I'll try compiling the module with the patch.

@HorstBaerbel
Copy link
Contributor Author

HorstBaerbel commented Jun 6, 2018

Btw. Would there be a convenient workaround by changing iuvolt or something else? E.g. use ACPI calls, make a kernel module etc...

@pgrycz
Copy link

pgrycz commented Jun 6, 2018

HorstBaerbel, https://github.com/georgewhewell/undervolt seems to maybe meet your requirements, it doesn't need any other additional packages than 'python-pip' and with newer hardware equipment it even shows already undervolted cpu/cache/gpu if You do it first under Windows (when dual systems are installed) so if '~/.local/...pathToUndervoltPackage.../undervolt.py --read' shows already these parameters set You don't need to do anything in Linux....reboot, wake up from suspend doesn't reset anything there. In older equipment all settings are resetted e.g after wake up from suspend.

@HorstBaerbel
Copy link
Contributor Author

Thanks for the info, but undervolt has the same problem. It uses the msr moduke too. Also I have a single-boot Linux system and Windows only in a virtual machine, so no dice... :/

@HorstBaerbel
Copy link
Contributor Author

HorstBaerbel commented Jun 6, 2018

On a different note why tf can't the super user r/w "/dev/cpu/0/msr"?! Regular users, ok, understandable, but the su can insert the module and the path is owned by root and has "crw-------" rights. Plus, the module is signed for secure boot.
It makes absolutely no sense to me. Can I report a bug somewhere?!

@tiziw
Copy link
Owner

tiziw commented Jun 6, 2018

As I said before, if you have secure boot enabled the msr module blocks calls from userspace. If you try to write to the msr register as root, it's still from userspace. Applying the patch is the only option, if you look at the patch you'll see it's pretty much removing two if statements.

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

3 participants