Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nVidia binary driver under Xen
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 551
Location: USA

PostPosted: Sun Jun 22, 2008 7:13 am    Post subject: nVidia binary driver under Xen Reply with quote

I recently had a need to get the binary nVidia drivers running under a Xen dom0 host. There are a number of discussions on this topic, but all of them seem to be for much older versions of Xen, the Linux kernel, and/or the nVidia driver package (such as https://forums.gentoo.org/viewtopic.html?t=619991). I couldn't make any of these methods work with current versions, so I messed around with it until I finally hit on something that did work. I documented the process on my personal website, but I figured I'd post here as well since it's rather Gentoo-specific.

I wrote this guide using the following component versions:
  • xen-3.2.1
  • xen-sources-2.6.21
  • gentoo-sources-2.6.24-r8 (for building the libraries)
  • nvidia-drivers-173.14.09

I also suggest uninstalling any existing binary nVidia drivers before beggining to prevent any possible version conflicts.

Here's the step-by-step guide:
  • Run uname -r to verify the version of your currently running Xen-enabled kernel; eg., mine's 2.6.21-xen
  • verify that you have both Xen and non-Xen kernels installed: cd /usr/src/ && ls -l; eg., I have both linux-2.6.21-xen and linux-2.6.24-gentoo-r8
  • create a symlink to the non-Xen kernel: ln -sfn linux-2.6.24-gentoo-r8 linux
  • install the nVidia-drivers package, which includes the necessary X librarys: emerge -av nvidia-drivers
    this will also install the actual driver, but it'll be built and installed for the non-Xen kernel, not your current Xen-enabled kernel
  • determine the specific name and version of the nVidia driver package that was just installed; this can be found by examining the output of emerge -f nvidia-drivers (look for the NVIDIA-Linux-* line)
  • extract the contents of the nVidia driver package: bash /usr/portage/distfiles/NVIDIA-Linux-x86_64-173.14.09-pkg2.run -a -x
  • change to the driver source code directory: cd NVIDIA-Linux-x86_64-173.14.09-pkg2/usr/src/nv/
  • build the driver for the currently-running Xen-enabled kernel: IGNORE_XEN_PRESENCE=y make SYSSRC=/lib/modules/`uname -r`/build module
  • assuming there are no build errors (nvidia.ko should exist), install the driver:
    mkdir /lib/modules/`uname -r`/video
    cp -i nvidia.ko /lib/modules/`uname -r`/video/
    depmod -a
  • if necessary, log out of X, then load the driver: modprobe nvidia
  • if necessary, reconfigure xorg.conf to use the nvidia binary driver rather than the nv driver
  • test that X will now load properly with startx
  • if approprate, start (or restart) the display manager with /etc/init.d/xdm start

Assuming all went well, you should not have a fully functional and accelerated desktop environment, even under a Xen dom0 host. W00t.
_________________
http://www.legroom.net/


Last edited by nitro322 on Thu Jul 17, 2008 11:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
vsnine
n00b
n00b


Joined: 04 Jul 2008
Posts: 3
Location: Windsor, Ontario

PostPosted: Tue Jul 15, 2008 12:33 am    Post subject: Reply with quote

I agree that this method works.

I had to make one small change in my setup. I use the method detailed here: http://www.gentoo-wiki.com/HOWTO_Xen_and_Gentoo, specifically the portion about using separate dom0 and domU kernels. I had to copy the dom0 config into the main kernel directory, run make oldconfig, and then i ran make && make modules && make modules_install. Only then would the nVidia driver compile correctly.

But all in all, this is alot more painless than I thought it was going to be. Perhaps we should move this into an article on Gentoo Wiki?
Back to top
View user's profile Send private message
behd
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 153

PostPosted: Fri Aug 01, 2008 9:12 am    Post subject: Reply with quote

set IGNORE_XEN_PRESENCE=y

was enough for me... didn't had to mess more with system...
dom0: 2.6.21-xen
xen: 3.1
Back to top
View user's profile Send private message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 551
Location: USA

PostPosted: Tue Aug 05, 2008 1:49 am    Post subject: Reply with quote

behd wrote:
set IGNORE_XEN_PRESENCE=y
was enough for me... didn't had to mess more with system...

I sure wish it had been enough for me. :-) I tried that multiple times with multiple versions of the driver, but the ebuild would always fail very early on.
_________________
http://www.legroom.net/
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2161
Location: The Peanut Gallery

PostPosted: Mon Aug 11, 2008 6:53 am    Post subject: Reply with quote

Nice post nitro322 I don't have any use for it but I know some bods who might.. ;-)
Back to top
View user's profile Send private message
xmaes
n00b
n00b


Joined: 13 Aug 2008
Posts: 69
Location: Madrid

PostPosted: Wed Aug 13, 2008 12:31 pm    Post subject: Reply with quote

Hello,

Works for me as well.
The only problem is that when i log out from gnome it turn off the monitor. there is no way to turn it back.
It doesnt happen with the non-xen kernel.

Any sugestion is welcome :-)

Thank you,

Xavier
Back to top
View user's profile Send private message
idella4
Veteran
Veteran


Joined: 09 Jun 2006
Posts: 1587
Location: Australia, Perth

PostPosted: Thu Aug 14, 2008 3:32 am    Post subject: Reply with quote

I finally got it to work, but your initial instructions needed correcting.

Don't use the form 'uname -r' int the dir path. Use the name itself, such as 2.6.21-xen. Using 'uname -r' failed in both lines and needed replacing in both lines.
_________________
idella4@aus
Back to top
View user's profile Send private message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 551
Location: USA

PostPosted: Mon Sep 08, 2008 2:45 pm    Post subject: Reply with quote

idella4 wrote:
Don't use the form 'uname -r' int the dir path. Use the name itself, such as 2.6.21-xen. Using 'uname -r' failed in both lines and needed replacing in both lines.

Using the explicit version string will certainly work, but I used uname to make it more generic. Just copy and paste.

'uname -r', btw, is incorrect and will definitely fail. It should be `uname -r`. Notice the backticks - they are quite important. :-)
_________________
http://www.legroom.net/
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2161
Location: The Peanut Gallery

PostPosted: Tue Sep 09, 2008 1:57 am    Post subject: Reply with quote

nitro322 wrote:
'uname -r', btw, is incorrect and will definitely fail. It should be `uname -r`. Notice the backticks - they are quite important. :-)

Use $(uname -r) then, it's a lot easier to spot, and is in Posix.
Back to top
View user's profile Send private message
rem7
n00b
n00b


Joined: 14 Oct 2005
Posts: 14
Location: USA, Los Angeles CA

PostPosted: Mon Nov 10, 2008 11:23 pm    Post subject: Reply with quote

nice, thanks a lot, I spent all morning trying to figure this out.
_________________
- rem7 -
Back to top
View user's profile Send private message
ramsesxi
n00b
n00b


Joined: 22 Nov 2008
Posts: 24
Location: Stockholm

PostPosted: Sun Nov 23, 2008 3:05 am    Post subject: Reply with quote

xmaes wrote:
Hello,

Works for me as well.
The only problem is that when i log out from gnome it turn off the monitor. there is no way to turn it back.
It does not happen with the non-xen kernel.

Any sugestion is welcome :-)

Thank you,

Xavier


It turns black because nvidia-drivers uses the fbdevice as frontend for the TTY:s. Unfortunately nvidia-drivers does not speak well with vesafb and the monitor turns black (but the tty is still active)
I run 2.6.27-r2 xen and have compiled it with uvesafb, wich works well with nvidia-drivers. Now the the other TTY:s is not black anymore.

http://dev.gentoo.org/~spock/projects/uvesafb/

Hope it helps, because it is really annoying when you can't see the monitor when you shutdown.

/Ramses XI
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum