mgutt 565 Posted October 17, 2020 Share Posted October 17, 2020 Beware! Undervolting can cause system crashs and this could cause data loss! Use it on your own risk! Undervolting Undervolting reduces the power usage of your CPU. Depending on the CPU and used settings 5 to 10W on full load and 0 to 1W in idle. Important: At first you should stop your array to avoid data loss (and to avoid parity check on reboot)! Requirements (install them through NerdPack) - Python 3 - pip - setuptools Execute the following script by CA User Scripts (do not schedule it, until you did not stress test your setting!): #!/bin/bash # ##################################### # Script: Intel Undervolting v0.4 # Description: Undervolts your Intel CPU # Author: Marc Gutt # # Changelog: # 0.4 # - reset undervolt installation method # - check install file integrity # 0.3 # - changed undervolt installation method # 0.2 # - bug fix # - unraid notification added # - more log output # 0.1 # - first release # # ######### Settings ################## notification=1 # ##################################### # # ######### Script #################### # make script race condition safe if [[ -d "/tmp/${0///}" ]] || ! mkdir "/tmp/${0///}"; then exit 1; fi; trap 'rmdir "/tmp/${0///}"' EXIT; # Check if python3 is installed (can be installed through NerdPack) if [[ "$(python3 -V)" =~ "Python 3" ]]; then echo "Python 3 has been found." # Check if undervolt is already installed if [[ ! "$(undervolt --version)" =~ "undervolt" ]]; then echo "Undervolt is missing and will be downloaded..." # source: https://slackware.pkgs.org/current/slackware-x86_64/undervolt-20201024_13fa33d-x86_64-2.txz.html package_filename="undervolt-20201024_13fa33d-x86_64-2.txz" wget http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/${package_filename} -P /tmp # check md5 md5=($(md5sum /tmp/${package_filename})) if [[ $md5 != "7b77cea0bf3d8c066a4d7465ed431f93" ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "Package file not found or has been changed (md5: $md5)!" exit 1 fi upgradepkg --install-new /tmp/${package_filename} fi # Get CPU Model cpu_model=$(lscpu | grep 'Model name' | cut -f 2 -d ":" | awk '{$1=$1}1') echo $cpu_model # Undervolt CPU undervolt --gpu -50 --core -50 --cache -50 --uncore -50 --analogio -50 undervolt --read undervolt_read=$(undervolt --read | tr '\n' ' ') if [[ $notification == "1" ]]; then /usr/local/emhttp/webGui/scripts/notify -i normal -s "CPU undervolted" -d "$undervolt_read" fi else /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "Python 3 is missing! Please install it through the Nerd Pack first." fi -50mV should work with all CPUs, but I suggest to stop the array first, install stress and perform it as described in the next section, before using the undervolted CPU on your productive server. Other often used variants as an example: undervolt --gpu -75 --core -100 --cache -100 --uncore -100 --analogio -100 undervolt --gpu -50 --core -130 --cache -100 --uncore -130 --analogio -100 Feel free to post your CPU model and used command. Stress After setting the undervolting (you hopefully stopped your array, if not, do it!), you can now install stress as follows: wget https://packages.slackonly.com/pub/packages/14.2-x86_64/system/stress/stress-1.0.4-x86_64-1_slonly.txz -P /tmp upgradepkg --install-new /tmp/stress-1.0.4-x86_64-1_slonly.txz And execute it as follows if your CPU has 4 cores (change the value as needed): stress --cpu 4 Quote Link to post
mgutt 565 Posted October 17, 2020 Author Share Posted October 17, 2020 Intel i3-8100 undervolt --gpu -50 --core -50 --cache -50 --uncore -50 --analogio -50 crashed Intel i3-9350K undervolt --gpu -75 --core -100 --cache -100 --uncore -100 --analogio -100 crashed Quote Link to post
Nuke 1 Posted October 21, 2020 Share Posted October 21, 2020 thank you much but i have some problems with script: /tmp/user.scripts/tmpScripts/undervolt script/script: line 8: syntax error near unexpected token `fi' /tmp/user.scripts/tmpScripts/undervolt script/script: line 8: ` fi' Quote Link to post
Porkie 5 Posted October 21, 2020 Share Posted October 21, 2020 I had the same issue with the script to but I got it to run by editing it. #!/bin/bash # Check if python3 is installed (can be installed through NerdPack) if [[ "$(python3 -V)" =~ "Python 3" ]]; then # Check if undervolt is already installed [[ ! "$(undervolt --version)" =~ "undervolt" ]]; wget http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/undervolt-20200612_07d0c70-x86_64-1.txz -P /tmp upgradepkg --install-new /tmp/undervolt-20200612_07d0c70-x86_64-1.txz fi # Undervolt CPU undervolt --gpu -75 --core -100 --cache -100 --uncore -100 --analogio -100 undervolt --read But I run into another issue. Resolving slackware.cs.utah.edu (slackware.cs.utah.edu)... 155.98.64.87 Connecting to slackware.cs.utah.edu (slackware.cs.utah.edu)|155.98.64.87|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 14936 (15K) [text/plain] Saving to: '/tmp/undervolt-20200612_07d0c70-x86_64-1.txz.1' 0K .......... .... 100% 13.2K=1.1s 2020-10-21 17:10:06 (13.2 KB/s) - '/tmp/undervolt-20200612_07d0c70-x86_64-1.txz.1' saved [14936/14936] +============================================================================== | Skipping package undervolt-20200612_07d0c70-x86_64-1 (already installed) +============================================================================== Traceback (most recent call last): File "/usr/bin/undervolt", line 33, in sys.exit(load_entry_point('undervolt==0.3.0', 'console_scripts', 'undervolt')()) File "/usr/lib64/python3.8/site-packages/undervolt.py", line 411, in main set_offset(plane, offset, msr) File "/usr/lib64/python3.8/site-packages/undervolt.py", line 222, in set_offset write_msr(write_value, msr.addr_voltage_offsets) File "/usr/lib64/python3.8/site-packages/undervolt.py", line 81, in write_msr os.write(f, pack('Q', val)) OSError: [Errno 5] Input/output error temperature target: -0 (100C) Traceback (most recent call last): File "/usr/bin/undervolt", line 33, in sys.exit(load_entry_point('undervolt==0.3.0', 'console_scripts', 'undervolt')()) File "/usr/lib64/python3.8/site-packages/undervolt.py", line 455, in main voltage = read_offset(plane, msr) File "/usr/lib64/python3.8/site-packages/undervolt.py", line 208, in read_offset write_msr(value_to_write, msr.addr_voltage_offsets) File "/usr/lib64/python3.8/site-packages/undervolt.py", line 81, in write_msr os.write(f, pack('Q', val)) OSError: [Errno 5] Input/output error Script Finished Oct 21, 2020 17:10.06 Quote Link to post
mgutt 565 Posted October 22, 2020 Author Share Posted October 22, 2020 (edited) @Porkie Your CPU seems not to be supported: https://github.com/georgewhewell/undervolt/issues/72 Search in the Github issues if your CPU model has already a request and if not ask for support. The dev sometimes adds new CPUs. @Nuke Sorry, bug is fixed. Edited October 22, 2020 by mgutt 1 Quote Link to post
mgutt 565 Posted October 29, 2020 Author Share Posted October 29, 2020 v0.3 released: - changed undervolt installation method Now undervolt is not installed by URL, instead its installed through the pip/setuptools package management, which is the recommened method to install python packages. 1 Quote Link to post
Pillendreher 2 Posted December 5, 2020 Share Posted December 5, 2020 Is there any way to get a readout on the actual voltage levels of the CPU? A before/after comparison would be nice when it comes to undervolting. Quote Link to post
PCR 2 Posted January 11 Share Posted January 11 Script location: /tmp/user.scripts/tmpScripts/Undervolt/script Note that closing this window will abort the execution of this script /tmp/user.scripts/tmpScripts/Undervolt/script: line 44: undervolt: command not found Undervolt is missing and will be installed... Collecting undervolt Downloading undervolt-0.3.0.tar.gz (10 kB) ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hdj944q9/undervolt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hdj944q9/undervolt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-hdd0073d cwd: /tmp/pip-install-hdj944q9/undervolt/ Complete output (11 lines): Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.9/site-packages/setuptools/__init__.py", line 18, in from setuptools.dist import Distribution File "/usr/lib64/python3.9/site-packages/setuptools/dist.py", line 32, in from setuptools import windows_support File "/usr/lib64/python3.9/site-packages/setuptools/windows_support.py", line 2, in import ctypes File "/usr/lib64/python3.9/ctypes/__init__.py", line 8, in from _ctypes import Union, Structure, Array ImportError: libffi.so.7: cannot open shared object file: No such file or directory ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz /tmp/user.scripts/tmpScripts/Undervolt/script: line 54: undervolt: command not found /tmp/user.scripts/tmpScripts/Undervolt/script: line 55: undervolt: command not found /tmp/user.scripts/tmpScripts/Undervolt/script: line 56: undervolt: command not found got this error. Quote Link to post
mgutt 565 Posted January 11 Author Share Posted January 11 @PCR Try to install the slackware package of undervolt instead: wget http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/undervolt-20201024_13fa33d-x86_64-1.txz -N -P /tmp upgradepkg --install-new /tmp/undervolt-20201024_13fa33d-x86_64-1.txz Does this work for you? Quote Link to post
PCR 2 Posted January 11 Share Posted January 11 cript location: /tmp/user.scripts/tmpScripts/Undervolt/script Note that closing this window will abort the execution of this script Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz temperature target: -0 (100C) core: -49.8 mV gpu: -49.8 mV cache: -49.8 mV uncore: -49.8 mV analogio: -49.8 mV powerlimit: 130.0W (short: 0.00244140625s - enabled) / 115.0W (long: 16.0s - enabled) yes. but why? have i made a mistake? Best Quote Link to post
mgutt 565 Posted January 13 Author Share Posted January 13 On 1/11/2021 at 7:15 PM, PCR said: have i made a mistake? No, must be something regarding the pip package I think. I will change my script so it does not use it anymore. Quote Link to post
postboy99 1 Posted January 27 Share Posted January 27 (edited) On 1/11/2021 at 7:11 PM, mgutt said: @PCR Try to install the slackware package of undervolt instead: wget http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/undervolt-20201024_13fa33d-x86_64-1.txz -N -P /tmp upgradepkg --install-new /tmp/undervolt-20201024_13fa33d-x86_64-1.txz Does this work for you? I had the same like PCR and installed the current slackware package (undervolt-20201024_13fa33d-x86_64-2.txz). This worked for me. My CPU is the same as yours mgutt core-i3 8100, so I used your settings. How long should the stress test run to make sure it's stable? PS: Nice work and thanks for the guide! Edited January 27 by postboy99 Quote Link to post
mgutt 565 Posted January 27 Author Share Posted January 27 Just now, postboy99 said: How long should the stress test run to make sure it's stable? 1 hour should be enough. Quote Link to post
FailX 0 Posted January 29 Share Posted January 29 Hello, I've got the same problem like PCR or postboy99 but then I try to install it through slackware I got this: wget http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/undervolt-20201024_13fa33d-x86_64-1.txz -N -P /tmp --2021-01-29 08:41:18-- http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/undervolt-20201024_13fa33d-x86_64-1.txz Resolving slackware.cs.utah.edu (slackware.cs.utah.edu)... 155.98.64.87 Connecting to slackware.cs.utah.edu (slackware.cs.utah.edu)|155.98.64.87|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2021-01-29 08:41:18 ERROR 404: Not Found. Can you give me a hint whats wrong? Thanks for your work. Quote Link to post
trurl 1651 Posted January 29 Share Posted January 29 1 hour ago, FailX said: 404: Not Found Wrong URL? Quote Link to post
mgutt 565 Posted January 29 Author Share Posted January 29 Original source is linked here: https://slackware.pkgs.org/current/slackware-x86_64/undervolt-20201024_13fa33d-x86_64-2.txz.html Quote Link to post
FailX 0 Posted January 29 Share Posted January 29 (edited) I found the correct link wget http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/undervolt-20201024_13fa33d-x86_64-2.txz -N -P /tmp upgradepkg --install-new /tmp/undervolt-20201024_13fa33d-x86_64-2.txz Thanks but I the script or the undervolt programm dont work: Script location: /tmp/user.scripts/tmpScripts/undervolt/script Note that closing this window will abort the execution of this script Intel(R) Core(TM) i3-9100 CPU @ 3.60GHz ERROR:root:Failed to apply core: set -49.8046875, read 0.0 temperature target: -0 (100C) core: 0.0 mV gpu: 0.0 mV cache: 0.0 mV uncore: 0.0 mV analogio: 0.0 mV powerlimit: 90.0W (short: 0.00244140625s - enabled) / 65.0W (long: 28.0s - enabled) [locked] any ideas? Edited January 29 by FailX Quote Link to post
mgutt 565 Posted February 7 Author Share Posted February 7 Ugpraded to Version 0.4 # - reset undervolt installation method # - check install file integrity Quote Link to post
Konijntjes 5 Posted February 18 Share Posted February 18 Could you update the script the filename is changed op pkgs.org so maby the md5 also. Quote Link to post
Alex.b 12 Posted March 31 Share Posted March 31 (edited) Hey, Tried to execute the script but it returns an error : Script location: /tmp/user.scripts/tmpScripts/Undervolt/script Note that closing this window will abort the execution of this script Python 3 has been found. /tmp/user.scripts/tmpScripts/Undervolt/script: line 31: undervolt: command not found Undervolt is missing and will be downloaded... --2021-04-01 00:13:53-- http://slackware.cs.utah.edu/pub/slackware/slackware64-current/slackware64/ap/undervolt-20201024_13fa33d-x86_64-2.txz Resolving slackware.cs.utah.edu (slackware.cs.utah.edu)... 155.98.64.87 Connecting to slackware.cs.utah.edu (slackware.cs.utah.edu)|155.98.64.87|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2021-04-01 00:13:54 ERROR 404: Not Found. md5sum: /tmp/undervolt-20201024_13fa33d-x86_64-2.txz: No such file or directory Update : works, updated with latest version : https://slackware.pkgs.org/current/slackware-x86_64/undervolt-20201024_13fa33d-x86_64-3.txz.html Edited April 1 by Alex.b Quote Link to post
21 posts in this topic Last Reply
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.