Contribute
Register

DUAL Success: QEMU+KVM+High Sierra/Win10+AMD RX560 Passthrough w/ AsusMaximusIX Code+Intel i7-7700K

Joined
Feb 8, 2014
Messages
8
Mac
Classic Mac
Mobile Phone
Well I understand what the problem is.
when I remove the xhci_hcd module by using your scripts or entering the commands
Code:
echo "0000:00:14.0" > /sys/bus/pci/devices/0000:00:14.0/driver/unbind
echo 1046 0xb4af > /sys/bus/pci/drivers/vfio-pci/new_id
it actually does work and loads the vfio module to the controller,
using a virtual keyboard and an ps/2 mouse I was able to log in to the vm
and use my mouse and all other usb ports with my passthrouged controller and install nvidia drivers on my second monitor
with the gpu passthrough.

But it seems that my controller doesn't support resetting which is supposed to give it back to the host as when I pass it through I get the message-
qemu-system-x86_64: vfio: Cannot reset device 0000:00:14.0, no available reset mechanism.

Controllers are cheap so I will probably just buy one that supports resetting.

for future googlers you can read this:
https://www.reddit.com/r/VFIO/comments/4o6wla/cant_get_vfiopci_to_bind_to_usb_30_card_at_boot/
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Passing_through_a_device_that_does_not_support_resetting
Glad you got the USB working.

By the way, how did you manage to get your Nvidia card up and running on hackintosh ? I managed to passthrough my EVGA GTX 1080 but High Sierra hangs at the end of the boot process.

Care to share your config.plist and what kexts you placed in /EFI/CLOVER/kexts/Other?
 
Joined
Nov 3, 2017
Messages
6
Glad you got the USB working.

By the way, how did you manage to get your Nvidia card up and running on hackintosh ? I managed to passthrough my EVGA GTX 1080 but High Sierra hangs at the end of the boot process.

Care to share your config.plist and what kexts you placed in /EFI/CLOVER/kexts/Other?
I just use the Clover.qcow2 image that kholia built,so you can see what kexts and settings he put on his repository.
I did not really have trouble with display after boot(gtx 960 was passed through) just installed web-drivers and cuda and was good to go,I will probably build my own clover settings later so i wont see the clover screen each time I boot.

I ran some benchmarks like unigine heaven and cinebench and there is no difference on cinebench
between my mac vm and the windows vm which runs close to bare metal performance,unigine is 5% slower than in windows.
Internet and sound work also(although sound is really choppy).

I also solved the usb controller issue completely and now when I run the script it binds to vfio when vm boots and
returns it to the host at shutdown using the vfi-group and vfio-ungroup scripts provided by kholia.

Oh and thanks again for pointing me to the root of the problem,I would have been scratching my head for a while without your help.

here is my revised script:

echo "--claiming passthrough resources (if any)---"

sudo ./scripts/vfio-group.sh 4 # USB controller



MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,avx2,+smep"

~/QEMU/bin/qemu-system-x86_64 -enable-kvm -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine pc-q35-2.9 \
-smp 4,cores=2 \
-m 12G \
-mem-path /dev/hugepages \
-mem-prealloc \
-balloon none \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=OVMF_CODE-pure-efi.fd \
-drive if=pflash,format=raw,file=OVMF_VARS-pure-efi-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ide-drive,bus=ide.2,drive=Clover \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./Clover.qcow2 \
-device ide-drive,bus=ide.1,drive=MacHDD \
-drive id=MacHDD,if=none,file=/media/linuxs/OS/mac_hdd.img,format=qcow2 \
-device vfio-pci,host=01:00.0,multifunction=on \
-device vfio-pci,host=01:00.1 \
-device vfio-pci,host=00:14.0,bus=pcie.0 \
-netdev user,id=net0 -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-vga none \
-nographic \




echo "--return devices---"

sudo ./scripts/vfio-ungroup.sh 4 # USB controller
 
Joined
Feb 8, 2014
Messages
8
Mac
Classic Mac
Mobile Phone
@ Grayperson

Thanks for the info regarding your boot process.

By the way, the choppy sound issue in Windows is really easy to fix for Nvidia card.

On the host (while the Windows guest is running) do a

lspci -v -s 1:00.0

Since your sound is choppy, it is probably because the message signalled interrupt setting inside your Windows guest OS is set to off, and so, the command on your host is probably showing "MSI: Enable-" for the passthroughed card, with a minus sign at the end.

To fix this, simply go into the guest Windows OS, open regedit, and edit the Windows registry as per this link:

https://forums.guru3d.com/threads/windows-line-based-vs-message-signaled-based-interrupts.378044/

Then reboot the guest Windows OS, and also check on the host again that the output to the lspci -v -s command above is now showing "MSI: Enable+" for the card.

The sound on the Windows guest should now be perfect.
 
Last edited:
Joined
Nov 8, 2017
Messages
4
Hi there, sorry, I have a newbie question about using QEMU. I have looked at your script for installation in the first post:

Code:
#!/bin/bash
MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,avx2,+smep"
export QEMU_AUDIO_DRV=alsa &&
qemu-system-x86_64 \
-enable-kvm \
-m 8192 \
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine pc-q35-2.9 \
-smp cpus=8,sockets=1,cores=4,threads=2 \
-device isa-applesmc,osk="<i inserted the key from my Apple Macbook Pro here>" \
-drive if=pflash,format=raw,readonly,file=OVMF_CODE-pure-efi.fd \
-drive if=pflash,format=raw,file=OVMF_VARS-pure-efi-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ide-drive,bus=ide.2,drive=Clover \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Clover.qcow2' \
-device ide-drive,bus=ide.1,drive=MacHDD \
-drive id=MacHDD,if=none,file=./high.img,format=qcow2 \
-netdev user,id=usr0 -device e1000-82545em,netdev=usr0,id=vnet0 \
-balloon none \
-device vfio-pci,host=03:00.0,multifunction=on \
-device vfio-pci,host=03:00.1 \
-vga none \
-monitor unix:/tmp/monitor.sock,server,nowait \
-nographic \
-device vfio-pci,host=00:14.0,bus=pcie.0 \
I see the 2 OVMF lines, Clover.qcow2 line and the high.img for the harddisk but I don't see a line for the USB stick. How do I specify that for the qemu-system command?

Thanks very much in advance.
 
Joined
Feb 8, 2014
Messages
8
Mac
Classic Mac
Mobile Phone
Hi there, sorry, I have a newbie question about using QEMU. I have looked at your script for installation in the first post:

I see the 2 OVMF lines, Clover.qcow2 line and the high.img for the harddisk but I don't see a line for the USB stick. How do I specify that for the qemu-system command?

Thanks very much in advance.
You can do a lsusb to list the usb devices, and for example if that shows your usb device as listed under bus 1 device 5, then add this line to the QEMU cmd:

-usb -device usb-host,hostbus=1,hostaddr=5 \

You can get all the details nicely and concisely laid out in the official QEMU documentation. Google for it.
 
Joined
Nov 8, 2017
Messages
4
You can do a lsusb to list the usb devices, and for example if that shows your usb device as listed under bus 1 device 5, then add this line to the QEMU cmd:

-usb -device usb-host,hostbus=1,hostaddr=5 \

You can get all the details nicely and concisely laid out in the official QEMU documentation. Google for it.
Thanks for your reply. I have tried installing the MacOS with the included High Sierra install script but I ran into the following issue. Have you seen this issue and how did you get around it? Do you think it's my host OS (I am running Ubuntu Mate 16.04) that is causing the issue? I have tried different USB sticks as well as using an ISO but no dice.

Thanks.
 

Attachments

Top