우분투 랩톱에서 ATLAS를 실행해야하지만 CPU 주파수 스케일링을 비활성화하지 않으면 소프트웨어가 실행되지 않습니다. http://math-atlas.sourceforge.net/atlas_install/node5.html 에서 지침을 시도했지만 Toshiba 랩톱에서 작동하지 않습니다. 주파수 스케일링을 켜면 소프트웨어가 쓸모 없게됩니다.
누구든지 도울 수 있습니까?
우분투 랩톱에서 ATLAS를 실행해야하지만 CPU 주파수 스케일링을 비활성화하지 않으면 소프트웨어가 실행되지 않습니다. http://math-atlas.sourceforge.net/atlas_install/node5.html 에서 지침을 시도했지만 Toshiba 랩톱에서 작동하지 않습니다. 주파수 스케일링을 켜면 소프트웨어가 쓸모 없게됩니다.
누구든지 도울 수 있습니까?
답변:
cpuf
최소 및 최대 주파수를 마음대로 설정하기 위해 GUI를 작성 했습니다. Math 앱 바로 전에 사용하여 모든 주파수를 최대로 설정할 수 있습니다. Math 앱을 실행 한 후 배터리 수명이 길고 발열이 적도록 주파수를 정상으로 재설정 할 수 있습니다.
이 데모에서는 cpuf
왼쪽에 conky
시스템 정보가 있고 오른쪽에 시스템 정보가 있습니다. 데모는 다음과 같이 진행됩니다.
800
/3500
800
/로 무시 800
하고 CPU 사용량이 20 %로 증가3500
/로 무시 3500
하고 CPU 사용량이 10 %로 감소3 개의 모니터를 사용하면 cpuf
10 피트 떨어진 곳에 나타날 수 있으므로 매개 변수 1 --geometry
옵션을 사용 하여 conky
다음에 가까이 두십시오 .
sudo cpuf --geometry="450x450+4720+80" /home/rick/Pictures/icons/cpu-intel-128.svg
--geometry
은 창 너비 x 높이 + 너비 오프셋 + 높이 오프셋입니다.cpuf
배쉬 스크립트이 섹션에서는 Ctrl+ Alt+ 로 터미널을 열어야합니다 T.
cpuf
bash 스크립트가 작동 하려면 다음이 필요합니다.
sudo apt install yad # from the repository universe
sudo apt install coreutils # installed by default in most distros
cpuf
검색 경로 내의 루트 소유 디렉토리에 스크립트를 배치하는 것이 가장 쉽습니다 . 예를 들면 다음과 같습니다 /usr/local/bin
..
cpuf
스크립트 를 만들 려면로 편집기를 엽니 다 sudo -H gedit /usr/local/bin/cpuf
.
로 스크립트를 실행 가능하게 만듭니다 sudo chmod a+x /usr/local/bin/cpuf
.
cpuf
편집기로 복사 할 코드#!/bin/bash
# NAME: cpuf (Pronounced SEA-PUFF)
# CALL: sudo cpuf
# PARM: $1 = --geometry=WidthxHeight+VertOffset+HorizOffset
# $2 = Optional image icon
# DESC: Simple GUI script to set CPU Min and Max Frequency.
# For Ask Ubuntu Question: https://askubuntu.com/q/1141605/307523
# DATE: May 12, 2019.
# UPDT: No updates yet.
# NOTE: No notes yet.
### Dependancies ###
command -v yad >/dev/null 2>&1 || { echo >&2 \
"yad package required but it is not installed. Aborting."; \
exit 1; }
command -v nproc >/dev/null 2>&1 || { echo >&2 \
"coreutils package required but it is not installed. Aborting."; \
exit 2; }
if [[ $(id -u) != 0 ]]; then # root powers needed to call this script
echo >&2 Must be called with sudo powers
exit 3
fi
# $TERM variable may be missing when called via desktop shortcut
CurrentTERM=$(env | grep TERM)
if [[ $CurrentTERM == "" ]] ; then
notify-send --urgency=critical \
"$0 cannot be run from GUI without TERM environment variable."
exit 4
fi
### Program constants ###
## Yad Window parameters
# Hard code Height & Width to suit your screen resolution and scaling factor
GEOMETRY="--width 400 --height 500"
# Pass Parameter 1 with ---geometry="WidxHgt+WidOff+HgtOff" to override
[[ "$1" == --geometry=* ]] && GEOMETRY="$1"
TITLE="cpuf"
TEXT="Set CPU Min/Max Frequencies"
ICON="/usr/share/icons/Adwaita/48x48/devices/computer.png"
# Pass Parameter 2 with icon for window image
# Intel CPU comes from: https://www.gnome-look.org/p/1107932/
[[ ! -z "$2" ]] && ICON="$2"
## Virtual File System directories
CPU0_DIR=/sys/devices/system/cpu/cpu0/cpufreq
PSTATE_DIR=/sys/devices/system/cpu/intel_pstate
CURR_MIN_FREQ="$CPU0_DIR/scaling_min_freq"
CURR_MAX_FREQ="$CPU0_DIR/scaling_max_freq"
ALLOW_MIN_FREQ="$CPU0_DIR/cpuinfo_min_freq"
ALLOW_MAX_FREQ="$CPU0_DIR/cpuinfo_max_freq"
OLD_IFS=$IFS # Save current Input File Separtor (IFS)
declare -a Arr # Array for YAD Window input
NumCPU=$(nproc --all) # Number of CPUs (nproc from coreutils)
### Error Message Functions ###
Abend () {
# Abnormal Ending - Parameter 1 = message to display, Parameter 2=exit code
yad --image "dialog-error" --image-on-top --title "$TITLE - Fatal Error" \
"$GEOMETRY" --button=gtk-ok:0 --text "$1" 2>/dev/null
exit "$2"
} # Abend
ErrMsg () {
# Parmater 1 = message to display
yad --image "dialog-error" --title "$TITLE - Logical Error" \
"$GEOMETRY" --button=gtk-ok:0 --text "$1" 2>/dev/null
fErrMsgForceContinue=true
} # ErrMsg
### Initialize Variables ###
InitVars () {
[[ ! -e "$ALLOW_MIN_FREQ" ]] && Abend "$ALLOW_MIN_FREQ not found" 11
AllowMinFreq=$(cat "$ALLOW_MIN_FREQ")
AllowMinFreq="${AllowMinFreq::-3}" # Chop off three decimals at end
[[ ! -e "$ALLOW_MAX_FREQ" ]] && Abend "$ALLOW_MAX_FREQ not found" 12
AllowMaxFreq=$(cat "$ALLOW_MAX_FREQ")
AllowMaxFreq="${AllowMaxFreq::-3}"
[[ ! -e "$CURR_MIN_FREQ" ]] && Abend "$CURR_MIN_FREQ not found" 13
CurrMinFreq=$(cat "$CURR_MIN_FREQ")
CurrMinFreq="${CurrMinFreq::-3}"
NewMinFreq="$CurrMinFreq"
[[ ! -e "$CURR_MAX_FREQ" ]] && Abend "$CURR_MAX_FREQ not found" 14
CurrMaxFreq=$(cat "$CURR_MAX_FREQ")
CurrMaxFreq="${CurrMaxFreq::-3}"
NewMaxFreq="$CurrMaxFreq"
if [[ -e "$PSTATE_DIR" ]] ; then
NumPstates=$(cat "$PSTATE_DIR/num_pstates")
if [[ $(cat "$PSTATE_DIR/no_turbo") -eq 0 ]] ; then
TurboBoost="Enabled"
else
TurboBoost="Disabled"
fi
else
NumPstates="Not found"
TurboBoost="Not found"
fi
if [[ -e "$CPU0_DIR/scaling_governor" ]] ; then
Governor=$(cat "$CPU0_DIR/scaling_governor")
else
Governor="Not found"
fi
if [[ -e "$CPU0_DIR/scaling_cur_freq" ]] ; then
CurrFreq=$(cat "$CPU0_DIR/scaling_cur_freq")
# Chop off three decimals at end
CurrFreq="${CurrFreq::-3}"
else
CurrFreq="Not found"
fi
} # InitVars
### Paint / repaint window and get new frequencies ###
GetParameters () {
# +------------------------------------------+
# | cpuf - Set CPU Min/Max Frequencies |
# +------------------------------------------+
# | |
# | Turbo Boost: Enabled |
# | |
# | Number of pstates: 99 |
# | Speed Governor Used: powersave |
# | Current CPU0 frequency: 9999 Mhz |
# | |
# | Current Minimum Freq.: 9999 Mhz |
# | Current Maximum Freq.: 9999 Mhz |
# | |
# | New Minimum Frequency 9999 |
# | New Maximum Frequency 9999 |
# | |
# +------------------------------------------+
IFS="|"
Arr=($(yad "$GEOMETRY" --form \
--title "$TITLE" --text "$TEXT" \
--window-icon="$ICON" --image="$ICON" \
--field="Turbo Boost:":RO "$TurboBoost" \
--field="Number of pstates:":RO "$NumPstates" \
--field="Speed Governor:":RO "$Governor" \
--field="Current Frequency:":RO "$CurrFreq MHz" \
--field="Allowable Minimum Frequency:":RO "$AllowMinFreq MHz" \
--field="Allowable Maximum Frequency:":RO "$AllowMaxFreq MHz" \
--field="Current Minimum Frequency:":RO "$CurrMinFreq MHz" \
--field="Current Maximum Frequency:":RO "$CurrMaxFreq MHz" \
--field="New Minimum Frequency" "$NewMinFreq" \
--field="New Maximum Frequency" "$NewMaxFreq" 2>/dev/null))
Return="$?"
NewMinFreq="${Arr[8]}"
NewMaxFreq="${Arr[9]}"
} # GetParameters
###################################
# MAINLINE #
###################################
ALL_PREFIX="/sys/devices/system/cpu/cpu"
MIN_SUFFIX="/cpufreq/scaling_min_freq"
MAX_SUFFIX="/cpufreq/scaling_max_freq"
while true ; do
InitVars
GetParameters
[[ ! "$Return" -eq 0 ]] && break ; # Exit on Cancel=1 or Close Window=252
# Sanity checks
fErrMsgForceContinue=false
[[ $NewMinFreq -lt $AllowMinFreq ]] && ErrMsg "Minimum frequency too low"
[[ $NewMaxFreq -gt $AllowMaxFreq ]] && ErrMsg "Maximum frequency too high"
[[ $NewMinFreq -gt $NewMaxFreq ]] && ErrMsg "Minimum frequency greater than Maximum Frequency"
[[ $fErrMsgForceContinue == true ]] && continue
# Set new Min/Max frequencies
for (( i=0 ; i<NumCPU ; i++ )) ; do
# If New Min > Curr Max, set Max first then Min
if [[ $NewMinFreq -gt $CurrMaxFreq ]] ; then
echo "$NewMaxFreq""000" > "$ALL_PREFIX$i$MAX_SUFFIX"
echo "$NewMinFreq""000" > "$ALL_PREFIX$i$MIN_SUFFIX"
else
echo "$NewMinFreq""000" > "$ALL_PREFIX$i$MIN_SUFFIX"
echo "$NewMaxFreq""000" > "$ALL_PREFIX$i$MAX_SUFFIX"
fi
done
done
IFS="$OLD_IFS"
exit 0
다음 파일에서 기본 조정기를 성능으로 바꾸십시오.
/etc/init.d/cpufrequtils
/etc/default/cpufrequtils
ondemand
서비스 비활성화
sudo update-rc.d ondemand disable
그런 다음 실행
update-initramfs -u -k all
그런 다음 재부팅
추가 정보 : CPU 주파수 스케일링을 비활성화하고 시스템을 성능으로 설정하려면 어떻게해야합니까?
udev
이 링크에 규칙을 추가해보십시오. wiki.archlinux.org/index.php/CPU_frequency_scaling SUBSYSTEM=="module", ACTION=="add", KERNEL=="acpi_cpufreq", RUN+="/bin/sh -c 'echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor'"
독자들은 여기서 성가신 ATLAS라는 것을 이해해야합니다. 최신 프로세서를 사용하면 CPU가 자체적으로 주파수를 낮추고 성능 모드에서도 사용 중이 아닐 때 유휴 상태의 함수로 작동합니다. CPU 주파수를 최대로 "고정"하려면 성능 모드 설정 외에도 모든 유휴 상태> = 0을 비활성화하십시오.
참고 : 이렇게하면 프로세서에서 많은 폐열이 발생하여 시스템이 처리 할 수있게합니다.
예:
시작 조건 :
doug@s15:~/idle$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
doug@s15:~/idle$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
performance
performance
performance
performance
performance
performance
performance
1 단계 : 시스템에 몇 개의 유휴 상태가 있습니까?
doug@s15:~/idle$ ls -l -d /sys/devices/system/cpu/cpu*/cpuidle/state*
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu0/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu0/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu0/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu0/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu0/cpuidle/state4
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu1/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu1/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu1/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu1/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu1/cpuidle/state4
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu2/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu2/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu2/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu2/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu2/cpuidle/state4
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu3/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu3/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu3/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu3/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu3/cpuidle/state4
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu4/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu4/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu4/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu4/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu4/cpuidle/state4
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu5/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu5/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu5/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu5/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu5/cpuidle/state4
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu6/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu6/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu6/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu6/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu6/cpuidle/state4
drwxr-xr-x 2 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu7/cpuidle/state0
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu7/cpuidle/state1
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu7/cpuidle/state2
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu7/cpuidle/state3
drwxr-xr-x 3 root root 0 Jul 3 11:41 /sys/devices/system/cpu/cpu7/cpuidle/state4
OK 5 개의 유휴 상태 (0-4)가 있습니다.
2 단계 : 상태 1-4 비활성화 (스크립트를 sudo로 실행합니다) :
doug@s15:~/idle$ cat idle_1-4_disable
#! /bin/bash
echo "idle disable states 1-4:"
/home/doug/idle/idle_state1_disable
/home/doug/idle/idle_state2_disable
/home/doug/idle/idle_state3_disable
/home/doug/idle/idle_state4_disable
doug@s15:~/idle$ cat idle_state1_disable
#! /bin/bash
echo "idle state 1: before:"
cat /sys/devices/system/cpu/cpu*/cpuidle/state1/disable
for file in /sys/devices/system/cpu/cpu*/cpuidle/state1/disable; do echo "1" > $file; done
echo "idle state 1: after:"
cat /sys/devices/system/cpu/cpu*/cpuidle/state1/disable
를 야기하는:
doug@s15:~/idle$ sudo ./idle_1-4_disable
idle disable states 1-4:
idle state 1: before:
0
0
0
0
0
0
0
0
idle state 1: after:
1
1
1
1
1
1
1
1
idle state 2: before:
0
0
0
0
0
0
0
0
idle state 2: after:
1
1
1
1
1
1
1
1
idle state 3: before:
0
0
0
0
0
0
0
0
idle state 3: after:
1
1
1
1
1
1
1
1
idle state 4: before:
0
0
0
0
0
0
0
0
idle state 4: after:
1
1
1
1
1
1
1
1
doug@s15:~/idle$
그리고 우리가 turbostat로이 모든 것을 본다면 :
doug@s15:~/idle$ sudo turbostat --quiet --Summary --show Busy%,Bzy_MHz,PkgTmp,PkgWatt,GFXWatt,IRQ --interval 15
Busy% Bzy_MHz IRQ PkgTmp PkgWatt GFXWatt
0.02 2743 438 30 3.75 0.12
0.02 2753 406 29 3.75 0.12
0.02 2806 402 29 3.75 0.12
0.02 2764 436 29 3.75 0.12
58.62 3500 70887 50 30.75 0.12 <<<< ilde state 1-4 disabled
100.00 3500 120240 55 50.39 0.12 <<<< tubostat counts idle state 0 as busy
100.00 3500 120243 58 50.95 0.12 <<<< The system is actually still idle.
100.00 3500 120241 60 51.38 0.12
100.00 3500 120248 62 51.91 0.12
100.00 3500 120241 64 52.58 0.12
100.00 3500 120244 65 52.88 0.12
100.00 3500 120252 67 53.13 0.12
100.00 3500 120251 68 53.29 0.12
100.00 3500 120242 68 53.46 0.12
100.00 3500 120268 68 53.56 0.12
100.00 3500 120260 68 53.63 0.12
100.00 3500 120267 70 53.69 0.12
프로세서 온도가 높아지면 CPU 주파수 상한을 제한하십시오. 인텔 Pstate 예 :
doug@s15:~/idle$ echo 60 | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct
60
를 야기하는:
100.00 3500 120267 70 53.96 0.12
100.00 3500 120274 71 53.92 0.12
100.00 3500 120256 70 53.95 0.12
100.00 3500 120277 70 53.93 0.12
100.00 3500 120326 70 53.95 0.12
34.97 3500 42719 48 21.53 0.12
0.02 2712 378 45 4.00 0.12
0.02 2754 396 42 3.96 0.12
0.02 2724 504 40 3.92 0.12
0.02 2816 378 39 3.89 0.12
94.33 3500 113569 60 48.59 0.12
100.00 3500 120242 63 51.88 0.12
100.00 3500 120240 65 52.64 0.12
100.00 3500 120280 68 53.08 0.12
100.00 3500 120333 68 53.32 0.12
100.00 1713 120348 55 20.29 0.12 <<< Had to toggle to powersave governor
100.00 2201 120280 57 26.31 0.12 <<< And then back to performance governor
100.00 2300 120239 56 27.58 0.12 <<< Now new max is in effect.
100.00 2300 120237 56 27.53 0.12 <<< And processor temp is less
100.00 2300 120237 55 27.46 0.12
100.00 2300 120232 54 27.42 0.12
performance
다음과 같은 파일 :/etc/init.d/cpufrequtils
및/etc/default/cpufrequtils
다음 실행update-initramfs -u -k all
후 재부팅.