WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Exported PCI video to domU. Need another video card for

To: "Xen Users" <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] Exported PCI video to domU. Need another video card for console?
From: "Emre Erenoglu" <erenoglu@xxxxxxxxx>
Date: Tue, 13 Nov 2007 15:49:38 +0100
Delivery-date: Tue, 13 Nov 2007 06:50:25 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=dAQ75ZqIjbrNdtTRZdV+m1nyTn8xwKZMPvZoQHEOzN0=; b=BKitQ2vZu+HlhOv4ONkEZGlHSDzFz/G6W+qrlECnLAnWjDTs0Jqp2eASpOhAtKTAShhCPd8MBKnuQ2jJB/22skJuB0Qhx9ZJ37PxDn5/xkQ27V3UdgqFwryVyHbKxBGTKuuPSbG/NjT5sN0I2a7mdyWw12MJbOLz+Hjt9ssgK0U=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=V7g0VVUmuBkIbj01vehsy4qeEO48RrAap+oKIaX5ztZ17hlzk9xHfl7NR0g7UD7nt8WLqRPyK3VW9OODqpDF8++vR/fS2VRmOt4Knj7xim5Lu+7OI9/g4QSb3jbh3EdUEfxrIqhjmvtIJyiE14udTrzSIRCFUqxbf0Ql24zObdY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4739B8C0.9080309@xxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <47385A0B.8060009@xxxxxxxxxxxxx> <4739B070.4040708@xxxxxxxxxxxxx> <fe9771a80711130620i4e31d50aub35d7183576504e4@xxxxxxxxxxxxxx> <4739B8C0.9080309@xxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
OK now I understood. Good use :)

Which also means that you don't actually use the exported PCI-X card in your DomU to display user interface and play fancy Compiz and 3D games.

I tried once, nvidia module failed to load with some memory map error, didn't try after...

Emre


On Nov 13, 2007 3:46 PM, Paul Waldo <pwaldo@xxxxxxxxxxxxx> wrote:
Hi Emre,

I'm doing it to speed up graphic operations in general, and for specific programs.  pfstools generates tone-mapped images from high-dynamic-range images, but it is a slow process.  The developers are working on the ability to use the video card's GPU to do some of the complex calculations.  I can't recall what the exact numbers reported were, but my recollection is that using the GPU reduced the calculation time by at least one, if not two or three, orders of magnitude.

Another reason is that the nVidia card is PCI-X, and this particular box is the only one I have with PCI-X.  I hate to see good hardware go to waste... :-)

Paul

Emre Erenoglu wrote:
Hi Paul,

I didn't really understand why you're trying to hide your PCI card. In your NX based setup, the KDE or KDM on the remote DomU (if I understand right) does not need a physical graphic card anyway. They run without it very well. You can still use NX to have the user interface of KDE running inside a DomU. (Dom0 also)

So why are you doing it?

Best regards,

Emre


On Nov 13, 2007 3:10 PM, Paul Waldo <pwaldo@xxxxxxxxxxxxx> wrote:
Paul Waldo wrote:
Hi all,

I'm exporting my nVidia video card to one of my domUs.  It works great, but I am unable to get a console on the dom0.  I'm assuming this is because the video card is in use by the domU.  Does this make sense and, if so, can I solve this by adding abother PCI video card and connecting the monitor to that?  Thanks for helping!

Paul
Hi all,

I have receive numerous requests for how I did this, so I'm glad to give back!

I do have to provide a caveat, so don't get your hopes up yet...  My setup is that I have a 4 CPU Xeon box.  It is a big, loud, hot unit, so it is in the computer closet.  I am using a low-end machine on my desk as a fancy xterminal.  The idea is that KDE runs on the Xen box, and I interact with it via the open source version of NX from nomachine.com, running on my low-end machine.  NX allows desktop sharing as well as sound and printers to be seamlessly piped to the desktop box.  The only thing I haven't figured out is how to get peripherals attached to the desktop box (like a CF card reader or a USB DVD writer) to be automatically recognized on the Xen box...  The idea behind getting the domU to use the nVidia card is not necessarily for games and such, although that may work OK...

So anyway, here is what I did to make this all work:
The first thing to do is hide the video card from the dom0.  Here is the stanza from my GRUB menu.lst:
title           Xen 3.1 / Ubuntu 7.10, kernel 2.6.22-14-xen
root            (hd0,0)
kernel          /xen-3.1.gz dom0_mem=262144
module          /vmlinuz-2.6.22-14-xen root=/dev/mapper/hydra-root ro xencons=xvc console=xvc0 console=tty1 pciback.hide=(05:00.0)
module          /initrd.img-2.6.22-14-xen
quiet


The key here is "pciback.hide=(05:00.0)".  The number is obtained using the lspci command on dom0:
root@hydra:~# lspci|grep -i nvidia
05:00.0 VGA compatible controller: nVidia Corporation NV38GL [Quadro FX 1300] (rev a2)


So, once the changes are made to the GRUB config, reboot the machine.  Be prepared to SSH into the box, as you won't get a console!!!  The reason for this is that as far as the dom0 is concerned, the video card doesn't exist.  Actually, it may not be that dire.  IIRC, I was still able to get a console at this point, and it is the next step that prevented the console.  I know my memory, and would not rely on it too much if I were you.  Just make sure that sshd is running before you do any of this... :-)

OK, so now the video card has been unshackled from the dom0.  How do you get a domU to claim it?  Here is my domU's config file:
#
# Configuration file for the Xen instance gutsy, created
# by xen-tools 3.5 on Mon Nov  5 13:39:24 2007.
#
#
#  Kernel + memory size
#
kernel      = '/boot/vmlinuz-2.6.22-14-xen'
ramdisk     = '/boot/initrd.img-2.6.22-14-xen'
memory      = '1024'
vcpus       = '4'
extra       = 'xencons=xvc'
pci         = ['05:00.0']
#
#  Disk device(s).
#
root        = '/dev/sda1 ro'
disk        = [ 'file:/root/domains/gutsy/disk.img,sda1,w', 'file:/root/domains/gutsy/swap.img,sda2,w' ]
#
#  Hostname
#
name        = 'gutsy'
#
#  Networking
#
dhcp        = 'dhcp'
vif         = [ '' ]
#
#  Behaviour
#
> on_reboot   = 'restart'
on_crash    = 'restart'


The key line here is "pci = ['05:00.0']".  This tells the domU to claim the video card.  Reboot the domU and you should then be able to see the video card:
$ lspci
00:00.0 VGA compatible controller: nVidia Corporation NV38GL [Quadro FX 1300] (rev a2)


At this point, you can use it just like a normal machine.  Change your driver in xorg.conf from "nv" to "nvidia", "apt-get install nvidia-glx-new" to get the nVidia drivers, maybe do a reboot, and you are up and running!

As pointed out in the caveat, I DO NOT get graphical output from the video card, nor am I even able to log into the box from the console.  I am going to try putting an additional PCI video card into the machine for console logins, but I'm pretty happy with the setup.

Feel free to let me know if you have questions, and by all means let me know if you have success.  Good luck!

Paul

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users



--
Emre Erenoglu
erenoglu@xxxxxxxxx

_______________________________________________ Xen-users mailing list Xen-users@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-users




--
Emre Erenoglu
erenoglu@xxxxxxxxx
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users