Issues with freezing VMs on Archlinux (smp + virtio-vga)

I’ve run into a small(ish) issue while testing LXD VMs under ArchLinux.

When I start a VM with multiple CPU cores (e.g. limits.cpu=8) the guest kernel just crashes with a weird “SMP NOPTI” message which is just impossible to google for.

I’ve manually validated the qemu config and found that by simply disabling the virtio-vga device the VM was working fine.

Does anybody have an idea why this could be happening? For my local testing I now just commented out the lines in LXDs config generator concerning virtio-vga, but I’m hoping to find the actual cause…

Some infos:

  • LXD 4.19 (from git master)
  • QEMU 6.1.0
  • Linux 5.14.11
  • Guest Image: Tested various images, e.g. ubuntu:20.04
  • CPU: AMD Ryzen 5900X

Any ideas @stgraber ?

Hmm, no. We’re shipping the same QEMU version in the snap and I don’t believe we’ve seen such issues.

I just tried using the snap and I’m seeing the same issue.

I tested on a temporary setup on Fedora 35 with LXD 4.19 as snap and kernel 5.14.11 (CPU: Ryzen 7 3700X), no issue here :frowning:

Maybe you could try with a different QEMU configuration by using Libvirt instead of LXD (with similar guest configuration) and see if the problem still occurs to identify if the problem come from LXD ?

I’ve done some further testing and this seems to be an issue with a combination of that device, probably somehow my CPU, and the kernel in use by the Ubuntu images.

Trying to simply load e.g. the “vmlinuz-5.11.0-1017-kvm” delivered by the Ubuntu 21.04 image results in said kernel panic, while downloading one of their generic images and loading the included “vmlinuz-5.11.0-37-generic” works without any issues.

Minimal example for the crash:

sudo qemu-system-x86_64 -enable-kvm -kernel vmlinuz-5.11.0-1017-kvm -append console=ttyS0 -bios /usr/share/ovmf/x64/OVMF_CODE.fd -m 2048M -serial stdio -smp 8,cores=8,sockets=1,threads=1 -machine q35 -nodefaults -cpu host -nographic -device pcie-root-port,id=qemu_pcie0 -device virtio-vga,bus=qemu_pcie0

(Other kernels will crash in this setup too, but not with the SMP NOPTI error but simply with an error of a missing rootfs)

Can you try using the LXD built images images:ubuntu/focal?

ubuntu:focal crashes, images:ubuntu/focal seems to work fine

from further testing it seems that only the official ubuntu images are failing