This tool was originally developed to fix Linux CPU throttling issues affecting Lenovo T480 / T480s / X1C6 as described here.
The CPU package power limit (PL1/2) is forced to a value of 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.
On systems where the EC doesn't reset the values (ex: ASUS Zenbook UX430UNR), the power limit can be altered by using the official intel_rapl driver (see Static fix for more information)
The latest commit (30 Oct 2021) switched from the legacy name lenovo_fix for the tool/config/system to a more uniform throttled. The install script was updated, but please report back if anything breaks.
Other users have confirmed that the tool is also working for these laptops:
I will keep this list updated.
I suggest you to use the excellent s-tui tool to check and monitor the CPU usage, frequency, power and temperature under load!
The tool supports undervolting the CPU by configuring voltage offsets for CPU, cache, GPU, System Agent and Analog I/O planes. The tool will re-apply undervolt on resume from standby and hibernate by listening to DBus signals. You can now either use the UNDERVOLT key in config to set global values or the UNDERVOLT.AC and UNDERVOLT.BATTERY keys to selectively set undervolt values for the two power profiles.
===== Notice that undervolt is typically locked from 10th gen onwards! =====
The tool now supports overriding the IccMax by configuring the maximum allowed current for CPU, cache and GPU planes. The tool will re-apply IccMax on resume from standby and hibernate. You can now either use the ICCMAX key in config to set global values or the ICCMAX.AC and ICCMAX.BATTERY keys to selectively set current values for the two power profiles. NOTE: the values specified in the config file are the actual current limit of your system, so those are not a offset from the default values as for the undervolt. As such, you should first find your system default values with the --monitor command.
I have found that under load my CPU was not always hitting max turbo frequency, in particular when using one/two cores only. For instance, when running prime95 (1 core, test #1) my CPU is limited to about 3500 MHz over the theoretical 4000 MHz maximum. The reason is the value for the HWP energy performance hints. By default TLP sets this value to balance_performance on AC in order to reduce the power consumption/heat in idle. By setting this value to performance I was able to reach 3900 MHz in the prime95 single core test, achieving a +400 MHz boost. Since this value forces the CPU to full speed even during idle, a new experimental feature allows to automatically set HWP to performance under load and revert it to balanced when idle. This feature can be enabled (in AC mode only) by setting to True the HWP_Mode parameter in the throttled config file : https://github.com/erpalma/throttled/blob/master/etc/throttled.conf#L41 .
I have run Geekbench 4 and now I can get a score of 5391/17265! On balance_performance I can reach only 4672/16129, so 15% improvement in single core and 7% in multicore, not bad ;)
On a lot of modern CPUs from Intel one can configure the TDP up or down based on predefined profiles. This is what this option does. For a i7-8650U normal would be 15W, up profile is setting it to 25W and down to 10W. You can lookup the values of your CPU at the Intel product website.
A stripped down version of the python module python-periphery is now built-in and it 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.
Some time ago a feature called Kernel Lockdown was added to Linux. Kernel Lockdown automatically enables some security measures when Secure Boot is enabled, among them restricted access to MSR and PCI BAR via /dev/mem, which this tool requires. There are two ways to get around this: You can either disable Secure Boot in your firmware settings, or disable the Kernel Lockdown LSM.
The LSM can be disabled this way: Check the contents of the file /sys/kernel/security/lsm (example contents: capability,lockdown,yama). Take the contents of the file, remove lockdown and add the rest as a kernel parameter, like this: lsm=capability,yama. Reboot and Kernel Lockdown will be disabled!
As of Linux 5.9, kernel messages will be logged whenever the script writes to MSR registers. These aren't a problem for now, but there's some indication that future kernels may restrict MSR writes from userspace by default. This is being tracked by issue #215. The messages will look something like:
[ 324.833543] msr: Write to unrecognized MSR 0x1a2 by python3
Please report to x86@kernel.org
Note that some kernels (e.g. linux-hardened) will prevent from writing to /dev/mem too. Specifically, you need a kernel with CONFIG_DEVMEM and CONFIG_X86_MSR set.
As discovered by DEvil0000 the Linux Thermal Monitor (thermald) can conflict with the purpose of this tool. In particular, thermald might be pre-installed (e.g. on Ubuntu) and configured in such a way to keep the CPU temperature below a certain threshold (~80 'C) by applying throttling or messing up with RAPL or other CPU-specific registers. I strongly suggest to either disable/uninstall it or to review its default configuration.
The tool is now running with Python3 by default (tested w/ 3.6) and a virtualenv is automatically created in /opt/throttled. Python2 should probably still work.
pacman -S throttled
sudo systemctl enable --now throttled.service
Thanks to felixonmars for creating and maintaining this package.
makepkg -si
sudo rc-update add throttled default
sudo rc-service throttled start
sudo apt install git build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev python3-cairo-dev python3-venv python3-wheel
git clone https://github.com/erpalma/throttled.git
sudo ./throttled/install.sh
If you own a X1C6 you can also check a tutorial for Ubuntu 18.04 here.
You should make sure that thermald is not setting it back down. Stopping/disabling it will do the trick:
sudo systemctl stop thermald.service
sudo systemctl disable thermald.service
If you want to keep it disabled even after a package update you should also run:
sudo systemctl mask thermald.service
In order to check if the service is well started, you could run:
systemctl status throttled
A copr repository is available and can be used as detailed below. You can find the configuration installed at /etc/throttled.conf. The issue tracker for this packaging is available here.
sudo dnf copr enable abn/throttled
sudo dnf install -y throttled
sudo systemctl enable --now throttled
If you prefer to install from source, you can use the following commands.
sudo dnf install python3-cairo-devel cairo-gobject-devel gobject-introspection-devel dbus-glib-devel python3-devel make libX11-devel
git clone https://github.com/erpalma/throttled.git
sudo ./throttled/install.sh
Feedback about Fedora installation is welcome.
Download the .repo file matching your Fedora on the copr repository page then copy it to /etc/yum.repos.d/.
You can then install the package:
rpm-ostree override remove thermald rpm-ostree install throttled systemctl reboot sudo systemctl enable --now throttled
User brycecordill reported that the following dependencies are required for installing in openSUSE, tested on openSUSE 15.0 Leap.
sudo zypper install gcc make python3-devel dbus-1-glib-devel python3-cairo-devel cairo-devel python3-gobject-cairo gobject-introspection-devel
git clone https://github.com/erpalma/throttled.git
sudo ./throttled/install.sh
The ebuild is now in the official tree!
sudo emerge -av sys-power/throttled
# when using OpenRC:
rc-update add throttled default
/etc/init.d/throttled start
# when using systemd:
systemctl enable --now throttled.service
sudo eopkg it -c system.devel
sudo eopkg it git python3-devel dbus-glib-devel python3-cairo-devel libcairo-devel python3-gobject-devel
git clone https://github.com/erpalma/throttled.git
sudo ./throttled/install.sh
The installation itself will create a runit service as throttled, enable it and start it. Before installation, make sure dbus is running sv up dbus.
sudo xbps-install -Sy gcc git python3-devel dbus-glib-devel libgirepository-devel cairo-devel python3-wheel pkg-config make
git clone https://github.com/erpalma/throttled.git
sudo ./throttled/install.sh
To permanently stop and disable the execution just issue:
systemctl stop throttled.service
systemctl disable throttled.service
If you're running runit instead of systemd:
sv down throttled
rm /var/service/throttled
If you're using OpenRC instead of systemd:
rc-service throttled stop
rc-update del throttled default
If you also need to remove the tool from the system:
rm -rf /opt/throttled /etc/systemd/system/throttled.service
# to purge also the config file
rm /etc/throttled.conf
On Arch you should probably use pacman -R lenovo-throttling-fix-git instead.
If you update the tool you should manually check your config file for changes or additional features and modify it accordingly. The update process is then as simple as:
cd throttled
git pull
sudo ./install.sh
sudo systemctl restart throttled.service
OpenRC: sudo rc-service throttled restart
The configuration has moved to /etc/throttled.conf. Makefile does not overwrite your previous config file, so you need to manually check for differences in config file structure when updating the tool. If you want to overwrite the config with new defaults just issue sudo cp etc/throttled.conf /etc. There exist two profiles AC and BATTERY and the tool can be totally disabled by setting Enabled: False in the GENERAL section. Undervolt is applied if any voltage plane in the config file (section UNDERVOLT) was set. Notice that the offset is in mV and only undervolting (i.e. negative values) is supported.
All fields accept floating point values as well as integers.
My T480s with i7-8550u is stable with:
[UNDERVOLT]
# CPU core voltage offset (mV)
CORE: -105
# Integrated GPU voltage offset (mV)
GPU: -85
# CPU cache voltage offset (mV)
CACHE: -105
# System Agent voltage offset (mV)
UNCORE: -85
# Analog I/O voltage offset (mV)
ANALOGIO: 0
IMPORTANT: Please notice that my system is stable with these values. Your notebook might crash even with slight undervolting! You should test your system and slowly incresing undervolt to find the maximum stable value for your CPU. You can check this tutorial if you don't know where to start.
With the flag --monitor the tool constantly monitors the throttling status, indicating the cause among thermal limit, power limit, current limit or cross-origin. The last cause is often related to an external event (e.g. by the GPU). The update rate can be adjusted and defaults to 1 second. Example output:
./throttled.py --monitor
[I] Detected CPU architecture: Intel Kaby Lake (R)
[I] Loading config file.
[I] Starting main loop.
[D] Undervolt offsets: CORE: -105.00 mV | GPU: -85.00 mV | CACHE: -105.00 mV | UNCORE: -85.00 mV | ANALOGIO: 0.00 mV
[D] IccMax: CORE: 64.00 A | GPU: 31.00 A | CACHE: 6.00 A
[D] Realtime monitoring of throttling causes:
[AC] Thermal: OK - Power: OK - Current: OK - Cross-domain (e.g. GPU): OK || VCore: 549 mV - Package: 2.6 W - Graphics: 0.4 W - DRAM: 1.2 W
You can alternatively set the power limits using intel_rapl driver (modifying MCHBAR values requires Linux 5.3+). Bear in mind, some embedded controllers (EC) control the power limit values and will reset them from time to time):
# MSR
# PL1
echo 44000000 | sudo tee /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw # 44 watt
echo 28000000 | sudo tee /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_time_window_us # 28 sec
# PL2
echo 44000000 | sudo tee /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_1_power_limit_uw # 44 watt
echo 2440 | sudo tee /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_1_time_window_us # 0.00244 sec
# MCHBAR
# PL1
echo 44000000 | sudo tee /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_power_limit_uw # 44 watt
# ^ Only required change on a ASUS Zenbook UX430UNR
echo 28000000 | sudo tee /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_time_window_us # 28 sec
# PL2
echo 44000000 | sudo tee /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_1_power_limit_uw # 44 watt
echo 2440 | sudo


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完 成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量 提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号