You are not logged in.

#176 2013-06-26 10:14:16

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I missed the "vfio_dma_map", which indicates some things, but I'm not the expert here. I managed to set this up and did some strange stuff with (1GB) hugepages, so I thought it might be that.
Maybe nbhs has some ideas.


i'm sorry for my poor english wirting skills…

Offline

#177 2013-06-26 13:00:46

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Fixed by kdesu, now I have:
qemu-system-x86_64: virtio_ioport_write: unexpected address 0x13 value 0x1
Add crash into amd officiel windows drivers. Blue screen at windows boot.

Last edited by alpha_one_x86 (2013-06-26 13:01:03)

Offline

#178 2013-06-26 13:22:10

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

@rabcor

You still have a rogue space after the first -device vfio-pci.

# qemu-system-x86_64 ... -device vfio-pci, host=01:00.0,...

I put a space in a working command and got a "could not open disk image" error, so that could be it.

Last edited by alphaniner (2013-06-26 13:22:39)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#179 2013-06-26 13:22:31

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

alpha_one_x86 wrote:

Add crash into amd officiel windows drivers. Blue screen at windows boot.

Sounds like you're not using a vfio-vga-reset patched qemu+kernel. Is it a fresh windows install or are you trying to migrate an old one?


i'm sorry for my poor english wirting skills…

Offline

#180 2013-06-26 13:26:07

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

andy123 wrote:
alpha_one_x86 wrote:

Add crash into amd officiel windows drivers. Blue screen at windows boot.

Sounds like you're not using a vfio-vga-reset patched qemu+kernel. Is it a fresh windows install or are you trying to migrate an old one?

Near to be fresh. I will try the patch, and after the clean install.

EDIT: This repository is temporarily unavailable.
The backend storage is temporarily offline. Usually this means the storage server is undergoing maintenance. Please contact support if the problem persists.

Some body can send me the patch?

Last edited by alpha_one_x86 (2013-06-26 13:31:41)

Offline

#181 2013-06-27 04:45:56

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

alpha_one_x86 wrote:
andy123 wrote:
alpha_one_x86 wrote:

Add crash into amd officiel windows drivers. Blue screen at windows boot.

Sounds like you're not using a vfio-vga-reset patched qemu+kernel. Is it a fresh windows install or are you trying to migrate an old one?

Near to be fresh. I will try the patch, and after the clean install.

EDIT: This repository is temporarily unavailable.
The backend storage is temporarily offline. Usually this means the storage server is undergoing maintenance. Please contact support if the problem persists.

Some body can send me the patch?

On page 6 i posted some builds for arch that contains the patches

Offline

#182 2013-06-27 07:23:18

powerhouse
Member
Registered: 2013-05-22
Posts: 15

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

apocolypse600 wrote:

Where does everyone keep up to date with news about VGA passthrough? I follow this thread, http://forums.linuxmint.com/viewtopic.php?f=42&t=112013 and http://www.overclock.net/t/1205216/guid … al-machine , although those are both aimed at passthrough via Xen rather than KVM. I also follow the xen-users, xen-devel and kvm general mailing lists. I notice that nbhs sometimes posts from a different mailing list (like the post directly before this one), but I can't find an easy way to navigate that list. Mailing lists aren't really my thing though, so that could be why. The KVM irc on freenode is pretty quiet most of the time, but I usually lurk there aswell.

...

Have been busy moving to a new appartment, so sorry for the late reply.

About the Linux Mint forum thread on VGA passthrough: I'm not an expert in Linux/virtualization/etc., but I usually get things done somehow. My favorite distro is Linux Mint and since there wasn't any VGA passthrough guide for Linux Mint, I simply wrote one. If you're looking for the latest developments in Xen, then that thread will probably not help you much. It doesn't cover KVM at all, at least not now. I hope to be able to update it for LM15 and Xen 4.2 with xl toolstack.
My aim was to get VGA passthrough working without the need for kernel/Xen patches, etc., just using standard packages. I definitely chose the hardware to support the software (Xen), not vice versa.

This thread here is my main source for info on KVM, and for getting a general perspective on KVM versus Xen. But I haven't tried KVM, yet. One reason for not trying KVM in the first place was the lack of documentation on the Internet, but nbhs is doing a good job here. Today I would definitely give KVM a try.

I second the advice of nbhs about choosing the right video card!

Last edited by powerhouse (2013-06-27 07:24:23)

Offline

#183 2013-06-27 08:37:41

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

nbhs wrote:

On page 6 i posted some builds for arch that contains the patches

