You are not logged in.
Did anyone passthrough gpu successfully on a laptop?
What GPU do you have in your notebook?
Offline
ctwdoecoss wrote:Did anyone passthrough gpu successfully on a laptop?
What GPU do you have in your notebook?
I. MSI GP70 2PE
CPU: I5-4200H
Chipset: HM86
GPU: NVIDIA GT840M w/ 2G GDDR3 and Intel HD 4600
Video Output: D-sub and HDMI
2. MSI GE60 2PC
CPU: I5-4200H
Chipset: HM87
GPU: NVIDIA GTX850M w/ 2G GDDR5 and Intel HD 4600
Video Output: D-sub and HDMI
I would buy one of these two laptop.
I know it may be difficult, for the gpu isn't quadro series.
Offline
Well almost got it working like i want but not there yet.
Nvidia GTX760 is the main GPU running arch latest mainline kernel.
With a Radeon 4870 its all working fine.
With a GTX 560ti 448 I managed to get it working once but I can't restart the VM. That gives me an error on the VGA rom (using a rom file doesn't help) or the screen just stays in standby mode.
I tried patching the nvidia drivers as mentioned earlier but that just makes the nvidia installer fail with a build error on nv.c (using patch -p0 < patchfile)
I'm quite sure its related to the nvidia driver. I have to stub the PCI id's to make sure the driver doesn't pick up the second card. I'll keep on trying to get it to work.
If all fails I'll just have to buy me a reasonable AMD card to run the guest on.
PC Spec:
Mainboard: Asus P8H67-V
CPU: Intel Core I5 2300
Mem: 8GB Geil DDR3
GPU 1: Asus Nvidia GTX760
GPU 2: Gainward Nvidia GTX560ti 448 / HIS IceQ+ 4870
Vout: HDMI on GTX760 / VGA on GTX560 or 4870
Vout2: VGA on GTX760
Offline
qemu-system-x86_64 -enable-kvm -M q35 -m 4096 -cpu host -smp 6,sockets=1,cores=2,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 -drive file=/home/rishub/windows.img,id=disk,format=raw -device ide-hd,drive=disk -drive file=/home/rishub/Downloads/X17-24395.iso,id=isocd -device ide-cd,bus=ide.1,drive=isocd
Puts me into qemu compat monitor console,
How do I get it to run the ISO?
Offline
Hi,
I followed the given tutorial step by step.
1) I compiled a new custom kernel
(3.15.6 +radeon_load_vbios_from_file.patch,
+i915_315.patch,
+override_for_missing_acs_capabilities.patch)
2) installed the new kernel
3) added new parameter to grub commandline:
GRUB_CMDLINE_LINUX_DEFAULT="iommu=1 intel_iommu=on vm.ignore_msrs=1 nomodeset pci-stub.ids=1002:9540,1002:aa38 vfio_iommu_type1.allow_unsafe_interrupts=1 quiet"
until here everthing looks good:
[ 0.432038] pci-stub: add 1002:9540 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[ 0.432043] pci-stub 0000:01:00.0: claimed by stub
[ 0.432045] pci-stub: add 1002:AA38 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[ 0.432049] pci-stub 0000:01:00.1: claimed by stub
4) used the given script for vfio-bind
vfio-bind 0000:01:00.0
vfio-bind 0000:01:00.1
5) tryied to start a test VM buy executing this command:
qemu-system-x86_64 -enable-kvm -M q35 -m 1024 -cpu host \
-smp 6,sockets=1,cores=2,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.0
but this gives me the following error:
qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: error, group 1 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver.
qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: failed to get group 1
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
Anyone got an idea whats wrong with my config?
Here are all my connected PCIe-devices:
00:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller (rev 06)
00:01.1 PCI bridge: Intel Corporation Haswell PCI Express x8 Controller (rev 06)
00:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host Controller (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
00:1a.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller #2 (rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #1 (rev d4)
00:1c.1 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #2 (rev d4)
00:1d.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point 6-port SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point SMBus Controller (rev 04)
00:1f.6 Signal processing controller: Intel Corporation Lynx Point Thermal Management Controller (rev 04)
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI RV710 [Radeon HD 4550]
01:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI RV710/730 HDMI Audio [Radeon HD 4000 series]
02:00.0 SATA controller: ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev 01)
03:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 03)
04:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 30)
05:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
Thanks in advance!
Offline
According to the error message you got, you need to ensure that your devices have their own cgroup. This is done by the acs override patch, but its not enough just to apply that patch, you also need to enable it.
append
pcie_acs_override=downstream
to your boot parameters and lets see what happens.
Offline
thx apex8. This boot flag was missing.
now i get this:
qemu-system-x86_64: -device vfio-pci,host=01:00.1,bus=root.1,addr=00.0: PCI: slot 0 function 0 not available for vfio-pci, in use by vfio-pci
qemu-system-x86_64: -device vfio-pci,host=01:00.1,bus=root.1,addr=00.0: Device initialization failed.
qemu-system-x86_64: -device vfio-pci,host=01:00.1,bus=root.1,addr=00.0: Device 'vfio-pci' could not be initialized
Offline
-device vfio-pci,host=01:00.1,bus=root.1,addr=00.0 <<<<<<<<<<<<<<<<<<<<<<<<<<< wrong address it should be 00.1
Offline
atleast the VM starts now.
black screen on the terminal, no signal on my hdmi port of the passed through card :-(
QEMU doesnt give me any error messages. Any tips on how I can proceed the debugging? I've read that some cards need to load an "external" bios-rom. Is this worth a try?
Offline
Can you try what happens when you adjust your script from above with
-vga std \
instead of
-vga none\
?
Offline
Hi guys,
I tried to setup the passthrough according to the OP - unfortunally I have not been able to get a signal from my GPU yet.
I am using the patched kernel from the OP with qemu 2.0.0-4 and seabios 1.7.5-2 from the official repo.
I also enabled the kernel parameters needed for Intel graphics
root@Ununhaswellium / # [b]uname -a[/b]
Linux Ununhaswellium 3.15.1-1-mainline #1 SMP PREEMPT Tue Jul 15 22:24:38 CEST 2014 x86_64 GNU/Linux
root@Ununhaswellium / # [b]cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-linux-mainline root=UUID=6209b873-4a4f-4265-bee6-5b4596d818e0 rw quiet nmi_watchdog=0 intel_iommu=on i915.enable_hd_vgaarb=1
1 root@Ununhaswellium / # lsmod | grep kvm
kvm_intel 135528 0
kvm 408519 1 kvm_intel
The hardware ofc supports VT-d:
Intel i7-4771 => IGP for the host
Gigabyte Z87-UD4H
AMD Radeon HD 7950 => for the guest
root@Ununhaswellium / # cat /etc/modprobe.d/blacklist.conf
blacklist radeon
root@Ununhaswellium / # lspci | grep AMD
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti PRO [Radeon HD 7950/8950 OEM / R9 280]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI Audio [Radeon HD 7970 Series]
root@Ununhaswellium / # ls /sys/kernel/iommu_groups/1/devices
0000:00:01.0@ 0000:01:00.0@ 0000:01:00.1@
root@Ununhaswellium / # cat /etc/vfio-pci.cfg
DEVICES="0000:00:01.0 0000:01:00.0 0000:01:00.1"
The IOMMU group devices are bound with the systemd service script in the OP.
Using the qemu command line from the OP shows the black QEMU window, but the HD 7950 doesn't output anything.
"-vga std" however at least shows the Seabios output in the QEMU window
root@Ununhaswellium / # dmesg | tail
[ 87.327240] VFIO - User Level meta-driver version: 0.3
[ 87.330781] pcie_pme 0000:00:01.0:pcie01: unloading service driver pcie_pme
[ 583.320937] vfio-pci 0000:01:00.0: enabling device (0000 -> 0003)
[ 583.346033] vfio_ecap_init: 0000:01:00.0 hiding ecap 0x19@0x270
[ 583.346037] vfio_ecap_init: 0000:01:00.0 hiding ecap 0x1b@0x2d0
[ 604.697892] [drm:ivb_err_int_handler] *ERROR* Pipe B FIFO underrun
I honestly don't know what I am missing here..? This was likely already discussed somethere, but I skimmed through the thread and couldn't find anything helpful...
Last edited by CharlieBra7o (2014-07-22 15:10:02)
Offline
Can you try what happens when you adjust your script from above with
-vga std \
instead of
-vga none\
?
if i use -vga std ill get videooutput on the terminal window. but the HDMI connected monitor stays black. Im using Seabios 1.7.4 is this a problem? Do I have to upgrade to 1.7.5.
Is there anything I can do to further investigate this issue?
Offline
At this point I have the same problem as you. I had a stable VM until I upgraded to kernel package 3.15.1 and later to 3.15.6. Using -vga std the VM still boots up. With version 3.14 it worked via DP signal monitor output. I'm still trying to figure out whats different now, but I do not really know where to start.
Does anyone have the archive for the 3.14 package or can I apply the recent patches to the 3.14 vanilla package?
Offline
You need to boot with i915.enable_hd_vgaarb=1 kernel parameter, this will disable dri on the host though.
This worked for me. That flag seems to be "new", at least for me If I remember correctly, the vga arbiter was always on previously.
Last edited by apex8 (2014-07-22 18:23:41)
Offline
nbhs wrote:You need to boot with i915.enable_hd_vgaarb=1 kernel parameter, this will disable dri on the host though.
This worked for me. That flag seems to be "new", at least for me If I remember correctly, the vga arbiter was always on previously.
no success with my configuration...
Any got an idea what to do next?
Offline
root@debian:/home/rishub# dmesg | tail
[ 20.391870] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 20.392637] alx 0000:03:00.0 eth0: NIC Up: 100 Mbps Full
[ 20.392845] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 20.410598] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 78.229382] vfio-pci 0000:01:00.0: enabling device (0000 -> 0003)
[ 96.022961] kvm: zapping shadow pages for mmio generation wraparound
[ 213.859145] [drm:hsw_unclaimed_reg_clear] *ERROR* Unknown unclaimed register before writing to a068
[ 215.665049] [drm:hsw_unclaimed_reg_clear] *ERROR* Unknown unclaimed register before writing to 2030
[ 318.484445] vfio-pci 0000:01:00.0: Invalid ROM contents
[ 361.228915] kvm: zapping shadow pages for mmio generation wraparound
What could invalid ROM content mean? Using VGA -std works, but -none gives me this
Update: tried a ROM file from tech power up for my graphics card (gtx580)
Now I am getting lots of
*ERROR* Unknown unclaimed...
errors in dmesg
Last edited by shrubuntu (2014-07-23 02:12:05)
Offline
apex8 wrote:nbhs wrote:You need to boot with i915.enable_hd_vgaarb=1 kernel parameter, this will disable dri on the host though.
This worked for me. That flag seems to be "new", at least for me If I remember correctly, the vga arbiter was always on previously.
no success with my configuration...
Any got an idea what to do next?
Hard to say where to start, but did you check your hardware for compatibility? Theres an linked Gdrive table document here, where you could look up your configuration.
Offline
Hello,
i just registered to the forum only for this topic which is, so far, the best resource on the web regarding this matter!
Thanks for the good job guys, i was able to successfully launch my VM following this topic.
I have only 2 problems i am not able to solve, being myself on Debian maybe i should tune better the workarounds, hope you can help me here.
1) KVM signature. I am on Nvidia and i am also facing the 337 driver issue (335 is fine). I would like to patch qemu but can't find the patch itself nor a good guide how to do it.
Is there anything similar on this post or the web? Despite searching i could find nothing.
2) that's the tricky one. I am on a Supermicro X10SL7-F mobo, it has an LSI SAS controller onboard which shares the same PCI group with VGA:
### Group 1 ###
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:01.1 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x8 Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 760] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)
02:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2308 PCI-Express Fusion-MPT SAS-2 (rev 05)
I would like to assing this controller and VGA to different VMs but it seems this is not possible unless i separate them in different groups.
I am not sure i can do it however, group is correclty reflecing motherboard's hw structure, here is the diagram from supermicro manual: mobo diagram. Hope you can give me some hints about.
My setup:
Intel Xeon 1245v3
16Gb ECC DDR
Supermicro x10sl7-f
MSI GeForce GTX 760 SFF
Host: Debian Sid with kernel 3.15.3 and all VM stuff activated
Guest1 : Openmediavault NAS distro with 2 HDD passd with "RDM", these are at the moment on the intel sata controller as i can't assign the LSI;
Guest2 : Win7 64Bit with working VGA passthrough;
Any help will be really appreciated.
Thanks!
Cheers.
Offline
@rg80: for point 1), you can compile qemu from git and replace debian's binary with it. For point 2), you need to patch the kernel with the ACS override patch and then boot with kernel parameter "pcie_acs_override=downstream"
Offline
@rg80: for point 1), you can compile qemu from git and replace debian's binary with it. For point 2), you need to patch the kernel with the ACS override patch and then boot with kernel parameter "pcie_acs_override=downstream"
Thanks Blimpi.
Point 1, will check it later.
Point 2, tried to apply it some months ago but got this error:
rino@Hubble:~/kernel/linux-3.15.3$ sudo patch -l -p1 <acs.patch
patching file Documentation/kernel-parameters.txt
Hunk #1 succeeded at 2554 with fuzz 1 (offset 205 lines).
patching file drivers/pci/quirks.c
Hunk #1 FAILED at 3292.
1 out of 1 hunk FAILED -- saving rejects to file drivers/pci/quirks.c.rej
patch unexpectedly ends in middle of line
that's char 3292:
+ case PCI_EXP_TYPE_RC_END:
+ if (acs_on_multifunction && dev->multifunction)
+ return 1;
It's the > in dev->multifunction.
any idea?
Thanks.
Rino.
Offline
...
Point 2, tried to apply it some months ago but got this error:
rino@Hubble:~/kernel/linux-3.15.3$ sudo patch -l -p1 <acs.patch patching file Documentation/kernel-parameters.txt Hunk #1 succeeded at 2554 with fuzz 1 (offset 205 lines). patching file drivers/pci/quirks.c Hunk #1 FAILED at 3292. 1 out of 1 hunk FAILED -- saving rejects to file drivers/pci/quirks.c.rej patch unexpectedly ends in middle of line
that's char 3292:
+ case PCI_EXP_TYPE_RC_END: + if (acs_on_multifunction && dev->multifunction) + return 1;
It's the > in dev->multifunction.
any idea?
Thanks.
Rino.
The error "patch unexpectedly ends in middle of line" might point to a broken acs.patch file. See this link for some ideas about the cause.
Offline
First, great Thanks to nbhs for this Howto, it's was very simple to understand the basics with vfio. (Searched over three Years for a possibility to passthrough my CrossfireX Cards to a VM, with Xen only one Card was possible, or even none).
Now i have passthrough my Soundcard (5.1 Setup), my 2 Graphic Cards (HD7770) (A third one (HD7750) as Primary Card for Linux), my Sata Controller (Linux boots from a Raid-Controller-Card), and different USB-Devices (Passing through the whole Bus makes Problems). The only negative thing is that my third Graphics Card only use PCIe x4 (But thats a thing i can live with).
The Performance is good, i have setup cgroups for Portage (Yes, i am a Gentoo User :-) ) and the VM, because when i compile Packages i don't care how long it takes, but when i play a game in this time, i can't live with less Performance :-) .
I use Windows 8.1 x64 Pro, Catalyst Drivers 14.7 Beta (Windows Part).
Linux has the Linux-next Kernel and the Radeon Kernel driver, and that is the main Reason i post here. Since i have seen that in this Kernel the Amd Iommu v2 is Supported (Don't know if i have one really :-) but that's not important for my Question). Since i only know that the iommu is important for Passthrough, is there any advance of using the v2 Iommu driver (If you have a v2 Iommu on your Board (That is really distracting, because the one site says it's a chip on the Board, the next one talks from the Cpu)) or is there no support for this at the moment ? (I want to change the Board in near Future because of the PCIe x8 and x4 setup and the Probs with Usb3, so i wanted to know if it is important to look that there is iommu v2 Support on it, my Processor (FX8350) should support this).
Offline
The error "patch unexpectedly ends in middle of line" might point to a broken acs.patch file. See this link for some ideas about the cause.
I think i got it, let me post again the solution found some pages behind.
If you have any problem applying original acs override patch from Alex Williamson (Hunk #1 FAILED at 3292 in my case) try downloading this package which contains a new version.
This one applies correctly on my Debian system with kernel 3.15.3
Just built a new kernel image, will test it later and update.
Edit: it works! Thanks again to this fantastic thread!
### Group 0 ###
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3 Processor DRAM Controller (rev 06)
### Group 1 ###
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
### Group 2 ###
00:01.1 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x8 Controller (rev 06)
### Group 3 ###
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
### Group 4 ###
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
### Group 5 ###
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
### Group 6 ###
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
### Group 7 ###
00:1f.0 ISA bridge: Intel Corporation C222 Series Chipset Family Server Essential SKU LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
00:1f.6 Signal processing controller: Intel Corporation 8 Series Chipset Family Thermal Management Controller (rev 05)
### Group 8 ###
01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 760] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)
### Group 9 ###
02:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2308 PCI-Express Fusion-MPT SAS-2 (rev 05)
### Group 10 ###
03:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 03)
04:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 30)
### Group 11 ###
05:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
### Group 12 ###
06:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
Last edited by rg80 (2014-07-23 22:34:00)
Offline
Well so far no luck on the NVIDIA card, I can't reboot the guest, when trying to install NVIDIA drivers in windows 8.1 guest it complains an instance is allready active which is not the case.
Does anyone know if there is an nvidia installer for the patched driver (its possible to create it with --apply-patch x.patch) so far on all my attempts I get errors on building the kernel module in nv.c.
Offline
<os>
<type arch='x86_64' machine='pc-q35-1.5'>hvm</type>
...
</os>
...
<devices>
<emulator>/usr/local/kvm/bin/qemu-system-x86_64</emulator>
...
</devices>
...
<qemu:commandline>
<qemu:arg value='-device'/>
<qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
<qemu:arg value='-device'/>
<qemu:arg value='vfio-pci,host=08:00.0,bus=root.1,addr=00.0,multifunctioIs there n=on,x-vga=on'/>
<qemu:arg value='-device'/>
<qemu:arg value='vfio-pci,host=08:00.1,bus=root.1,addr=00.1'/>
...
<qemu:arg value='-bios'/>
<qemu:arg value='/usr/src/kvm/seabios-1.7.2-patched/seabios/out/bios.bin'/>
...
</qemu:commandline>
I tried using these <qemu:*> tags in my virt-manager XML, but no matter if I define a new VM from the XML or edit an existing one, all the qemu tags vanish without an error. This means after I insert them, virsh edit/define, and then reopen the XML file all the qemu tags are gone...
I tried virt-manager and libvirt from both official repo and AUR. No difference
Am I missing some setting for qemu integration or why is this happening???
Offline