Help me to reduce battery consumption. I tried it Improving battery life, TLP and Intel pstate - #22 by KitsuneNoBaka and updated the udev rules, but it seems that didn’t help. The battery drains approximately ~hour. I’m using an i9-14900HX. Battery lasts 3.5 hours with powertop on Debian 13. Nvidia disabled. Maybe I need to modify udev rules for my processor? What tools do you use to solve this problem?
Have you had this problem for a long time or has it just happened?
Maybe you have a VM that consumes too much?
There can be a lot of reasons ![]()
Always. Since switching to Qubes. I tried running powertop in dom0, but it didn’t affect my battery. I don’t use HVM. I only use browsers and SimpleX in appVMs.
and xentop?
No, does this tool help reduce power consumption? Or is it just a monitor?
Oh, xentop is already installed in dom0
When on battery post result of command
xenpm get-cpufreq-para 0
PS: powertop works in Dom0 but it’s Xen that manages CPU so it won’t do you any good - you need to use Xen tools.
How many vcore per app and service qubes you use?
Try to reduce cores in following way:
- 1vcore per service qube
- 2vcore per average app qube
- 3vcore for multimedia/high usage qube
With so high end CPU you may use too much CPU power without real need to.
[user@dom0 ~]$ xenpm get-cpufreq-para 0
cpu id : 0
affected_cpus : 0
cpuinfo frequency : base [2400000] turbo [5800000]
scaling_driver : hwp-cpufreq
scaling_avail_gov : hwp-internal
current_governor : hwp-internal
hwp variables :
hardware limits : lowest [1] most_efficient [11]
: guaranteed [28] highest [72]
configured limits : min [1] max [25] energy_perf [160]
: activity_window [0 hardware selected]
: desired [0 hw autonomous]
turbo mode : enabled
I’m using default settings with 2 cores. I’ve allocated 10 cores to just one browser for watching movies, but I rarely run it.
The way typical hypervisor work it provide full power to all active cores and it doesn’t matter are they in real use or rest, as opposed to ordinary workstation OS that much more power efficient.
Consider each vcore you attacked to running qube as active.
Try to reduce amount of cores you use as fast and easy available solution, for better result you may tweak XEN hypervisor in another way.
What do you think? You are good at it
I’ve reduced number of vcpus in service qubes and I’m using 4 vcpus in YouTube qube - I have way less powerfull cpu, i5-1245U with max frequency of 4.2GHz observed in QubesOS (normally it goes to 3.9).
You could chceck if disabling turbo mode will cripple your cpu (as mine goes bellow 1GHz) or it improves battery
Thank you @WhiteShadow @KitsuneNoBaka. I reduced the number of cores, and that roughly doubled the battery life. I will try disabling turbo mode. Thank you, @Tezeria. You are always kind and responsive to Qubes newusers.
You could also try to set soft affinity with Qubes Admin Events
After setting service and restart all qubes, by default every qube will have soft affinity set to e-cores (will prefer e-cores) except for qubes with tag performance which you set and forget like that (in dom0 terminal):
qvm-tags app-YouTube add performance
and those qubes will have soft affinity (scheduler preference) set to p-cores
It’s also good to set scheduler wieght of dom0 2x as much as other qubes.
Default weight of sched-credit2 for all qubes is 256
xl sched-credit2
here you see, thad dom0 is ID is 0 and by standard all qubes have weight 256, so set it to 512 for dom0:
xl sched-credit2 -d 0 -w 512
PS: weight for sched-credit2 for dom0 is set persistently if you add this command to /etc/rc.d/rc.local
You could also use some systemd shenanigans …
cat /etc/systemd/system/xenweight.service
[Unit]
Description=XENweight dom0
[Service]
Type=oneshot
Environment="TERM=dumb"
RemainAfterExit=true
ExecStart=/usr/bin/xl sched-credit2 -d 0 -w 512
[Install]
WantedBy=multi-user.target
It’s in no way better. It’s just that I prefer to stick with systemd if it’s implemented, even though I hate it. Having different philosophies cluttered over the system is not ideal (with my memory capacities, that is).
Thank you, friends! I did all of that, and your advice increased the battery life!
I’m curious about dissabling “turbo”.
With underpowered cpus of “U” series it cripled everything.
How’s that with more powerfull cpu?
Powerful CPU’s as i9 13/14th gen run without any feelable load any service qube with 1vCore, when you load over around 50% of physical cores laptop may consuming battery in nonsense speed.
Maybe solution is to tweak CPU management:
Hi. Should I create an rc.local file in /etc/rc.d/? The /etc/rc.d/ directory is empty. I have 8 such directories: rc.d, rc0.d, rc1.d … rc6.d