Skip to content
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

adjustor: init at 3.6.1 #347279

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

adjustor: init at 3.6.1 #347279

wants to merge 9 commits into from

Conversation

toast003
Copy link
Contributor

@toast003 toast003 commented Oct 8, 2024

Adjustor is a plugin for handheld daemon that allows TDP control on AMD powered handhelds

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Oct 8, 2024
@toast003 toast003 changed the title adjustor: init at 3.5.2 adjustor: init at 3.6.0 Dec 3, 2024
@ofborg ofborg bot added 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-linux: 1 labels Dec 3, 2024
@alyraffauf
Copy link
Contributor

This has been working well for me! Is there a reason it's still marked as a draft?

@toast003
Copy link
Contributor Author

toast003 commented Dec 6, 2024

I still need to add an option to enable adjustor from services.handheld-daemon, plus I also noticed some weirdness with ppd emulation.

Iirc power profiles would only apply when you changed the tdp, as well as some errors showing up.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` and removed 10.rebuild-linux: 1 labels Dec 7, 2024
@toast003
Copy link
Contributor Author

toast003 commented Dec 7, 2024

I'm not sure how to tackle adjustor's energy management feature, since it does different things depending on the hardware you run it on.

On handhelds it emulates power-profiles-daemon, while on everything else it uses it. Since there's no way to only disable energy management without disabling TDP control entirely, right now I think the thing to do is add an option (adjustor.energyManagement) that disables ppd when enabled, and assures handheld-daemon starts after ppd when disabled. That way we'll avoid conflicting with ppd unless the user wants to use the energy management feature.

EDIT: Energy management can be disabled separately, very first option too so I'm not sure how I missed it 😅

@alyraffauf
Copy link
Contributor

alyraffauf commented Dec 7, 2024

This seems like a good solution, it ought to also conflict with tuned (not yet merged into nixpkgs) and other power management daemons.

Looking into Bazzite, Bazzite masks tuned on handhelds that use adjustor, while it's unmasked on laptops and other devices. Adjustor is only installed on handhelds afaict. I know they have plans for other types of devices but for now it seems like everyone is using tuned or PPD.

@alyraffauf
Copy link
Contributor

alyraffauf commented Dec 7, 2024

Also, iirc PPD emulation is an option within the HHD UI, not sure how that factors in here but it seems optional.

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 8, 2024
@toast003
Copy link
Contributor Author

toast003 commented Dec 9, 2024

Yeah, PPD emulation can be turned off as well as energy management, which I missed initially.

Looking into Bazzite, Bazzite masks tuned on handhelds that use adjustor, while it's unmasked on laptops and other devices. Adjustor is only installed on handhelds afaict. I know they have plans for other types of devices but for now it seems like everyone is using tuned or PPD.

Adjustor does have some logic to deal with this with HHD_PPD_MASK, however it involves masking ppd and tuned, which we can't do on NixOS. Apart from some nasty looking errors from systemctl it does work tho, so that's probably the way foward.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 10, 2024
@toast003 toast003 changed the title adjustor: init at 3.6.0 adjustor: init at 3.6.1 Dec 12, 2024
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 21, 2024
  Refactored adjustor to be more similar to handheld-daemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants