7 ms·
Better PC cooling with Python and Grafana
- naggie 3y agoI got annoyed at my fan speeds so decided to experiment with controlling my fans with Python and measuring the results.
- jtriangle 3y agoYou likely have a setting for fan ramp time in your bios, usually in seconds. So setting your pump to always run at 100% and your fans to ramp slowly, say 10 seconds or longer, and using a minimum fan speed that is as high as tolerable would likely work as a no-additional-code solution.
- fwip 3y agoLooks pretty cool, the self-calibration routine is very nice too. My only worry is that rapid changes in pump speed might cause extra mechanical stress or wear on the pump, but I have no data to back that up. I've just heard that water pumps sometimes behave in counter-intuitive ways - e.g: sometimes running at a higher speed is better for longevity than a lower one.
- voidnap 3y agoIt would have been neat to include cpu freqency in your charts along side temperature and other things.
- hnuser123456 3y agoPlease do some measuring of core temperature response to load before and after re-pasting / upgrading the thermal compound. Something between a large grain of rice and a pea, and I like to clean the CPU and cooler cold plate completely, paste the CPU, then press and smear around the cooler onto the CPU before mounting it, to ensure full surface area coverage with a thin layer of compound.
- majesticmerc 3y agoGenuine question: I've known the law of "pea sized amount" for thermal paste for 20 years or so. Does it still hold true for modern (and larger) CPU dies? I haven't upgraded in a long time so genuinely don't know, but also wouldn't want to use outdated knowledge!
- jtriangle 3y agoYou want to use as little paste as possible while fully covering the heat spreader. Most modern coolers will provide sufficient pressure to spread a pea sized amount of thermal paste to cover the whole cooler. There are also thermal pads, both reusable and single use, that perfom well and don't require any guesswork. If you want to paste, noctua has the best paste in terms of thermal resistance, but mx4 or mx5 both perform well, as does cryorig and a bunch of others.
- willis936 3y ago>You want to use as little paste as possible while fully covering the heat spreader. The data disagrees. Too much paste is fine; too little is not. https://youtu.be/EUWVVTY63hc https://youtu.be/EUWVVTY63hc
- jtriangle 3y agoYes, but that's not what I said. Too much paste makes a mess, too little makes, well, a different mess. A pea sized amount is plenty, being that a pea is fairly large. Personally, I do an X if I'm not lapping, but that is more complex and a dot works just fine for most things.
- mckirk 3y agoFor people that want to do something similar on Windows, I can wholeheartedly recommend FanControl [1]. It's sadly not open-source, but it works great, and is quite pleasant to interact with. [1]: https://getfancontrol.com/ https://getfancontrol.com/
- haunter 3y agoIt’s open source
- giobox 3y agoNo it isn't. I use and like the app also, but the GitHub repo link on their page takes you to a separate release artifact management repo, not the source code itself. > https://getfancontrol.com/ https://getfancontrol.com/ Their linked GitHub repo, which only has a compiled zip uploaded for release artifact creation, not the code: > https://github.com/Rem0o/FanControl.Releases https://github.com/Rem0o/FanControl.Releases From the repo: "Sources for this software are closed." I wonder why the author hasn't open sourced it - there doesn't appear to be any commercial aspect to the tool, and the author makes a point of it being "free" on the site.
- soultrees 3y agoAI ownership most likely. Preventing LLMs from using it’s code in an output and not putting it in the ‘safe to spew’ bucket.
- kingkongjaffa 3y agoThis tool has been like this for years even before LLM was popular. Not everything is about LLMs.
- rrrrrrrrrrrryan 3y agoThe author probably used some non open-source bits when building the thing.
- 3y ago
- jerrygenser 3y agoAnother thing I've had great success with on my AMD 7700X is to use AMD Ryzen Master to reduce the TDP. The chip comes to consumers overclocked by default with a TDP of 105W. I suspect this is the case so that it can beat Intel on benchmarks on "default" settings. You can set it to "eco mode" and have it run at 65W or 45W TDP. Under load, this only results in like a 5% reduction in performance for a dramatic reduction in electricity consumption, fan speed, heat, etc. Not sure if the 5500x series chips are overclocked but using eco mode could be a good approach.
- this_user 3y agoI had a similar problem to what the article describes with a Ryzen 9. The reason was the the CPU would constantly automatically spike the clock frequency to overclock the CPU. The solution was just to disable this specific feature in the BIOS.
- jtriangle 3y agoYou can also undervolt most modern AMD parts and actually gain performance
- yjftsjthsd-h 3y agoHow does that work? Is it just that it can run at high speed sustained if it doesn't have to dissipate as much heat?
- parineum 3y agoThe chips overclock themselves under load but it's unsustainable. Limiting their TDP can allow them to sustain their overclocks longer/indefinitely.
- jtriangle 3y agoYes, exactly. Modern chips thermal throttle by default, their turbo clocks/voltages aren't sustainable with most cooling solutions, so, reducing the voltage the chip runs at lowers the power consumed and allows the chip to maintain a higher clock for longer durations. There is, of course, a risk that the lower voltage won't be stable, but, as long as you stress test your system as you would while overclocking, you'll be able to find a lower voltage that is workable. The 7000 series ryzen chips have this built into most motherboard bioses by the name 'pbo offset' (or similar) which modifies the stock voltage curve lower, and can set new temperature targets if desired. I'm running my 7950x at PBO level 3 with an 85c target, works well with no more fuss than a couple reboots really.
- _cenw 3y agoDidn't pick the right fans for going extra slow. These run at 1700 RPM by default, whereas Noctua has a version - even in the redux line - that runs at 1200 RPM. Though the non-redux like gets even slower - so much that Noctua includes a "low noise adapter" (presumably a resistor).
- anticodon 3y agoOn AMD it helps to have pretty recent kernel and amd_pstate=active string in the kernel boot params. I haven't checked the temperatures but I think I've started to hear the fan noise less after enabling it. This option was finally implemented in kernel 6.1 or 6.2. I don't remember the exact version, it happened only 1-1.5 years ago.
- js2 3y agoI geeked out on something like this for my TrueNAS server setting fan speed based on drive temperature with a PID controller. e.g. https://github.com/dak180/TrueNAS-Scripts/blob/master/FanControl.tool https://github.com/dak180/TrueNAS-Scripts/blob/master/FanCon... (That's not mine. I think I wrote a variation in Python.) Then I realized: my server is in the unfinished part of my basement where I can't hear it anyway. Let's just run the fans at 80% speed all the time since that's sufficient to keep the drives cool.
- ltbarcly3 3y agoJust buy a large AIO water cooler. Replace the included fans with Noctua. That is the full story of how I made my computer silent despite having a CPU with a TDP of over 200W.
- _cenw 3y agoDidn't read the article, did you?
- ltbarcly3 3y agoYes?
- _cenw 3y agoBecause OP uses a (mid-sized, but large by most standards) AIO with two Noctua redux PF-12 1700 PWM's. So... your recommendation is the article.
- ltbarcly3 3y agoDid you read my comment? I said buy a large AIO and then don’t do the rest of the article and then it actually is quiet with no effort. Large.
- _cenw 3y agoOh, c'mon, you weren't this specific. And I was. A 240mm rad is large by normal standards. Sure, a 360mm one is larger, but also usually not needed and you are likely to run into clearance issues.
- ltbarcly3 3y agoI mounted it outside the case. Lots of cases have little cutouts to facilitate this. The fact you are sucking hot air into the radiator is probably not helping you. 360mm isn't needed, unless you want it to be quiet...
- deleted 3y ago[deleted]
- AceJohnny2 3y agoIn conclusion, this is why Systems (Thermal) Control is a profession. Not dissing on the author's efforts, quite the contrary! But they demonstrate the rabbit hole that is second order effects (like multi-fan beat frequency) and number of parameters to take into account (like "... A solution to [when to enable Passive Mode] may be to detect if the computer is in use (mouse movements)")
- deleted 3y ago[deleted]
- Arch-TK 3y agoWith a Noctua NH-D15 and about 30 minutes spent tweaking the motherboard fan curves I was able to get my 5950x to not thermal throttle without producing any noticeable fan noise. This seems extremely over-engineered and sounds like it could have been solved by using Noctua or similar quiet fans.
- ComputerGuru 3y agoThe author specifically mentions (multiple times) that they are using Noctua fans...
- _cenw 3y agoNot exactly the optimal Noctua fan, considering it's a high RPM redux.
- gen_greyface 3y agoHow did you achieve this? tweaked by hand? i'm in the middle of building a pc and would love to know more.
- Arch-TK 3y agoI just played around with the fan curves. The Noctua fans are pretty damn silent below a certain speed (especially with GPU fan noise usually being louder). So I tried to keep them running faster than necessary at lower speeds and only ramp up a little bit when the temps go up, except at 80-85 or so degrees at which point I ramp up much faster until they're basically at max at 95 degrees. The CPU never really seems to hit those temperatures, as the NH-D15 is an over-sized cooler even for that chip. Most of the work is in stress testing the CPU to see what you can get away with without thermal throttling. Also helps to do this in the summer if you're in a no-air-conditioning-by-default country.
- cinntaile 3y agoIt says 5959x in the article but it should be 5950x.
- pstrateman 3y agoThis is pretty cool but honestly just setting the pump speed to a constant that's not annoying and setting the fans to a constant that's not annoying is likely to get the same result.
- craftoman 3y agoBetter cooling with Python, Grafana, Prometheus on top of Kubernetes with enchanted AI. Who needs PID these days?
- belter 3y agoAnother way to help with cooling..."Energy Efficiency across Programming Languages" - https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sle...
- moffkalast 3y agoNow we just need a follow up that takes the average dev time for each language and show which one has the optimal ratio based on these two values. It should be possible to draw a curve based on how long and how often the program will run to plot exactly when it makes sense to switch to something more efficient but also more dev intensive. Sort of in this fashion: https://xkcd.com/1205/ https://xkcd.com/1205/ E.g. assembly would have very low energy use by itself, but would require an inordinate amount of human energy (~8.7 MJ/day) invested to get that end result, making it very inefficient when the whole picture is considered. Unless that code runs everywhere constantly for years of course.
- austinjp 3y agoTheir 2021 update here: https://www.sciencedirect.com/science/article/abs/pii/S0167642321000022 https://www.sciencedirect.com/science/article/abs/pii/S01676... Link to full paper via sci-hub: https://sci-hub.st/10.1016/j.scico.2021.102609 https://sci-hub.st/10.1016/j.scico.2021.102609 This appears to be a web page where the authors have posted links to their research, data, updates, etc: https://sites.google.com/view/energy-efficiency-languages/ https://sites.google.com/view/energy-efficiency-languages/ For transparency, I've posted these here recently: https://news.ycombinator.com/item?id=39286827 https://news.ycombinator.com/item?id=39286827
- mrweasel 3y agoThis is something we've been slightly interested in, as a means to reduce power consumption and the number of servers we need to operate. It's just an insane amount of work trying to rewrite software and finding the bits where produces the most results. It's not really surprising to see C and C++ doing so well, also positive to see Rust being up there as one of the most energy efficient languages. The one language that keeps surprising me is Pascal. It often in the top 5 - 10 in terms of speed and it also does really well for energy consumption. While I haven't read the article, I could also imagine that it's good in terms of "power spend compiling" due to it's one-pass compiler. What I'm not sure of is if it's all a result of the language design, or if it's because it just had a lot of work put into it over the years by some really smart people. I presume that the tested implementation is Free Pascal.
- kelvie 3y agoI've been using an esp32-based fan controller with esphome and inlined C++ for my waterloop for a while, with a custom (but super simple) temp control algorithm as well: https://github.com/kelvie/esphome-config/blob/master/pc-fan-control-1.yaml#L158-L188 https://github.com/kelvie/esphome-config/blob/master/pc-fan-... The main reason for doing this was so that I didn't have to connect the controller to my main PC via USB to program it (I can change the target points via MQTT/wifi). Playing around with this stuff on my laptop I've also noticed that you have to be careful what calls you make when querying system status on a loop, some things (like weirdly, `powerprofilectl get`) even when called every 5 seconds drains a surprising amount of battery, so in a sense, your tool may start to affect the "idle" power consumption somewhat, and you need to test that.
- 3abiton 3y agoThis looks so promising! The only issue is that many MB don't have drivers available in the Linux kernel, makes reading temp control not possible yet.
- avidphantasm 3y agoWho has time for all this rigamarole. Just use an ARM CPU.
- dvdkon 3y agoIt's surprising that there are no PC fan controllers that would use some variant of PID control with a temperature target. Traditional fan curves are simple, but the result isn't very intuitive. And many desktop motherboards manage to screw up even the basic fan curve, offering users control of only two points within strict bounds, no piecewise linear curves or hysteresis settings. I started a fan controller project some 4 years ago and it's now sadly in limbo, waiting for me to solve power filtering issues for the makeshift power supply it grew into. Maybe I should just limit myself to 4-pin fans...
- selcuka 3y ago> It's surprising that there are no PC fan controllers that would use some variant of PID control with a temperature target. They actually exist (such as ARCTIC F12 TC) but not very common. Separate controllers such as Adafruit EMC2101 are also available.
- 4gotunameagain 3y agoBoth EMC2101 and F12 TC work with a look up table, so a normal curve as opposed to a PID. You can verify that in the datasheet of EMC2101, and in the case of F12 TC in product descriptions (..The fan responses to the rise in temperature swiftly within a critical 6°C range, the rpm of the ARCTIC F Pro TC fan increases from around 500 to its maximum of 2,000 rpm (the steep curve in the chart).)
- Aurornis 3y agoPID control isn’t an easy solution in PC cooling. CPU temperatures can swing from 40C to 90C and back in a matter of seconds as loads come and go. Modern fan control algorithms have delays and smoothing for this reason. If you had a steady state load so stable that you could tune around it, setting a fan curve is rather easy and PID is overkill. For normal use where you’re going between idle with the occasional spike and back, trying to PID target a specific temperature doesn’t really give you anything useful and could introduce unnecessary delays in cooling if tuned incorrectly.
- 3y ago
- deleted 3y ago[deleted]
- lreeves 3y agoWhat an awesome post! I recently built a new PC based on workstation parts that frustratingly didn't expose the actual CPU temperature except in the IPMI interface; I was starting to hack something together with Netdata and ipmitool but then I saw this post and in a couple hours had a Grafana ingesting the ipmitool sensor output every 10 seconds or so. Thanks! https://i.imgur.com/KDeHgFY.png https://i.imgur.com/KDeHgFY.png
- a_vanderbilt 3y agoMy problem is that I just don't want to think about it. Complex solutions are cool but ultimately it's bandwidth I could use for better things. I like my Chromebook because it requires nearly zero mental effort. I install the package and I use it. Ubuntu was great because you could Google it and get an answer that applies, and ChromeOS is great for the same reason. Linux could be as great as macOS, but it's the fragmentation that kills it.
- npteljes 3y ago>Linux could be as great as macOS, but it's the fragmentation that kills it. No, Linux is as valid technologically as the other offerings, fragmented or not. It's just that it doesn't have a mega-corp behind it to push, to make deals with businesses, schools, governments. As soon as Google stepped in with Android and ChromeOS, suddenly it was everywhere.
- a_vanderbilt 3y agoAndroid and ChromeOS just reinforce my point though. There is one Android™ and there is one ChromeOS™. I don't have to support Android with this package manager and another with that display server. I don't have to wonder what DE the Chromebook user has running, or whether they have a certain package installed that conflicts with mine. If those were concerns that had to be considered, would Android and ChromeOS have gotten as popular as they are? Food for thought.
- npteljes 3y agoI think what you describe is a necessary part of what I'm trying to get at, but not sufficient enough for it. So, yes, successful products tend to converge, because support and maintenance makes more sense that way. But products are not successful because of this convergence. If there was only one Linux, it would be about as popular as the myriad of them are right now. What it needs to be more popular is to be a product that a giant corporation pushes with all its might. Only that the standard PC market is pretty saturated - which is why a machine like the Valve Deck might be successful for Linux (or already is, if we consider some millions of sold units a success).
- then4p 3y agoI had very similar issues with my nzxt AIO and a Ryzen 5900X. What annoyed me the most is that other vendors offer water temperature based fan control by default. This makes NZXT AIOs basically unfit for modern CPUs and I don't understand why they're recommended and well reviewed. I switched to a Fractal Celsius and its default setting is to control pump and fan speed by water temp. Problem solved.
- u4ik 3y ago[flagged]
- derped 3y agoDon't know if someone mentioned it or not so I just drop it here: https://getfancontrol.com/ https://getfancontrol.com/
- derped 3y ago[dead]
- PeterStuer 3y agoWhy is there so much dust on the radiator? Is he sucking hot air through the fins into the pc, or is there soooo much dust inside the case that this is actually the radiator being so saturated with it that it is starting to ooze out? Either way there seems to be a serious problem with unfiltered air being sucked into the case here. That radiator isn't going to radiate if it is wearing a furr coat.
- voidnap 3y ago> I’ve played with PBO2 adjustment as I said, but it should be possible to reduce the voltage at the expense of a bit of performance. Undervolting with PBO2 should not decrease peformance unless you have done something very wrong. Ryzen CPUs have limit, max temperature, frequency, power, and voltage. The voltage curve follows a frequency curve so higher clock speed requires a higher voltage. A negative offset in PBO reduces the voltage required for a given frequency. It shifts down the voltage curve. Lower voltage typically means less heat and power draw so you can achive a higher clock speed without hitting temperature, power, or voltage maximums. If your system is stable when undervolting you don't see a loss in performance, generally it improves because you are able to reach higher clock speeds before running into voltage or power limits. The exception is if you induce a rare issue called clock skew at extreme cases that i'm not even sure you can do with PBO2.
- whywhywhywhy 3y ago>I presume the quick temperature rises are specific to modern Ryzen CPUs, perhaps others too. Maybe this is due to more accurate sensors, or even a less-than-ideal thermal interface. It’s because the cpu is designed to push itself to a thermal limit and have its output performance decided by how you keep it at that limit so it essentially goes full throttle to 90deg then slows down if your cooling can’t keep up which causes the fan spikes. So I’m told from the research I did. My latest machine had the same issue but just updating all drivers, setting some auto curves and adding easing for the fan spin up time completely solved it.
- NwtnsMthd 3y agoHas anyone tried a controller for cooling that is dependent on processor current consumption? Temperature measurements lag, but the current used by the processor is instantaneous and directly converted to heat (P = VI). In theory, it should be possible to reduce temperature spikes.
- hernandipietro 3y agoI just use FanControl , and I'm very happy with it. Windows only, unfortunately.