Open sickcodes opened 4 years ago
I'd be happy to try this out, but I'm not sure what to do with this xml... does this need to be converted to qemu command line parameters somehow and added to the dockerfile?
Yes, or use the Catalina xml file in the OSX-KVM directory and directly import it into virt-manager.
You will find the commented lines above in that file.
I have an Nvidia 1660 now, plus the integrated AMD graphics, so I might test this
@sickcodes any updates on GPU passthrough. Thanks
I couldn't get it to work but OSX-KVM upstream is testing
Some additional GPU based docs here, thanks to @cephasara
https://github.com/sickcodes/Docker-OSX/blob/master/helm/INSTALL-QEMU-AND-GPU-IOMMU.md
I have used OSX-KVM with virt manager and my Big Sur can work with GPU (RX580) passthrough smoothly. So my system qcow2 file and custom OpenCore file should be fine. However when I tried it with docker, the screen can show the menu and I can pick the system from the list, but it will start to load the system and freeze/stuck after a few seconds. Does anyone know how to solve this?
This is the actual qemu command it executes
+ exec qemu-system-x86_64
-m 16000
-cpu max,kvm=on,hypervisor=on,vmx=on,vendor=GenuineIntel,vmware-cpuid-freq=on,+pcid,+popcnt,+xsave,rdtscp=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc
-machine q35,accel=kvm,kernel-irqchip=on
-smp 4,cores=4
-usb
-device usb-kbd
-device usb-tablet
-device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'
-drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd
-drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd
-smbios type=2
-audiodev alsa,id=hda -device ich9-intel-hda
-device hda-duplex,audiodev=hda
-device ich9-ahci,id=sata
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore.qcow2
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
-device ide-hd,bus=sata.3,drive=InstallMedia -drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2
-drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/BigSur.qcow2,format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900,
-device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17
-monitor stdio -nodefaults -enable-kvm -boot menu=on
-vga none -nographic -display none
-device pcie-root-port,id=pcie.1,bus=pcie.0,addr=1c.0,slot=1,chassis=5,multifunction=on
-device vfio-pci,host=02:00.0,bus=pcie.1,addr=00.0
-device vfio-pci,host=02:00.1,bus=pcie.1
-device vfio-pci,host=04:00.0,bus=pcie.1
-device vfio-pci,host=06:00.0,bus=pcie.1
and the docker run command
docker run -it --privileged \
--device /dev/kvm --device /dev/vfio \
-v "${PWD}/BigSur.qcow2:/home/arch/OSX-KVM/BigSur.qcow2" \
-v "${PWD}/OpenCore.qcow2:/home/arch/OSX-KVM/OpenCore.qcow2" \
-e "NOPICKER=false" \
-e "RAM=16" \
-e "BOOTDISK=/home/arch/OSX-KVM/OpenCore.qcow2" \
-e "IMAGE_PATH=/home/arch/OSX-KVM/BigSur.qcow2" \
docker-osx-custom
Or is it possible to start it with virt manager within docker?
It is possible, I had planned to add a virt-manager version and it will not be difficult to do so. I personally don't have a detached GPU to test with, only an iGPU, but we should be able to do it with Docker as well, just a matter of passing through the right permissions and devices.
I have a mobile 2060 and an Intel cpu with integrated GPU, is there something I can do to get better performance? I honestly don't have a good understanding of how it works that's why I ask where to look for.
Haven't seen anyone mention it but as far as I know MacOS only supports AMD GPUs and Intel iGPUs.
This information comes from the OpenCore Install Guide which is for building "Hackintosh" systems. Full support table here: https://dortania.github.io/OpenCore-Install-Guide/macos-limits.html#gpu-support
I don't know anything about virtualization but I don't assume it would be different for this project?
It is possible, I had planned to add a virt-manager version and it will not be difficult to do so. I personally don't have a detached GPU to test with, only an iGPU, but we should be able to do it with Docker as well, just a matter of passing through the right permissions and devices.
Where are we on this?
Has GPU-Passthrough worked for anyone? Did you figure this out, add/test this yet?
As per the virt-manager xml on king @kholia's repo:
https://github.com/kholia/OSX-KVM/blob/master/macOS-libvirt-Catalina.xml
I have an iGPU and it's difficult for me to test