<div dir="ltr"><div>My setup:</div><div>Ryzen 1600</div><div>Asus B350 Prime Plus</div><div>r5 230 (linux host)</div><div>gtx 1060 (for passthrough)</div><div><br></div><div>The passthrough process itself went without much trouble.</div><div>I've been able to boot the VM, the 1060 was properly detected, went on to install the drivers.</div><div>Next, I fired up Dota 2 to take it for a spin and noticed it only gave around 20 fps.</div><div>The 1060 should't have troubles running this game. Haven't run any other games.</div><div><br></div><div>Monitoring the cpu and gpu performance, I noticed that they are not even remotely loaded.</div><div>Searching on the net, I found a thread suggesting adding iommu=pt to the kernel boot parameters, in addition to</div><div>options kvm ignore_msrs=1</div><div>options kvm-amd npt=0</div><div>to a .conf file in /etc/modprobe.d/, suggesting it may boost performance.</div><div><br></div><div>Adding the kernel boot option in addition to the kernel module options resulted in the VM being unable to boot,</div><div>dumping register values with a bunch of other info upon crashing.</div><div><br></div><div>By eliminating, I've come to the conclusion that the npt=0 option is the culprit.</div><div>Without it, I am able to boot fine, but still experience the degraded VM performance in aforementioned game.</div><div><br></div><div>I think I've managed to boot the VM with the npt=0 option present once or twice, in which case the VM reported the cpu having</div><div>only one core, despite my setting the -smp in qemu command line to a specific option.</div><div><br></div><div>Information that may prove relevant:</div><div>Iommu group in which my card resides, passed only the card itself along with the audio device, omitting the other two devices</div><div>in the ids parameter of vfio-pci:</div><div>IOMMU Group 2 00:03.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1452]</div><div>IOMMU Group 2 00:03.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device [1022:1453]</div><div>IOMMU Group 2 22:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 3GB] [10de:1c02] (rev a1)</div><div>IOMMU Group 2 22:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10f1] (rev a1)</div><div><br></div><div>Qemu command line:</div><div>qemu-system-x86_64 \</div><div>        -enable-kvm \</div><div>        -machine type=q35,accel=kvm \</div><div>        -m 4096 \</div><div>        -mem-path /dev/hugepages \</div><div>        -mem-prealloc \</div><div>        -cpu host,kvm=off \</div><div>        -smp sockets=2,cores=3,threads=2 \</div><div>        -usb -usbdevice host:04d9:a09f -usbdevice host:258a:1006 \</div><div>        -device vfio-pci,host=22:00.0,multifunction=on,x-vga=on \</div><div>        -device vfio-pci,host=22:00.1 \</div><div>        -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/ovmf_code_x64.bin \</div><div>        -drive if=pflash,format=raw,file=/tmp/ovmf_vars.bin \</div><div>        -boot order=dc \</div><div>        -device virtio-scsi-pci,id=scsi \</div><div>        -drive file=/vm/win10.img,id=disk,if=none,format=qcow2 -device scsi-hd,drive=disk \</div><div>        -drive file=/home/stefan/Downloads/virtio-win-0.1.137.iso,id=virtiocd,if=none,format=raw -device ide-cd,bus=ide.1,drive=virtiocd \</div><div>        -netdev user,id=vmnic -device virtio-net,netdev=vmnic \</div><div>        -vga none \</div><div>        -nographic</div><div><br></div><div>I think I've only tried fiddling with the -machine type and x-vga setting, but that didn't yield any difference.</div><div><br></div><div>Finally, my question would be whether anyone has experienced something remotely similar to what I have?</div><div>Any suggestions are welcome, at the moment I don't have any ideas what to try next.</div><div><br></div><div>Thanks in advance,</div><div>Stefan</div></div>