From abc29d148ac1917860a2d4cf9a637fa67be505a4 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Fri, 20 Apr 2018 10:52:25 +0200 Subject: [PATCH 1/8] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e9ec86f..7da19a7 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,14 @@ The script now also supports **undervolting** the CPU by configuring voltage off ## Requirements The python module `python-periphery` is used for accessing the MCHBAR register by memory mapped I/O. You also need `dbus` and `gobject` python bindings for listening to dbus signals on resume from sleep/hibernate. +### Update: +The scripts is now running with Python3 by default (tested w/ 3.6) and a virtualenv is automatically created in `/opt/lenovo_fix`. Python2 should probably still work. + ## Installation ``` git clone https://github.com/erpalma/lenovo-throttling-fix.git -sudo -H pip install python-periphery -sudo apt install python-dbus python-gobject -sudo make install -sudo systemctl enable lenovo_fix.service -sudo systemctl start lenovo_fix.service +sudo apt install virtualenv +sudo ./install.sh ``` ## Configuration From 8ee7f3008c5ca0c20d9757c55ee4134eed9e8a01 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Mon, 23 Apr 2018 14:22:19 +0200 Subject: [PATCH 2/8] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index fca5835..7f9b232 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ echo "Building virtualenv..." cp requirements.txt lenovo_fix.py "$INSTALL_DIR" cd "$INSTALL_DIR" virtualenv -p /usr/bin/python3 venv -source venv/bin/activate +. venv/bin/activate pip install -r requirements.txt echo "Enabling and starting systemd service..." From 9905f609d4cb1add6480f16cd49a83eb95fc108d Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Tue, 8 May 2018 12:02:38 +0200 Subject: [PATCH 3/8] Update README.md update required packages for Ubuntu 18.04 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7da19a7..8f7d841 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ The scripts is now running with Python3 by default (tested w/ 3.6) and a virtual ## Installation ``` +sudo apt install git virtualenv build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev git clone https://github.com/erpalma/lenovo-throttling-fix.git -sudo apt install virtualenv sudo ./install.sh ``` From 36ecf77204a538bd5db2b00ad1ff5ffeed91412f Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Fri, 11 May 2018 21:23:44 +0200 Subject: [PATCH 4/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f7d841..c4e0153 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The scripts is now running with Python3 by default (tested w/ 3.6) and a virtual ## Installation ``` -sudo apt install git virtualenv build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev +sudo apt install git virtualenv build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev git clone https://github.com/erpalma/lenovo-throttling-fix.git sudo ./install.sh ``` From d671ce2a5fb06fcf94aaea7c6c34df7863982c0b Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Mon, 14 May 2018 12:33:41 +0200 Subject: [PATCH 5/8] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4e0153..682a017 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,15 @@ Workaround for Linux throttling issues on Lenovo T480 / T480s / X1C6 notebooks a This script forces the CPU package power limit (PL1/2) to **44 W** (29 W on battery) and the temperature trip point to **97 'C** (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default. -### Undervolt +### Undervolt: The script now also supports **undervolting** the CPU by configuring voltage offsets for CPU, cache, GPU, System Agent and Analog I/O planes. The script will re-apply undervolt on resume from standby and hibernate by listening to DBus signals. ## Requirements The python module `python-periphery` is used for accessing the MCHBAR register by memory mapped I/O. You also need `dbus` and `gobject` python bindings for listening to dbus signals on resume from sleep/hibernate. +### Secure Boot: +Right now it is mandatory to **disable Secure Boot** (in BIOS) in order to avoid [Kernel Lockdown](https://lwn.net/Articles/706637/). In particular Lockdown restricts access to MSR and PCI BAR (via /dev/mem) which are required by this script. + ### Update: The scripts is now running with Python3 by default (tested w/ 3.6) and a virtualenv is automatically created in `/opt/lenovo_fix`. Python2 should probably still work. From 0444e9d0f7fa6eb7d840961139eeaa173db71ba5 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Thu, 24 May 2018 11:44:06 +0200 Subject: [PATCH 6/8] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 682a017..3e99cf1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -# Fix T480 / T480s / X1C6 Throttling on Linux +# Fix Intel CPU Throttling on Linux Workaround for Linux throttling issues on Lenovo T480 / T480s / X1C6 notebooks as described [here](https://www.reddit.com/r/thinkpad/comments/870u0a/t480s_linux_throttling_bug/). This script forces the CPU package power limit (PL1/2) to **44 W** (29 W on battery) and the temperature trip point to **97 'C** (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default. +Tested and working also for **T580**! + ### Undervolt: The script now also supports **undervolting** the CPU by configuring voltage offsets for CPU, cache, GPU, System Agent and Analog I/O planes. The script will re-apply undervolt on resume from standby and hibernate by listening to DBus signals. From 19ab4cf72bb4b1ea1826b62bca4191d1bed0bca0 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Fri, 25 May 2018 11:10:32 +0200 Subject: [PATCH 7/8] updated default trip temperature on AC to a more conservative value --- etc/lenovo_fix.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/lenovo_fix.conf b/etc/lenovo_fix.conf index f3c5375..b428d94 100644 --- a/etc/lenovo_fix.conf +++ b/etc/lenovo_fix.conf @@ -29,7 +29,7 @@ PL2_Tdp_W: 44 # Time window #2 duration PL2_Duration_S: 0.002 # Max allowed temperature before throttling -Trip_Temp_C: 97 +Trip_Temp_C: 95 [UNDERVOLT] # CPU core voltage offset (mV) From 2e32d4e74219df1f9e3dadb44dbf5fcb57023f12 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Fri, 25 May 2018 11:10:57 +0200 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e99cf1..0e18507 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Fix Intel CPU Throttling on Linux Workaround for Linux throttling issues on Lenovo T480 / T480s / X1C6 notebooks as described [here](https://www.reddit.com/r/thinkpad/comments/870u0a/t480s_linux_throttling_bug/). -This script forces the CPU package power limit (PL1/2) to **44 W** (29 W on battery) and the temperature trip point to **97 'C** (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default. +This script forces the CPU package power limit (PL1/2) to **44 W** (29 W on battery) and the temperature trip point to **95 'C** (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default. Tested and working also for **T580**!