Introduction

Debian lenny/testing is currently (11/09/2008) shipping with kernels which include some sort of limited Xen support. The installer program provided with nVidia's official driver does not like this and refuses to compile the driver. The same applies to nVidia's current (11/09/2008) beta driver.

There are a lot of pages referring to fixing this problem 'the Debian way', but I found no specifics. The Debian wiki contains some information about how to install the nVidia driver the Debian Way, but makes no reference to Xen or nVidia installer's error message about Xen, so I did not try it.

There are also a lot of pages out there describing how to fix this in other ways, but, to me at least, none of these seemed 100% complete; hence the procedure below.

(For info: I was using kernel 2.6.26-1-686-bigmem, gcc package gcc-4.1, nvidia download NVIDIA-Linux-x86-173.14.12-pkg1.run, bits of this procedure are copied from the links mentioned at the bottom of the page.)

Procedure

  1. Download the official nVidia driver from http://www.nvidia.com.

  2. Su to root with:

    su - 
  3. Go to the directory containing the modules for the currently running kernel by running:

    cd /lib/modules/`uname -r` 
  4. In all the modules and associated files change the text the presence of which the nVidia install will use to determine that the kernel has Xen support to something else so that it will no longer think the kernel has Xen support by running:

    grep CONFIG_XEN . -Rl | xargs -i sed -i -e 's/CONFIG_XEN/CONFIG_LUPO/g' {} 
  5. Print out or save this procedure to a file in text format (you're going to stop X in a moment and they you won't so easily be able to browse the web).
  6. Stop X by running:

    /etc/init.d/gdm stop 
  7. Log in to the text terminal as root.
  8. Determine the version of gcc which was used to compile the kernel you are currently running by running:

    cat /proc/version 
    E.g. In my case this said that the version of gcc used to compile the kernel was 4.1.3.
  9. Determine the Debian package which provides the closest release to this; this probably means just removing the last "dot number" suffix and adding "gcc-" prefix. E.g. in my case the Debian package was gcc-4.1.
  10. Note that in Debian, the gcc package and the gcc command inside that package both have the same name, so in a moment we're going to use one environment variable to refer to both the package and the command.

  11. Set and export the environment variable 'CC' to be that package/command. E.g. In my case I ran:

    export CC=gcc-4.1 
  12. Install that version of gcc by running:

    apt-get install $CC 
    (If the package is already installed then this command will generate an error which you can ignore.)
  13. Run the nVidia installer with:

    cd <to-where-ever-you-downloaded-the-installer-to>
    sh ./<name-of-the-file-you-downloaded> 
    and follow the prompts, allowing the installer to compile the module for you and to make the modifications to /etc/X11/xorg.conf.
  14. Restart X with:

    /etc/init.d/gdm start 
  15. You could run some tests by logging in to X and running commands:

    less /var/log/Xorg.0.log     #  check 'nvidia' driver module loaded
    glxgears                     #  install mesa-utils first if not already installed 
  16. Rewriting of /etc/X11/xorg.conf may mean that you lose some stuff you added manually (in my case I lost a fix I applied to workaround BTS#445323) so you might want to merge the old and new versions (a tool like mgdiff is quite good for this).

See also

CategoryProcedure

InstallingNvidiaDriverOnDebianLennyWithStandardKernel (last edited 2011-02-07 07:32:18 by AlexisHuxley)