You are not logged in.

#1876 2014-05-29 04:52:51

gutleib
Member
Registered: 2014-05-29
Posts: 5

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

The thing is, gpu is gtx590, which is basically two 580 on single board. Not sure how it will behave with only one "half" passthru'ed.
The kernel is Ubuntu 14.04 from updates repo, no patches. Only some modules.
Host gpu is radeon HD2600, afair, but generaly it's a smallest radeon hd with passive heatsink I could find.
Qemu is also ubuntu 14.04 stock, which is 2.0.
I am trying to make gpu passthrough with minimal tinkering, since I have quite a bunch of 3d workstations. Windows and custom linux builds equally suck.

aw wrote:

...Besides, you've made a non-standard PCIe configuration in the guest by using PCI slots 0 and 1 behind your root port.  Typically only slot 0 is scanned by the guest.  Once you get your VGA card working, add another ioh3420 and put the other card behind it.

Ummm... Didn't know that.
Will check.

But would be really great if you could explain the whole ioh3420 argument. Or point to where I could read the short version smile
So far, I don't understand which variables should be changed for second ioh.

Offline

#1877 2014-05-29 04:57:04

aw
Member
Registered: 2013-10-04
Posts: 921
Website

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

You need the VGA arbiter patch from a page or two back


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#1878 2014-05-29 05:26:17

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

Today test again with Kernel 3.15-rc7, still without any luck.

The VM still hangs during reboot when Guest OS is Ubuntu Server.
And CUDA still get "InvalidDevice" error to me, even I tried use dumped VGA BIOS and -cpu using qemu64.

I still can't understand that with same settings, same functions, why Windows 7 can run CUDA but Ubuntu Server can't.
Now update the kernel of guest Ubuntu is my only hope for now.

But I'm not get rid of the possibility that maybe I'm doing a wrong installation.
If update the kernel still can't fix the problem. I'll really have no idea.

Does anyone tried run CUDA in guest Ubuntu and works?

Last edited by AKSN74 (2014-05-29 05:27:27)

Offline

#1879 2014-05-29 08:44:32

cdrjameson
Member
Registered: 2013-05-19
Posts: 46

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

For a while I have been a lurker on this thread and been very impressed by the efforts and time of nhbs, aw and others to get peoples set-up working. I would like a quick feasibility check of my hardware from the other veterans of this thread.

