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

Different settings if running on battery #19

Open
mvdan opened this issue Mar 11, 2019 · 3 comments
Open

Different settings if running on battery #19

mvdan opened this issue Mar 11, 2019 · 3 comments

Comments

@mvdan
Copy link

mvdan commented Mar 11, 2019

It would be useful if certain settings could change when a laptop is unplugged from the charger.

For example, using a lower temperature limit or power limit on battery could reduce overall fan usage, which could mean longer battery life. On the other hand, when plugged in, one might want the highest performance, even if that means a louder fan and more power use.

Perhaps this is outside the scope of this project, but I wasn't able to find any information about it.

@HennieLouw
Copy link

I don't have the time at the moment to play with this idea, but perhaps this will help someone which can spend the time at the moment.

According to this article: adding-power-related-targets-to-systemd, systemd and udev can be used to create the system setup you want.

Only change I can see that would be needed from the project would be the ability to provide the path to the config file which should be used when calling 'apply' operation.

@kitsunyan
Copy link
Owner

I'm not planning to add AC-state dependent configuration. I think TLP with properly configured HWP hints will do the same. You can set them to balance_power or even power which will reduce clock speed and lead to lower power consumption.

I also added a new HWP hint switching feature to intel-undervolt, which you can also find useful. I have TLP installed which sets the HWP hint value to performance from AC and balance_power from battery. And I have the following intel-undervolt config:

hwphint switch power:core:gt:8:and:uncore:lt:3 performance balance_performance
hwphint switch load:single:0.90 balance_power power

It will switch between performance and balance_performance on AC and between balance_power and power on battery depending on power consumption or CPU load, so I'm getting the best performance from AC and low power consumption on battery.

@agaskins
Copy link

agaskins commented Dec 3, 2019

I'm sorry if I'm just being dense, but I'm still fuzzy on how these particular Intel-Undervolt settings work exactly...

Using your TLP example above, would this still work if, for instance, I use 'balance_performance' on AC & 'power' on battery (in my TLP configuration)? If I understand correctly (which I quite possibly may not, ha) this would allow the default state to be the more conservative hints, and switch to the more performant 'performance' (AC) & 'balance_power' (battery) hints when needed? As opposed to examples behavior where I believe you are saying it would essentially down-shift, so to speak, from performance to balanced_performance, as needed.

Maybe in practice there is no functional difference between these examples... but on my notebook running in 'performance' any more than absolutely necessary really cooks! Especially if I'm using my Nvidia GPU offloading (which isn't directly related, but just makes everything quite hotter as they share a single heat-pipe).

I love the utility you've created, but even after reading through the article you link in the README and doing some research on related topics, I'm still a bit unsure of exactly how the "Energy Versus Performance Preference Switch" & "Power Limits Alteration" sections of the configuration works. I have a very poor grasp on this at the moment, and I'm not even close to feeling like I've grok'd these two sections of the configuration - but I'm sure doing so would be of great benefit, as no other utility I've found provides such an elegant and robust solution to this problem (which is a critical issue for many of us running modern notebooks)! I'm sorry if this is long-winded, but I'd love to wrap my mind around these two sections a bit more and give a little back by writing a how-to article for those like myself who don't find this as obvious as someone like yourself might; something that shows some more in-depth examples for solving similar problems, and would help others grok this wonderful creation you've shared with us all! If you can help me understand these bits I'll gladly do my part to help pass that understanding to more folks!

Thanks for taking the time to listen, if you've made it this far! :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants