How to make Apple machines run cooler on Linux?
- Login o registrati per inviare commenti
The two Apple machines I am in control of suffer from hot temperatures using anything other than MacOS. I've also heard this is a common issue with Apple machines.
There was someone here in this forum that mentioned that this may have something to with how the Linux kernel are not as efficient as the Apple kernel in regards to the usage of the CPU's different states.
So I am wondering... If I want to make Apple machines run cooler on Linux. If I want to help the Linux Libre project, but specifically in regards to making it more Apple machine-friendly, where do I start?
I am sure many people have wanted this before me, but I would not forgive myself if I at least didn't try. There are so many old Apple machines laying around, and they can be quite nice casual personal computers if only it was able to run a little cooler.
Anyway, I am getting off track here, what I am asking this forum about is guidance to how/where/what I should do.
I have limited/none coding/tech skills, but I have enormous willpower. I am more than willing to use time and to learn along the way.
I understand that there are drivers needed to get the most out of different components. Are the CPU any different?
I have no idea where to start, so I'm just shooting questions:
When making drivers for components (and in this situation the CPU), are there ways to make the driver work with many different CPUs or is it necessary to make one driver for each different CPU.
Have you installed sensors?
sudo apt install lm-sensors
I have a 2015 Macbook Air with Mint 18.3 installed. It runs pretty cool.
There's something here. Perhaps you could try turning turbo off (if any).
http://www.hastymail.org/macbook_stuff/pstate_driver_example.txt
Thank you for this!
In the second link you posted there are three commands, right? The first one disabling the turbo, but what does the next two?
PS. Quite strange that your machine seems to be that much cooler.
Behind the first link titled "Something here" there's an explanation at the end. Scroll down and read the lines that explain the use of the scripts and config files.
That particular line says "Example of tweaking the Intel CPU scaling Pstate driver".
I took a look and my Macbook Air had "0" -- that is 'on'. The path is '/sys/devices/system/cpu/intel_pstate/' followed by files that you can edit.
I believe you misunderstood my question.
But anyway, it seems that I am missing the "intel_pstate" folder.
The first one disabling the turbo, but what does the next two?
It's written there in the remarks after #.
echo '1' > '/sys/devices/system/cpu/intel_pstate/no_turbo'; # disable turbo CPU speeds
echo '35' > '/sys/devices/system/cpu/intel_pstate/min_perf_pct'; # set minimum CPU speed to 35%
echo '100' > '/sys/devices/system/cpu/intel_pstate/max_perf_pct'; # set maximum CPU speed to 100%
What is CPU speed? What is the default minimum and maximum CPU speed?
You say you don't find the path or it doesn't exist. Here's my HP, it's there if it's Intel.
CPU speed must be the bus (external) speed factor. CPUs are clocked multiplying the base (internal) speed 2x and so on. But I'm not sure here. The effect will, anyway, be scale down and up.
https://en.wikipedia.org/wiki/CPU_multiplier
##EDIT##
Forget about CPU multiplying, it's explained here (called 'scaling'):
https://www.kernel.org/doc/html/v4.12/admin-guide/pm/cpufreq.html
https://www.kernel.org/doc/html/v4.12/admin-guide/pm/intel_pstate.html
It seems as though I am missing the "intel_pstate" folder, but I have /sys/devices/system/cpu/cpufreq
and inside this "cpufreq" folder the seems be some scripts for doing something similar to the CPU speed minimum and maximum.
Inside the "cpufreq" folder there are three folders "ondemand", "policy0" and "policy1". I suspect that the policy0 and policy1 folders maybe controls the two cores in the CPU or something like that, because the two folders seems to hold exactly the same things.
Anyway if I enter the policy0 folder there's another folder called "stats" and a bunch of scripts. Among the scripts there are one called "scaling_max_freq" and one called "scaling_min_freq". If I open them I am presented a number which seems to maybe represent hertz. So I may be able to manually set the maximum and minimum hertz there? :)
I wish somebody in the know would step in. I'm afraid I can't tell.
Execute this command to use the "powersave" governor for all your cores:
$ nprocessors=$(getconf _NPROCESSORS_ONLN); nprocessors=$(expr $nprocessors - 1); for i in $(seq 0 $nprocessors); do sudo cpufreq-set -c $i -g powersave; done
That does not mean your cores will not be able to switch to the highest frequencies. It just mean the kernel will wait to be sure that the process needs that much resource before switching. However, if you want to to fix a maximal frequency, the -u option of 'cpufreq-set' does that.
Hi, thank you for stopping by MB! :)
> Execute this command to use the "powersave" governor for all your cores:
What exactly does that command do, and is there a similar thing for the GPU? I searched around to find out what all the sensors mean, and it seems my GPU is also getting quite hot.
> However, if you want to to fix a maximal frequency, the -u option of 'cpufreq-set' does that.
What is the "cpufreq-set"? :)
btw I tried to just copy what wrote:
nprocessors=$(getconf _NPROCESSORS_ONLN); nprocessors=$(expr $nprocessors - 1); for i in $(seq 0 $nprocessors); do sudo cpufreq-set -c $i -g powersave; done
and paste it in the terminal and I got:
"sudo: cpufreq-set: command not found
sudo: cpufreq-set: command not found"
Cool thanks, I got no errors now, let's wait and observe the temps :)
I am not aware of any analog tool for GPUs.
Thank you for this! :)
Do you happen to know an easy way to set the cpu frequency mode to "powersave" at startup? :)
I think I got it with just following your guidance from another post and switching out some parts of the scripts: https://trisquel.info/en/forum/temperatures-inside-pc-high?page=1#comment-125753
But anyway, I'm trying to make a script for mbpfan as well.
Usually when I am in the terminal and type "$ sudo mbpfan" the program kicks in immediately. But I am not able to make script for it.
With Trisquel 7 (but probably also with Trisquel 8), write the command line I gave you, without 'sudo', in /etc/rc.local, before the exit statement.
I found that my MacBook Pro would get pretty hot while running anything Linux kernel based. Some distros ran hotter than others, and it seemed to be fan speed. I could run 'stress' and I would watch my fan RPMs never get much above the idle speed of 2000 RPM. I found a project called mbpfan a few years ago, and it works great.
It is GPLv3, and full disclosure I help maintain it. One of the tasks I did got Trisquel on the "Verified GNU/Linux Distributions" list for the project.
https://github.com/dgraziotin/mbpfan is the upstream.
Cool, I think I managed to install it. But being a daemon, does that mean that there is no CLI or GUI or anything, I just install it, and then it is running in background?
Right now I have the fans set manually, do I need to change them back to auto for the mbpfan to work?
Correct, in daemon mode, just install it and set it to run at start up. If you want to run it in the foreground you can manually do mbpfan -f for verbosity you can do mbpfan -v, or look in /var/log/messages to see its output there.
There are a few different ways to set your fans manually, but this should override it.
How do I set it to run at startup? :)
I want to install mbpfan on another device, but forgotten how the installation process is.
Are you able to tell me how?
nvm, I didn't realize that "build-essentials" was a package I needed to install.
I should probably get some sleep...
Interesting thing though:
I have a panel at the top dedicated to hardware sensors, and the "TGOD" and the "TpOP" are the two that is significantly hotter than the rest. Usually 6-7 degrees celsius over the next hottest thing.
After some internet searching it turns out that those two are the GPU and the PSU. Mind you the CPU is also almost always very hot, when I am not loading the computer (just typing this comment for example and doing simple stuff) it seems that the PSU gets hottest, than the GPU, and then the CPU.
But the three fans I have are the ODD, the HDD and the CPU. No cooling for either the GPU nor the PSU.
Just for logging purposes I will now post a screenshot showing my hardware sensor panel at the top of the desktop.
I have now been using the cpupower frequency-set governor "powersave" for some time, and the mbpfan program.
The sensors are from left to right:
temp1, ODD, HDD, CPU, TA0P, TC0D, TC0H, TC0P, TG0D, TG0H, TG0P, TH0P, TL0P, TO0P, TW0P, TW0P, Tm0P, Tp0P, Core 0, Core 1
Great! I don't check these forums all the time, so if you have questions or bug reports, just open them on the git repo. I, and the other maintainers, are active there.
Apologies if I ask some off-topic questions GrevenGull, but which distro(s) do you run on your Apple devices, which model devices are they, and did you have to do anything unusual to get GNU-Linux installed and working on them? I just started a thread focused on getting Trisquel 8 to install reliably on Macs. Any knowledge you could share there would be most appreciated:
https://trisquel.info/en/forum/getting-trisquel-8-working-macs
No problem :)
See my answer here: https://trisquel.info/en/forum/getting-trisquel-8-working-macs#comment-130464
I saw an older post in this forum about Libreboot on old MacBooks.
One person there had modified their MacBook to have an air-intake at the bottom that resulted in almost 20 degrees lower temps.
Are there anyone else in this forum that has done modifications to MacBooks in the hopes of getting their temps down?
I can't remember where or when, but someone said that it has to do with how the Linux Kernel does not quite handle the different states of the apple CPUs as well as Apple's own kernels. If that's the case I am wondering: perhaps on could replace the CPU?
I would just like to point at that I tested out vita_cell's modification tips:
https://trisquel.info/en/forum/librebooted-macbook-21#comment-80134
I just removed the whole backplate (MacBookPro 9,1) and put the computer on top of four glasses so that the computer was totally "open" underneath and free air entrance and... it was amazing lol :P
Definitely check out that solution if you have a macbook and the temps annoy you!
Thank you vita_cell!
Now I think I'll be looking for some dust filter in some way, or at least some kind of solution to make it more permanent.
I should have included a picture of the laptop standing on top of four glasses with no backplate, but I have no free camera at the moment ;)
- Login o registrati per inviare commenti