avoidik / homebrew-qemu-spice

Homebrew formula for qemu with spice support
MIT License
0 stars 1 forks source link

Issue with OpenGL #1

Open startergo opened 3 months ago

startergo commented 3 months ago

when I run /usr/local/Cellar/qemu-spice/9.0.0/bin/qemu-system-x86_64

-L /private/var/folders/3_/70vmt3s91gn6812rcpl3rx7m0000gn/T/AppTranslocation/71CC80BF-5BAC-412A-BDF7-F84F3E0870A9/d/UTM.app/Contents/Resources/qemu -S -spice unix=on,addr=192340CB-7E2B-4F09-8859-7FF5C5981A28.spice,disable-ticketing=on,image-compression=off,playback-compression=off,streaming-video=off,gl=on -chardev spiceport,name=org.qemu.monitor.qmp.0,id=org.qemu.monitor.qmp -mon chardev=org.qemu.monitor.qmp,mode=control -nodefaults -vga none -device e1000,mac=1E:1D:76:3B:80:F6,netdev=net0 -netdev vmnet-bridged,id=net0,ifname=en0 -device virtio-vga-gl -cpu Penryn,+sse4.1,+sse4.2,+ssse3 -smp cpus=1,sockets=1,cores=1,threads=1 -machine pc-q35-7.2,vmport=off,i8042=off,hpet=off -accel hvf -global PIIX4_PM.disable_s3=1 -global ICH9-LPC.disable_s3=1 -m 4096 -audiodev coreaudio,id=audio1 -audiodev spice,id=audio0 -device usb-audio,audiodev=audio1 -usb -device usb-tablet,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -device ich9-usb-ehci1,id=usb-controller-0 -device ich9-usb-uhci1,masterbus=usb-controller-0.0,firstport=0,multifunction=on -device ich9-usb-uhci2,masterbus=usb-controller-0.0,firstport=2,multifunction=on -device ich9-usb-uhci3,masterbus=usb-controller-0.0,firstport=4,multifunction=on -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device ide-hd,bus=ide.0,drive=drive7E7A1E5D-D66F-48A1-A892-FE7BDFDE979D,bootindex=0 -drive "if=none,media=disk,id=drive7E7A1E5D-D66F-48A1-A892-FE7BDFDE979D,file=/Users/mbp151/Library/Containers/com.utmapp.UTM/Data/Documents/Snow Leopard.utm/Data/1920x1080-OpenCoreSLeopard.qcow2,discard=unmap,detect-zeroes=unmap" -device ide-hd,bus=ide.1,drive=driveA51C89E5-8257-4DD2-A2AE-C05E689F3C99,bootindex=1 -drive "if=none,media=disk,id=driveA51C89E5-8257-4DD2-A2AE-C05E689F3C99,file=/Users/mbp151/Library/Containers/com.utmapp.UTM/Data/Documents/Snow Leopard.utm/Data/macintosh.qcow2,discard=unmap,detect-zeroes=unmap" -device ide-hd,bus=ide.2,drive=driveBB803421-B774-4499-B637-F7AD32805921,bootindex=2 -drive "if=none,media=disk,id=driveBB803421-B774-4499-B637-F7AD32805921,file=/Users/mbp151/Library/Containers/com.utmapp.UTM/Data/Documents/Snow Leopard.utm/Data/sl_utm.qcow2,discard=unmap,detect-zeroes=unmap" -device ide-hd,bus=ide.3,drive=drive97EED3F2-7CCB-4C6B-9BDB-5BE5A84A05D5,bootindex=3 -drive "if=none,media=disk,id=drive97EED3F2-7CCB-4C6B-9BDB-5BE5A84A05D5,file=/Users/mbp151/Library/Containers/com.utmapp.UTM/Data/Documents/Snow Leopard.utm/Data/sierra_utm.qcow2,discard=unmap,detect-zeroes=unmap" -device virtio-serial -device virtserialport,chardev=org.qemu.guest_agent,name=org.qemu.guest_agent.0 -chardev spiceport,name=org.qemu.guest_agent.0,id=org.qemu.guest_agent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,id=vdagent,debug=0,name=vdagent -device virtserialport,chardev=charchannel1,id=channel1,name=org.spice-space.webdav.0 -chardev spiceport,name=org.spice-space.webdav.0,id=charchannel1 -name "Snow Leopard" -uuid 192340CB-7E2B-4F09-8859-7FF5C5981A28 -device virtio-rng-pci -device virtio-balloon-pci

