MacBook Pro 10(2013)上的 ubuntu 过热

MacBook Pro 10(2013)上的 ubuntu 过热

我在 MacBook Pro(2013)上运行 ubuntu,即使启用了 mbpfan,与 MACOS 相比,它还是过热了。还有其他方法可以进一步降低运行温度吗?我看到 2010 年有一种方法可以手动设置风扇规则https://bbs.archlinux.org/viewtopic.php?id=71187

我有一台配备 Intel/Nvidia 显卡的 Mac book pro,并且我启用了 Nvidia 显卡 Nvidia GPU 使用情况

我已经安装了mbpfan采用以下温度配置:

[general]
# see https://ineed.coffee/3838/a-beginners-tutorial-for-mbpfan-under-ubuntu for the values
# 
# mbpfan will load the max / min speed of from the files produced by the applesmc driver. If these files are not found it will set all fans to the default of min_speed = 2000 and max_speed = 6200
# by setting the values for the speeds in this config it will override whatever it finds in:
# /sys/devices/platform/applesmc.768/fan*_min
# /sys/devices/platform/applesmc.768/fan*_max
# or the defaults.
#
# multiple fans can be configured by using the config key of min_fan*_speed and max_fan*_speed
# the number used will correlate to the file number of the fan in the applesmc driver that are used to control the fan speed.
#
#min_fan1_speed = 2000  # put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
#max_fan1_speed = 6200  # put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"
#low_temp = 63          # try ranges 55-63, default is 63
low_temp = 55           # try ranges 55-63, default is 63
#high_temp = 66         # try ranges 58-66, default is 66
high_temp = 58          # try ranges 58-66, default is 66
max_temp = 86           # take highest number returned by "cat /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_max", divide by 1000
polling_interval = 1    # default is 1 seconds

虽然我的 Macbook 温度仍然很高,但有人知道如何进一步控制 macbook-ubuntu 上的过热问题吗?

$ sensors
applesmc-isa-0300
Adapter: ISA adapter
Left side  : 3474 RPM  (min = 2160 RPM, max = 5940 RPM)
Right side : 3042 RPM  (min = 2000 RPM, max = 5499 RPM)
TB0T:         +36.0°C  
TB1T:         +36.0°C  
TB2T:         +34.5°C  
TC0E:         +65.5°C  
TC0F:         +67.5°C  
TC0P:         +51.5°C  
TC1C:         +63.0°C  
TC2C:         +63.0°C  
TC3C:         +63.0°C  
TC4C:         +61.0°C  
TCGC:         +63.0°C  
TCSA:         +58.0°C  
TCTD:          -0.2°C  
TCXC:         +65.2°C  
TG0D:         +61.8°C  
TG0P:         +56.0°C  
TG1D:         +64.0°C  
TG1F:         +63.2°C  
TG1d:         +58.0°C  
TH0A:         +37.8°C  
TH0B:         +40.8°C  
TH0V:         +41.0°C  
TH0a:         +37.8°C  
TH0b:         +40.8°C  
TH0c:        -127.0°C  
TH0x:         +40.8°C  
TM0P:         +52.0°C  
TM0S:         +51.2°C  
TMBS:         +51.0°C  
TP0P:         +53.5°C  
TPCD:         +56.0°C  
TS0D:        -127.0°C  
TS0P:        -127.0°C  
TS1D:        -127.0°C  
TS1P:        -127.0°C  
TW0P:         +47.5°C  
Ta0P:         +42.8°C  
TaSP:         +40.0°C  
Th1H:         +44.2°C  
Th2H:         +53.0°C  
Ts0P:         +33.0°C  
Ts0S:         +40.0°C  
Ts1S:         +41.0°C  

BAT0-acpi-0
Adapter: ACPI interface
in0:          12.40 V  
temp:         +36.3°C  
curr1:         0.00 A  (avg =  +0.00 A)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +64.0°C  (high = +87.0°C, crit = +105.0°C)
Core 0:        +64.0°C  (high = +87.0°C, crit = +105.0°C)
Core 1:        +64.0°C  (high = +87.0°C, crit = +105.0°C)
Core 2:        +64.0°C  (high = +87.0°C, crit = +105.0°C)
Core 3:        +64.0°C  (high = +87.0°C, crit = +105.0°C)

BAT0-virtual-0
Adapter: Virtual device
temp1:        +36.3°C  

答案1