I have the i7-4771 with HD 4600 IGP, AMD 7950 GPU and AsRock Extreme 6 Z87 Motherboard with 16GB RAM. I did my research (hopefully it's right) and this hardware does support the necessary technologies.

I want the host to use the IGP, and passthrough the GPU. I have read mixed reports in this thread about the success for this type of setup, what is the current thinking? In the future I will add an Nvidia GPU for the host.

I have read the Wiki pages on the ABS, Creating Packages and Kernels. I haven't seen an easy-to-follow guide how I would compile the linux-mainline kernel from the AUR. And I've been directed to the Gentoo handbook for more info or Kernel configurations; interesting stuff, but a little over my head and, I think, my needs too.

I haven't touched my Arch partition yet but I have created a seperate Arch install and installed qemu, seabios and abs. I will be creating the virtual machine there and writing down all the steps I take to get it working before transferring that work and attempting it in my main install. Hopefully this method will give me the fewest headaches in the future.

But in relative-newbie terms, how does one install the linux-mainline?

BTW if anyone is interested there is an Arch Linux Class this Saturday on the Linux Kernel and will cover things like compiling your own.

Last edited by cdrjameson (2014-05-29 08:54:16)

Offline

#1880 2014-05-29 09:38:16

sinny
Member
Registered: 2014-05-24
Posts: 75

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

cdrjameson wrote:

For a while I have been a lurker on this thread and been very impressed by the efforts and time of nhbs, aw and others to get peoples set-up working. I would like a quick feasibility check of my hardware from the other veterans of this thread.

I have the i7-4771 with HD 4600 IGP, AMD 7950 GPU and AsRock Extreme 6 Z87 Motherboard with 16GB RAM. I did my research (hopefully it's right) and this hardware does support the necessary technologies.

I want the host to use the IGP, and passthrough the GPU. I have read mixed reports in this thread about the success for this type of setup, what is the current thinking? In the future I will add an Nvidia GPU for the host.

I have read the Wiki pages on the ABS, Creating Packages and Kernels. I haven't seen an easy-to-follow guide how I would compile the linux-mainline kernel from the AUR. And I've been directed to the Gentoo handbook for more info or Kernel configurations; interesting stuff, but a little over my head and, I think, my needs too.

I haven't touched my Arch partition yet but I have created a seperate Arch install and installed qemu, seabios and abs. I will be creating the virtual machine there and writing down all the steps I take to get it working before transferring that work and attempting it in my main install. Hopefully this method will give me the fewest headaches in the future.

But in relative-newbie terms, how does one install the linux-mainline?

BTW if anyone is interested there is an Arch Linux Class this Saturday on the Linux Kernel and will cover things like compiling your own.

i can confirm the following setupd working:
MB: asrock z87 pro4
CPU: intel i7 4770
OS: fedora 20 x86_64 (with additional repositories: kernel-vanilla-mainline and virt-preview)
kernel: kernel-3.15.0-0.rc5.git2.8.vanilla.mainline.knurd.1.fc20.x86_64.rpm
host GPU: integrated (intel i7 4770)
guest GPU0: radeon hd 6450 (Gigabyte GV-R645-1GI)
guest GPU1: nvidia gt 430 // not used at the moment - pending

kernel patchwork performed (basic info for fedora: here), $DST_VER refers to destination kernel version:

  1. grab kernel source (.srpm, as described above) for mainline kernel being used

  2. modify EXTRAVERSION variable in Makefile at root level of mainline kernel source (NOTE: needed for vermagic, see step 6 below)

  3. "make prepare scripts" at root level of mainline kernel source

  4. apply vga arbiter patch (NOTE: this modifies only i915 kernel module)

  5. "make modules SUBDIRS=drivers/gpu/drm/i915" at root level of mainline kernel source

  6. if "modinfo /lib/modules/$DST_VER/kernel/drivers/gpu/drm/i915/i915.ko drivers/gpu/drm/i915/i915.ko | grep vermagic" does not match - restart from step 2

  7. copy built i915.ko module to "/lib/modules/$DST_VER/updates"

  8. perform "depmod" as root

  9. rebuild initramfs (something like "dracut /boot/initramfs-$DST_VER.img $DST_VER") - you might want to save previous initramfs or build initramfs to different filename to enable it by modifying grub2 initrd parameter

this is "easy" but pretty inconvenient way to do things: easy because only one kernel module is rebuilt, unconvenient because on every kernel update the rebuild procedure should be remade from scratch
NOTE: vermagic of built module not matching with running kernel may result in module not being loaded, which in turn (in my case) resulted in X server start rendering host system completely unusable (hang with screen showing garbage-colored lines)

more info bits may be found in my previous posts here

Offline

#1881 2014-05-29 12:40:13

derbroti
Member
Registered: 2014-05-09
Posts: 1

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

Hello,

I have a working setup with win7 as guest:

intel e3-1230v3
asus p9d ws
sapphire radeon 9200 SE Lite (PCI - host)
sapphire radeon R9 280 (PCIe - guest)
silverstone card Marvell 88SE9130 (PCIe)


I am using the PCI graphics card to be able to set that one as primary in the bios (there is no possibility to manually select the primary when two pcie cards are installed)
The Marvell sata card is primarily used because of its hyperduo (combining ssd + hdd) feature.

One sad thing is, that I can not boot from the Marvell card, if i use passthrough on it. The cards bios shows up but does not detect a single drive... The only working card i found was a LSI card with a sas2008 chip but the ssd caching feature of the marvell was more convenient through... so now I am using virtio-scsi as I gave up on the idea to be able to boot from the passed through marvell controller.

I am using a mainline 3.13 kernel with acs-override patch, because I was unable to build ZFS with >= 3.14

One "problem" i have left:

I am using an old dma-alias patch, that i found on the "Bug 42679 - DMA Read on Marvell 88SE9128 fails" kernel bugzilla post.

Is there any chance to get a patchfile for the new dma-alias-v4 without using aw's whole kernel?

Offline

#1882 2014-05-29 14:16:12

Slabity
Member
Registered: 2013-12-29
Posts: 40

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

Okay, I can't seem to get this to work anymore. I can pass the card to the guest, and I get video output from it, but Windows keeps reporting error code 43 in the device manager whenever I install the device drivers.

My setup consists of an AMD 6780 host card (open source drivers) and an Nvidia 780 guest card. I've also installed linux-mainline with all the patches on the front page.

My kernel options are as such:

root=/dev/sda2 rw initrd=/initramfs-linux-mainline.img pci-stub.ids=10de:1004,10de:0e1a intel_iommu=on pcie_acs_override=downstream

My qemu command:

qemu-system-x86_64 \
    -enable-kvm -M q35 -m 8192 -cpu host \
    -smp 6,sockets=1,cores=4,threads=1 \
    -bios /usr/share/qemu/bios.bin -vga none \
    -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
    -device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
    -device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 \
    -device virtio-scsi-pci,id=scsi \
    -drive file=/dev/sdb,id=disk,format=raw -device ide-hd,bus=ide.0,drive=disk

Before I run the VM, I run:

sudo vfio-bind 0000:02:00.0 0000:02:00.1
sudo vga-clear 00:01.0
sudo vga-set 00:01.1

I feel like I'm missing one simple thing, but I've scanned the thread and can't figure out what that is.

Offline

#1883 2014-05-29 14:18:16

aw
Member
Registered: 2013-10-04
Posts: 921
Website

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

Slabity wrote:

Okay, I can't seem to get this to work anymore. I can pass the card to the guest, and I get video output from it, but Windows keeps reporting error code 43 in the device manager whenever I install the device drivers.

My setup consists of an AMD 6780 host card (open source drivers) and an Nvidia 780 guest card. I've also installed linux-mainline with all the patches on the front page.

My kernel options are as such:

root=/dev/sda2 rw initrd=/initramfs-linux-mainline.img pci-stub.ids=10de:1004,10de:0e1a intel_iommu=on pcie_acs_override=downstream

My qemu command:

qemu-system-x86_64 \
    -enable-kvm -M q35 -m 8192 -cpu host \
    -smp 6,sockets=1,cores=4,threads=1 \
    -bios /usr/share/qemu/bios.bin -vga none \
    -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
    -device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
    -device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 \
    -device virtio-scsi-pci,id=scsi \
    -drive file=/dev/sdb,id=disk,format=raw -device ide-hd,bus=ide.0,drive=disk

Before I run the VM, I run:

sudo vfio-bind 0000:02:00.0 0000:02:00.1
sudo vga-clear 00:01.0
sudo vga-set 00:01.1

I feel like I'm missing one simple thing, but I've scanned the thread and can't figure out what that is.

Did you upgrade the guest to the 337.88 Nvidia driver?  We're all having trouble with the new driver.


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#1884 2014-05-29 14:38:41

aw
Member
Registered: 2013-10-04
Posts: 921
Website

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

Slabity wrote:

Before I run the VM, I run:

sudo vfio-bind 0000:02:00.0 0000:02:00.1
sudo vga-clear 00:01.0
sudo vga-set 00:01.1

There's a kernel patch for this, use it.


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#1885 2014-05-29 15:04:47

Slabity
Member
Registered: 2013-12-29
Posts: 40

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

aw wrote:

Did you upgrade the guest to the 337.88 Nvidia driver?  We're all having trouble with the new driver.

Damnit, that explains it. Downgrading to the previous driver fixes it...

aw wrote:

There's a kernel patch for this, use it.

Hey thanks!

Offline

#1886 2014-05-29 20:27:15

apex8
Member
Registered: 2014-03-29
Posts: 60

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

Hey together,

I achieved to run my qemu script without root priviledges. I needed to set priviledges to three devices, I pass through to my VM. My Script looks as follows:

#!/bin/bash

#QEMU settings for user access
chown :kvm /dev/vfio/13
chmod g+rw /dev/vfio/13

chown :kvm /dev/vfio/14
chmod g+rw /dev/vfio/14

chown :kvm /dev/vfio/17
chmod g+rw /dev/vfio/17

To automatically run this script, I made a systemd service file:

[Unit]
Description=grants members of group kvm access to passthroughed devices
After=syslog.target

[Service]
#EnvironmentFile=-/etc/vfio-pci.cfg
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/bin/vfiouseraccess

[Install]
WantedBy=multi-user.target

My problems is, that this doesn't work:

systemctl status vfiouseraccess.service                                                                                ⏎
● vfiouseraccess.service - grants members of group kvm access to passthroughed devices
   Loaded: loaded (/usr/lib/systemd/system/vfiouseraccess.service; enabled)
   Active: active (exited) since Do 2014-05-29 22:15:35 CEST; 8min ago
  Process: 337 ExecStart=/usr/bin/vfiouseraccess (code=exited, status=1/FAILURE)
 Main PID: 337 (code=exited, status=1/FAILURE)
   CGroup: /system.slice/vfiouseraccess.service

chown: cannot access ‘/dev/vfio/13’: No such file or directory
chmod: cannot access ‘/dev/vfio/13’: No such file or directory
chown: cannot access ‘/dev/vfio/14’: No such file or directory
chmod: cannot access ‘/dev/vfio/14’: No such file or directory
chown: cannot access ‘/dev/vfio/17’: No such file or directory
chmod: cannot access ‘/dev/vfio/17’: No such file or directory

It seems, that a the point where my script is called, the devices aren't present. Can someone tell my, how I could fix this?

Thanks in advance
apex8

EDIT: I forgot to mention: Once the system has started and I logged in, I can easily run my script manually and its setting the priviledges as intended.

Last edited by apex8 (2014-05-29 20:28:21)

Offline

#1887 2014-05-29 22:01:31

aw
Member
Registered: 2013-10-04
Posts: 921
Website

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

aw wrote:
Flyser wrote:
dwe11er wrote:

Is it only me or new NVIDIA 337.88 driver still has issues with virtualized Windows? I'm getting code 43, 335.23 doesn't have this issue.

It's not only you. Same here for my gtx660

EDIT: Downgrading worked

Same here *sigh* time to start comparing traces :-\

The driver doesn't even seem to be trying to work, I've reported it to the GeForce Forums, not sure what more to do about it other than hope it gets fixed  https://forums.geforce.com/default/topi … 9/#4229739


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#1888 2014-05-30 00:44:25

gutleib
Member
Registered: 2014-05-29
Posts: 5

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

aw wrote:

You need the VGA arbiter patch from a page or two back

Could you explain? I don't have any intel graphics in my pc at all...

Also: I tried passthrugh'ing only "vga controller" half of gtx590, and also tried different pcie addresses. Results are:
apparently, if I use the line
"sudo qemu-system-x86_64 -enable-kvm -M q35 -m 1024 -cpu host -smp 6,sockets=1,cores=6,threads=1
-bios /usr/share/qemu/bios.bin
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1
-device vfio-pci,host=05:00.0,bus=root.1,addr=00.0,multifunction=on,romfile=/root/Gigabyte.GTX590.1536.110223.rom 
-device vfio-pci,host=05:00.1,bus=root.1,addr=00.1
-device vfio-pci,host=06:00.0,bus=root.1,addr=01.0,multifunction=on,romfile=/root/Gigabyte.GTX590.1536.110223.rom,x-vga=on
-device vfio-pci,host=06:00.1,bus=root.1,addr=01.1
-vga cirrus",
the bios boot process doesn't complete. It goes first "seabios..." line in vnc, then the second, "ipxe..." then (in second line) "PnP PNN..." and lots of numbers. then it just sits there.
If I use only one pci device (the vga half, not the 3d controller),
"sudo qemu-system-x86_64 -enable-kvm -M q35 -m 1024 -cpu host -smp 6,sockets=1,cores=6,threads=1
-bios /usr/share/qemu/bios.bin
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1
-device vfio-pci,host=06:00.0,bus=root.1,addr=00.0,multifunction=on,romfile=/root/Gigabyte.GTX590.1536.110223.rom,x-vga=on
-device vfio-pci,host=06:00.1,bus=root.1,addr=00.1 ",
it goes through full seabios routine, yet on vnc (note no -vga cirrus, but...).

Offline

#1889 2014-05-30 05:14:30

sinny
Member
Registered: 2014-05-24
Posts: 75

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

gutleib wrote:
aw wrote:

You need the VGA arbiter patch from a page or two back

Could you explain? I don't have any intel graphics in my pc at all...

Also: I tried passthrugh'ing only "vga controller" half of gtx590, and also tried different pcie addresses. Results are:
apparently, if I use the line
"sudo qemu-system-x86_64 -enable-kvm -M q35 -m 1024 -cpu host -smp 6,sockets=1,cores=6,threads=1
-bios /usr/share/qemu/bios.bin
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1
-device vfio-pci,host=05:00.0,bus=root.1,addr=00.0,multifunction=on,romfile=/root/Gigabyte.GTX590.1536.110223.rom 
-device vfio-pci,host=05:00.1,bus=root.1,addr=00.1
-device vfio-pci,host=06:00.0,bus=root.1,addr=01.0,multifunction=on,romfile=/root/Gigabyte.GTX590.1536.110223.rom,x-vga=on
-device vfio-pci,host=06:00.1,bus=root.1,addr=01.1
-vga cirrus",
the bios boot process doesn't complete. It goes first "seabios..." line in vnc, then the second, "ipxe..." then (in second line) "PnP PNN..." and lots of numbers. then it just sits there.
If I use only one pci device (the vga half, not the 3d controller),
"sudo qemu-system-x86_64 -enable-kvm -M q35 -m 1024 -cpu host -smp 6,sockets=1,cores=6,threads=1
-bios /usr/share/qemu/bios.bin
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1
-device vfio-pci,host=06:00.0,bus=root.1,addr=00.0,multifunction=on,romfile=/root/Gigabyte.GTX590.1536.110223.rom,x-vga=on
-device vfio-pci,host=06:00.1,bus=root.1,addr=00.1 ",
it goes through full seabios routine, yet on vnc (note no -vga cirrus, but...).

did you mean to use "-vga none"?

[s@localhost ~]$ man qemu-system-x86_64 | grep "cirrus" -4

       -vga type
           Select type of VGA card to emulate. Valid values for type are

           cirrus
               Cirrus Logic GD5446 Video card. All Windows versions starting from Windows 95 should recognize and use this graphic card. For optimal performances, use 16 bit color depth in the guest and the host OS.  (This one is the default)

           std Standard VGA card with Bochs VBE extensions.  If your guest OS supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want to use high resolution modes (>= 1280x1024x16) then you should use this option.

[s@localhost ~]$

Offline

#1890 2014-05-30 10:26:35

gutleib
Member
Registered: 2014-05-29
Posts: 5

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

> sinny

Dang! forgot it's default!

With vga none, vnc and display are off.

Offline

#1891 2014-05-30 12:16:26

rabcor
Banned
Registered: 2013-02-09
Posts: 500

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

I'm having a problem applying the ACS Override patch in Gentoo, can anyone help me figure out what's up?

I copied it from the page starting at:

----
Documentation/kernel-parameters.txt |   10 +++
...

This is the output I get from portage when I emerge the gentoo-sources (that's gentoo's default kernel):

***** ACS_Override.patch *****
PWD: /var/tmp/portage/sys-kernel/gentoo-sources-3.14.4/work/linux-3.14.4-gentoo

==============================

PATCH COMMAND:  patch -p0 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches/sys-kernel/gentoo-sources/ACS_Override.patch'

==============================
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|---
| Documentation/kernel-parameters.txt |   10 +++
| drivers/pci/quirks.c                |  102 +++++++++++++++++++++++++++++++++++
| 2 files changed, 112 insertions(+)
|diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
|index 47bb23c..a60e6ad 100644
|--- a/Documentation/kernel-parameters.txt
|+++ b/Documentation/kernel-parameters.txt
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 30
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
|index 0369fb6..c7609f6 100644
|--- a/drivers/pci/quirks.c
|+++ b/drivers/pci/quirks.c
--------------------------
No file to patch.  Skipping patch.
patch unexpectedly ends in middle of line
1 out of 1 hunk ignored

patch program exited with status 1

I have no idea what to do here, I'm a total noob when it comes to "patch" and "diff". I know it fails at line 9 and 30 (i.e. the "@@" lines in the patch) but how to fix it I have no clue. The Nvidia Proprietary driver patch applied just fine though.

The lines it's failing at are these:

9: @@ -2349,6 +2349,16 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
30: @@ -3292,11 +3292,113 @@ struct pci_dev *pci_get_dma_source(struct pci_dev *dev)

Offline

#1892 2014-05-30 14:24:29

mbroemme
Member
From: Cologne
Registered: 2014-02-05
Posts: 40

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

rabcor wrote:
PATCH COMMAND:  patch -p0 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches/sys-kernel/gentoo-sources/ACS_Override.patch'

I have no idea what to do here, I'm a total noob when it comes to "patch" and "diff". I know it fails at line 9 and 30 (i.e. the "@@" lines in the patch) but how to fix it I have no clue. The Nvidia Proprietary driver patch applied just fine though.

Try it with -p1

Offline

#1893 2014-05-30 15:17:42

cdrjameson
Member
Registered: 2013-05-19
Posts: 46

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

sinny wrote:

i can confirm the following setupd working:
MB: asrock z87 pro4
CPU: intel i7 4770
OS: fedora 20 x86_64 (with additional repositories: ...)
kernel: kernel-3.15.0-0.rc5.git2.8.vanilla.mainline.knurd.1.fc20.x86_64.rpm
host GPU: integrated (intel i7 4770)
guest GPU0: radeon hd 6450 (Gigabyte GV-R645-1GI)

Well that is good to know, thanks for the info. Apart from the OS the only thing massively different is my knowledge!

I am attempting to follow #1 and have a few (very basic) questions, suffice to say it is not working yet.

Question 1 All I did to get the linux-mainline was:

yaourt linux-mainline

followed by

mkinitcpio -p linux-mainline

should I have done anything else?

Question 2 I copied the vfio-bind script and used it to bind my gpu which was

vfio-bind 0000:01:00.0 0000:01:00.1

but after I start the systemd service I cannot see any output from the next command:

[cdrjameson@experiment ~]$ cat /etc/vfio-pci.cfg
cat: /etc/vfio-pci.cfg: No such file or directory

I called my systemd service file vfiobind.service and there didn't look to be anything in the file that was specific or needed changing per user. Did I miss something?

Question 3 The next step: to test if working fails. I changed the qemu test invocation nbhs uses for my processor (4 cores instead of 6), gave more memory and changed the address of the vfio-pci.

qemu-system-x86_64 -enable-kvm -M q35 -m 4096 -cpu host -smp 4,sockets=1,cores=4,threads=1 
-bios /usr/share/qemu/bios.bin -vga none 
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 
-device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on 
-device vfio-pci,host=01:00.1,bus=root.1,addr=00.1

Are these sane defaults...?
The errors read:

qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: error no iommu_group for device
qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device initialization failed.
qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device 'vfio-pci' could not be initialized

After I create the blank windows.img file I am able to start qemu by a very simple

 qemu-system-x86_64 windows.img

which then opens the VM, proving qemu is working...
I dont want to/cant go any further without fixing these fundamental issues.

Last edited by cdrjameson (2014-05-30 15:24:09)

Offline

#1894 2014-05-30 15:23:30

apex8
Member
Registered: 2014-03-29
Posts: 60

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

Hey,
in #1 there are mentioned two links for linux-mainline. Use "linux-mainline.tar.gz (3.14.1 includes acs override patch, i935 vga arbiter fixes, debug registers patch)" right unter "Ingredients".
You need to build this kernel for yourself, but there are all required patches already included. If you have all required packages for building an arch package yourself installed, you just need to unzip this file, cd into the new directory and run "makepkg".

If you don't have the necessary packages installed, read this

Once the kernel is build you will find a package file in your build directory. You can install the kernel via

yaourt -U <package filename> 

Last edited by apex8 (2014-05-30 15:25:58)

Offline

#1895 2014-05-30 15:31:09

cdrjameson
Member
Registered: 2013-05-19
Posts: 46

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

apex8 wrote:

Hey,
in #1 there are mentioned two links for linux-mainline. Use "linux-mainline.tar.gz

That link is broken for me, I get to the download page but cant download it... so I used the second link which is the AUR package. Is there another location for the first link?

Offline

#1896 2014-05-30 15:33:27

apex8
Member
Registered: 2014-03-29
Posts: 60

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

I tested it. The links isn't broken. Click on it and then on slow download.

Offline

#1897 2014-05-30 15:38:11

cdrjameson
Member
Registered: 2013-05-19
Posts: 46

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

I've tried on two computers and after selecting slow download I just get 'invalid download link'. Using firefox and chromium. Did the link actually take you to the download page?

Offline

#1898 2014-05-30 15:41:37

apex8
Member
Registered: 2014-03-29
Posts: 60

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

Yes, it takes you to a download page. Could you try this link?

Offline

#1899 2014-05-30 15:47:09

shawly
Member
Registered: 2014-05-24
Posts: 22

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

Hey Guys,

I finally managed to get my VM started and installed Windows 8.1, Passthrough works since I get the output from my GTX 770 and the device-manager also says that it uses a NVIDIA GTX 770.
But I got two problems, first, I can't install the Nvidia drivers, because it says the Windows version is incompatible and no compatible graphics hardware was found.. The driver IS for Win8.1 x64 which IS installed and like I said, the device-manager in Windows says, that there is a GTX 770 and it has NO yellow exclamation mark or something else, so I guess it's working but yeah, I have no idea how to fix this problem..

Second problem, I can't get the EFI-BIOS to work (OVMF).. I installed the version from the repository with pacman but I only get a black screen and nothing happens when I start the VM, then I tried to compile the AUR version of ovmf-svn but it doesn't want to compile so I gave up.. Tbh I don't really need EFI, but I want it so the Windows Bootlogo is in the full resolution, which is way sexier and I can use the UEFI features like secure boot. I tried all parameters like -boot -pflash and -L, it finds and uses the OVMF-Bios, but as I said, when I start the VM I only get a black screen and it doesn't boot anything.

I hope someone atleast can give me an answer to the problem with the nvidia gpu drivers.. everything works fine, except I can't install them.


And I got another little offtopic question, is there anything BESIDES Synergy to seamlessly integrate the VM with my desktop?
I don't want to pass my keyboard to my VM directly, because when there are problems and the VM is stuck for example, I'm pretty screwed. big_smile

Last edited by shawly (2014-05-30 15:49:59)

Offline

#1900 2014-05-30 15:53:43

apex8
Member
Registered: 2014-03-29
Posts: 60

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

@shawly regarding synergy: It should be the normal case, that your VM works flawlessly. Whenever there is a serious problem, e.g. an bsod, you can go to the qemu console and enter system_reset; the vm will reboot. If this doesn't solve the problem you could prepare a second qemu script, which runs the vm in a window where you are able to use your keyboad and mouse.
This strategy works good enough for me, because like I said: the normal case is that the VM runs without any problems.

Offline

Board footer

Powered by FluxBB