After installing QubesOS, my laptop’s battery seems to be draining very quickly. Is it just my imagination?
No, it’s not your imagination.
You are running multiple operating systems in a hypervisor, it’s going to use a lot more power than just running a single bare metal system.
You are going to have higher CPU load, and worse power management.
I’ll add that while lower battery duration is to be expected, as renehoj points out, you really may want to look into power management, as he also mentions; it’s possible that e.g. your CPU is drawing more power than it should due to problems with governors or the driver in general. Use the
xenpm command to investigate (from dom0) and look into switching to hwp if it’s not already the default on your system (beware, however, that allegedly hwp doesn’t work on some systems).
@fslover That report seems quite extreme, though. I’ve never had this bad an endurance on my laptop, even though I run 10+ VMs simultaneously almost all the time, also with an i7.
powersave governor can make your CPU more reluctant to boost up and draw less power. If you are receiving less than 3 hours of battery life and do not have a discrete GPU ( which can drain the battery quite quickly ), then probably you have a misbehaving scaling driver. Try to use
hwp according to https://github.com/QubesOS/qubes-issues/issues/4604#issuecomment-1460107033 .
During the QubesOS summit this past month, I saw a presentation as well on GPU acceleration pass-through (which is not enabled on Qubes OS yet). It seems that the lack of GPU acceleration, even on integrated GPUs like Intel, may be responsible for much of the drain as the CPU then has to process all the compositor functions far less efficently than the GPU would.
To my understanding, this particular cause cannot be resolved yet, due to no passthrough?
I believe so, and that’s why playing video in the app qube makes the laptop run hot. But I think running simple softwares ( like keepassxc or blueman ) without fantastic graphical effects shouldn’t put too much pressure on the CPU…
No, Xen has far worse power management on a typical laptop than the Linux kernel “on the iron,” and Qubes is very demanding compared to a typical OS - for a range of reasons, to include “CPU rendering of things normally passed to the GPU.”
Play with the
xenpm command in dom0. I’ve found that
xenpm disable-turbo-mode helps at least some, as most mobile CPUs draw a lot more power for marginal additional performance in turbo mode. You can also play with the governors - powersave is going to keep the CPUs throttled down, which rather improves efficiency at the cost of performance, performance is going to pin the CPUs wide open, and ondemand will let them wander up and down as needed, but realistically they’re going to be running at full speed a lot.
You can also run
xenpm set-sched-smt enable to try and get some SMT power savings going, if you’ve enabled SMT in Xen (sched-gran-core is probably safe enough to use these days).
Very comprehensive conclusion, thanks @Syonyk !
I’ll just point out that
sched-gran=core doesn’t work on all CPUs (e.g. doesn’t work on Alder Lake), in which case Xen will fall back to
sched-gran=cpu by default (regular SMT with its potential security problems).
So it’s prudent to check (using
xl dmesg) whether the setting is accepted or not.