I have gentoo + custom kernel build, then I need a patch more than all.

Offline

#184 2013-06-27 10:01:54

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

alpha_one_x86 wrote:
nbhs wrote:

On page 6 i posted some builds for arch that contains the patches

I have gentoo + custom kernel build, then I need a patch more than all.

Yeah i know, but the zip packages contains the needed patches

Offline

#185 2013-06-27 10:17:17

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I prefer do my self the patching, but well, you speak well about: message of 2013-06-21 00:17:12, no? I can't dl: Error 102 (net::ERR_CONNECTION_REFUSED): The server refused the connection.

Offline

#186 2013-06-27 10:26:41

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

alpha_one_x86 wrote:

I prefer do my self the patching, but well, you speak well about: message of 2013-06-21 00:17:12, no? I can't dl: Error 102 (net::ERR_CONNECTION_REFUSED): The server refused the connection.

kernel and qemu patches here: http://www.fileswap.com/dl/LFDgdLJbyj/

Offline

#187 2013-06-27 11:03:47

dogblue
Member
Registered: 2013-06-23
Posts: 5

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

nbhs wrote:

NIce! have you tried the patched nvidia drivers yet?

Yep, no trouble there at all actually, or at least no trouble that wasn't due to my own unfamiliarity with Arch :)

I have a couple of minor issues on the windows side (BSOD installing certain drivers), but nothing that can't be resolved, I think.
I can also confirm that the Etron EJ168 USB controller mentioned earlier in this thread is a pain to get going in Win 7 (had to test-sign drivers, etc), but it worked out of the box for me in Win 8.

I'm going to get the rest of these drivers installed then work my way through the optimizations that you posted on the first page. I'll report back with results and/or any more questions.

Offline

#188 2013-06-27 11:36:22

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

On linux 3.10 RC7, I have to do manual patching, after I have the error:

drivers/pci/pci.c:3261:2: error: implicit declaration of function 'pci_hp_reset_slot' [-Werror=implicit-function-declaration]

Then I have put into the header:
int pci_hp_reset_slot(struct hotplug_slot *hotplug, int probe);
After it:

*drivers/vfio/pci/vfio_pci.c:85:10: error: 'irq_type' undeclared (first use in this function)

unknow resolution, can you help me?

*drivers/vfio/pci/vfio_pci.c:268:3: error: duplicate (or overlapping) case value
*drivers/vfio/pci/vfio_pci.c:257:3: error: this is the first entry overlapping that value

Fixed the switch.

*drivers/vfio/pci/vfio_pci.c:416:18: error: 'VFIO_DEVICE_PCI_BUS_RESET' undeclared (first use in this function)

resolved by define into the header.
Do you think release patch for 3.10 final?
After I will try patch qemu.

Last edited by alpha_one_x86 (2013-06-27 11:36:54)

Offline

#189 2013-06-27 18:13:40

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

alpha_one_x86 wrote:

On linux 3.10 RC7, I have to do manual patching, after I have the error:

drivers/pci/pci.c:3261:2: error: implicit declaration of function 'pci_hp_reset_slot' [-Werror=implicit-function-declaration]

Then I have put into the header:
int pci_hp_reset_slot(struct hotplug_slot *hotplug, int probe);
After it:

*drivers/vfio/pci/vfio_pci.c:85:10: error: 'irq_type' undeclared (first use in this function)

unknow resolution, can you help me?

*drivers/vfio/pci/vfio_pci.c:268:3: error: duplicate (or overlapping) case value
*drivers/vfio/pci/vfio_pci.c:257:3: error: this is the first entry overlapping that value

Fixed the switch.

*drivers/vfio/pci/vfio_pci.c:416:18: error: 'VFIO_DEVICE_PCI_BUS_RESET' undeclared (first use in this function)

resolved by define into the header.
Do you think release patch for 3.10 final?
After I will try patch qemu.

You need to build pcie hotplug static instead of as a module, i suggest you use kernel 3.9

Last edited by nbhs (2013-06-27 18:30:56)

Offline

#190 2013-06-27 19:07:38

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I need the kernel 3.10 to my haswell.
PCIe hotplug already in static.

Offline

#191 2013-06-27 19:09:56

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

For 3.10-rc7 try this patch kernel-vfio-vga-reset.patch.tar.gz

Offline

#192 2013-06-28 08:28:10

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Well same, under windows (with kernel + qemu patched):
http://files.first-world.info/temp/ati-crash.png
And in console:

qemu-system-x86_64: virtio_ioport_write: unexpected address 0x13 value 0x1

