Overclock.net › Forums › Software, Programming and Coding › Operating Systems › {Guide} Create a Gaming Virtual Machine
New Posts  All Forums:Forum Nav:

{Guide} Create a Gaming Virtual Machine - Page 9

post #81 of 825
Quick update: after switching from a dying ASUS 7970 DCII to a reference 7970 (Sapphire), GPU passthrough works out of the box with QEMU + KVM (no workarounds, no tricks).

All I needed:
  • a VT-d capable motherboard: Gigabyte GA-Z77MX-D3H
  • a VT-d capable CPU: i7-2600
  • an AMD graphics card: reference 7970*
  • Kernel with KVM and IOMMU enabled
  • qemu-kvm (fork of QEMU, soon to be merged upstream) compiled from Git as of two weeks ago

...and simply pass the following option to qemu-kvm: -device pci-assign,host=00:01.0

Where 00:01.0 is the BDF of the graphics card's VGA function (.0) on my particular system (use lspci to determine these). One can also pass through the HDMI audio function (.1).

The main GPU is the HD2000, controlled by Linux. When booting the Windows VM, its video output comes out to a secondary input of my monitor. When the VM boots up, the VNC output shows the Windows logo frozen after a second or two. I can also hear the fan slow down. Sign that the Windows AMD driver has taken over. Which means, it's time to switch inputs on the monitor and Windows is there, fully 3D accelerated!

In the end, there's really nothing to it. Almost turn key thumb.gif.

* Not sure about the "reference" requirement: the ASUS DCII was freezing after a minute once passed through, but after weeks of struggle, I eventually found out it also artifacted on bare metal sometimes as soon as the Windows logo while booting. Pretty sure about the AMD requirement, as AMD employees like Joerg Roedel have actively contributed to QEMU for PCI passthrough to work.

---

Regarding doing the same thing with Xen, Michael Mair-Keimberger has accomplished it successfully as well, see his blog entry.
Edited by Roman2K - 7/5/12 at 8:36am
    
CPUMotherboardGraphicsRAM
Intel Core i7-2600 Gigabyte GA-Z77MX-D3H Sapphire Radeon HD 7970 Corsair XMS3 (16 GB) 
Hard DriveCoolingOSMonitor
Intel 330 (180 GB) × 2 Thermalright HR-02 Windows 7 BenQ XL2420T 
KeyboardPowerCaseMouse
Xenta Super Compact Wireless UK Keyboard Seasonic X-560 Fractal Design Define Mini Roccat Pyra 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core i7-2600 Gigabyte GA-Z77MX-D3H Sapphire Radeon HD 7970 Corsair XMS3 (16 GB) 
Hard DriveCoolingOSMonitor
Intel 330 (180 GB) × 2 Thermalright HR-02 Windows 7 BenQ XL2420T 
KeyboardPowerCaseMouse
Xenta Super Compact Wireless UK Keyboard Seasonic X-560 Fractal Design Define Mini Roccat Pyra 
  hide details  
Reply
post #82 of 825
^ awesome, great to hear. I really need to get some IOMMU friendly hardware...


have you had much of a chance to use it yet? If so, how's the performance of everything?
stable again
(25 items)
 
  
CPUCPUMotherboardGraphics
E5-2687W E5-2687W ASUS Z9PED8-WS EVGA GTX 570 (Linux host) 
GraphicsRAMHard DriveHard Drive
EVGA GTX 970 FTW (win7 guest) 64GB G.SKILL 2133 2x Crucial M4 256GB raid1 4x 3TB raid 10 
CoolingCoolingCoolingCooling
2x Apogee HD  2x RX 480 2x MCP 655 RP-452x2 rev2 (new) 
CoolingCoolingOSOS
16x Cougar Turbine CFT12SB4 (new) EK FC 580 Gentoo (host) Gentoo (x23 guests) 
OSMonitorMonitorPower
windows 7 (guest w/ vfio-pci) Viewsonic 23" 1080P Viewsonic 19" Antec HCP Platinum 1000 (new) 
CaseOtherOther
Case Labs TH10 (still the best ever) 2x Lamptron FC-5 IOGEAR 2 way DVI KVM Switch 
  hide details  
Reply
stable again
(25 items)
 
  
CPUCPUMotherboardGraphics
E5-2687W E5-2687W ASUS Z9PED8-WS EVGA GTX 570 (Linux host) 
GraphicsRAMHard DriveHard Drive
EVGA GTX 970 FTW (win7 guest) 64GB G.SKILL 2133 2x Crucial M4 256GB raid1 4x 3TB raid 10 
CoolingCoolingCoolingCooling
2x Apogee HD  2x RX 480 2x MCP 655 RP-452x2 rev2 (new) 
CoolingCoolingOSOS
16x Cougar Turbine CFT12SB4 (new) EK FC 580 Gentoo (host) Gentoo (x23 guests) 
OSMonitorMonitorPower
windows 7 (guest w/ vfio-pci) Viewsonic 23" 1080P Viewsonic 19" Antec HCP Platinum 1000 (new) 
CaseOtherOther
Case Labs TH10 (still the best ever) 2x Lamptron FC-5 IOGEAR 2 way DVI KVM Switch 
  hide details  
Reply
post #83 of 825
Quote:
Originally Posted by lloyd mcclendon View Post

have you had much of a chance to use it yet? If so, how's the performance of everything?
I don't have numbers yet, sorry. However, so far, I've played CoD:Black Ops and Medal of Honor (I should finally be playing BF3 soon, still downloading), tried out VLC (hardware video decoding) and WebGL games on Chrome. All perfectly smooth, I cannot tell the difference compared to bare metal. And that's with "only" 4 virtual CPUs, 4 GB of RAM, disk image on a Btrfs compressed (LZO) subvolume.
    
CPUMotherboardGraphicsRAM
Intel Core i7-2600 Gigabyte GA-Z77MX-D3H Sapphire Radeon HD 7970 Corsair XMS3 (16 GB) 
Hard DriveCoolingOSMonitor
Intel 330 (180 GB) × 2 Thermalright HR-02 Windows 7 BenQ XL2420T 
KeyboardPowerCaseMouse
Xenta Super Compact Wireless UK Keyboard Seasonic X-560 Fractal Design Define Mini Roccat Pyra 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core i7-2600 Gigabyte GA-Z77MX-D3H Sapphire Radeon HD 7970 Corsair XMS3 (16 GB) 
Hard DriveCoolingOSMonitor
Intel 330 (180 GB) × 2 Thermalright HR-02 Windows 7 BenQ XL2420T 
KeyboardPowerCaseMouse
Xenta Super Compact Wireless UK Keyboard Seasonic X-560 Fractal Design Define Mini Roccat Pyra 
  hide details  
Reply
post #84 of 825
First of all, Thank you dizzy, for your formidable guide smile.gif

This weekend i successfully planted a win7ult on my xen.

My Hardware:
Mainboard: Gigabyte 990FXA-UD3
Processor: Phenom II 955 BE
Ram: 16GB 1333 DDR3
Gfx #1: Radeon HD5450 (small passive cooled just for Dom0)
Gfx #2: Radeon HD7850

Here are my impressions:

Had to overcome some oddities with pciback settings, it didn't work til i compiled them into the kernel. (Maybe a AMD chipset thing, you may add this to your guide, dizzy)
After that it was easy to pass the 7850 to my win7.

What i noticed, i can reboot my domU several times (if i xm delete/xm new it each time), but then it gets really sluggish. I think there may be some memoryleak or not released interrupts. After a Dom0 reboot all is fine again.

Next thing is to get audio running. I can't pass the mainboard audio to the DomU, because xen is complaining that it doesnt work without another pci device, as it does for my old Conexant TV card. Is there any qm-emu audio driver which could be used to pass audio streams back to the main audio driver (like Virtualbox is doing it)?

