All Qubes using Maxiumum Memory

Something very odd that I’ve noticed. Qubes seems to be a bit slow. despite me having a fairly beefy machine. Things like the windowmanager being a bit laggy, and my windows having “tracers”

I looked at my xentop and saw that all my VMs are using the maximum memory allocated to them. For example firewall using 4GB, disp (whonix-dvm) only running TB using 4GB, vault only with KeePass open using 4GB etc.

Any VM that I open will use the maximum memory available to it (4GB) despite being configured with a minimum of only 500MB

xentop - 01:43:18   Xen 4.14.5
9 domains: 1 running, 8 blocked, 0 paused, 0 crashed, 0 dying, 0 shutdown
Mem: 33433784k total, 22086848k used, 11346936k free    CPUs: 12 @ 3493MHz
      NAME  STATE   CPU(sec) CPU(%)     MEM(k) MEM(%)  MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS   VBD_OO   VBD_RD   VBD_WR  VBD_RSECT  VBD_WSECT SSID
  disp3230 --b---        234    2.5    4079680   12.2    4097024      12.3     2    0        0        0    4        0    10654     5007    1020530     561744    0
  Domain-0 -----r	    3895    6.3    4177920   12.5    4195328      12.5    12    0        0        0    0        0        0        0          0          0    0
sys-firewa --b---        174    0.3    4079680   12.2    4097024      12.3     2    0        0        0    4        0    12473     2499    1225882     310152    0
   sys-net --b---        187    0.4     393260    1.2     410624       1.2     2    0        0        0    4        0   132683    30054    5541890    2903688    0
sys-net-dm --b---         20    0.2     147456    0.4     148480       0.4     1    0        0        0    4        0	   168        0      32362          0    0
   sys-usb --b---        296    3.0     290860    0.9     308224       0.9     2    0        0        0    4        0    18130     5271    1270378     255448    0
sys-usb-dm --b---         19    0.2     147456    0.4     148480       0.4     1    0        0        0    4        0	   168        0      32362          0    0
sys-whonix --b---         89    0.5    4079680   12.2    4097024      12.3     2    0        0        0    4        0     9258     2381     849074     205672    0
     vault --b---         31    0.3    4079680   12.2    4097024      12.3     2    0        0        0    4        0    11014     1409    1262842	23936    0

When I run top in any of the VMs, they say that the memory usage is fine, such as under 5% used.

Any ideas as to what might be causing this, and if there is a way to fix it?

Sounds like maybe dom0 isn’t using the right driver for your display device, and it’s software rendering the graphics.

If you have free memory, the qube will get the maximum amount. You told the hypervisor to give the vm 4 GB, and it will do whatever it can to honor the request.

Once you run out of free memory, you can see the hypervisor start to balance the memory, Xen calls this process ballooning

2 Likes

That’s amazing.

Is there any way I can confirm that CPU rendering is being used? lspci shows that the GPU connected to my monitors is correctly using the amdgpu drivers, and the other GPUs are also using the nouveau.

I wonder if the fact that there are multiple GPUs in the workstation is confusing Dom0, or if just having 4K displays is stressing it out too much?

xfwm has already has compositing disabled, enabling it makes it MUCH worse. I don’t think GPU performance should be a problem, on Other OSs running multiple monitors at their highest refresh rates is perfectly smooth.

Could the wrong amount of gui video RAM buffer be causing this? I’ve tried setting it with:
$ qvm-features dom0 gui-videoram-min 81000
2 x 2160p monitors, + 1080p monitor = 81,000

Perhaps I’ve set the gui-videoram-min incorrectly though…

Thanks, this answers my question perfectly. Is there some benefit to setting the maximum memory to something lower on VMs that likely dont need all that much, such as sys-* to avoid memory balancing overhead once enough qubes are running?

I normally check the xorg log and config to be 100% sure xorg is using the right driver, my nvidia card defaults to using a generic driver unless nouveau is specified in xorg.conf.

If you are using multiple 4K monitors, that could also be the issue.

Yes, you reduce the amount of work the hypervisor needs to do, it also allows to you more efficiently use the memory in qubes that actually need the memory.

You can use the command free -h in the qube to see how much memory is used/cached/swapped.

Thanks, this helped me identify the problem. the xorg log was saying that it could not find amdgpu.

I got the correct package with
sudo qubes-dom0-update xorg-x11-drv-amdgpu
and xorg logs showed that driver was found and using the amdgpu successfully, however the screen still had issues with very long trailers.

What needed to be done was to hide the other GPUs from dom0 by editing the grub config, now it seems to be working much better, albeit not perfectly, as there is still some trailers, but not nearly as many as before. Its at a level where I don’t really care, I just wonder if its a sign that theres still some other configuration or setting that should be tweaked.

Thanks again for the help