Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

Linux, low power / low heat for summer

$
0
0

Sometimes I playbrowser games including diep.io . This loadsthe CPU and GPU, and in this summer weather my laptop gets too hot and heats up the room.

I tried using Chrome with the GPU disabled, but the browser games would still cause theGPU to ramp up to full clock rate. I guesstheX server was using the GPU.

google-chrome --disable-gpu # does not always prevent GPU clocking up

So here’s what I did:

For the NVIDIA GPU, we can force the lowest power mode by adding the following to the “Device” section in/etc/X11/xorg.conf:

# Option "RegistryDwords" "PowerMizerEnable=0x0;" Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3333; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"

Unfortunately the “nvidia-settings” tool does not allow this. It is necessary to restart the X server in order to change this setting. Just swap which line is commented out.

Given that we are keeping the GPU cool like this,Chrome works better with the GPU enabled not disabled.

For the CPU, setting “scaling_governor=powersave” does not force the lowest power mode, and the CPU still clocks up and gets hot. But we can set “scaling_max_freq” to stop linux from raising theclock speed. I’m using this shellscript “ cpu_speed “:

#!/bin/bash cmd=${1-info} cd /sys/devices/system/cpu for cpu in cpu[0-9]*; do ( cd $cpu/cpufreq case "$cmd" in info) echo $cpu `<scaling_cur_freq` `<scaling_min_freq` `<scaling_max_freq` ;; slow) cat cpuinfo_min_freq >scaling_min_freq cat cpuinfo_min_freq >scaling_max_freq ;; fast) cat cpuinfo_min_freq >scaling_min_freq cat cpuinfo_max_freq >scaling_max_freq ;; esac ) done

I can run it with “cpu_speed” to see the current speed, “cpu_speed slow”to fix the clock at the lowest speed, and “cpu_speed fast” to allow the clock to go up to the maximum speed.

This“ temperature ” script shows the NVIDIAGPUCurrentPerfLevel, GPUCoreTemp, and CPU temperatureinfo:

#!/bin/sh ( set -a : ${DISPLAY:=:0.0} nvidia-settings -q GPUCurrentPerfLevel -q GPUCoreTemp acpi -t ) 2>/dev/null | perl -ne 'print "$1 " if /[:,] (\d+)\./' echo

Finally, I can reduce the screen resolution to decreasethe load on the GPU and CPU. “xrandr” with the NVIDIA driver does not allow me to change the resolution directly, but there is an option to scale the display. This gives much smootherperformance in the browser games, and the lower resolution doesn’t hurt.

xscale-half:

xrandr --output DP-2 --scale 0.5x0.5

xscale-normal:

xrandr --output DP-2 --scale 1x1

Anyway, now I have my laptop set up to run cool by default. This doesn’t hurt for most things I am doing with it, and I feel it’s less likely to explode and burn down our house.


Viewing all articles
Browse latest Browse all 11063

Trending Articles