我使用节流/不节流脚本修复了过热问题:-)

  1. 安装mbpfanhttps://github.com/linux-on-mac/mbpfan
  2. 安装CPU 功率https://manpages.debian.org/buster/linux-cpupower/cpupower.1.en.html
  3. 使用 Sepero 定制的节流/取消节流脚本:http://seperohacker.blogspot.com/2012/10/linux-keep-your-cpu-cool-with-frequency.html https://github.com/Sepero/temp-throttle 我利用以下方法定制了 Sepero 的脚本CPU 功率
#!/bin/bash

# Usage: temp_throttle.sh max_temp
# USE CELSIUS TEMPERATURES.
# version 2.21

cat << EOF
Author: Sepero 2016 (sepero 111 @ gmx . com)
URL: http://github.com/Sepero/temp-throttle/

EOF

# Additional Links
# http://seperohacker.blogspot.com/2012/10/linux-keep-your-cpu-cool-with-frequency.html

# Additional Credits
# Wolfgang Ocker <weo AT weo1 DOT de> - Patch for unspecified cpu frequencies.

# License: GNU GPL 2.0

# Generic  function for printing an error and exiting.
err_exit () {
    echo ""
    echo "Error: $@" 1>&2
    exit 128
}

if [ $# -ne 1 ]; then
    # If temperature wasn't given, then print a message and exit.
    echo "Please supply a maximum desired temperature in Celsius." 1>&2
    echo "For example:  ${0} 60" 1>&2
    exit 2
else
    #Set the first argument as the maximum desired temperature.
    MAX_TEMP=$1
fi


### START Initialize Global variables.

# The frequency will increase when low temperature is reached.
LOW_TEMP=$((MAX_TEMP - 5))

CORES=$(nproc) # Get number of CPU cores.
echo -e "Number of CPU cores detected: $CORES\n"
CORES=$((CORES - 1)) # Subtract 1 from $CORES for easier counting later.

# Temperatures internally are calculated to the thousandth.
MAX_TEMP=${MAX_TEMP}000
LOW_TEMP=${LOW_TEMP}000

FREQ_FILE="/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies"
FREQ_MIN="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq"
FREQ_MAX="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"

# Store available cpu frequencies in a space separated string FREQ_LIST.
if [ -f $FREQ_FILE ]; then
    # If $FREQ_FILE exists, get frequencies from it.
    FREQ_LIST=$(cat $FREQ_FILE | xargs -n1 | sort -g -r | xargs) || err_exit "Could not read available cpu frequencies from file $FREQ_FILE"
elif [ -f $FREQ_MIN -a -f $FREQ_MAX ]; then
    # Else if $FREQ_MIN and $FREQ_MAX exist, generate a list of frequencies between them.
    FREQ_LIST=$(seq $(cat $FREQ_MAX) -100000 $(cat $FREQ_MIN)) || err_exit "Could not compute available cpu frequencies"
else
    err_exit "Could not determine available cpu frequencies"
fi

FREQ_LIST_LEN=$(echo $FREQ_LIST | wc -w)

# CURRENT_FREQ will save the index of the currently used frequency in FREQ_LIST.
CURRENT_FREQ=2

# This is a list of possible locations to read the current system temperature.
TEMPERATURE_FILES="
/sys/class/thermal/thermal_zone0/temp
/sys/class/thermal/thermal_zone1/temp
/sys/class/thermal/thermal_zone2/temp
/sys/class/hwmon/hwmon0/temp1_input
/sys/class/hwmon/hwmon1/temp1_input
/sys/class/hwmon/hwmon2/temp1_input
/sys/class/hwmon/hwmon0/device/temp1_input
/sys/class/hwmon/hwmon1/device/temp1_input
/sys/class/hwmon/hwmon2/device/temp1_input
null
"

# Store the first temperature location that exists in the variable TEMP_FILE.
# The location stored in $TEMP_FILE will be used for temperature readings.
for file in $TEMPERATURE_FILES; do
    TEMP_FILE=$file
    [ -f $TEMP_FILE ] && break
done

[ $TEMP_FILE == "null" ] && err_exit "The location for temperature reading was not found."


### END Initialize Global variables.


### START define script functions.

# Set the maximum frequency for all cpu cores.
set_freq () {
    # From the string FREQ_LIST, we choose the item at index CURRENT_FREQ.
    FREQ_TO_SET=$(echo $FREQ_LIST | cut -d " " -f $CURRENT_FREQ)
    echo $FREQ_TO_SET
    for i in $(seq 0 $CORES); do
        # Try to set core frequency by writing to /sys/devices.
        { echo $FREQ_TO_SET 2> /dev/null > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq; } ||
        # Else, try to set core frequency using command cpufreq-set.
        { cpupower -c $i frequency-set -u $FREQ_TO_SET > /dev/null; } ||
        #{ cpufreq-set -c $i --max $FREQ_TO_SET > /dev/null; } ||
        # Else, return error message.
        { err_exit "Failed to set frequency CPU core$i. Run script as Root user. Some systems may require to install the package cpufrequtils."; }
    done
}

# Will reduce the frequency of cpus if possible.
throttle () {
    if [ $CURRENT_FREQ -lt $FREQ_LIST_LEN ]; then
        CURRENT_FREQ=$((CURRENT_FREQ + 1))
        echo -n "throttle "
        set_freq $CURRENT_FREQ
    fi
}

# Will increase the frequency of cpus if possible.
unthrottle () {
    if [ $CURRENT_FREQ -ne 1 ]; then
        CURRENT_FREQ=$((CURRENT_FREQ - 1))
        echo -n "unthrottle "
        set_freq $CURRENT_FREQ
    fi
}

get_temp () {
    # Get the system temperature. Take the max of all counters
    
    TEMP=$(cat $TEMPERATURE_FILES 2>/dev/null | xargs -n1 | sort -g -r | head -1)
}

### END define script functions.

echo "Initialize to max CPU frequency"
unthrottle


# Main loop
while true; do
    get_temp # Gets the current temperature and set it to the variable TEMP.
    if   [ $TEMP -gt $MAX_TEMP ]; then # Throttle if too hot.
        throttle
    elif [ $TEMP -le $LOW_TEMP ]; then # Unthrottle if cool.
        unthrottle
    fi
    sleep 3 # The amount of time between checking temperatures.
done

然后最终使用设置温度 50 的脚本后,我能够将 CPU 温度降低 10C!

$ sensors
applesmc-isa-0300
Adapter: ISA adapter
Left side  : 3620 RPM  (min = 2160 RPM, max = 5940 RPM)
Right side : 3360 RPM  (min = 2000 RPM, max = 5499 RPM)
TB0T:         +33.5°C  
TB1T:         +33.5°C  
TB2T:         +32.5°C  
TC0E:         +55.0°C  
TC0F:         +58.2°C  
TC0P:         +45.2°C  
TC1C:         +55.0°C  
TC2C:         +55.0°C  
TC3C:         +55.0°C  
TC4C:         +55.0°C  
TCGC:         +55.0°C  
TCSA:         +48.0°C  
TCTD:          -0.5°C  
TCXC:         +52.5°C  
TG0D:         +52.5°C  
TG0P:         +47.2°C  
TG1D:         +55.0°C  
TG1F:         +54.2°C  
TG1d:         +49.0°C  
TH0A:         +35.0°C  
TH0B:         +37.0°C  
TH0V:         +37.0°C  
TH0a:         +35.0°C  
TH0b:         +37.0°C  
TH0c:        -127.0°C  
TH0x:         +37.0°C  
TM0P:         +46.5°C  
TM0S:         +45.2°C  
TMBS:         +45.0°C  
TP0P:         +48.8°C  
TPCD:         +51.0°C  
TS0D:        -127.0°C  
TS0P:        -127.0°C  
TS1D:        -127.0°C  
TS1P:        -127.0°C  
TW0P:         +43.5°C  
Ta0P:         +38.8°C  
TaSP:         +36.2°C  
Th1H:         +39.8°C  
Th2H:         +44.8°C  
Ts0P:         +31.0°C  
Ts0S:         +35.5°C  
Ts1S:         +37.2°C  

BAT0-acpi-0
Adapter: ACPI interface
in0:          12.38 V  
temp:         +33.7°C  
curr1:         0.00 A  (avg =  +0.00 A)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +58.0°C  (high = +87.0°C, crit = +105.0°C)
Core 0:        +51.0°C  (high = +87.0°C, crit = +105.0°C)
Core 1:        +58.0°C  (high = +87.0°C, crit = +105.0°C)
Core 2:        +53.0°C  (high = +87.0°C, crit = +105.0°C)
Core 3:        +52.0°C  (high = +87.0°C, crit = +105.0°C)

BAT0-virtual-0
Adapter: Virtual device
temp1:        +33.7°C  

相关内容