mgutt 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.5 # Description: Undervolts your Intel CPU # Author: Marc Gutt # # Changelog: # 0.5 # - reset install method to v0.3 # 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) # check if Python 3 is installed if [[ "$(python3 -V)" =~ "command not found" ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "Python 3 is missing!" fi # check if pip is installed if [[ "$(pip -V)" =~ "command not found" ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "pip (Python package manager) is missing!" exit 1 fi # check if setuptools is installed if [[ ! "$(pip list)" =~ "setuptools" ]]; then /usr/local/emhttp/webGui/scripts/notify -i alert -s "CPU Undervolting failed!" -d "setuptools (Python package library) is missing!" exit 1 fi # Check and install undervolt if [[ ! "$(undervolt --version)" =~ "undervolt" ]]; then echo "Undervolt is missing and will be installed..." pip install undervolt 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 -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 comment
mgutt 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 comment
Nuke 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 comment
Porkie 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 comment
mgutt 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 comment
mgutt 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 comment
Pillendreher 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 comment
PCR Posted January 11, 2021 Share Posted January 11, 2021 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 comment
mgutt Posted January 11, 2021 Author Share Posted January 11, 2021 @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 comment
PCR Posted January 11, 2021 Share Posted January 11, 2021 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 comment
mgutt Posted January 13, 2021 Author Share Posted January 13, 2021 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 comment
postboy99 Posted January 27, 2021 Share Posted January 27, 2021 (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, 2021 by postboy99 Quote Link to comment
mgutt Posted January 27, 2021 Author Share Posted January 27, 2021 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 comment
FailX Posted January 29, 2021 Share Posted January 29, 2021 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 comment
trurl Posted January 29, 2021 Share Posted January 29, 2021 1 hour ago, FailX said: 404: Not Found Wrong URL? Quote Link to comment
mgutt Posted January 29, 2021 Author Share Posted January 29, 2021 Original source is linked here: https://slackware.pkgs.org/current/slackware-x86_64/undervolt-20201024_13fa33d-x86_64-2.txz.html Quote Link to comment
FailX Posted January 29, 2021 Share Posted January 29, 2021 (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, 2021 by FailX Quote Link to comment
mgutt Posted February 7, 2021 Author Share Posted February 7, 2021 Ugpraded to Version 0.4 # - reset undervolt installation method # - check install file integrity Quote Link to comment
Konijntjes Posted February 18, 2021 Share Posted February 18, 2021 Could you update the script the filename is changed op pkgs.org so maby the md5 also. Quote Link to comment
Nuke Posted June 2, 2021 Share Posted June 2, 2021 On 2/7/2021 at 5:48 PM, mgutt said: Ugpraded to Version 0.4 # - reset undervolt installation method # - check install file integrity Please fix script. v0.3 still works. Quote Link to comment
mgutt Posted June 2, 2021 Author Share Posted June 2, 2021 48 minutes ago, Nuke said: Please fix Done 1 Quote Link to comment
cvincible Posted October 15, 2021 Share Posted October 15, 2021 Hello @mgutt! Thank you for writing sharing this script! I was wondering if you can share your undervolt settings for your 2146g. I recently acquired a 2176g and would like to know where to start testing. Thank you! Quote Link to comment
Jess3 Posted October 24, 2021 Share Posted October 24, 2021 (edited) asrock deskmini H310 with I3 9100 core: -120.12 mV gpu: -75.2 mV cache: -99.61 mV uncore: -109.38 mV analogio: -99.61 mV powerlimit: 65.0W saved 2watt at idle (from 14watt to 12watt) Edited October 24, 2021 by Jess3 Quote Link to comment
onotop Posted November 10, 2021 Share Posted November 10, 2021 (edited) Unfortunately it doesn't work for me. Get the following error message root@unraid:~# undervolt --core -1 --cache -1 ERROR:root:Failed to apply core: set -0.9765625, read 0.0 root@unraid:~# undervolt --core -50 --cache -50 ERROR:root:Failed to apply core: set -49.8046875, read 0.0 i3-8100 FUJITSU D3642-B1, Version S26361-D3642-B1 FUJITSU // American Megatrends Inc., Version V5.0.0.13 R1.26.0 for D3642-B1x BIOS dated: Monday, 08.03.2021 Edited November 10, 2021 by onotop Translate to English Quote Link to comment
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.