AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 443654
Accepted
piegames
piegames
Asked: 2018-05-15 01:10:15 +0800 CST2018-05-15 01:10:15 +0800 CST 2018-05-15 01:10:15 +0800 CST

Defina a temperatura crítica da CPU para otimização térmica

  • 772

De acordo com sensors, a temperatura crítica para os núcleos da minha CPU é de 100°C. Ao usar meu laptop, ele nunca passa de 95 ° C (portanto, meu sensor está com defeito ou a limitação térmica está definida para um valor mais baixo por algum motivo, mas isso realmente não importa). Eu tenho um Intel i7 e o thermald.service está funcionando e estou no Arch Linux.

Mas 95°C é muito quente e gostaria de diminuir esse valor. Eu gostaria de ter um estrangulamento térmico a 75 ou 80°C. Achei que seria simples, mas aparentemente há pouca informação no Google e a configuração do thermald carece de documentação.

eu tentei

dbus-send --system --dest=org.freedesktop.thermald /org/freedesktop/thermald org.freedesktop.thermald.SetUserPassiveTemperature string:cpu uint32:80000

como sugere a página de manual, mas a execução stressainda aumentou a temperatura para 95.

Então, como faço para diminuir o valor no qual ocorre o estrangulamento térmico?

arch-linux cpu-frequency
  • 1 1 respostas
  • 8520 Views

1 respostas

  • Voted
  1. Best Answer
    Ipor Sircer
    2018-05-15T03:47:21+08:002018-05-15T03:47:21+08:00

    Existe uma solução de hack via shellscript: https://github.com/Sepero/temp-throttle/

    #!/bin/bash
    
    # Usage: temp_throttle.sh max_temp
    # USE CELSIUS TEMPERATURES.
    # version 2.20
    
    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) || 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.
            { 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.
    
        TEMP=$(cat $TEMP_FILE)
    }
    
    ### 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
    
    • 3

relate perguntas

  • Erro de configuração do Nftables: protocolos conflitantes especificados: inet-service v. icmp

  • archlinux efi netboot kernel "ip" não funciona?; systemd "Falha ao iniciar o Switch Root."

  • Como alguém pode configurar o áudio no Arch Linux suportando vários programas que emitem áudio ao mesmo tempo sem criar um asoundrc?

  • Por que às vezes é necessário importar chaves manualmente?

  • Carregar dispositivo na inicialização

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    ssh Não é possível negociar: "nenhuma cifra correspondente encontrada", está rejeitando o cbc

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    Como descarregar o módulo do kernel 'nvidia-drm'?

    • 13 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add retorna com: "Erro ao conectar ao agente: nenhum arquivo ou diretório" 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya Por que o Linux usa LF como caractere de nova linha? 2017-12-20 05:48:21 +0800 CST

Hot tag

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve