adnanhodzic / auto-cpufreq Goto Github PK
View Code? Open in Web Editor NEWAutomatic CPU speed & power optimizer for Linux
Home Page: https://foolcontrol.org/?p=4603
License: GNU Lesser General Public License v3.0
Automatic CPU speed & power optimizer for Linux
Home Page: https://foolcontrol.org/?p=4603
License: GNU Lesser General Public License v3.0
Greetings,
OS: Ubuntu 19.10
Installed from source. Added required packages with PIP.
Tried to install and got error below
Traceback (most recent call last):
File "/usr/bin/auto-cpufreq", line 11, in
import psutil
File "/usr/local/lib/python3.7/dist-packages/psutil/init.py", line 96, in
from . import _pslinux as _psplatform
File "/usr/local/lib/python3.7/dist-packages/psutil/_pslinux.py", line 26, in
from . import _psutil_linux as cext
ImportError: /usr/local/lib/python3.7/dist-packages/psutil/_psutil_linux.cpython-37m-x86_64-linux-gnu.so: failed to map segment from shared object
Any help is much appreciated
Would it be a good idea to have a settings file?
Certain things could be stored here like;
My laptop is fully charged, and connected to the socket, and when run auto-cpufreq --log
see the following error:
Traceback (most recent call last):
File "/usr/bin/auto-cpufreq", line 437, in <module>
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/bin/auto-cpufreq", line 401, in cli
set_autofreq()
File "/usr/bin/auto-cpufreq", line 243, in set_autofreq
bat_state = p.sensors_battery().power_plugged
AttributeError: 'NoneType' object has no attribute 'power_plugged'
I just installed auto-cpugreq from AUR on Manjaro and decided to use --install after I tested it live, however I'm getting this output
[~] sudo auto-cpufreq --install
--------------------- Deploying auto-cpufreq as a daemon ----------------------
* Turn off bluetooth on boot
* Deploy auto-cpufreq as system wide accessible binary
cp: cannot stat 'auto-cpufreq.py': No such file or directory
* Deploy auto-cpufreq install script
cp: cannot stat 'scripts/auto-cpufreq-install.sh': No such file or directory
* Deploy auto-cpufreq remove script
cp: cannot stat 'scripts/auto-cpufreq-remove.sh': No such file or directory
/bin/sh: /usr/bin/auto-cpufreq-install: No such file or directory
I've been trying to search for the file "auto-cpufreq-remove.sh" with no results at all.
Hi,
firstly thank you for this amazing tool for Linux, in the past days I used the previous version with any issues (except for the log freeze), today I saw the new update and I followed the new installation instructions.
With the new installer I encoutered this pip warning:
WARNING: The directory '/home/filip/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
After that the installation was completed and fine.
But when I give the sudo auto-cpufreq --install instruction and after that, I check the systemctl status auto-cpufreq I receive the error in the title:
/etc/systemd/system/auto-cpufreq.service:9: Executable path is not absolute: auto-cpufreq --daemon
My OS is Elementary 5.1.2 (based on Ubuntu 18.04 LTS)
Thank you in advance for your help!
auto-cpufreq --log
CPU min frequency: 2300MHz
CPU frequency for each core:
CPU0: 2300 MHz
CPU1: 2300 MHz
CPU2: 2300 MHz
CPU3: 2300 MHz
Temperature for each physical core:
CPU0 temp: 53°C
CPU1 temp: 53°C
---------------------------- CPU frequency scaling ----------------------------
Battery is: charging
Setting to use: "performance" governor
Setting to use: "balance_performance" EPP
Total CPU usage: 10.6 %
Total system load: 2.29
High load, setting turbo boost: on
PermissionError: [Errno 1] Operation not permitted
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/snap/auto-cpufreq/14/bin/auto-cpufreq", line 115, in <module>
main()
File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/snap/auto-cpufreq/14/bin/auto-cpufreq", line 42, in main
set_autofreq()
File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/source/core.py", line 402, in set_autofreq
set_performance()
File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/source/core.py", line 362, in set_performance
turbo(True)
File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/source/core.py", line 52, in turbo
f.write_text(str(int(value)) + "\n")
File "/snap/auto-cpufreq/14/usr/lib/python3.6/pathlib.py", line 1216, in write_text
return f.write(data)
PermissionError: [Errno 1] Operation not permitted
^C
Aborted!
auto-cpufreq --debug
-------------------------------------------------------------------------------
System: Notebook product: N24_25JU serial: N/A
Mobo: Notebook model: N24_25JU serial: N/A UEFI: American Megatrends v: 5.11 date: 03/31/2016
Battery BAT0: charge: 40.5 Wh 100.0% condition: 40.5/43.1 Wh (94%)
hidpp__3: charge: N/A condition: NA/NA Wh
CPU: Governors: performance powersave Dual core Intel Core i3-6100U (-MT-MCP-) cache: 3072 KB
clock speeds: max: 2300 MHz 1: 2297 MHz 2: 2298 MHz 3: 2293 MHz 4: 2295 MHz
Graphics: Card: Intel Skylake GT2 [HD Graphics 520]
Display Server: N/A drivers: modesetting (unloaded: fbdev,vesa) tty size: 168x41
Audio: Card Intel Sunrise Point-LP HD Audio driver: snd_hda_intel
Sound: Advanced Linux Sound Architecture v: k5.6.14-050614-generic
Network: Card-1: Realtek RTL8111/8168/8411 PCIE Gigabit Ethernet Controller driver: r8169
IF: enp1s0f1 state: down mac: <filter>
Card-2: Intel Wireless 8260 driver: iwlwifi
IF: wlp2s0 state: up mac: <filter>
Drives: HDD Total Size: 2120.4GB (41.8% used)
ID-1: /dev/sdb model: WDC_WDS120G1G0B size: 120.0GB
ID-2: /dev/sda model: ST2000LX001 size: 2000.4GB
Partition: ID-1: /var/log size: 19G used: 1.2G (7%) fs: zfs dev: N/A
ID-2: swap-1 size: 4.29GB used: 0.00GB (0%) fs: swap dev: /dev/zd0
ID-3: swap-2 size: 2.15GB used: 0.00GB (0%) fs: swap dev: /dev/sdb2
ID-4: swap-3 size: 1.56GB used: 0.10GB (7%) fs: swap dev: /dev/zram0
ID-5: swap-4 size: 1.56GB used: 0.10GB (7%) fs: swap dev: /dev/zram1
ID-6: swap-5 size: 1.56GB used: 0.10GB (7%) fs: swap dev: /dev/zram2
ID-7: swap-6 size: 1.56GB used: 0.10GB (7%) fs: swap dev: /dev/zram3
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:
{'battery': sbattery(percent=100.0, secsleft=<BatteryTime.POWER_TIME_UNLIMITED: -2>, power_plugged=True),
'fans': {},
'temperatures:': {'acpitz': [shwtemp(label='', current=49.0, high=120.0, critical=120.0)],
'coretemp': [shwtemp(label='Package id 0', current=52.0, high=100.0, critical=100.0),
shwtemp(label='Core 0', current=47.0, high=100.0, critical=100.0),
shwtemp(label='Core 1', current=52.0, high=100.0, critical=100.0),
shwtemp(label='Package id 0', current=52.0, high=100.0, critical=100.0),
shwtemp(label='Core 0', current=47.0, high=100.0, critical=100.0),
shwtemp(label='Core 1', current=52.0, high=100.0, critical=100.0)],
'iwlwifi_1': [shwtemp(label='', current=44.0, high=None, critical=None)]}} System Temperatures: cpu: 51.0C mobo: N/A
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 474 Uptime: 2 days Memory: 9981.7/11899.3MB Init: systemd runlevel: 5
Client: Unknown python3.6 client inxi: 2.3.56
-------------------------------------------------------------------------------
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Linux distro: Ubuntu 20.04.1 LTS (Focal Fossa)
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Linux kernel: 5.6.14-050614-generic
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Driver: intel_pstate
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Architecture: x86_64
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Processor: Intel(R) Core(TM) i3-6100U CPU @ 2.30GHz
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Cores: 4
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: ------------------------------ Current CPU states ------------------------------
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU max frequency: 2300MHz
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU min frequency: 2300MHz
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU frequency for each core:
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU0: 2300 MHz
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU1: 2300 MHz
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU2: 2300 MHz
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU3: 2300 MHz
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Temperature for each physical core:
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU0 temp: 53°C
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: CPU1 temp: 53°C
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: ---------------------------- CPU frequency scaling ----------------------------
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Battery is: charging
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Setting to use: "performance" governor
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Setting to use: "balance_performance" EPP
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Total CPU usage: 10.6 %
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Total system load: 2.29
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: High load, setting turbo boost: on
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: PermissionError: [Errno 1] Operation not permitted
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: During handling of the above exception, another exception occurred:
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: Traceback (most recent call last):
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/bin/auto-cpufreq", line 115, in <module>
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: main()
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 829, in __call__
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: return self.main(*args, **kwargs)
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 782, in main
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: rv = self.invoke(ctx)
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: return ctx.invoke(self.callback, **ctx.params)
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/click/core.py", line 610, in invoke
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: return callback(*args, **kwargs)
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/bin/auto-cpufreq", line 42, in main
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: set_autofreq()
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/source/core.py", line 402, in set_autofreq
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: set_performance()
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/source/core.py", line 362, in set_performance
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: turbo(True)
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/lib/python3.6/site-packages/source/core.py", line 52, in turbo
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: f.write_text(str(int(value)) + "\n")
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: File "/snap/auto-cpufreq/14/usr/lib/python3.6/pathlib.py", line 1216, in write_text
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: return f.write(data)
Aug 7 08:49:39 kwaadpepper-N24-25JU auto-cpufreq.service[1519481]: PermissionError: [Errno 1] Operation not permitted
Aug 7 08:49:39 kwaadpepper-N24-25JU systemd[1]: snap.auto-cpufreq.service.service: Succeeded.
Aug 7 08:49:39 kwaadpepper-N24-25JU tracker-store[1516511]: OK
Aug 7 08:49:39 kwaadpepper-N24-25JU systemd[4954]: tracker-store.service: Succeeded.
Aug 7 08:51:31 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_full (No such file or directory)
Aug 7 08:51:31 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_now (No such file or directory)
Aug 7 08:51:31 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/power_now (No such file or directory)
Aug 7 08:51:31 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/energy_full (No such file or directory)
Aug 7 08:51:31 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/charge_full (No such file or directory)
Aug 7 08:51:31 kwaadpepper-N24-25JU cpufreqd: acpi_battery_init : Couldn't open hidpp_battery_3 attributes
Aug 7 08:52:04 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_full (No such file or directory)
Aug 7 08:52:04 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_now (No such file or directory)
Aug 7 08:52:04 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/power_now (No such file or directory)
Aug 7 08:52:04 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/energy_full (No such file or directory)
Aug 7 08:52:04 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/charge_full (No such file or directory)
Aug 7 08:52:04 kwaadpepper-N24-25JU cpufreqd: acpi_battery_init : Couldn't open hidpp_battery_3 attributes
Aug 7 08:52:41 kwaadpepper-N24-25JU wpa_supplicant[2908]: wlp2s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-37 noise=9999 txrate=866700
Aug 7 08:53:07 kwaadpepper-N24-25JU PackageKit: daemon quit
Aug 7 08:53:07 kwaadpepper-N24-25JU systemd[1]: packagekit.service: Succeeded.
Aug 7 08:54:51 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_full (No such file or directory)
Aug 7 08:54:51 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_now (No such file or directory)
Aug 7 08:54:51 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/power_now (No such file or directory)
Aug 7 08:54:51 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/energy_full (No such file or directory)
Aug 7 08:54:51 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/charge_full (No such file or directory)
Aug 7 08:54:51 kwaadpepper-N24-25JU cpufreqd: acpi_battery_init : Couldn't open hidpp_battery_3 attributes
Aug 7 08:55:47 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_full (No such file or directory)
Aug 7 08:55:47 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/energy_now (No such file or directory)
Aug 7 08:55:47 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/power_now (No such file or directory)
Aug 7 08:55:47 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/energy_full (No such file or directory)
Aug 7 08:55:47 kwaadpepper-N24-25JU cpufreqd: get_class_device_attribute: couldn't open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.2/0003:046D:C52B.0013/0003:046D:4072.0015/power_supply/hidpp_battery_3/charge_full (No such file or directory)
@AdnanHodzic what do you think, about adding a feature (option in config when the config file will be available see #26 ) that will disable CPU cores in order to have more battery life?
I found that we can easily disable CPU cores by command echo 0 > /sys/devices/system/cpu/cpu0/online
Probably minor, but when running it doesn't report the architecture, i.e. it is empty:
[30/30]
----------------------------- System information ------------------------------
Linux distro: Debian GNU/Linux 10 buster
Linux kernel: 4.19.0-6-amd64
Driver: intel_pstate
Architecture:
Processor: Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Cores: 12
------------------------------ Current CPU states ------------------------------
Hey there,
I like your tool very much and gave it some testing. On Geekbench 5 I score on the Multi Core test about the same, as when I set my system manually to its maximum. Yet the Single Core test only yields 3/4 of the result. Turbo Boost stays off and the cpu never goes beyond its base frequency then.
Second thing: the log constantly reports that my battery is discharging, even when the ACPI is on-line. Therefore it says it always puts the governor to powersave. Maybe only a logging error since the Multi Core test was good in the benchmark.
Third thing: upon calling the log I get this error:
cp: der Aufruf von stat für '/usr/local/share/auto-cpufreq/scripts/cpufreqctl.sh' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
cp: call of stat for '/usr....' is not possible: File or directory not found
Looks like something isnt copied the right way.
Here are my specs for reference:
Would be great, if you find the time to look into it. :)
Thx and greetings
~ent
No errors
Manjaro
System: Micro-Star product: Alpha 15 A3DD v: REV:1.0 serial: <filter>
Mobo: Micro-Star model: MS-16U6 v: REV:1.0 serial: <filter> UEFI: American Megatrends v: E16U6AMS.110
date: 05/20/2020
Battery: ID-1: BAT1 charge: 48.0 Wh condition: 51.0/53.4 Wh (96%)
CPU: Governors: performance schedutil Topology: Quad Core model: AMD Ryzen 7 3750H with Radeon Vega Mobile Gfx bits: 64 type: MT MCP L2 cache: 2048 KiB
Speed: 1202 MHz min/max: 1400/2300 MHz Core speeds (MHz): 1: 1190 2: 1201 3: 1613 4: 1707 5: 1492 6: 1451 7: 1231
8: 1395
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] driver: amdgpu v: kernel
Device-2: Advanced Micro Devices [AMD/ATI] Picasso driver: amdgpu v: kernel
Display: server: X.org 1.20.8 driver: amdgpu,ati unloaded: modesetting,radeon resolution: <xdpyinfo missing>
Message: Advanced graphics data unavailable for root.
Audio: Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 HDMI Audio driver: snd_hda_intel
Device-2: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor driver: snd_rn_pci_acp3x
Device-3: Advanced Micro Devices [AMD] Family 17h HD Audio driver: snd_hda_intel
Sound Server: ALSA v: k5.8.0-1-MANJARO
Network: Device-1: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter driver: rtw_8822ce
IF: wlo1 state: down mac: <filter>
Device-2: Realtek driver: r8169
IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives: Local Storage: total: 942.70 GiB used: 122.96 GiB (13.0%)
ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB512HAJQ-00000 size: 476.94 GiB
ID-2: /dev/sda vendor: Crucial model: CT500MX500SSD1 size: 465.76 GiB
Partition: ID-1: / size: 457.16 GiB used: 122.96 GiB (26.9%) fs: ext4 dev: /dev/sda2
Sensors:
{'battery': sbattery(percent=94.12644169158479, secsleft=<BatteryTime.POWER_TIME_UNKNOWN: -1>, power_plugged=None),
'fans': {'amdgpu': [sfan(label='', current=65535)]},
'temperatures:': {'acpitz': [shwtemp(label='', current=56.0, high=100.0, critical=100.0)],
'amdgpu': [shwtemp(label='edge', current=40.0, high=108.0, critical=108.0),
shwtemp(label='junction', current=40.0, high=99.0, critical=99.0),
shwtemp(label='mem', current=42.0, high=99.0, critical=99.0),
shwtemp(label='edge', current=53.0, high=80.0, critical=80.0)],
'k10temp': [shwtemp(label='Tctl', current=53.0, high=None, critical=None),
shwtemp(label='Tdie', current=53.0, high=None, critical=None)],
'nvme': [shwtemp(label='Composite', current=52.85, high=80.85, critical=81.85),
shwtemp(label='Sensor 1', current=52.85, high=65261.85, critical=65261.85),
shwtemp(label='Sensor 2', current=36.85, high=65261.85, critical=65261.85)]}} System Temperatures: cpu: 51.4 C mobo: N/A
Fan Speeds (RPM): N/A
GPU: device: amdgpu temp: 54 C fan: 65535 device: amdgpu temp: 51 C
Info: Processes: 289 Uptime: 3h 40m Memory: 29.37 GiB used: 4.69 GiB (16.0%) Shell: auto-cpufreq inxi: 3.0.37
/usr/bin >>> upower -i /org/freedesktop/UPower/devices/battery_BAT1 [130]
native-path: BAT1
vendor: MSI
model: BIF0_9
power supply: yes
updated: pią, 7 sie 2020, 16:52:33 (16 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: fully-charged
warning-level: none
energy: 47,86 Wh
energy-empty: 0 Wh
energy-full: 50,8465 Wh
energy-full-design: 53,2357 Wh
energy-rate: 0,0465847 W
voltage: 12,113 V
percentage: 94%
capacity: 95,512%
technology: lithium-ion
icon-name: 'battery-full-charged-symbolic'
I don't know if it's an error (translation), but according to auto-cpufreq (as I understand it), the battery is discharged even when it is plugged in. In my opinion the program can take bad values in boost management and so on (although I don't see that it would change anything).
Unless I'm stupid and I misunderstand something.
just built snapcraft, installed it
tried to look at --monitor
, but it said that I should use --log
instead
It means that installing new version doesn't remove old one.
@AdnanHodzic could you confirm?
I receive this traceback when running sudo python3 auto-cpufreq.py
Traceback (most recent call last): File "auto-cpufreq.py", line 382, in <module> @click.option("--daemon", is_flag=True, hidden=True) File "/usr/lib/python3/dist-packages/click/decorators.py", line 170, in decorator _param_memo(f, OptionClass(param_decls, **attrs)) File "/usr/lib/python3/dist-packages/click/core.py", line 1460, in __init__ Parameter.__init__(self, param_decls, type=type, **attrs) TypeError: __init__() got an unexpected keyword argument 'hidden'
Unable to copy the scripts/auto-cpufreq.service file to
/lib/systemd/system/auto-cpufreq.service in openSuse.
Correct path should be /usr/lib/systemd/system/auto-cpufreq.service.
Thanks for the auto-cpufreq.
Hello @AdnanHodzic ,
Do we need turbo boost in a powersave mode?
I suddenly start to see that messages appeared from time to time (exact conditions are not yet clear, once it appeared after restoring from the hibernation, another time just in the middle of a running session, literally in all console/terminal window covering whatever is there at the moment):
(base) alex@precision:~$
Message from syslogd@precision at Jan 7 18:27:59 ...
kernel:[30691.577644] Uhhuh. NMI received for unknown reason 3c on CPU 0.
Message from syslogd@precision at Jan 7 18:27:59 ...
kernel:[30691.577645] Do you have a strange power saving mode enabled?
Message from syslogd@precision at Jan 7 18:27:59 ...
kernel:[30691.577646] Dazed and confused, but trying to continue
Not necessary this is related to auto-cpufreq
. Could it be related to tlp
as this was the only relevant package I installed recently and which also potentially could cause this?
sudo python3 auto-cpufreq.py --remove
Traceback (most recent call last):
File "auto-cpufreq.py", line 14, in <module>
import power
ModuleNotFoundError: No module named 'power'
It would be nice if there are some kind of message about how to exit "auto-cpufreq --log". Ctrl+C is working but it is not intuitive for new users.
--> Battery is: charging
Battery appears as "charging" while not ! My computer was not charging at all.
System: HP product: HP EliteBook 830 G5 v: N/A serial:
Mobo: HP model: 83B3 v: KBC Version 04.65.00 serial: UEFI: HP
v: Q78 Ver. 01.10.01 date: 03/02/2020
Battery: ID-1: BAT0 charge: 20.7 Wh condition: 47.3/47.3 Wh (100%)
CPU: Governors: performance powersave Topology: Dual Core model: Intel Core i5-7300U bits: 64 type: MT MCP
L2 cache: 3072 KiB
Speed: 1611 MHz min/max: 400/2600 MHz Core speeds (MHz): 1: 1751 2: 1895 3: 1857
4: 1802
Graphics: Device-1: Intel HD Graphics 620 driver: i915 v: kernel
Device-2: Lite-On HP HD Camera type: USB driver: uvcvideo
Display: server: X.Org 1.20.8 driver: intel unloaded: modesetting,vesa
resolution: 1920x1080~60Hz
OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 20.1.4
Audio: Device-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel
Sound Server: ALSA v: k5.7.12-arch1-1
Network: Device-1: Intel Ethernet I219-LM driver: e1000e
IF: enp0s31f6 state: down mac:
Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi
IF: wlp1s0 state: up mac:
Drives: Local Storage: total: 238.47 GiB used: 110.49 GiB (46.3%)
ID-1: /dev/sda vendor: Micron model: MTFDDAV256TBN-1AR15ABHA size: 238.47 GiB
Partition: ID-1: / size: 229.28 GiB used: 110.38 GiB (48.1%) fs: ext4 dev: /dev/dm-2
ID-2: /boot size: 511.0 MiB used: 109.7 MiB (21.5%) fs: vfat dev: /dev/sda1
Swap: ID-1: swap-1 type: partition size: 4.00 GiB used: 0 KiB (0.0%) dev: /dev/dm-1
Sensors:
{'battery': None,
'fans': {},
'temperatures:': {'acpitz': [shwtemp(label='', current=30.0, high=None, critical=None),
shwtemp(label='', current=39.0, high=128.0, critical=128.0),
shwtemp(label='', current=0.0, high=128.0, critical=128.0),
shwtemp(label='', current=33.0, high=128.0, critical=128.0),
shwtemp(label='', current=33.0, high=128.0, critical=128.0),
shwtemp(label='', current=31.0, high=128.0, critical=128.0),
shwtemp(label='', current=33.0, high=128.0, critical=128.0),
shwtemp(label='', current=0.0, high=128.0, critical=128.0)],
'coretemp': [shwtemp(label='Package id 0', current=42.0, high=100.0, critical=100.0),
shwtemp(label='Core 0', current=42.0, high=100.0, critical=100.0),
shwtemp(label='Core 1', current=39.0, high=100.0, critical=100.0),
shwtemp(label='Package id 0', current=42.0, high=100.0, critical=100.0),
shwtemp(label='Core 0', current=42.0, high=100.0, critical=100.0),
shwtemp(label='Core 1', current=39.0, high=100.0, critical=100.0)],
'iwlwifi_1': [shwtemp(label='', current=44.0, high=None, critical=None)],
'pch_skylake': [shwtemp(label='', current=36.5, high=None, critical=None)]}} System Temperatures: cpu: 44.0 C mobo: 39.0 C
Fan Speeds (RPM): N/A
Info: Processes: 240 Uptime: 4h 19m Memory: 15.49 GiB used: 2.17 GiB (14.0%) Shell: Sudo
inxi: 3.1.04
As far as we know that not all linux distribution uses snap by default.
I think that adding flatpak package would be a nice addition for the RHEL/Fedora/Silverblue/CentOS users and others (clear linux, POP OS, and other who relise on flatpak as default)
I have a bit of experience with flatpak, so can try to look in that direction.
@AdnanHodzic if you consider flatpak support, than you can assign this issue to me.
I've installed auto-cpufreq on my up-to-date Manjaro machine with snap:
snap 2.44.1-1
snapd 2.44-1
series 16
manjaro -
kernel 4.19.112-1-MANJARO
Installation goes well, but things go wrong when I try to start the daemon. This is from system logs:
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: ----------------------------- System information ------------------------------
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: Traceback (most recent call last):
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: File "/snap/auto-cpufreq/5/bin/auto-cpufreq", line 108, in <module>
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: main()
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 829, in __call__
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: return self.main(*args, **kwargs)
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 782, in main
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: rv = self.invoke(ctx)
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: return ctx.invoke(self.callback, **ctx.params)
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 610, in invoke
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: return callback(*args, **kwargs)
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: File "/snap/auto-cpufreq/5/bin/auto-cpufreq", line 39, in main
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: sysinfo()
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/source/core.py", line 360, in sysinfo
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: dist = distro + " " + version
Mar 29 14:56:22 rocinante auto-cpufreq.service[1881264]: UnboundLocalError: local variable 'version' referenced before assignment
I did a bit of digging and found that the core.py script is failing due to not being able to locate the searchfile
at /var/lib/snapd/hostfs/etc/os-release
. The bug here seems that it assumes the file is always present (which it seems not on my system), and if the file is not present then the version
and distro
variables go uninitialised. Looking at that path on my machine, I have an empty directory at /var/lib/snapd/hostfs
.
Hi there!
I just installed a fresh ubuntu 20.04 copy.
I'm running your app, and i'm liking it so much...i'm not even going to install TLP.
So... there's also gamemode in ubuntu. As far as as i know, running gamemode, will change your governor to performance ( and so does your app when plugged to ac).
ubuntu's game mode will disable the performance governor when you exit the game. In this case, as i'm still plugged to ac, how will your app respond?
these 2 won't play well together right? do i need gamemode anyway?
cheers
My APU does not report temps for each core so it fails.
Output of:
import psutil
print(psutil.sensors_temperatures())
{'nvme': [shwtemp(label='Composite', current=37.85, high=84.85, critical=84.85), shwtemp(label='Sensor 1', current=37.85, high=65261.85, critical=65261.85), shwtemp(label='Sensor 2', current=37.85, high=65261.85, critical=65261.85)], 'k10temp': [shwtemp(label='Tctl', current=62.375, high=None, critical=None), shwtemp(label='Tdie', current=62.375, high=None, critical=None)], 'amdgpu': [shwtemp(label='edge', current=62.0, high=80.0, critical=80.0)]}
❯ sudo auto-cpufreq --monitor
----------------------------- System information ------------------------------
Linux distro: Manjaro Linux 20.0.3 Lysia
Linux kernel: 5.8.0-1-MANJARO
Driver: acpi-cpufreq
Architecture: x86_64
Processor: AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx
Cores: 8
------------------------------ Current CPU states ------------------------------
CPU max frequency: 2000MHz
CPU min frequency: 1600MHz
CPU frequency for each core:
CPU0: 2112 MHz
CPU1: 2154 MHz
CPU2: 2179 MHz
CPU3: 1861 MHz
CPU4: 1668 MHz
CPU5: 1556 MHz
CPU6: 2032 MHz
CPU7: 1867 MHz
Temperature for each physical core:
Traceback (most recent call last):
File "/usr/sbin/auto-cpufreq", line 116, in <module>
main()
File "/usr/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/sbin/auto-cpufreq", line 67, in main
sysinfo()
File "/usr/lib/python3.8/site-packages/source/core.py", line 483, in sysinfo
temp = core_temp['acpitz'][0].current
KeyError: 'acpitz'
-------------------------------------------------------------------------------
System:
Kernel: 5.8.0-1-MANJARO x86_64 bits: 64 Desktop: GNOME 3.36.4 Distro: Manjaro Linux
Machine:
Type: Laptop System: Dell product: Inspiron 5575 v: 1.3.3 serial: <filter>
Mobo: Dell model: 0M0Y6P v: X01 serial: <filter> UEFI: Dell v: 1.3.3
date: 10/31/2019
Battery:
ID-1: BAT1 charge: 31.7 Wh condition: 31.7/42.0 Wh (76%)
CPU: Governors: performance schedutil
type: MT MCP L2 cache: 2048 KiB
Speed: 2781 MHz min/max: 1600/2000 MHz Core speeds (MHz): 1: 1776 2: 1814 3: 1513
4: 1466 5: 1528 6: 1495 7: 2365 8: 1969
Graphics:
Device-1: AMD Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series]
driver: amdgpu v: kernel
Device-2: Realtek Integrated Webcam type: USB driver: uvcvideo
Display: x11 server: X.Org 1.20.8 driver: amdgpu unloaded: modesetting
resolution: 1920x1080~60Hz
OpenGL: renderer: AMD RAVEN (DRM 3.38.0 5.8.0-1-MANJARO LLVM 10.0.1)
v: 4.6 Mesa 20.1.4
Audio:
Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio driver: snd_hda_intel
Device-2: AMD Family 17h HD Audio driver: snd_hda_intel
Sound Server: ALSA v: k5.8.0-1-MANJARO
Network:
Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169
IF: eth0 state: down mac: <filter>
Device-2: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter
driver: ath10k_pci
IF: wlan0 state: up mac: <filter>
Device-3: Qualcomm Atheros type: USB driver: btusb
Drives:
Local Storage: total: 1.14 TiB used: 803.28 GiB (69.0%)
ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO Plus 250GB size: 232.89 GiB
ID-2: /dev/sda vendor: Western Digital model: WD10SPZX-75Z10T2 size: 931.51 GiB
Partition:
ID-1: / size: 227.94 GiB used: 184.70 GiB (81.0%) fs: ext4 dev: /dev/nvme0n1p2
Swap:
ID-1: swap-1 type: file size: 20.00 GiB used: 83.2 MiB (0.4%) file: /swapfile
Sensors:
System Temperatures: cpu: 67.2 C mobo: N/A gpu: amdgpu temp: 67 C
Fan Speeds (RPM): cpu: 6200 fan-1:
Info:
Processes: 399 Uptime: 8h 21m Memory: 15.35 GiB used: 8.14 GiB (53.0%) Shell: Zsh
inxi: 3.1.05
-------------------------------------------------------------------------------
Hi, when I try to run your software I receive this error message:
andrea@andrea-X510UQR:~/.tmp/auto-cpufreq$ sudo python3 auto-cpufreq.py
Traceback (most recent call last):
File "auto-cpufreq.py", line 32, in <module>
gov_state = get_cur_gov.split()[0]
IndexError: list index out of range
How can I resolve this? Thanks in advance!
TLP can, but auto-cpufreq doesn't.
Example:
+++ Processor
CPU model = Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 400000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 1600000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power
I removed the auto-cpufreq and configure TLP again. Without TLP, energy_performance_preference = balance_performance
. scaling_governor is changing without any issue.
-------------------------- auto-cpufreq installer -----------------------------
Welcome to auto-cpufreq tool installer.
Options:
[I]nstall
[R]emove
[Q]uit
Select a key: [i/r/q]: i
-------------------------------------------------------------------------------
Detected Debian based distribution
-------------------------------------------------------------------------------
Setting up Python environment
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-dev is already the newest version (3.6.7-1~18.04).
python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-------------------------------------------------------------------------------
Installing necessary Python packages
The directory '/home/fireflower/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/fireflower/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: psutil in /usr/lib/python3/dist-packages
Collecting click
Downloading https://files.pythonhosted.org/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl (82kB)
100% |████████████████████████████████| 92kB 4.6MB/s
Collecting distro
Downloading https://files.pythonhosted.org/packages/25/b7/b3c4270a11414cb22c6352ebc7a83aaa3712043be29daa05018fd5a5c956/distro-1.5.0-py2.py3-none-any.whl
Collecting power
Downloading https://files.pythonhosted.org/packages/6a/fc/a730a7c7a9a30b8e0774ca7e06c54181f61620250749ac3de47da138cfd4/power-1.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3uuw_wzv/power/
-------------------------------------------------------------------------------
installing auto-cpufreq tool
Traceback (most recent call last):
File "setup.py", line 3, in <module>
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
-------------------------------------------------------------------------------
auto-cpufreq tool successfully installed.
For list of options, run:
auto-cpufreq
-------------------------------------------------------------------------------
fireflower@romuluotain8:
Seems like python installation failed and automatic installation failed with it but reports successful installation.
Cannot reopen #6 myself, so opening the issue again. After suspending and resuming the laptop causes stopping auto-cpufreq --log
output. It freezes.
Hello ! I'm testing this program, but so far, so good. Although, I found a problem and resolved it.
When I first installed it with 'snap', when running with 'sudo the auto-cpufreq --live', I was getting permission denied when trying to make changes.
I removed it and re-installed using the source code. Then, everything changed as supposed too.
[my small contribution, even though I don't now if it's a know issue...]
Cheers!
I installed the last version of your code with manually installation. After installation without errors, I tried monitor and live and perfectly works. I decide to install it with the proper command and all works. The problem born when I try to execute the log command to see the configuration, but nothing showed. I see that service is running but I can't see the current configuration. Can you help me?
Hi!
Using auto-cpufreq --log
after a successful sudo auto-cpufreq --install
, I get the following error:
⋊> ~ auto-cpufreq --log
-------------------------------- Daemon check ---------------------------------
ERROR:
Daemon not enabled, must run install first, i.e:
sudo auto-cpufreq --install
-------------------------------------------------------------------------------
----------------------------- System information ------------------------------
Traceback (most recent call last):
File "/snap/auto-cpufreq/5/bin/auto-cpufreq", line 108, in <module>
main()
File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/snap/auto-cpufreq/5/bin/auto-cpufreq", line 39, in main
sysinfo()
File "/snap/auto-cpufreq/5/lib/python3.6/site-packages/source/core.py", line 351, in sysinfo
searchfile = open("/var/lib/snapd/hostfs/etc/os-release", "r")
PermissionError: [Errno 13] Permission denied: '/var/lib/snapd/hostfs/etc/os-release'
Tried the command with sudo
, same result.
yay -S auto-cpufreq
sudo auto-cpufreq --install
--------------------- Deploying auto-cpufreq as a daemon ----------------------
* Turn off bluetooth on boot
* Deploy auto-cpufreq install script
Traceback (most recent call last):
File "/usr/bin/auto-cpufreq", line 115, in <module>
main()
File "/usr/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/bin/auto-cpufreq", line 98, in main
deploy_daemon()
File "/usr/lib/python3.8/site-packages/source/core.py", line 215, in deploy_daemon
shutil.copy(SCRIPTS_DIR / "auto-cpufreq-install.sh", "/usr/bin/auto-cpufreq-install")
File "/usr/lib/python3.8/shutil.py", line 415, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.8/shutil.py", line 261, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/auto-cpufreq/scripts/auto-cpufreq-install.sh'
-------------------------------------------------------------------------------
System: Hewlett-Packard product: HP EliteBook Folio 1040 G1 v: A3009D510203
serial: <filter>
Mobo: Hewlett-Packard model: 213E v: KBC Version 24.2B serial: <filter>
BIOS: Hewlett-Packard v: L83 Ver. 01.21 date: 08/19/2014
Battery: ID-1: BAT0 charge: 25.1 Wh condition: 31.1/31.1 Wh (100%)
CPU: Governors: performance powersave Topology: Dual Core model: Intel Core i5-4300U bits: 64 type: MT MCP L2 cache: 3072 KiB
Speed: 799 MHz min/max: 800/2500 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798
Graphics: Device-1: Intel Haswell-ULT Integrated Graphics driver: i915 v: kernel
Display: x11 server: X.Org 1.20.8 driver: intel unloaded: modesetting,vesa
resolution: 1920x1080~60Hz
OpenGL: renderer: Mesa DRI Intel HD Graphics 4400 (HSW GT2) v: 4.5 Mesa 20.1.3
Audio: Device-1: Intel Haswell-ULT HD Audio driver: snd_hda_intel
Device-2: Intel 8 Series HD Audio driver: snd_hda_intel
Sound Server: ALSA v: k5.6.19-2-MANJARO
Network: Device-1: Intel Ethernet I218-LM driver: e1000e
IF: enp0s25 state: down mac: <filter>
Device-2: Intel Wireless 7260 driver: iwlwifi
IF: wlo1 state: up mac: <filter>
Drives: Local Storage: total: 167.68 GiB used: 13.97 GiB (8.3%)
ID-1: /dev/sda vendor: Intel model: SSDSCKGF180A4H size: 167.68 GiB
Partition: ID-1: / size: 29.52 GiB used: 13.97 GiB (47.3%) fs: ext4 dev: /dev/sda3
Sensors:
{'battery': sbattery(percent=80.62789867998573, secsleft=11894, power_plugged=False),
'fans': {},
'temperatures:': {'acpitz': [shwtemp(label='', current=42.0, high=128.0, critical=128.0),
shwtemp(label='', current=0.0, high=128.0, critical=128.0),
shwtemp(label='', current=37.0, high=128.0, critical=128.0),
shwtemp(label='', current=36.0, high=128.0, critical=128.0),
shwtemp(label='', current=34.0, high=128.0, critical=128.0),
shwtemp(label='', current=114.0, high=128.0, critical=128.0)],
'coretemp': [shwtemp(label='Package id 0', current=43.0, high=100.0, critical=100.0),
shwtemp(label='Core 0', current=37.0, high=100.0, critical=100.0),
shwtemp(label='Core 1', current=42.0, high=100.0, critical=100.0),
shwtemp(label='Package id 0', current=43.0, high=100.0, critical=100.0),
shwtemp(label='Core 0', current=37.0, high=100.0, critical=100.0),
shwtemp(label='Core 1', current=42.0, high=100.0, critical=100.0)]}} System Temperatures: cpu: 37.0 C mobo: N/A
Fan Speeds (RPM): N/A
Info: Processes: 159 Uptime: 45m Memory: 7.68 GiB used: 1.11 GiB (14.5%) Shell: auto-cpufreq
inxi: 3.0.37
-------------------------------------------------------------------------------
██████████████████ ████████
██████████████████ ████████ OS: Manjaro 20.0.3 Lysia
██████████████████ ████████ Kernel: x86_64 Linux 5.6.19-2-MANJARO
██████████████████ ████████ Uptime: 55m
████████ ████████ Packages: 1041
████████ ████████ ████████ Shell: zsh 5.8
████████ ████████ ████████ Resolution: 1920x1080
████████ ████████ ████████ WM: i3
████████ ████████ ████████ GTK Theme: Adapta-Nokto-Eta-Maia [GTK2/3]
████████ ████████ ████████ Icon Theme: breeze
████████ ████████ ████████ Font: Noto Sans, 10
████████ ████████ ████████ Disk: 14G / 34G (44%)
████████ ████████ ████████ CPU: Intel Core i5-4300U @ 4x 2.5GHz [44.0°C]
████████ ████████ ████████ GPU: Mesa DRI Intel(R) HD Graphics 4400 (HSW GT2)
RAM: 1453MiB / 7859MiB
Traceback (most recent call last):
File "auto-cpufreq.py", line 448, in <module>
cli()
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "auto-cpufreq.py", line 421, in cli
sysinfo()
File "auto-cpufreq.py", line 349, in sysinfo
print("CPU" + str(core_num) + " temp: {:.0f}".format(core_temp['coretemp'][core_num].current) + "°C")
KeyError: 'coretemp'
Seems that it can read the CPU temp easily fixed by adding
cat /sys/devices/virtual/thermal/thermal_zone0/temp
For checking temp if not available via the pypi packages :)
anyways thanks for a great tool
How about making a config file to specify the powersave vs performance and turbo-boost constants, which are currently hardcoded in the set_powersave and mon_powersave and related functions.
This could be a long term goal and would expose tweak-ability in a format similar to tlp.
From another directory I got this (file does not exist):
cp: no se puede efectuar
stat' sobre 'scripts/cpufreqctl.sh': No existe el fichero o el directorio`
But, executing when pwd is inside the directory auto-cpufreq, then the error mensaje is this:
python3 auto-cpufreq.py --monitor
----------------------------- System information ------------------------------
Linux distro: PCLinuxOS 2020 PCLinuxOS
Linux kernel: 5.4.8-pclos1
Driver: intel_pstate
Architecture: x86_64
Processor: Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz
Cores: 4
------------------------------ Current CPU states ------------------------------
CPU max frequency:
3200 MHz
CPU frequency for each core:
CPU0: 1898 MHz
CPU1: 1702 MHz
CPU2: 2149 MHz
CPU3: 1566 MHz
Temperature for each physical core:
Traceback (most recent call last):
File "auto-cpufreq.py", line 437, in <module>
cli()
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib64/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "auto-cpufreq.py", line 410, in cli
sysinfo()
File "auto-cpufreq.py", line 338, in sysinfo
print("CPU" + str(core_num) + " temp: {:.0f}".format(core_temp['coretemp'][core_num].current) + "°C")
KeyError: 'coretemp'
Hi!
Got error when use
sudo auto-cpufreq --live
Setting to use "performance" governor
/usr/bin/cpufreqctl: row 267: /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference: Access denied
/usr/bin/cpufreqctl: row 267: /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference: Access denied
/usr/bin/cpufreqctl: row 267: /sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference: Access denied
/usr/bin/cpufreqctl: row 267: /sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference: Access denied
I check that files and they doesn't exist....
Ubuntu 18.04.4
Systemd service fails on boot, but runs successfully when started manually (sudo systemctl start auto-cpufreq.service). Suspect that the service needs a different "After" target. Will dig further on my own.
System:
Arch Linux x86_64 5.4.8-arch1-1
Intel i5-4200U
Asus Q501LA 1.0
sudo systemctl status auto-cpufreq.service immediately after boot:
● 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 Tue 2020-01-07 18:31:17 MST; 15min ago
Process: 474 ExecStart=/usr/bin/python3 /usr/bin/auto-cpufreq --daemon (code=exited, status=1/FAILURE)
Main PID: 474 (code=exited, status=1/FAILURE)
Jan 07 18:31:17 orpheus systemd[1]: Started auto-cpufreq - Automatic CPU speed & power optimizer for Linux.
Jan 07 18:31:17 orpheus systemd[1]: auto-cpufreq.service: Main process exited, code=exited, status=1/FAILURE
Jan 07 18:31:17 orpheus systemd[1]: auto-cpufreq.service: Failed with result 'exit-code'.
install: cannot stat 'auto-cpufreq.py': No such file or directory
==> ERROR: A failure occurred in package().
Aborting...
Error making: auto-cpufreq-git
I got this error, is there a fix?
I got this error while running the tool with a AMD Ryzen 7 PRO 3700U cpu.
If this error is indeed caused because the AMD cpu isn't supported, might I suggest updating the README to reflect this? If this isn't what's causing the error I'd have to look more into it and I'd gladly provide any needed information.
Output of sudo tlp-stat -p
--- TLP 1.2.2 --------------------------------------------
+++ Processor
CPU model = AMD Ryzen 7 PRO 3700U w/ Radeon Vega Mobile Gfx
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = acpi-cpufreq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = ondemand performance schedutil
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 1400000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 2300000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies = 2300000 1700000 1400000 [kHz]
(Idem for the remaining seven cores)
/sys/devices/system/cpu/cpufreq/boost = 1
x86_energy_perf_policy: unsupported CPU.
/sys/module/workqueue/parameters/power_efficient = N
/proc/sys/kernel/nmi_watchdog = 0
+++ Undervolting
PHC kernel not available.
I cannot be able to see the stream of the log. It just stopped with the following content:
----------------------------- System information ------------------------------
Linux distro: Ubuntu 20.04 Focal Fossa
Linux kernel: 5.0.0-37-generic
Driver: intel_pstate
Architecture: x86_64
Processor: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
Cores: 8
------------------------------ Current CPU states ------------------------------
CPU max frequency:
3900 MHz
CPU frequency for each core:
CPU0: 3114 MHz
CPU1: 3175 MHz
CPU2: 3301 MHz
CPU3: 3556 MHz
CPU4: 3242 MHz
CPU5: 2934 MHz
CPU6: 3488 MHz
CPU7: 3382 MHz
Temperature for each physical core:
CPU0 temp: 44°C
CPU1 temp: 40°C
CPU2 temp: 41°C
CPU3 temp: 44°C
---------------------------- CPU frequency scaling ----------------------------
Battery is: charging
Setting to use "performance" governor
Total CPU usage: 3.2 %
Total system load: 0.34
Setting turbo boost: on
-------------------------------------------------------------------------------
"auto-cpufreq" refresh in: 2
But right now I'm not on the charging status, that machine goes with the battery.
● auto-cpufreq.service - auto-cpufreq - Automatic CPU speed & power optimizer f>
Loaded: loaded (/lib/systemd/system/auto-cpufreq.service; enabled; vendor >
Active: active (running) since Sun 2020-01-05 14:00:51 +03; 24min ago
Main PID: 1843 (python3)
Tasks: 1 (limit: 9195)
Memory: 19.3M
CGroup: /system.slice/auto-cpufreq.service
└─1843 /usr/bin/python3 /usr/bin/auto-cpufreq --daemon
Hi, I would recommend updating your web page and other auto-cpufreq material with the correct instructions on how to check daemon status when snap was used to install auto-cpufreq. The instructions currently posted are not working in that scenario.
auto-cpufreq is amazing, thanks for your time!
Hi,
With a fresh install today, I get this when I launch auto-cpufreq
$ sudo auto-cpufreq
/usr/local/lib/python3.6/dist-packages/power/linux.py:100: UserWarning: Unable to read properties of /sys/class/power_supply/hidpp_battery_0: [Errno 2] No such file or directory: '/sys/class/power_supply/hidpp_battery_0/present'
warnings.warn("Unable to read properties of {path}: {error}".format(path=supply_path, error=str(e)))
Traceback (most recent call last):
File "/usr/local/bin/auto-cpufreq", line 4, in <module>
__import__('pkg_resources').run_script('auto-cpufreq==1.0', 'auto-cpufreq')
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 658, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1445, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.6/dist-packages/auto_cpufreq-1.0-py3.6.egg/EGG-INFO/scripts/auto-cpufreq", line 20, in <module>
File "/usr/lib/python3/dist-packages/click/decorators.py", line 170, in decorator
_param_memo(f, OptionClass(param_decls, **attrs))
File "/usr/lib/python3/dist-packages/click/core.py", line 1460, in __init__
Parameter.__init__(self, param_decls, type=type, **attrs)
TypeError: __init__() got an unexpected keyword argument 'hidden'
Context:
To bring stability to my system, I use virtualenv to install all python tools through package managers like pip. When installing the auto-cpufreq-git
package from the AUR, I noticed that it installed the auto-cpufreq
binary into my user space virtualenv:
$ which auto-cpufreq
/home/marco/.virtualenv/bin/auto-cpufreq
When the auto-cpufreq
service is started with systemctl
it borks with the following:
● auto-cpufreq.service - auto-cpufreq - Automatic CPU speed & power optimizer for Linux
Loaded: bad-setting (Reason: Unit auto-cpufreq.service has a bad unit file setting.)
Active: inactive (dead)
Mar 24 11:09:21 rocinante systemd[1]: /usr/lib/systemd/system/auto-cpufreq.service:9: Executable "auto-cpufreq" not found in path "/usr/local/bin:/usr/bin"
Mar 24 11:09:21 rocinante systemd[1]: auto-cpufreq.service: Unit configuration has fatal error, unit will not be started.
Mar 24 11:10:12 rocinante systemd[1]: /usr/lib/systemd/system/auto-cpufreq.service:9: Executable "auto-cpufreq" not found in path "/usr/local/bin:/usr/bin"
Mar 24 11:10:12 rocinante systemd[1]: auto-cpufreq.service: Unit configuration has fatal error, unit will not be started.
Hi.
I just cloned the repo, installed dependencies and run the script but got a TypeError
:
> sudo python3 auto-cpufreq.py
Traceback (most recent call last):
File "auto-cpufreq.py", line 382, in <module>
@click.option("--daemon", is_flag=True, hidden=True)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 170, in decorator
_param_memo(f, OptionClass(param_decls, **attrs))
File "/usr/lib/python3/dist-packages/click/core.py", line 1460, in __init__
Parameter.__init__(self, param_decls, type=type, **attrs)
TypeError: __init__() got an unexpected keyword argument 'hidden'
I am using Linux Mint 19.3.
I've started using the tool and loving it so far. Good work!
After installation, the auto-cpufreq
service is continually outputting the full payload of the --log
command to the system logs.
When tailing the logs with journalctl --follow
, I see a continual stream of these log reports being dumped in the log every 5 seconds.
...
Aug 07 12:34:18 rocinante auto-cpufreq.service[561395]: ----------------------------- System information ------------------------------
Aug 07 12:34:18 rocinante auto-cpufreq.service[561395]: Linux distro: Manjaro Linux UNKNOWN version
Aug 07 12:34:18 rocinante auto-cpufreq.service[561395]: Linux kernel: 5.4.52-1-MANJARO
Aug 07 12:34:18 rocinante auto-cpufreq.service[561395]: Driver: intel_pstate
Aug 07 12:34:18 rocinante auto-cpufreq.service[561395]: Architecture: x86_64
Aug 07 12:34:18 rocinante auto-cpufreq.service[561395]: Processor: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
...
My system info:
+
#
###
#####
######
; #####; User: marco
+##.##### Hostname: rocinante
+########## Distro: Arch Linux
#############; Kernel: 5.4.52-1-MANJARO
###############+ Uptime: 10 days, 14:03
####### ####### Window Manager: i3
.######; ;###;`". Desktop Environment:
.#######; ;#####. Shell: /bin/zsh
#########. .########` Terminal: screen-256color
######' '###### Packages: 1588
;#### ####; CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
##' '## RAM: 6717 MB / 15766 MB
#' `# Disk: 469GB / 989GB
Installed with snap:
snap 2.45.2-1
snapd 2.45.2-1
series 16
manjaro -
kernel 5.4.52-1-MANJARO
Should this perhaps rather be a one-line summary whenever the state of cpu scaling is changed by the tool?
I also further noticed the continued references to a /var/log/auto-cpufreq.log
file in the service descriptor and elsewhere, but this file never seems to be created. I tried creating it myself, but it still doesn't get populated with the logs.
I realise that these are just teething issues that still need to be sorted. Keep up the great work!
I have centos 8 on this machine and python-devel does not exist on here but a package called platform-python-devel did the trick :)
Since sensors are very different across the machines I think that it would be nice to add output of psutil.sensors_temperature()
into get_sys_info()
function
also, we need to know the version and the way user start it (snap or directly from the git)
in general, we should add:
maybe more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.