You are not logged in.

#1 2021-12-13 07:32:17

860lacov
Member
Registered: 2020-05-02
Posts: 497

[SOLVED] How to adjust laptop power settings

I have Acer Spin 5 with intel 11th gen 1165 CPU
Acer promises about 15h of work. I'm aware that it's probably a laboratory number with no power drain or something, but I think that It was never even the half of this time.

I wanted to set my laptop power management to some kind "optimal" settings.
I use thermald because of Acer spin 5 temperature management
For some time I used TLP with defaults.
Then decided to go with power-profiles-daemon
I tried auto-cpufreq
but now I have:

systemctl status auto-cpufreq.service 
× auto-cpufreq.service - auto-cpufreq - Automatic CPU speed & power optimizer for Linux
     Loaded: loaded (/usr/lib/systemd/system/auto-cpufreq.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Mon 2021-12-13 07:59:56 CET; 17min ago
    Process: 5922 ExecStart=/usr/bin/auto-cpufreq --daemon (code=exited, status=1/FAILURE)
   Main PID: 5922 (code=exited, status=1/FAILURE)
        CPU: 35ms

gru 13 07:59:56 spin systemd[1]: Started auto-cpufreq - Automatic CPU speed & power optimizer for Linux.
gru 13 07:59:56 spin auto-cpufreq[5922]: Traceback (most recent call last):
gru 13 07:59:56 spin auto-cpufreq[5922]:   File "/usr/bin/auto-cpufreq", line 14, in <module>
gru 13 07:59:56 spin auto-cpufreq[5922]:     from auto_cpufreq.core import *
gru 13 07:59:56 spin auto-cpufreq[5922]: ModuleNotFoundError: No module named 'auto_cpufreq'
gru 13 07:59:56 spin systemd[1]: auto-cpufreq.service: Main process exited, code=exited, status=1/FAILURE
gru 13 07:59:56 spin systemd[1]: auto-cpufreq.service: Failed with result 'exit-code'.

After that, I read:

Laptop
Power management
CPU frequency scaling
Powertop

Now I'm completely lost.
I don't know which service/application works with which service/application, and which interfere each other.
I checked on wiki power management topics more than once, and now I don't even know where to start.

Last edited by 860lacov (2022-06-19 20:33:44)

Offline

#2 2021-12-13 08:11:41

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 338

Re: [SOLVED] How to adjust laptop power settings

Just a couple of quick checks:

  1. Did you uninstall the other power management tools, so that you're not running several in parallell?

  2. Did you do what you shouldn't, when installing from AUR?
    auto-cpufreq --install

https://wiki.archlinux.org/title/Power_ … pace_tools
https://github.com/AdnanHodzic/auto-cpufreq

Offline

#3 2021-12-13 08:22:18

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: [SOLVED] How to adjust laptop power settings

Ferdinand wrote:

Just a couple of quick checks:

  1. Did you uninstall the other power management tools, so that you're not running several in parallell?

  2. Did you do what you shouldn't, when installing from AUR?
    auto-cpufreq --install

https://wiki.archlinux.org/title/Power_ … pace_tools
https://github.com/AdnanHodzic/auto-cpufreq

I stopped tlp service.
I didn't do auto-cpufreq --install
After installation, I checked auto-cpufreq I it was fine. I checked it today it there was error I mentioned earlier.

Currently I only have enabled
thermald
acpid
power-profiles-daemon

And powertop is installed

Last edited by 860lacov (2021-12-13 08:24:17)

Offline

#4 2021-12-13 10:29:43

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 338

Re: [SOLVED] How to adjust laptop power settings

Hm.. I'm afraid I'm a bit at a loss here.

The error

gru 13 07:59:56 spin auto-cpufreq[5922]: Traceback (most recent call last):
gru 13 07:59:56 spin auto-cpufreq[5922]:   File "/usr/bin/auto-cpufreq", line 14, in <module>
gru 13 07:59:56 spin auto-cpufreq[5922]:     from auto_cpufreq.core import *
gru 13 07:59:56 spin auto-cpufreq[5922]: ModuleNotFoundError: No module named 'auto_cpufreq'

seems to stem from the file auto_cpufreq/power_helper.py, line 8, but I can't see why that should fail;  auto_cpufreq/core.py evidently exists, and also performs a similar import in line 21.

Someone more pythonic than me might spot something wrong, but I'd say this should not produce an error.

Except I haven't actually installed the package myself, and haven't inspected /usr/bin/auto-cpufreq - that should be a python script, and the import statement should be in line 14, so check if the file core.py exists somewhere sensible in your system?

Or reinstall the package?

If core.py exists, and reinstalling the package doesn't help, I'm afraid I'm at loss. I think a comment on the AUR package page would be in order :-)

Offline

#5 2021-12-13 22:54:11

loqs
Member
Registered: 2014-03-06
Posts: 18,954

Re: [SOLVED] How to adjust laptop power settings

What is the output of

pacman -Q python
pacman -Ql auto-cpufreq

Offline

#6 2021-12-16 18:31:07

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: [SOLVED] How to adjust laptop power settings

loqs wrote:

What is the output of

pacman -Q python
pacman -Ql auto-cpufreq

It's probably irrelevant but:

python 3.10.1-1
auto-cpufreq /usr/
auto-cpufreq /usr/bin/
auto-cpufreq /usr/bin/auto-cpufreq
auto-cpufreq /usr/lib/
auto-cpufreq /usr/lib/python3.10/
auto-cpufreq /usr/lib/python3.10/site-packages/
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq-1.0-py3.10.egg-info/
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq-1.0-py3.10.egg-info/PKG-INFO
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq-1.0-py3.10.egg-info/SOURCES.txt
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq-1.0-py3.10.egg-info/dependency_links.txt
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq-1.0-py3.10.egg-info/requires.txt
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq-1.0-py3.10.egg-info/top_level.txt
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq-1.0-py3.10.egg-info/zip-safe
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__init__.py
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/__init__.cpython-310.opt-1.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/__init__.cpython-310.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/core.cpython-310.opt-1.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/core.cpython-310.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/power_helper.cpython-310.opt-1.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/power_helper.cpython-310.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/tlp_stat_parser.cpython-310.opt-1.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/__pycache__/tlp_stat_parser.cpython-310.pyc
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/core.py
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/power_helper.py
auto-cpufreq /usr/lib/python3.10/site-packages/auto_cpufreq/tlp_stat_parser.py
auto-cpufreq /usr/lib/systemd/
auto-cpufreq /usr/lib/systemd/system/
auto-cpufreq /usr/lib/systemd/system/auto-cpufreq.service
auto-cpufreq /usr/share/
auto-cpufreq /usr/share/auto-cpufreq/
auto-cpufreq /usr/share/auto-cpufreq/scripts/
auto-cpufreq /usr/share/auto-cpufreq/scripts/cpufreqctl.sh
auto-cpufreq /usr/share/doc/
auto-cpufreq /usr/share/doc/auto-cpufreq/
auto-cpufreq /usr/share/doc/auto-cpufreq/README
auto-cpufreq /usr/share/licenses/
auto-cpufreq /usr/share/licenses/auto-cpufreq/
auto-cpufreq /usr/share/licenses/auto-cpufreq/LICENSE

In the time I posted this topic auto-cpufreq was marked out of date.

Now it is working fine.

I would like to come back to my first question.
Currently I have disabled power-profiles-daemon  service and tlp service.

auto-cpufreq is enabled and running fine.
Can/should I do something to make laptop work longer on battery? I don't want to limit my CPU power usage under load. On idle sure, why not.

Offline

#7 2021-12-16 18:54:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,240

Re: [SOLVED] How to adjust laptop power settings

There's not really a generic answer to this you need to check power consumption with tools like powertop. At the end of the day these tools set the same kernel knobs, which you want to prefer here is mostly up to preference/what you feel more comfortable configuring/desktop integration....

auto-cpufreq only handles CPU consumption, power-profiles and TLP set more knobs for more components of your system. You can technically combine these cpufreq and the other two tools.

Offline

#8 2021-12-16 20:00:25

loqs
Member
Registered: 2014-03-06
Posts: 18,954

Re: [SOLVED] How to adjust laptop power settings

860lacov wrote:

In the time I posted this topic auto-cpufreq was marked out of date.

Now it is working fine.

The new version would be built against python 3.10 and the paths would then match,  solving the issue

Offline

Board footer

Powered by FluxBB