Skip to content

Instantly share code, notes, and snippets.

@mietzen
Last active April 20, 2024 05:14
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mietzen/1569ed77c2820e7b7b8845375f6f7ed2 to your computer and use it in GitHub Desktop.
Save mietzen/1569ed77c2820e7b7b8845375f6f7ed2 to your computer and use it in GitHub Desktop.
m720q Setup: i7 8700 65W

m720q Setup with an i7-8700 65W

I had trouble getting my i7-8700 65W to work in my m720q with a 65W PSU. It was working fine in Windows, but was throttling down first to 20 Watt, then to 15, 10, and finally to 7 Watt, which resulted in a maximum clock speed of 800 MHz.

The main problem seems to be a mix of crappy firmware settings from Lenovo/Intel (Reddit Post) and the weak power supply.

To fix this problem, we have to install some tools, and for them to work, you have to make sure that secure boot is OFF; otherwise, the kernel doesn't allow you to set the CPU power limits. The easiest way is to install in legacy mode; therefore, you need to disable secure boot and enable CSM in the BIOS, select legacy boot preferred.

After we made sure that secure boot is OFF, we need intel-undervolt, which enables us to set the power limits.

All commands are run as root.

Enter a root Shell with: sudo -i

apt update
apt install git build-essential pkg-config powertop s-tui stress-ng -y
cd /opt
git clone https://github.com/kitsunyan/intel-undervolt.git
cd intel-undervolt
./config && make && make install
cd ..
rm -rf intel-undervolt

Then we need to configure intel-undervolt:

cat <<EOF > /etc/intel-undervolt.conf
power package 35/10 35/81920
EOF

It is very important NOT to raise the power limit above 35 Watt, neither PL1 nor PL2. It will result in a very short burst of ~38 Watt of pkg power consumption; afterward, the CPU goes into some kind of save state and throttles to 7 Watt!

IMG_7051

The duration of PL1 and PL2 doesn't seem to be applied/working. Once you created the config, apply it.

intel-undervolt apply

You should now test your settings with s-tui if the package power is ~35 Watt, everything is fine.

image

Make it permanent:

I noticed that the service somehow needs some cool down after the system is started, so I added a delay of 30 seconds.

cat <<EOF > /etc/systemd/system/intel-undervolt.service
[Unit]
Description=Intel Undervolt Service
After=multi-user.target suspend.target hibernate.target hybrid-sleep.target

[Service]
Type=oneshot
ExecStartPre=/bin/sleep 30
ExecStart=/usr/bin/intel-undervolt apply

[Install]
WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target
EOF

Afterwards enable the service:

systemctl enable intel-undervolt.service

Reboot and test again with s-tui.

Optinal Undervolt:

Be careful undervolting might have effects on your system stability! Always test the undervolt before activating the service or you may end up with a unusable OS!

To activate undervolting, we have to edit an EFI variable since undervolting is locked. Therefore, create a ventoy stick and put the following .efi binary on it: https://github.com/datasone/grub-mod-setup_var/releases/download/1.4/modGRUBShell.efi

Boot into modGRUBShell via ventoy and typ in the following commands

setup_var 0x7BD 0x00

IMG_7045

and then:

reboot

Remove the stick and boot back into linux, now add the undervolt to your config

cat <<EOF >> /etc/intel-undervolt.conf
undervolt 0 'CPU' -75
undervolt 1 'GPU' 0
undervolt 2 'CPU Cache' 0
undervolt 3 'System Agent' 0
undervolt 4 'Analog I/O' 0
EOF

and apply it:

intel-undervolt apply

Further power tuning:

You can further power tune your system by running powertop:

powertop --auto-tune

And setting the cpu govenor to powersave instead of performance:

cpupower frequency-set -g powersave

image

Your system should now idle at 5-7 Watt and underload it should be consume around 55 Watt

Sources:

@alm494
Copy link

alm494 commented Apr 20, 2024

Extremely useful manual! Thank you!
Upgraded my m720q to i9-9900T, it has power supply unit of 90W.
Optimal setting is 45/10 45/81920.
I believe you could achieve the same values if power supply changed from 65 to 90W.
It can also recieve more but limited by CPU cooling fan, so average value is always running around 45W (observed in s-tui tool).
tjoffset has no effect at all and fixed on 75C.
Also confirm EFI var setting is harmless on the last BIOS but I did not find any profit from -100mV undervolting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment