Tip: you can reduce the heat your laptop/desktop computer generates by limiting its CPU frequency.

To restrict all cores to 800MHz on Linux, run one of these two commands as root:

cpupower frequency-set -u 800MHz

echo 800000 | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq

#heatwave #laptop #desktop #computers #downclocking #EnergyEfficiency #Linux #shell

Why 800MHz? Because it's a typical minimum of modern processors, at least the Intel ones I've used. You can get the minimum frequencies of your CPU cores with:

grep -H '' /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_min_freq

Is it slow? Eight hundred million clock cycles per second is faster than CPUs were 30 years ago and is sufficient both for basic use and to play games from that era. However, it does noticeably slow down even some basic features on my system.

#CPU #underclocking

By the way, throttling the CPU to a constant frequency is the proper way to run the classic game Pharaoh (https://en.wikipedia.org/wiki/Pharaoh_(video_game)). This game is too fast on modern computers because its default speed varies with the number of instructions the processor executes per second instead of being rooted in real time (https://en.wikipedia.org/wiki/Elapsed_real_time). So, changing its speed settings (https://www.protondb.com/app/564530#BBh0duM0C0) isn't enough. It needs a stable clock rate.

#Pharaoh #Wine #Proton #LinuxGaming #retrogaming #time

Pharaoh (video game) - Wikipedia

Extra tip: if keeping your CPU at its minimum frequency slows down your system too much, you can use the base frequency instead:

( cd /sys/devices/system/cpu && for cpu in *[0-9]/ ; do cat <$cpu/cpufreq/base_frequency >$cpu/cpufreq/scaling_max_freq ; done )

This will generate more heat than staying at the minimum frequency, but less heat than letting the cores go higher.

#heatwave #ClimateAdaptation #CPU #downclocking #Linux

@Changaco great Idea. Thanks for sharing. Is there also a similar trick for GPUs in general? (I know you can change clock speeds with AMD GPUs, but only if you boot with feature flags which will mark the booted kernel as tainted AFAIK. ) If there is any trick to just limit the clock speed without that requirement, it would be great.

@zerozx GPU frequencies can be capped with https://github.com/ilya-zlobintsev/LACT or by running some of the following commands.

Intel:

intel_gpu_frequency -c max=500

tee <<<500 /sys/class/drm/card*/gt_max_freq_mhz

Nvidia:

nvidia-smi --lock-gpu-clocks=0,500
nvidia-smi --lock-memory-clocks=0,500

AMD (probably, I currently don't have hardware to test this on):

tee <<<"0 1" /sys/class/drm/card*/device/pp_dpm_[ms]clk

#heatwave #ClimateChange #GPU #underclocking #Linux

GitHub - ilya-zlobintsev/LACT: Linux GPU Configuration And Monitoring Tool

Linux GPU Configuration And Monitoring Tool. Contribute to ilya-zlobintsev/LACT development by creating an account on GitHub.

GitHub
@Changaco unfortunately, for AMD cards you still need to enable "overdrive" mode for both LACT or the command line version (which is the kernel parameter which causes the running kernel to be considered "tainted", so you can't report bugs anymore). But thanks for sharing, it can still be very useful for anyone trying to save energy/heat.