public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "André Weidemann" <Andre.Weidemann@web.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	seabios@seabios.org, kvm@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: Graphics card pass-through working with two pass pci-initialization
Date: Fri, 27 May 2011 13:09:46 +0200	[thread overview]
Message-ID: <4DDF867A.9040700@siemens.com> (raw)
In-Reply-To: <4DDF3768.5010002@web.de>

On 2011-05-27 07:32, André Weidemann wrote:
> Hi Gerd,
> I managed to pass through a graphics card to a Windows7 VM using your
> kraxel.q35 seabios branch
> (http://www.kraxel.org/cgit/seabios/log/?h=kraxel.q35).
> 
> Here is my setup:
> Intel DX58SO
> Core i7 920
> Radeon HD 6950
> Kernel 2.6.35.7
> qemu-kvm git pull from May 26th
> 
> The gfx card is working well on the desktop even with Aero turned on.
> I tried various 3D Games which worked good (some were a bit choppy ;-)
> though).

Cool!

> 
> There were 2 games that made Windows crash.
> What is the way to debug what went wrong here?

Likely that's very hard to analyze, specifically as pass-through may
also widen pre-existing race windows that may reveal real bugs in the
drivers. However, you could start with tracing the host kvm events
around the crash using ftrace / trace-cmd. With a lot of luck, the
traces may contain some suspicious access patterns.

> 
> One thing that is not working is the pass-through of a second device, a
> sound card in my case. As soon as I pass 2 devices to the VM, Windows
> does not boot anymore.
> If I continue and remove the second device from the command line the VM
> does not boot anymore with the passed through gfx card. The graphics
> card drivers crashes Windows, with the error message of not being able
> to reset the graphics card. A reboot of the host cures this problem.

Does it make a difference when you preserve the function address by
specifying -device pci-assign,host=03:00.0,addr=XX.0 and -device
pci-assign,host=03:00.1,addr=XX.1 (where XX is some free slot number in
the guest)?

> 
> These are the command lines I used to start the VM:
> 
> echo "1002 6719" > /sys/bus/pci/drivers/pci-stub/new_id
> echo 0000:03:00.0 > /sys/bus/pci/devices/0000\:03\:00.0/driver/unbind
> echo 0000:03:00.0 > /sys/bus/pci/drivers/pci-stub/bind
> echo "1002 6719" > /sys/bus/pci/drivers/pci-stub/remove_id
> 
> qemu-system-x86_64 \
> -boot order=cd -cpu host -vnc 192.168.3.1:0 -k de \
> -smp 2,cores=2,sockets=1 \
> -drive file=${IMAGE},if=ide,index=0,cache=writeback -m 4096 \
> -drive file=/dev/sda3,if=ide,index=1,cache=none \ -drive
> file=/dev/sdb3,if=ide,index=2,cache=none \
> -drive file=/dev/cdrom,if=ide,index=3,media=cdrom,cache=none \
> -device pci-assign,host=03:00.0 \
> -net nic,model=e1000,macaddr=DE:AD:BE:EF:42:42 \
> -net tap,script=/usr/local/bin/qemu-ifup \
> -usb -usbdevice host:045e:00f9 \
> -monitor telnet:192.168.3.1:11111,server,nowait,nodelay
> 
> Thank you very much for your work.
> 

I've started to create a wiki page to save success stories like this one
and collect the open issues, see
http://www.linux-kvm.org/wiki/index.php?title=VGA_device_assignment.
Everyone is welcome to fix, update, or otherwise enhance it.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2011-05-27 11:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1306227933-4880-1-git-send-email-kraxel@redhat.com>
     [not found] ` <1306227933-4880-2-git-send-email-kraxel@redhat.com>
     [not found]   ` <20110525023406.GG8517@valinux.co.jp>
     [not found]     ` <20110525043353.GH8517@valinux.co.jp>
     [not found]       ` <4DDCC7A5.60706@redhat.com>
     [not found]         ` <4DDCF9ED.5050208@redhat.com>
     [not found]           ` <4DDDDA8D.6080807@web.de>
     [not found]             ` <4DDDF62C.2010603@redhat.com>
2011-05-27  5:32               ` Graphics card pass-through working with two pass pci-initialization André Weidemann
2011-05-27 11:09                 ` Jan Kiszka [this message]
2011-05-27 19:40                   ` André Weidemann
2011-05-27 19:50                     ` André Weidemann
2011-05-26 21:19                       ` André Weidemann
2011-05-28  8:18                         ` Jan Kiszka
2010-05-28 18:49                           ` André Weidemann
2011-05-29 15:22                             ` Jan Kiszka
2011-05-29 15:33                               ` Avi Kivity
2011-05-29 19:30                               ` André Weidemann
2011-05-29 20:51                                 ` Jan Kiszka
2011-05-30  7:34                     ` Gerd Hoffmann
2011-05-30  9:58                       ` Gerd Hoffmann
2011-05-31  2:29                       ` [SeaBIOS] " Isaku Yamahata
2011-06-01  7:30                         ` Gerd Hoffmann
2011-06-01  9:56                           ` Alexander Graf
2011-06-01 10:20                             ` Rudolf Marek
2011-06-01 13:47                               ` Gerd Hoffmann
2011-06-01 14:40                                 ` Rudolf Marek
2011-06-01 22:15                                   ` Kevin O'Connor
2011-06-01 22:22                                     ` Yushu Yao
2011-06-01 11:13                             ` Avi Kivity
2011-06-01 11:16                               ` [SeaBIOS] " Alexander Graf
2011-06-01 11:18                                 ` Avi Kivity
2011-06-01 14:20                           ` [SeaBIOS] " Isaku Yamahata
2011-06-01 14:31                             ` Jan Kiszka
2011-06-01 14:36                               ` Alex Williamson
2011-06-01 22:34                             ` Kevin O'Connor
2011-06-06  6:30                               ` Gerd Hoffmann
2011-06-07  8:05                                 ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DDF867A.9040700@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=Andre.Weidemann@web.de \
    --cc=alex.williamson@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox