lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.48k stars 608 forks source link

qemu: support OpenGL acceleration (VirGL) #2086

Open AkihiroSuda opened 11 months ago

AkihiroSuda commented 11 months ago

UTM seems to have been supporting VirGL with forked repos: https://github.com/utmapp/UTM/blob/62bd84c78c045870c580df34c1ba233d75e02995/patches/sources#L38-L45

I'm not sure we can just use them in Homebrew's QEMU. Maybe we need a custom Tap.

afbjorklund commented 11 months ago

Another interesting addition would be to see if it would be possible to add VirtualGL support, to the VNC server.

https://github.com/TurboVNC/turbovnc

afbjorklund commented 11 months ago

If I understand correctly, you need to configure the QEMU build

--enable-virglrenderer

And then make sure to use the new device, when starting the VM

-device virtio-gpu-gl


https://www.qemu.org/docs/master/system/devices/virtio-gpu.html

There should be a virtio-gpu for testing, that uses software rendering.

EDIT: Also need to set gl=on option, for the default display. Otherwise:

qemu-system-x86_64: -device virtio-gpu-gl: opengl is not available

AkihiroSuda commented 3 weeks ago

Support for Venus was recently merged to QEMU: https://github.com/qemu/qemu/commit/e4bad9cc5e3a8193988d42a1ca8416afe3220d08

AkihiroSuda commented 3 weeks ago

Patches in https://github.com/akihikodaki/virglrenderer/commits/macos/ are still not upstreamed to https://gitlab.freedesktop.org/virgl/virglrenderer (Where is the merge request?)

AkihiroSuda commented 1 week ago

@akihikodaki May I ask if you are planning to submit your macOS patches in https://github.com/akihikodaki/virglrenderer/commits/macos/ to the upstream repo (https://gitlab.freedesktop.org/virgl/virglrenderer)? Thanks!

akihikodaki commented 1 week ago

@AkihiroSuda It depends on a libepoxy change which has not landed yet: https://github.com/anholt/libepoxy/pull/239 cc: @ebassi