[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] can't passthrough video card



On 10/27/2013 07:16 AM, bob evans wrote:
Hi, I have been trying to find help with a problem I am having passing a video 
card to a Xen domu. I do have VT-d enabled in BIOS and I can pass some PCI 
cards to the domu, but trying to pass my video card results in an error. My 
dom0 is Kubuntu 3.10, the video card I am trying to pass is a Radeon 7970 ghz. 
I am using Xen version 4.3.0(preserve-AS), my motherboard is an Asrock Extreme4 
z87, and my CPU is an Intel i7-4771.

When I tried to run my HVM for the first time I had the error: "Error: pci: PCI 
Backend  and pci-stub don't own device 0000:02:00.0"

I found that I had to unbind my PCI devices from the Linux kernel drivers and 
bind them to pciback. I found these instructions for doing this:

echo 0000:08:00.0 > /sys/bus/pci/devices/0000:08:00.0/driver/unbind
echo 0000:08:00.0 > /sys/bus/pci/drivers/pciback/new_slot
echo 0000:08:00.0 > /sys/bus/pci/drivers/pciback/bind

These commands worked great for PCI USB controller, I was able to passthrough 
without any problems. When it was time to pass my video card I ran into 
problems. Here is the relevant output of lspci -k

You need to do a few things:

1) Put something like this in your /etc/modprobe.d/xen-pciback.conf (or equivalent on your distro)

options xen-pciback hide=(08:00.0)(08:00.1)

where 08:00.0 and 08:00.1 are PCI IDs of the device in question.
Alternatively, you may need to do the equivalent of this on your kernel boot line if your xen-pciback module is built into the kernel.

If any of the devices were bound to a different driver first, for those devices it is easier to do something like:

xl pci-assignable-remove 0000:08.00.0

instead of what you did above.

02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
Tahiti XT [Radeon HD 7970/R9 280X]
         Subsystem: Hightech Information System Ltd. Tahiti XT2 [Radeon HD 7970 
GHz Edition]
         Kernel driver in use: radeon
02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI 
Audio [Radeon HD 7970 Series]
         Subsystem: Hightech Information System Ltd. Device aaa0
         Kernel driver in use: snd_hda_intel

I was able to unbind the VGA controller with this command: echo -n 0000:02:00.0 
> /sys/bus/pci/drivers/radeon/unbind
I couldn't get it to work with this command: echo 0000:02:00.0 > 
/sys/bus/pci/devices/0000:02:00.0/driver/unbind

This is a problem - if the radeon driver has already initialized the card, it's not going to work. ATI cards' BIOS and drivers aren't good enough to handle this situation properly.

This is ok though, because lspci -k now shows:

02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
Tahiti XT [Radeon HD 7970/R9 280X]
         Subsystem: Hightech Information System Ltd. Tahiti XT2 [Radeon HD 7970 
GHz Edition]
02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti XT HDMI 
Audio [Radeon HD 7970 Series]
         Subsystem: Hightech Information System Ltd. Device aaa0
         Kernel driver in use: snd_hda_intel

Now I run into the issue I am currently stuck at. When I issue the commands

echo 0000:02:00.0 > /sys/bus/pci/drivers/pciback/new_slot
echo 0000:02:00.0 > /sys/bus/pci/drivers/pciback/bind

The first command works fine, but the second results in an error: -bash: echo: 
write error: No such device

Use xl command as described above. It is simpler and less error prone.

Gordan

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.