LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2015, 05:59 PM   #1
marthakaber
LQ Newbie
 
Registered: Aug 2015
Posts: 2

Rep: Reputation: Disabled
KVM GPU Passthrough won't work


Hey Guys!

I have been trying to get GPU passthrough to work, but cannot seem to find out where the problem lies, since I do not get any errors.

I have primarily used these guides as sources:
http://ubuntuforums.org/showthread.php?t=2262280
https://www.pugetsystems.com/labs/ar...14-04-KVM-585/
https://bbs.archlinux.org/viewtopic.php?id=162768

Specs:
Lubuntu 14.04 with patched 3.18.0 kernel
GTX 750TI
i5 4690K (VT-d enabled)
Gigabyte Z97 D3H
TV with multiple outputs (VGA, HDMI)

The IGPU runs over VGA, whereas the GPU is connected via HDMI.
I use the IGPU for the host system, while attempting to pass the GTX 750TI through to the Guest.
When I run the script, a qemu window pops up saying "compat_monitor0 console Qemu 2.1.2 monitor - type help
When I switch to the HDMI output of the TV, to which the GPU is connected, nothing appears. However, my GPU usage ramps up to 25%, hence something must be going on.
http://s18.postimg.org/9u9hg6v61/qemu.png

When I assign one of the downloaded gpu roms in the script, the colors become fuzzy and inverted (which cannot be seen on the screen), while nothing appears on the HDMI output and the cpu usage only momentarily rises, while dropping shortly after:
http://s10.postimg.org/3rnh2vpcp/colors.png

Prepwork:
.)I compiled, patched and installed kernel 3.18.0 with ACS and i915: http://ubuntuforums.org/showthread.php?t=2262280
.)Downloaded a rom file for my GPU (GTX 750 TI): http://www.techpowerup.com/vgabios/i...Type=&memSize=
.)Upgraded Qemu to version 2.1.2 via this ppa:jacob/virtualisation
.)Installed all necessary packages as suggested by this guide: https://help.ubuntu.com/community/KVM/Installation


1.)Grub
Code:
 
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1 pcie_acs_override=downstream i915.enable_hd_vgaarb=1"
GRUB_CMDLINE_LINUX=""
2.)Nvidia IDs
Code:
 
lspci -nn | grep NVIDIA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380] (rev a2)
01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fbc] (rev a1)
3.)/etc/initramfs-tools/modules
Code:
 
pci_stub ids=10de:1380,10de:0fbc
4.)/etc/vfio-pci.cfg
Code:
 
0000:01:00.0
0000:01:00.1
5.)Here my script (Here without a rom file assigned, this can be seen in the screen above)
Code:
 
#!/bin/bash

configfile=/etc/vfio-pci.cfg

vfiobind() {
    dev="$1"
        vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
        device=$(cat /sys/bus/pci/devices/$dev/device)
        if [ -e /sys/bus/pci/devices/$dev/driver ]; then
                echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
        fi
        echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
   
}

modprobe vfio-pci

cat $configfile | while read line;do
    echo $line | grep ^# >/dev/null 2>&1 && continue
        vfiobind $line
done

sudo qemu-system-x86_64 -enable-kvm -M q35 -m 4096 -cpu host,kvm=off \
-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 \
-drive file=/home/jackson/windows.img,id=disk,format=raw -device ide-hd,bus=ide.0,drive=disk \
-drive file=/home/jackson/Downloads/windows.iso,id=isocd -device ide-cd,bus=ide.1,drive=isocd \
-boot menu=on

exit 0
Please help me find out what's wrong.

Thank you!



-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/...tures_and_Code [jwr] --
 
Old 08-04-2015, 06:08 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Slackware/Knoppix
Posts: 1,789
Blog Entries: 14

Rep: Reputation: 279Reputation: 279Reputation: 279
Just a quick suggestion: have you tried following http://vfio.blogspot.com with or without OVMF? It is more up to date. Which Windows are you trying to run? What happens if you try the example in the arch thread, which I've given below?

(For testing I'd separate the vfio bind step of your script from the qemu command step.)

Code:
qemu-system-x86_64 -enable-kvm -m 1024 -cpu host,kvm=off \
-smp 4,sockets=1,cores=4,threads=1 \
-device vfio-pci,host=01:00.0,x-vga=on -device vfio-pci,host=01:00.1 \
-vga none
Or the corresponding OVMF example immediately below it?

I presume that you are manually switching the TV inputs from VGA to HDMI with a remote.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu/kvm: permissions for pci-passthrough insectiod Linux - Virtualization and Cloud 1 08-20-2014 03:33 PM
Chipset support for PCI Passthrough in KVM rajivdp Linux - Virtualization and Cloud 0 06-14-2011 03:02 AM
USB Passthrough Problem with KVM/QEMU on FC12 wdsnyc Linux - Virtualization and Cloud 1 02-23-2010 10:49 PM
PCI Passthrough with KVM fails martdj Linux - Virtualization and Cloud 5 02-01-2010 09:01 AM
problem with kvm and pci passthrough with two devices vegatux Linux - General 0 09-24-2009 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration