{Guide} Create a Gaming Virtual Machine - Page 57 - Overclock.net - An Overclocking Community

Forum Jump: 

{Guide} Create a Gaming Virtual Machine

Reply
 
Thread Tools
post #561 of 825 (permalink) Old 03-25-2013, 03:35 PM
New to Overclock.net
 
powerhouse's Avatar
 
Join Date: May 2012
Posts: 340
Rep: 22 (Unique: 13)
Quote:
Originally Posted by lloyd mcclendon View Post

KVM currently 'sort-of' works with passthrough - it will assign and may even be picked up and work ok, but the code to 'reset' the card back to normal when the VM shuts off is currently not there. So if you shutdown your guest, your host will crash if you try to start the guest back up. I experienced this myself and there's plenty of other KVM users out there who have documented the same behavior, regardless of hardware selected. The card did actually work fine until I shut the guest off. I'd expect QEMU/KVM to have this code added in a year or two - I may switch back at that point, but lets see how XEN goes for a bit first.

Regarding NVIDIA, supposedly the 'quadro' series cards do support it, but whether or not anyone has gotten it to work is spotty at best. There are even some users out there who have used the 'nvflash' tool to hack in their custom built firmware updates with memory mappings built to support resetting the card. There's a neat pdf out there somewhere where the guy loosely outlines the steps to do this. I would never do this as it's a good way to brick your card ... say you type 0x00007A400000 instead of 0x0007A400000 rolleyes.gif

Also there are some blurbs out there that if you contact nvidia support they will send you patched firmware for the card, but when I called support they said this is misinformation and they have never offered said patches.

"nvidia has been the single worst company we've ever dealt with ... so nvidia, :bleep: you." -Linus

KVM: I've seen similar reports on the web (but have no hands-on experience).

Nvidia Quadro: I have the Quadro 2000 and it works great with VGA passthrough (as secondary GPU). Really easy! I had the Quadro 600 before and that one DOESN'T work! Nvidia has a line of professional cards that are specified "multi-OS" - just search for that and you'll get a list of all supported cards. They should work with VGA passthrough. That said, you would have to spend a LOT of money to get a Quadro card that's useful for gaming - most Quadro's aren't designed for that and deliver very mediocre benchmark results.

BUT, an hour ago I found this thread/post: http://www.eevblog.com/forum/projects/hacking-nvidia-cards-into-their-professional-counterparts/msg207550/#msg207550.

It turns out you can hardware modify consumer Nvidia cards to identify themselves as pro-cards, thus enabling the pro features as well as VGA passthrough. I really only read a few posts on that forum, but it looks very promising. Certainly this kind of hacking is for the adventurous among us.

Hardware:
Desktop: i7 3930K, Asus Sabertooth X79, 32GB Kingston 1600MHz RAM, PNY Quatro 2000 graphics adapter for Linux Mint host, Gigabyte GTX 970 graphics adapater for Windows 10 VM, Asus Xonar Essence sound card, Sandisk Extreme 120GB SSD for Linux, Samsung 850 EVO 250GB SSD for Windows, 4 hard drives for data, Corsair 500R chassis, Noctua CPU cooler, SeaSonic Gold PSU, NEC 2690WUXI2 screen, Linux Mint 18.2 Mate host OS, Windows 10 Pro in KVM VM, Logitech K780 multi-device wireless keyboard, Logitech MX Master multi-device mouse smile.gif

Notebook: Macbook 2010 edition with 8GB RAM
powerhouse is offline  
Sponsored Links
Advertisement
 
post #562 of 825 (permalink) Old 03-25-2013, 03:40 PM
New to Overclock.net
 
powerhouse's Avatar
 
Join Date: May 2012
Posts: 340
Rep: 22 (Unique: 13)
Quote:
Originally Posted by Virum View Post

Great answer. Im disappointed I did not get the 3770 instead of 3770k (Both are fantastic chips! But I didn't know I'd have this option of VM when i got it). Also there are a lot of con's I'm seeing in those nvidia articles.

Ill have to stick with Wine tweaking. Dual Booting for gaming is just too inconvenient. Every time i do it I find my self just defaulting to Windows despite my distaste of it.

CPU: Maybe you can exchange it with someone who has a 3770?

Nvidia: I just ran into this thread: http://www.eevblog.com/forum/projects/hacking-nvidia-cards-into-their-professional-counterparts/.
See also this post: http://www.eevblog.com/forum/projects/hacking-nvidia-cards-into-their-professional-counterparts/msg207550/#msg207550.
Haven't managed to read much, but this looks real cool.

Hardware:
Desktop: i7 3930K, Asus Sabertooth X79, 32GB Kingston 1600MHz RAM, PNY Quatro 2000 graphics adapter for Linux Mint host, Gigabyte GTX 970 graphics adapater for Windows 10 VM, Asus Xonar Essence sound card, Sandisk Extreme 120GB SSD for Linux, Samsung 850 EVO 250GB SSD for Windows, 4 hard drives for data, Corsair 500R chassis, Noctua CPU cooler, SeaSonic Gold PSU, NEC 2690WUXI2 screen, Linux Mint 18.2 Mate host OS, Windows 10 Pro in KVM VM, Logitech K780 multi-device wireless keyboard, Logitech MX Master multi-device mouse smile.gif

Notebook: Macbook 2010 edition with 8GB RAM
powerhouse is offline  
post #563 of 825 (permalink) Old 03-26-2013, 04:25 AM
New to Overclock.net
 
nbhusain's Avatar
 
Join Date: May 2007
Posts: 76
Rep: 13 (Unique: 5)
Quote:
Originally Posted by lloyd mcclendon View Post

KVM currently 'sort-of' works with passthrough - it will assign and may even be picked up and work ok, but the code to 'reset' the card back to normal when the VM shuts off is currently not there. So if you shutdown your guest, your host will crash if you try to start the guest back up. I experienced this myself and there's plenty of other KVM users out there who have documented the same behavior, regardless of hardware selected. The card did actually work fine until I shut the guest off. I'd expect QEMU/KVM to have this code added in a year or two - I may switch back at that point, but lets see how XEN goes for a bit first.

Regarding NVIDIA, supposedly the 'quadro' series cards do support it, but whether or not anyone has gotten it to work is spotty at best. There are even some users out there who have used the 'nvflash' tool to hack in their custom built firmware updates with memory mappings built to support resetting the card. There's a neat pdf out there somewhere where the guy loosely outlines the steps to do this. I would never do this as it's a good way to brick your card ... say you type 0x00007A400000 instead of 0x0007A400000 rolleyes.gif

Also there are some blurbs out there that if you contact nvidia support they will send you patched firmware for the card, but when I called support they said this is misinformation and they have never offered said patches.

"nvidia has been the single worst company we've ever dealt with ... so nvidia, :bleep: you." -Linus

No not really, like i mentioned in a previous post kvm will crash the host when doing vga passthrough if you dont bind your gpu to pci-stub before the radeon driver loads, i recently switched from arch + xen to opensuse + kvm because of xen poor power management options on my amd machine (suspend doesnt work, cool'n quiet crash my system, etc), and im passing though a radeon 6950 without issues, i can reboot or shutdown the vm as much as i want without a single crash, and it seems most of my performance issues in the past were related to ksm.

Here's how i bind my gpu:

First of all you need to build your kernel with pci-stub built-in or add the pci-stub module to your initrd, then you need to find out the ids of your card.

lspci
Code:
07:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Cayman PRO [Radeon HD 6950]                                                                                
07:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI Cayman/Antilles HDMI Audio [Radeon HD 6900 Series]

lspci -n
Code:
07:00.0 0300: 1002:6719
07:00.1 0403: 1002:aa80

So now you add this to your grub config file:
Code:
pci-stub.ids=1002:6719,1002:aa80

It will end up looking something like this:
Code:
linux   /vmlinuz-3.7.10-1.1-desktop root=/dev/mapper/system-root   resume=/dev/system/swap splash=silent quiet showopts iommu=1  pci-stub.ids=1002:6719,1002:aa80

dmesg | grep pci-stub
Code:
[    2.136667] pci-stub: add 1002:6719 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    2.136674] pci-stub 0000:07:00.0: claimed by stub
[    2.136676] pci-stub: add 1002:AA80 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    2.136682] pci-stub 0000:07:00.1: claimed by stub

