打印

[軟件] KVM with VT-d passthrough for gaming? (Benchmarked)

KVM with VT-d passthrough for gaming? (Benchmarked)

Benchmark result, i5-6600+AMD 7950

Virtual Machine:



Bare metal:


[ 本帖最後由 Sandbo 於 2016-2-21 03:06 編輯 ]

TOP

引用:
原帖由 YCST 於 2016-2-13 15:53 發表
pass咩hardware入VM裡面?display card?
Sorry for missing the focus out
Yes, mainly it is the graphics card (AMD HD 7950).

From the others it can give >95% of performance to the guest (given I use Intel IGP for Linux host).

TOP

引用:
原帖由 YCST 於 2016-2-13 16:22 發表
剩係試過pass LAN卡同USB
USB usually doesn't need VT-d, LAN card not sure.
I will try to give more details if I successfully play GTA V on Windows 10 guest

TOP

引用:
原帖由 dom 於 2016-2-14 01:39 發表
Display 應該唔多夠力....
經左VMWare Player 後佢入面上Driver 都唔係show 翻 GTX970 反而係show SVGA 3D
依個就係有冇VT-d的分别
用VT-d好似真係pass到九成, 而且係直接 show張卡....想一陣試下,
但要 backup左部機先唔係一陣抄左 kernel就奶野

[ 本帖最後由 Sandbo 於 2016-2-15 04:42 編輯 ]

TOP

唉,好灰,整到天光都唔 work,一加 PCI device個vm就唔 boot

已經detach左AMD graphics+audio,再做埋vfio-bind,
就係唔work....可能會reset左個QEMU-KVM搞過哂……

Damn:
https://bugzilla.kernel.org/show_bug.cgi?id=107561

[ 本帖最後由 Sandbo 於 2016-2-15 12:46 編輯 ]

TOP

Working!
Not a kernel issue, but the point being having the PCI bridge in the same IOMMU group caused some complications in the passthrough.
Swapping the graphics card to PCI-E slot 2 solved the problem, and I can install AMD driver on guest.

TOP

引用:
原帖由 qcmadness 於 2016-2-16 04:47 發表

Chipset problem?
I can't tell, it seems in terms of IOMMU group, the PCI bridge is linked to whatever connected to PCI-E x16 slot 1 (it reports three devices in the IOMMU group), this is also the case for z97 so I don't think it's z170 bound.

Swapping to slot 2, the IOMMU group reported no components other than AMD graphics and audio (only 2 devices as oppose to 3 in the above case), then it worked.
One important point being for VT-d pass through, the whole group has always to be passed together.

[ 本帖最後由 Sandbo 於 2016-2-16 07:17 編輯 ]

TOP

?size_id=8

TOP

Exact reason for passthrough failure before:
Not the slot, but in fact the setting of CPU:
Nothing but host-passthrough (type manually) can work, if anyone concerns.

TOP


Exactly like on bare metal

[ 本帖最後由 Sandbo 於 2016-2-17 15:36 編輯 ]

TOP

引用:
原帖由 XT 於 2016-2-17 15:50 發表
KVM for normal home using?

How to? I'm interesting
It's actually very simple,
you first need hardware supporting VT-d, that is your mainboard and CPU.
This can be checked, for Intel, http://ark.intel.com/, see if you can find VT-d in your CPU/mainboard chipset.
You also need 2 GPUs, 1 of them can be Intel Graphics, another is any discrete card.
At the end you need 2 video cables, connecting from both the Intel IGP and your discrete graphics card to the same monitor, or you can do a dual monitor setup like what I showed.

Then, follow this tutorial closely:
http://vfio.blogspot.ca/2015/05/ ... es-part-3-host.html
http://vfio.blogspot.ca/2015/05/ ... es-part-4-host.html

A shorter tutorial (which can be used without referring to the above two), is easier to follow but not using the best method (imho):
http://www.andrewklau.com/my-fed ... without-compromise/

And there is a good video showing the whole process from bare metal, he basically followed the first 2 links I gave:
https://www.youtube.com/watch?v=GtV_pYIgxOA

In short, here is what I did (just a general description, excluding detailed scripting, please refer to the above tutorials and their explanation are excellent)
1. Enable VT-d in BIOS/UEFI interface (suppose you have the mainboard+CPU, graphics card shouldn't matter except it's too old, I am using AMD HD7950)
2. In your Linux host, install the virtualization tools. I am using qemu-kvm and virt-manager, plus OVMF (installed separated from the normal qemu-kvm packages)
3. Then enable IOMMU and set to prevent the graphics card from being loaded by Linux host (meaning that the pass-through GPU cannot be used by Linux).
For step 3 I suggest you follow the first 2 links, Alex's blog. It outlined a more advanced method with a direct vfio-bind, without first passing the graphics to pci-stub.
4.You can then move on to set up the virtual machine, and add the PCI devices in virt-manager.
-When creating the virtual machine, don't start it right away, check the box to configure it first. Over there,
in Overview set the Firmware to UEFI instead of BIOS.
-(very important, spent me 3 days to figure out) In CPUs configuration, in Model, type host-passthrough.
Without this, the virtual machine will always boot into BSoD.
-You have to add both the graphics card's graphic processor and HD audio, so there will be 2 PCI devices to be added.
If after adding, the machine doesn't boot, try to uncheck the box in the PCI devices "ROM_BAR". My machine works only without them. It seems they are useful when you want to give it a specific ROM file.
5. If everything works, you should be able to enter Windows and see the cards there. Go ahead and install the driver, on installation completed successfully, the graphics card will start to generate signal output.

It will be better if you start by following the tutorial, and I can then help with specific issues that you might find (I have 3 days of experience LOL)

TOP

引用:
原帖由 dom 於 2016-2-17 17:10 發表


竟然玩到?!!!
Performance hit 差幾多
GTA V做到60fps,但就有時一疾,要睇下點tune,
今晚行轉3DMark再對比下bare metal performance

TOP

引用:
原帖由 XT 於 2016-2-18 00:16 發表

https://www-ssl.intel.com/conten ... ards/000005758.html

要check板
I think most boards after Haswell should just work, it's also the time the people started doing this.

TOP

引用:
原帖由 YCST 於 2016-2-17 23:34 發表

我太耐無玩都唔醒起
我以前都試過呢個問題
At the end it was my fault, I didn't follow strictly the tutorial to set the CPU model to "host-passthrough",
this is not in the drop down menu nor anywhere, I have to type it manually.

This is the only choice that allows a true passthrough of CPU configuration to the guest, any other options will have a mismatch and bring down the graphics once it's accessed.

TOP

對比返 bare metal, 個fire strike分竟然高左幾乎10%

PS: Buying a PCI USB3 card for the VM, that way I can pass the PCI card directly without using the Spice (which I believe would have performance hit)

[ 本帖最後由 Sandbo 於 2016-2-19 02:05 編輯 ]

TOP