It seems impossible at first to run the NVIDIA binary driver on Linux x86_64 when Xen is enabled.
That’s because NVIDIA does not support Xen in the first place albeit there’s some demand for it for sure.
Luckily the only things to be changed are within the kernel interface contained in the driver package. There exist already a lot of patches on the net, I took mine from nvnews.
You can grab a copy of the patch from my site, too.
The following instructions are derived from my steps in getting NVIDIAS’s binary driver to work on Fedora Core 6 running Xen on the x86_64 platform (Intel Core 2 Duo 6420 CPU).
It was verified to work with driver version 1.0.9755 (march 29, 2007) and 1.0-9639 (may 29, 2007), both of which you can get from the NVidia website.
First you need to have some prerequisites installed on your system:
- toolchain (gcc, make, etc.)
- applicable kernel headers (I had kernel 2.6.20-1.2948.fc6xen on my system, so I installed kernel-xen-devel-2.6.20-1.2948.fc6 and kernel-xen-2.6.20-1.2948.fc6 packages)
Then the appropriate driver packages needs to be downloaded and extracted to a temporary directory:
/bin/sh NVIDIA-Linux-x86_64-1.0-9639-pkg2.run -x
Creating directory NVIDIA-Linux-x86_64-1.0-9639-pkg2
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 1.0-9639.
Also get a copy of the NVidia Patch for XEN:
Then change to the source directory, apply the patch and compile the driver.
The kernel source is required. If installed properly it should be located at /usr/src/kernels. If more than one exists choose the right one according to your ‘uname -r’ output.
zcat ../../../../nvidia_xenpatch.gz | patch -p4
make SYSSRC=/usr/src/kernels/2.6.20-1.2948.fc6xen-x86_64/ module
NVIDIA: left KBUILD.
If the compile run succeeds you should see the message NVIDIA: left KBUILD by the end of the output.
If anything weird happens, e.g. build process aborts, either the patch did not apply cleanly, the headers are not up to date or your sources are not configured.
In the last case a simple ‘make oldconfig’ from the kernel source directory may be enough to get it fixed.
There’s also the chance that you try this patch on a non-supported kernel source version or NVIDIA driver package which may prevent successful compilations.
Since I did not implement the patch by myself I cannot be of much help in either case.
Upon successful compilation you can install and load the driver. Verify that the driver loaded by means of ‘lsmod’.
install -D -o root -g root -m 0644 nvidia.ko /lib/modules/`uname -r`/video/nvidia.ko
nvidia 7771096 22
At this point run the NVIDIA installer to get the remaining utilities.
Use the ‘no-kernel-module’ option as you installed the kernel module already.
/bin/sh nvidia-installer --no-kernel-module
This is it! You are now ready to configure your X server to use the NVIDIA driver.
Stick to the docs included with the driver on how to achieve this.
This is my Xorg sample configuration with twin-view enabled accross two displays at 1280×1024 resolution.
# sample Xorg configuration file for NVIDIA graphics driver
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
Option "XkbModel" "pc105"
Option "XkbLayout" "ch"
Option "XkbVariant" "de_nodeadkeys"
Option "TwinView" "1"
Option "CursorShadow" "1"
Option "TwinViewOrientation" "RightOf"
Option "MetaModes" "1280x1024,1280x1024"