-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
intel-lpmd: init at 0.0.8 #349198
base: master
Are you sure you want to change the base?
intel-lpmd: init at 0.0.8 #349198
Conversation
c5940b2
to
937e97b
Compare
937e97b
to
512357e
Compare
Written a rudimentary NixOS module that, for the most part, covers everything that I could see documented in the There are a lot of things that aren't explicitly documented, and a lot of technical jargon that I presume pertains uniquely to an Intel CPU. Documenting this was outside of my scope and arguably I do not believe it should be documented here anyways, but rather something that the user must figure out themselves. I will write a NixOS test for this module as well. That's to come later. cc @Anifyuli for testing of the module, including some of the more elusive options. An exhaustive test of everything would be the most preferrable, but a minimal test is still fine. |
8b88d85
to
6c9c687
Compare
6c9c687
to
65f6e34
Compare
For testing purposes, I just installed it on my machine? Or anything else? I haven't experienced testing modules or packages in NixOS previously |
Main thing to look for is trying to get the systemd service running and configuring the daemon using the module settings in |
|
||
platforms = platforms.linux; | ||
license = licenses.gpl2Only; | ||
maintainers = with maintainers; [ frontear ]; | ||
|
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.
There shouldn't be an empty lines here.
|
||
meta = with lib; { | ||
homepage = "https://github.com/intel/intel-lpmd"; | ||
description = "Linux daemon used to optimize active idle power."; |
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.
description = "Linux daemon used to optimize active idle power."; | |
description = "Linux daemon used to optimize active idle power"; |
nativeBuildInputs = [ | ||
autoreconfHook | ||
pkg-config | ||
|
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.
]; | |
buildInputs = [ |
|
||
autoreconfHook, | ||
pkg-config, | ||
|
||
glib, | ||
gtk-doc, | ||
libnl, | ||
libxml2, | ||
systemd, | ||
upower, | ||
|
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.
autoreconfHook, | |
pkg-config, | |
glib, | |
gtk-doc, | |
libnl, | |
libxml2, | |
systemd, | |
upower, | |
autoreconfHook, | |
pkg-config, | |
glib, | |
gtk-doc, | |
libnl, | |
libxml2, | |
systemd, | |
upower, |
}; | ||
in | ||
{ | ||
###### interface |
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.
###### interface |
those comments are legacy copy&paste and don't serve any purpose
}; | ||
|
||
IgnoreITMT = lib.mkOption { | ||
default = false; |
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.
default = false; | |
default = false; | |
type = lib.types.bool; |
If enabled, ITMT is disabled upon entering LPM, | ||
and re-enabled upon exiting LPM. Otherwise, the | ||
ITMT setting is ignored entirely. |
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.
If enabled, ITMT is disabled upon entering LPM, | |
and re-enabled upon exiting LPM. Otherwise, the | |
ITMT setting is ignored entirely. | |
If enabled, ITMT is disabled upon entering LPM and re-enabled upon exiting LPM. | |
Otherwise the ITMT setting is ignored entirely. |
lp_mode_epp = lib.mkOption { | ||
default = null; | ||
description = '' | ||
EPP (energy performance preferences) to use in LPM. | ||
Leave as `null` to ignore this setting. | ||
|
||
Accepts a value from **0** (favor performance) | ||
to **255** (favor power). | ||
''; | ||
|
||
type = with lib.types; nullOr numbers.between 0 255; |
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.
lp_mode_epp = lib.mkOption { | |
default = null; | |
description = '' | |
EPP (energy performance preferences) to use in LPM. | |
Leave as `null` to ignore this setting. | |
Accepts a value from **0** (favor performance) | |
to **255** (favor power). | |
''; | |
type = with lib.types; nullOr numbers.between 0 255; | |
lp_mode_epp = lib.mkOption { | |
type = with lib.types; nullOr numbers.between 0 255; | |
default = null; | |
description = '' | |
EPP (energy performance preferences) to use in LPM. | |
Leave as `null` to ignore this setting. | |
Accepts a value from **0** (favor performance) | |
to **255** (favor power). | |
''; |
We should put the 0 to 255 range into the type.
statesSubmodule = { | ||
options = { | ||
CPUFamily = lib.mkOption { | ||
description = '' | ||
The CPU generation to match. | ||
''; | ||
|
||
type = with lib.types; str; | ||
}; | ||
|
||
CPUModel = lib.mkOption { | ||
description = '' | ||
The CPU model to match. | ||
''; | ||
|
||
type = with lib.types; str; | ||
}; | ||
|
||
CPUConfig = lib.mkOption { | ||
description = '' | ||
Define a configuration of CPUs and TDP to match different skews | ||
for the same CPU model and family. | ||
|
||
See `man 5 intel_lpmd_config.xml` for more details. | ||
''; | ||
|
||
type = with lib.types; str; | ||
}; | ||
|
||
State = lib.mkOption { | ||
default = [ ]; | ||
description = '' | ||
List of "state" definitions. | ||
''; | ||
|
||
type = with lib.types; listOf (submodule perStateSubmodule); | ||
}; | ||
}; |
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.
We should add an example to those.
HfiLpmEnable = { | ||
default = false; | ||
description = '' | ||
Specifies if the HFI monitor can capture HFI hints for LPM. | ||
''; | ||
|
||
type = with lib.types; bool; | ||
}; |
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.
HfiLpmEnable = { | |
default = false; | |
description = '' | |
Specifies if the HFI monitor can capture HFI hints for LPM. | |
''; | |
type = with lib.types; bool; | |
}; | |
HfiLpmEnable = { | |
type = lib.types.bool; | |
default = false; | |
description = '' | |
Specifies if the HFI monitor can capture HFI hints for LPM. | |
''; | |
}; |
we shouldn't use with lib here
Introduces https://github.com/intel/intel-lpmd as a package with an accompanying NixOS module.
Closes #349187.
cc @Anifyuli for testing.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.