Closed priand1 closed 5 years ago
Sure, thanks for your work.
Alright, here we go. Just to clear some things up: I am on openSUSE Tumbleweed and the msr kernel module was not available early-on during boot, not even when including it in the initrd. Thus I decided to work around this by adding a systemd timer to execute amdctl via service 15s after boot. 15s after boot is sufficient on my system to have the msr module up and running when amdctl gets started. For others 15s might be too short of a timespan (I am not sure about that). If you are sure your msr module gets loaded but have a message like the following in your journal when amdctl is started
"ERROR: Could not open CPU for reading! Is the msr kernel module loaded?"
just raise the value to 30s, 1min, 2min or whatever fits your needs.
The services and the script assume that amdctl resides in /usr/sbin.
A short Howto:
Copy the sample script to /usr/sbin, rename it (remove the .sample in the file name) and make it executable.
Edit the script and fill in your tested values for voltage/clockspeed for each P-state.
Copy amdctl-boot.timer, amdctl-boot.service and amdctl-after-suspend.service to /usr/lib/systemd/system
Enable amdctl-boot.timer with systemctl enable amdctl-boot.timer
Enable amdctl-after-suspend.service with systemctl enable amdctl-after-suspend
Reboot
You're done. From now on after every boot and after every wake-up from suspend-to-ram/hibernate/hybrid-sleep amdctl is run to apply your desired settings for voltage/clockspeed.
amdctl-after-suspend.service.txt amdctl-boot.service.txt amdctl-boot.timer.txt amdctl.sh.sample.txt
Note: I had to add a *.txt ending to all files, otherwise github refuses to upload them. Just remove the .txt extension from the file names, please.
Hi Kevin,
would you be interested in adding amdctl.service + .timer + amdclt-after-resume.service + example bash script to your package? It is nothing big but I have written all of the above and they have been running on my system for a couple of weeks now without any problems.