I get:

qemu-system-x86_64: -spice unix=on,addr=192340CB-7E2B-4F09-8859-7FF5C5981A28.spice,disable-ticketing=on,image-compression=off,playback-compression=off,streaming-video=off,gl=on: Invalid parameter 'gl'

Is there a way to compile it with open-gl? I am trying to run a machine created in UTM through qemu.

Seems to be implemented here, but the upstream qemu is very old version 2.5: https://github.com/startergo/homebrew-qemu-virgl

This is how UTM handles it: https://github.com/utmapp/UTM/issues/4285#issuecomment-1475017059

avoidik commented 3 months ago

I afraid it is not really possible on mac, because:

avoidik commented 3 months ago

Let's keep this issue open for now. I guess some of those custom qemu patches have already landed upstream. On the other hand, knowing how scrupulous and tedious the process of maintaining custom patches is, I would rather say I have no interest outside of compile-time features 😅

startergo commented 3 months ago
  • libepoxy does not support EGL on darwin (build_egl evaluates to false) -

Yes I realized that, but we can use angle? https://lore.kernel.org/all/1E9D7BA4-C070-48AE-9989-70EA04FE547D@gmail.com/T/ Also macports provides libepoxy

https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5 https://gist.githubusercontent.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5/raw/9589b879cce1cc90ea412da0682eab10390355c8/run.sh

avoidik commented 1 month ago

I've added libepoxy-egl, could you check that? ... meh, I was able to build it, but it is still the same error

$ qemu-system-x86_64 -display help
Available display backend types:
none
egl-headless
curses
cocoa
spice-app
dbus

and

$ qemu-system-x86_64 -spice help
spice options:
  addr=<str>
  agent-mouse=<bool (on/off)>
  disable-agent-file-xfer=<bool (on/off)>
  disable-copy-paste=<bool (on/off)>
  disable-ticketing=<bool (on/off)>
  display=<str>
  head=<num>
  image-compression=<str>
  ipv4=<bool (on/off)>
  ipv6=<bool (on/off)>
  jpeg-wan-compression=<str>
  password-secret=<str>
  plaintext-channel=<str>
  playback-compression=<bool (on/off)>
  port=<num>
  sasl=<bool (on/off)>
  seamless-migration=<bool (on/off)>
  streaming-video=<str>
  tls-channel=<str>
  tls-ciphers=<str>
  tls-port=<num>
  unix=<bool (on/off)>
  x509-cacert-file=<str>
  x509-cert-file=<str>
  x509-dh-key-file=<str>
  x509-dir=<str>
  x509-key-file=<str>
  x509-key-password=<str>
  zlib-glz-wan-compression=<str>

while the standard qemu gives:

$ qemu-system-x86_64 -display help
Available display backend types:
none
curses
cocoa
dbus

and

$ qemu-system-x86_64 -spice help
qemu-system-x86_64: -spice: invalid option

it seems with that I've just introduced two new display modes egl-headless and spice-app

avoidik commented 1 month ago

added these devices via https://github.com/akihikodaki/virglrenderer/tree/macos but still no gl in qemu-system-x86_64 -spice help output

$ qemu-system-x86_64 -device help | grep -i gl
name "virtio-gpu-gl-device", bus virtio-bus
name "virtio-gpu-gl-pci", bus PCI, alias "virtio-gpu-gl"
name "virtio-vga-gl", bus PCI

... but none of those has real EGL support 😈 either egl: not available on this platform or OpenGL is not supported by the display