New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msr-tools: nixos module to avoid CPU throttling #29764
Conversation
@peterhoeg, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @offlinehacker and @bjornfor to be potential reviewers. |
Half joking but I think the option needs a scarier name, like |
I've made it possible to add more hardware in a structured way and emphasized the danger in the description. |
I think that modules to work around bugs in very specific pieces of hardware might be more appropriate for the https://github.com/NixOS/nixos-hardware repo. |
The hardware repo is really for "recommended settings for particular pieces of hardware" which probably makes that repo equally unsuitable for this PR... We can today configure many aspects of the various pieces hardware supported by NixOS - I think this PR is just one aspect of that. The questions as I see them:
|
machineConfigs = { | ||
dell_latitude_e6x00 = { | ||
link = "https://wiki.archlinux.org/index.php/Dell_Latitude_E6x00"; | ||
read = "44:32 0xCE"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could explain (or at least link to something that explains) how to figure out which values to use for a particular machine.
I see it like this: I also think the graveness of this option should be conveyed in the option name itself. |
There is some similar work in nixos-hardware by now. |
Motivation for this change
The BIOS on the Dell Latitude E6x00 series is badly broken (despite 38 tries at getting a working version) and the BIOS will throttle the CPU even with just a little load.
This PR keeps kicking the CPU into the maximum power state to avoid any kind of throttling.
As a consequence the hardware will get QUITE hot, but at least it will perform.
I'm not entirely sure what is the best way to ship a feature that is capable of physically harming the hardware. Do we need more warnings?
Additionally, I don't know if the magic numbers being written to the registers will also work on other CPUs/BIOSes.
I could make the registers configurable (or hide them behind a model variable that sets them in case anyone has any good ideas.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)