knazarov / homebrew-qemu-virgl

A homebrew tap for qemu with support for 3d accelerated guests
414 stars 67 forks source link

Guest crashing with AGX: exceeded compiled variants footprint limit on M1 MacBook Air #65

Open PMahar opened 2 years ago

PMahar commented 2 years ago

VM works fine except for occasional network interruptions (which I'm attributing to something in my script) and the guest crashing after some time of using the VM. QEMU itself doesn't actually crash, but spits out AGX: exceeded compiled variants footprint limit and the guest becomes entirely unresponsive except for being able to move the cursor.

I'm running Ubuntu Server 20.04.3 with Kubuntu Desktop installed. Here is my script for launching the VM:

args=(
-machine virt,accel=hvf,highmem=off \
-cpu max -smp cpus=4,sockets=1,cores=4,threads=1 -m 8G \
-device intel-hda -device hda-output \
-device qemu-xhci \
-device virtio-gpu-gl-pci \
-device usb-kbd \
-device virtio-net-pci,netdev=net0 \
-device usb-mouse,bus=usb-bus.0 \
-display cocoa,gl=es \
-netdev user,smb=/,id=net0 \
-drive "if=pflash,format=raw,file=./edk2-aarch64-code.fd,readonly=on" \
-drive "if=pflash,format=raw,file=./edk2-arm-vars.fd,discard=on" \
-device nvme,drive=drive2,serial=drive2,bootindex=2 \
-drive "if=none,media=disk,id=drive2,file=/Users/patrick/ubuntu-server-21-10.qcow2" \
-rtc base=localtime
)
sudo qemu-system-aarch64 "${args[@]}"
knazarov commented 2 years ago

If you have problems with the network device, you may try running with -netdev vmnet-shared,id=net, but for vmnet-shared to work, you need to start qemu with sudo, and pass -runas "$(id -u):$(id -g)", essentially:

args=(
-machine virt,accel=hvf,highmem=off \
-cpu max -smp cpus=4,sockets=1,cores=4,threads=1 -m 8G \
-device intel-hda -device hda-output \
-device qemu-xhci \
-device virtio-gpu-gl-pci \
-device usb-kbd \
-netdev vmnet-shared,id=net \
-device usb-mouse,bus=usb-bus.0 \
-display cocoa,gl=es \
-netdev user,smb=/,id=net0 \
-drive "if=pflash,format=raw,file=./edk2-aarch64-code.fd,readonly=on" \
-drive "if=pflash,format=raw,file=./edk2-arm-vars.fd,discard=on" \
-device nvme,drive=drive2,serial=drive2,bootindex=2 \
-drive "if=none,media=disk,id=drive2,file=/Users/patrick/ubuntu-server-21-10.qcow2" \
-rtc base=localtime
-runas "$(id -u):$(id -g)"
)
sudo qemu-system-aarch64 "${args[@]}"

Anyway, I'm going to release a new version soon, which may fix some of the issues with opengl.

PMahar commented 2 years ago

Still seems to crash at random. Now though, it spits out a repeating GL error until it freezes.

shader failed to compile
ERROR: unsupported shader version

GLSL:
#version 310 es
// Blitter
precision mediump float;
#define cvec4 vec4
uniform mediump  sampler2D samp;
in vec4 tc;
out cvec4 FragColor;
void main() {
   cvec4 texel = texture(samp, tc.xy);
   FragColor = cvec4(texel.r, texel.g, texel.b, texel.a);
}

got error linking
The program must contain objects to form both a vertex and fragment shader.

Blitter: unable to create or find shader program
DUOLabs333 commented 2 years ago

Interestingly, crashes used to happen all the time for me before the latest update -- now it no longer happens.