Offline

#193 2013-06-28 16:09:07

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

alpha_one_x86 wrote:

Well same, under windows (with kernel + qemu patched):
http://files.first-world.info/temp/ati-crash.png
And in console:

qemu-system-x86_64: virtio_ioport_write: unexpected address 0x13 value 0x1

Could you please post your qemu cmdline

Offline

#194 2013-06-28 22:00:48

perfectsine
Member
Registered: 2013-06-28
Posts: 2

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

nbhs,

Do foresee any problems with doing multiple VM's and passing a different VGA adapter to each?

-perfectsine

Offline

#195 2013-06-29 02:56:24

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

perfectsine wrote:

nbhs,

Do foresee any problems with doing multiple VM's and passing a different VGA adapter to each?

-perfectsine

I havent tried since i only have 2 cards ( and my brother's gtx 470) but i dont think its a problem if you got it working with one

Last edited by nbhs (2013-06-29 02:58:09)

Offline

#196 2013-06-30 11:55:25

Chais
Member
Registered: 2011-08-08
Posts: 33

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Thanks a lot for this huge tutorial. I can't say I have fully understood it. I'm quite new to the deeper magic of virtualisation.
My idea is build a gaming system that can run a virtual Windows for those games unavailable for linux.
I'd like to do a primary vga passthrough, as I don't want to buy two potent graphics cards. Since only host or guest will be needing it ata a time that shouldn't be a problem. Just I have no idea how to do it.
If that's impossible for some reason, plan B would be to have have an Intel igp as primary vga for Arch, pass the nvidia through to Windows or, if the VM isn't running, use it for the host with bumblebee. How would I do that?


--
Chais

Offline

#197 2013-07-01 19:07:45

alpha_one_x86
Member
Registered: 2013-06-26
Posts: 11

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

/usr/bin/qemu-system-x86_64 -drive file=hdd.img,if=virtio,cache=none,aio=native -k fr -alt-grab -m 512 -vga vmware -net nic,vlan=0,model=virtio -net user -rtc base=localtime -smp 4,cores=4,sockets=1 -boot once=c -cpu kvm64,+nx -enable-kvm -device vfio-pci,host=01:00.0,multifunction=on,x-vga=on

With x-vga=on I have artifact on my second screen of my dual screen (and black screen for qemu), with it do the BsD.

Offline

#198 2013-07-02 03:26:33

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

alpha_one_x86 wrote:
/usr/bin/qemu-system-x86_64 -drive file=hdd.img,if=virtio,cache=none,aio=native -k fr -alt-grab -m 512 -vga vmware -net nic,vlan=0,model=virtio -net user -rtc base=localtime -smp 4,cores=4,sockets=1 -boot once=c -cpu kvm64,+nx -enable-kvm -device vfio-pci,host=01:00.0,multifunction=on,x-vga=on

With x-vga=on I have artifact on my second screen of my dual screen (and black screen for qemu), with it do the BsD.

You should probably send the redhat dev a bug report (alex williamson), see: http://lists.nongnu.org/archive/html/qe … 00432.html to submit a bug report

Offline

#199 2013-07-03 13:23:51

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I'm going to try this with my Gigabyte 990FXA-UD5, a Nvidia GT-430 (host), and some older Geforce 7xxx which currently rotting in the cellar. (If I can use it for that: great)
The display panel has two inputs, so I'm planning to switch video between host and guest by simply pressing the source button.

But I wonder if it's possible to use a single keyboard and mouse for both host and guest? Not at the same time of course, more like in usual KVM VNC window.
And if so, how's the handling of the focus (vm or host)?
Or would it be better to get a separate PCIe USB controller and use a KVM switch?

Sorry for the maybe stupid question.

Offline

#200 2013-07-03 13:35:00

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

teekay wrote:

But I wonder if it's possible to use a single keyboard and mouse for both host and guest? Not at the same time of course, more like in usual KVM VNC window.
And if so, how's the handling of the focus (vm or host)?
Or would it be better to get a separate PCIe USB controller and use a KVM switch?

Hi,
I use a setup with KVM switch and it's not that complicated, assuming you have multiple usb controllers on your mainboard (are there boards that don't?). You simply have to pass one through to the guest as a PCI device. The host will ignore the input on those, since it doesn't load a driver for it and it'll appear as a normal usb controller to the guest.
I don't thik I get what you mean by "usual KVM VNC window", so no idea about that one.
I hope this helps…


i'm sorry for my poor english wirting skills…

Offline

Board footer

Powered by FluxBB