Also there's some interesting development in the kvm + qemu camp using vfio-pci to get primary vga passthrough working on NVIDIA and AMD using secondary devices, here are the patches for qemu:

http://lists.gnu.org/archive/html/qemu-devel/2013-02/msg02758.html
http://lists.gnu.org/archive/html/qemu-devel/2013-02/msg02760.html
http://lists.gnu.org/archive/html/qemu-devel/2013-02/msg02759.html
nbhusain is offline  
Sponsored Links
Advertisement
 
post #564 of 825 (permalink) Old 03-29-2013, 01:56 PM
New to Overclock.net
 
powerhouse's Avatar
 
Join Date: May 2012
Posts: 340
Rep: 22 (Unique: 13)
Hi guys (and gals). I just couldn't resist posting the Passmark results of my Windows 7 Pro 64 bit virtual machine running on the Xen hypervisor:



The only "weak" point is 3D graphics which is due to my graphics card, a Nvidia Quadro 2000. Actually, my 3D Graphics Mark (1,369) inside the VM is even better than the average performance for that card shown on Passmark (1,295) biggrin.gif - see http://www.videocardbenchmark.net/gpu.php?gpu=Quadro+2000.

Xen rocks thumb.gif

Hardware:
Desktop: i7 3930K, Asus Sabertooth X79, 32GB Kingston 1600MHz RAM, PNY Quatro 2000 graphics adapter for Linux Mint host, Gigabyte GTX 970 graphics adapater for Windows 10 VM, Asus Xonar Essence sound card, Sandisk Extreme 120GB SSD for Linux, Samsung 850 EVO 250GB SSD for Windows, 4 hard drives for data, Corsair 500R chassis, Noctua CPU cooler, SeaSonic Gold PSU, NEC 2690WUXI2 screen, Linux Mint 18.2 Mate host OS, Windows 10 Pro in KVM VM, Logitech K780 multi-device wireless keyboard, Logitech MX Master multi-device mouse smile.gif

Notebook: Macbook 2010 edition with 8GB RAM
powerhouse is offline  
post #565 of 825 (permalink) Old 04-06-2013, 05:40 AM
New to Overclock.net
 
Dh0mp5eur's Avatar
 
Join Date: Apr 2013
Posts: 7
Rep: 0
Hello
I use KVM on Debian Sid with a i7 3770 Asus P8Z77-M and HD7970 for the VM.
It works perfectly.
But I can't restart my VM.

I enable pci-stub in grub
Code:
GRUB_CMDLINE_LINUX="intel_iommu=on pci-stub.ids=1002:6798,1002:aaa0"

dmesg |grep pci-stub
Code:
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.8-trunk-amd64 root=UUID=4e436466-36c9-45a9-a455-2ad879c7baaf ro intel_iommu=on pci-stub.ids=1002:6798,1002:aaa0 quiet
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.8-trunk-amd64 root=UUID=4e436466-36c9-45a9-a455-2ad879c7baaf ro intel_iommu=on pci-stub.ids=1002:6798,1002:aaa0 quiet

kvm   1:1.1.2+dfsg-6
qemu-kvm     1.1.2+dfsg-6
Dh0mp5eur is offline  
post #566 of 825 (permalink) Old 04-06-2013, 10:07 AM
New to Overclock.net
 
nbhusain's Avatar
 
Join Date: May 2007
Posts: 76
Rep: 13 (Unique: 5)
You need to have the pci-stub module compiled built-in in the kernel or inside your initramfs, you should see something like this:

dmesg | grep pci-stub
Code:
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-linux-nb root=/dev/mapper/system-root ro iommu=1 pci-stub.ids=1002:4391,1002:6719,1002:aa80 acpi_sleep=s3_bios,s3_mode quiet
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-linux-nb root=/dev/mapper/system-root ro iommu=1 pci-stub.ids=1002:4391,1002:6719,1002:aa80 acpi_sleep=s3_bios,s3_mode quiet
[    2.087342] pci-stub: add 1002:4391 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    2.087350] pci-stub 0000:00:11.0: claimed by stub
[    2.087363] pci-stub: add 1002:6719 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    2.087371] pci-stub 0000:07:00.0: claimed by stub
[    2.087375] pci-stub: add 1002:AA80 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000


pci-stub has to grab the card before the radeon module otherwise your system will crash
nbhusain is offline  
post #567 of 825 (permalink) Old 04-06-2013, 12:57 PM
New to Overclock.net
 
Dh0mp5eur's Avatar
 
Join Date: Apr 2013
Posts: 7
Rep: 0
I loaded the pci-stub in the initramfs.
I blacklisted radeon module.
But I still can't restart my VM.
Code:
dmesg |grep pci-stub
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.8-trunk-amd64 root=UUID=4e436466-36c9-45a9-a455-2ad879c7baaf ro intel_iommu=on pci-stub.ids=1002:6798,1002:aaa0 quiet
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.8-trunk-amd64 root=UUID=4e436466-36c9-45a9-a455-2ad879c7baaf ro intel_iommu=on pci-stub.ids=1002:6798,1002:aaa0 quiet
[    1.031665] pci-stub: add 1002:6798 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.031671] pci-stub 0000:01:00.0: claimed by stub
[    1.031675] pci-stub: add 1002:AAA0 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    1.031680] pci-stub 0000:01:00.1: claimed by stub
Dh0mp5eur is offline  
post #568 of 825 (permalink) Old 04-06-2013, 02:59 PM
New to Overclock.net
 
nbhusain's Avatar
 
Join Date: May 2007
Posts: 76
Rep: 13 (Unique: 5)
Does the host crash in your case?
nbhusain is offline  
post #569 of 825 (permalink) Old 04-06-2013, 03:15 PM
New to Overclock.net
 
myweb's Avatar
 
Join Date: Apr 2013
Posts: 11
Rep: 0
Dear all,
I faced with passthrough issue of NVIDIA GT640 on the following configuration:
Intel(R) Core(TM) i5-3470
AsRock Z77 Pro4
Ubuntu Raring (Kubuntu 13.04 Beta 2)
xen-hypervisor-4.2.1

/etc/modprobe.d/xen-pciback.conf
Code:
blacklist nvidia
options xen-pciback hide=(0000:01:00.0)(0000:01:00.1)

/etc/modules
Code:
xen-pciback

dmesg | grep pcib
Code:
[    0.000000] Command line: placeholder root=UUID=cf9f10d5-40d6-41fe-8e10-b7801ef3b87e ro intel_iommu=on xen-pciback.passthrough=1 xen-pciback.hide=(0000:01:00.0)(0000:01:00.1) quiet splash
[    2.165897] Kernel command line: placeholder root=UUID=cf9f10d5-40d6-41fe-8e10-b7801ef3b87e ro intel_iommu=on xen-pciback.passthrough=1 xen-pciback.hide=(0000:01:00.0)(0000:01:00.1) quiet splash
[    5.444046] pciback 0000:01:00.0: seizing device
[    5.444055] pciback 0000:01:00.1: seizing device
[    5.444238] pciback 0000:01:00.0: enabling device (0000 -> 0003)
[    5.450089] xen-pciback: backend is passthrough

Guest OS is Windows 7. Win7 recognized videocard, Nvidia driver was installed, but device manager show Yellow Triangle with Exclamation Mark and Error Code 43.
Could you please clarify are there any chances to get working Nvidia gt640 under xen guest?
Also I am planing to use another Linux guest as movie player (HTPC) since Nvidia hardware acceleration is better than ATI, but right now Ubuntu guest with NVIDIA GT640 hang up during boot.
myweb is offline  
post #570 of 825 (permalink) Old 04-06-2013, 03:35 PM
New to Overclock.net
 
nbhusain's Avatar
 
Join Date: May 2007
Posts: 76
Rep: 13 (Unique: 5)
You need need patches to get vga passthrough working with NVIDIA cards on xen or kvm, take a look at http://www.davidgis.fr/blog/index.php?2011/12/07/860-xen-42unstable-patches-for-vga-pass-through, u'll find patches to get nvidia cards working under xen, for kvm, there's some experimental patches on the qemu-devel mailing list from april 1.
nbhusain is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off