As for performance, played a few hours Burnout Paradise, no problems, no hangs or anything. I'll post HeavenDX this evening.
Btw, did anyone check the throughput difference between HD image file and physical access to HD yet?
Edited by RocketW0rm - 7/16/12 at 11:06am
post #85 of 825
Quote:
Originally Posted by RocketW0rm View Post

Btw, did anyone check the throughput difference between HD image file and physical access to HD yet?

I have, and the results seem a little unreasonable:

368

That's significantly faster than it was as a native Win 7 install.
Edited by wTheOnew - 7/16/12 at 6:49am
THEONE-4770
(10 items)
 
Storage Server
(11 items)
 
 
CPUMotherboardGraphicsRAM
Intel i7 4770k @ 4.0GHz AsRock z87 Extreme6 Asus HD 7970 16GB Corsair Vengeance 
Hard DriveHard DriveCoolingMonitor
(2) OCZ F40 RAID0 OCZ F3 120 XSPC RX360 (1) Seiki 39" 4k and (2) vertical Asus VW266H 2... 
PowerCase
OCZ 1000W Corsair 800D 
CPUMotherboardRAMHard Drive
Intel i7 3770S ASRock Z77 Extreme4 16GB Corsair Vengeance 1600MHz Corsair F40 SSD 
Hard DriveHard DriveHard DriveHard Drive
8x 2TB Western Digital Green 2x 1TB Western Digital Green 1x 4TB Seagate 2x 500GB Western Digital VelociRaptor 
Hard DriveOSCase
2x 500GB Western Digital Blue Server 2012 Norco 4020 
  hide details  
Reply
THEONE-4770
(10 items)
 
Storage Server
(11 items)
 
 
CPUMotherboardGraphicsRAM
Intel i7 4770k @ 4.0GHz AsRock z87 Extreme6 Asus HD 7970 16GB Corsair Vengeance 
Hard DriveHard DriveCoolingMonitor
(2) OCZ F40 RAID0 OCZ F3 120 XSPC RX360 (1) Seiki 39" 4k and (2) vertical Asus VW266H 2... 
PowerCase
OCZ 1000W Corsair 800D 
CPUMotherboardRAMHard Drive
Intel i7 3770S ASRock Z77 Extreme4 16GB Corsair Vengeance 1600MHz Corsair F40 SSD 
Hard DriveHard DriveHard DriveHard Drive
8x 2TB Western Digital Green 2x 1TB Western Digital Green 1x 4TB Seagate 2x 500GB Western Digital VelociRaptor 
Hard DriveOSCase
2x 500GB Western Digital Blue Server 2012 Norco 4020 
  hide details  
Reply
post #86 of 825
Nice one thumb.gif


Did my HeavenDX comparision now.

Bare: with 16GB, didnt want to remove Memory, but i don't think it has too much impact.
Win7 HVM: 4GB and 8GB

Quite nice speed. Though i've seen some corrupted screens now and then. Just single frames complete white. I wonder where that comes from.
post #87 of 825
Do you have the vcpus pinned to actual cpus? I had some weird issues until I pinned all of my VMs to specific cores. Did you install Catalyst Control Center or just the driver? I've heard of issues resulting from having CCC installed...

3DM Vantage comparison: http://3dmark.com/compare/3dmv/4190200/3dmv/4111825

I selected the closest system to my VM that I could find. The graphics scores are almost identical and the CPU score difference can probably be explained by the 3570K's higher clock. It's very much a negligible difference. biggrin.gif
THEONE-4770
(10 items)
 
Storage Server
(11 items)
 
 
CPUMotherboardGraphicsRAM
Intel i7 4770k @ 4.0GHz AsRock z87 Extreme6 Asus HD 7970 16GB Corsair Vengeance 
Hard DriveHard DriveCoolingMonitor
(2) OCZ F40 RAID0 OCZ F3 120 XSPC RX360 (1) Seiki 39" 4k and (2) vertical Asus VW266H 2... 
PowerCase
OCZ 1000W Corsair 800D 
CPUMotherboardRAMHard Drive
Intel i7 3770S ASRock Z77 Extreme4 16GB Corsair Vengeance 1600MHz Corsair F40 SSD 
Hard DriveHard DriveHard DriveHard Drive
8x 2TB Western Digital Green 2x 1TB Western Digital Green 1x 4TB Seagate 2x 500GB Western Digital VelociRaptor 
Hard DriveOSCase
2x 500GB Western Digital Blue Server 2012 Norco 4020 
  hide details  
Reply
THEONE-4770
(10 items)
 
Storage Server
(11 items)
 
 
CPUMotherboardGraphicsRAM
Intel i7 4770k @ 4.0GHz AsRock z87 Extreme6 Asus HD 7970 16GB Corsair Vengeance 
Hard DriveHard DriveCoolingMonitor
(2) OCZ F40 RAID0 OCZ F3 120 XSPC RX360 (1) Seiki 39" 4k and (2) vertical Asus VW266H 2... 
PowerCase
OCZ 1000W Corsair 800D 
CPUMotherboardRAMHard Drive
Intel i7 3770S ASRock Z77 Extreme4 16GB Corsair Vengeance 1600MHz Corsair F40 SSD 
Hard DriveHard DriveHard DriveHard Drive
8x 2TB Western Digital Green 2x 1TB Western Digital Green 1x 4TB Seagate 2x 500GB Western Digital VelociRaptor 
Hard DriveOSCase
2x 500GB Western Digital Blue Server 2012 Norco 4020 
  hide details  
Reply
post #88 of 825
Quote:
Originally Posted by wTheOnew View Post

Do you have the vcpus pinned to actual cpus? I had some weird issues until I pinned all of my VMs to specific cores. Did you install Catalyst Control Center or just the driver? I've heard of issues resulting from having CCC installed...

No, don't have pinned the cpus yet. And yes i have installed the CCC.



Tried now with pinned cpus and removed the CCC. Here is the result.
The max FPS is still ~10% lower, but the overall score is better now (1182 -> 1217 redface.gif).
Edited by RocketW0rm - 7/16/12 at 12:56pm
post #89 of 825
dizzy,
could u post a link to the live linux usb ?
I tried many times but only to have succeeded once and cant replicate it .
problem with detaching the vga hdmi sound and usb controller ..



cpu : xeon e3 1235
board : asus c206 p8b ws
gpu : hd5670
post #90 of 825
Thanks Dizzy for a great guide! I got it working on my system. Here are my specs.

Fedora 17 x86_64
Xen 4.1.2
i7 3770
ASRock Z77 Extreme4
Sapphire AMD Radeon HD 6450 (passed through to a Win7 VM)

I can only get it to work if I manually run a small script that does the following:
Code:
#!/bin/bash

#01:00.0 VGA compatible controller: ATI Technologies Inc NI Caicos [AMD RADEON HD 6450]
virsh nodedev-dettach pci_0000_01_00_0

#01:00.1 Audio device: ATI Technologies Inc NI Caicos HDMI Audio [AMD RADEON HD 6450]
virsh nodedev-dettach pci_0000_01_00_1

#00:1d.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #1 (rev 04) -- 2x grey 2.0 ports on back.
virsh nodedev-dettach pci_0000_00_1d_0

xm start win777

What I mean is that my xen-pciback.hide isn't functioning properly. So I have to dettach from dom0 after boot. i.e. this doesn't work in /etc/sysconfig/grub:
GRUB_CMDLINE_XEN="iommu=1 dom0_mem=2048M xen-pciback.hide=(0000:01:00.0)(0000:01:00.1)(0000:00:1d.0)"

So I tried running that script in rc.local (rc.local apparently runs before xend), and I also dumped it in /etc/xen/auto (looks like this folder just takes sxp type files). At this point I can get it to work, but only if I manually run the script. I'm probably making this more complicated than it needs to, but I suppose I could mod my little script to loop and watch for a started xend. Hmm...

Also I'm seeing a drastic performance hit on my Crucial M4 128GB SSD when inside my little VM. It's running on a SATA2 port so maybe I'll try the SATA3
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Operating Systems
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › {Guide} Create a Gaming Virtual Machine