Search This Blog

Showing posts with label thinkpad. Show all posts
Showing posts with label thinkpad. Show all posts

A script to disable and enable intel cpu turbo boost on Linux

I have a Thinkpad T410 laptop with i5 cpu. The computer turns off when compiling GWT code because of cpu overheating. The cpu temperature increases to 100 degrees in about 3 minutes even if I set the fan speed to maximum 5000rpm.

So I looked for resolution and found disabling turbo boost can help.
  1. First, you need to install msr-tools:
    sudo apt-get install msr-tools
  2. To disable turbo boost on all your cpu cores:
    sudo wrmsr -pi 0x1a0 0x4000850089
    where i is the cpu core number, e.g. 0, 1, 2, 3..., you can get those number by running
    cat /proc/cpuinfo | grep processor
    .
    Note: you need to run the wrmsr command for each cpu core.
  3. To re-enable turbo boost on all your cpu cores:
    sudo wrmsr -pi 0x1a0 0x850089
    where i is the cpu core number, e.g. 0, 1, 2, 3..., you can get those number by running
    cat /proc/cpuinfo | grep processor
    .
    Note: you need to run the wrmsr command for each cpu core.
After disabling turbo boost, I am able to complete my GWT compilation altough the temperature still goes as high as 90 degrees.

A script to disable/enable turbo boost

The following script can be used to turn off/on turbo boost:
#!/bin/bash

if [[ -z $(which rdmsr) ]]; then
    echo "msr-tools is not installed. Run 'sudo apt-get install msr-tools' to install it." >&2
    exit 1
fi

if [[ ! -z $1 && $1 != "enable" && $1 != "disable" ]]; then
    echo "Invalid argument: $1" >&2
    echo ""
    echo "Usage: $(basename $0) [disable|enable]"
    exit 1
fi

cores=$(cat /proc/cpuinfo | grep processor | awk '{print $3}')
for core in $cores; do
    if [[ $1 == "disable" ]]; then
        sudo wrmsr -p${core} 0x1a0 0x4000850089
    fi
    if [[ $1 == "enable" ]]; then
        sudo wrmsr -p${core} 0x1a0 0x850089
    fi
    state=$(sudo rdmsr -p${core} 0x1a0 -f 38:38)
    if [[ $state -eq 1 ]]; then
        echo "core ${core}: disabled"
    else
        echo "core ${core}: enabled"
    fi
done

Usage:
You can copy the above script and save it into a file named turbo-boost then set it to be executable:
sudo chmod +x turbo-boost
you can then use it to disable/enable turbo boost:
  • turbo-boost disable
  • turbo-boost enable


See also

Install thinkfan fan control utility on Lenovo thinkpad laptops

I.Installation

  1. Install thinkfan from repository:
    sudo apt-get install thinkfan
  2. Enable fan control in thinkpad_acpi module configuration:
    sudo echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkpad_acpi.conf
  3. Reload thinkpad_acpi module:
    sudo rmmod thinkpad_acpi; sudo modprobe thinkpad_acpi
  4. Set to start thinkfan automatically at boot time:
    sudo vi /etc/defaults/thinkfan
    START=yes

II.Customization

  1. Install lm-sensors:
    sudo apt-get install lm-sensors
  2. To check the temperatures of the sensors:
    sensors
  3. To modify the thinkfan fan control settings:
    sudo vi /etc/thinkfan.conf

Thinkpad R400 - Windows 7 Installation - driver for PCI Simple Communications Controller

The unknown device, "PCI Simple Communications Controller", in Device Manager, is the Intel Management Engine Interface.

Install the driver for Management Engine Interface. Problem solved.

Thinkpad R400 - Windows 7 Installation - driver for Base System Device

After installation of the OS and a few drivers, I found there are still some unknown devices, "Base System Device", in Device Manager.

Searched and found that it is the Ricoh Multi Card reader and I missed the driver. Download and install Ricoh Multi Card reader driver from Lenovo.com. Problem fixed.

Thinkpad Laptop/Notebook Fan Control Software

Thinkpad fan keeps running on high speed (noisy) even if the cpu/acpi temperature is quite low.  You may try to use the following Thinkpad Fan (Speed) Control software to manage the fan speeds.

1. tpfancontrol(tp4xfancontrol) at sourceforge.net

2. tpfancontrol by troubadix

Tips: