ticket
March 7th, 2009, 05:47 PM
This has been pulled together from various sites & threads. It certainly helped me to install nvidia on the rt-kernel and the generic kernel, and switch easily between them using grub. Also the video resolution issue is solved for me. Note that this how-to is for installing the nvidia drivers directly as supplied by nvidia. It does not cover the .deb packages. I am running Intrepid.
From the nvidia site:
If you wish to install the NVIDIA Linux graphics driver on a Debian GNU/Linux or Ubuntu system that ships with Xorg 7.x, please ensure that your system meets the following requirements:
* development tools like make and gcc are installed
* the linux-headers package matching the installed Linux kernel is installed
* the pkg-config and xserver-xorg-dev packages are installed
* the nvidia-glx package has been uninstalled with the --purge option and the files /etc/init.d/nvidia-glx and /etc/init.d/nvidia-kernel do not exist
If you use Ubuntu, please also ensure that the linux-restricted-modules or linux-restricted-modules-common packages have been uninstalled. Alternatively, you can edit the /etc/default/linux-restricted-modules or /etc/default/linux-restricted-modules-common configuration file and disable the NVIDIA linux-restricted kernel modules (nvidia, nvidia_legacy) via:
DISABLED_MODULES="nv nvidia_new"
Additionally, delete the following file if it exists:
/lib/linux-restricted-modules/.nvidia_new_installed
================================================== =====
This is what I did to install the 177.80 drivers to the rt kernel:
(from http://meandubuntu.wordpress.com/2008/07/17/install-nvidia-17713-drivers-on-realtime-kernel )
1. Download the drivers, necessary build packages and Linux kernal source
http://www.nvidia.co.uk/object/linux_display_ia32_177.80_uk.html
3. Run the driver script with the “-x” (extract-only) option:
sudo sh NVIDIA-Linux-x86-177.80-pkg1.run -x
4. Make the replacements mentioned in the nvidia linux forums:
sudo gedit /usr/src/NVIDIA-Linux-x86-177.80-pkg1/usr/src/nv/nv-linux.h
Replace “__SEMAPHORE_INITIALIZER” with “__COMPAT_SEMAPHORE_INITIALIZER”
Replace “struct semaphore” with “struct compat_semaphore”
5. Run the installer:
cd NVIDIA-Linux-x86-177.80-pkg1
Then Kill X-server using:
sudo /etc/init.d/gdm stop
Then:
sudo ./nvidia-installer
From here on out it should work just like normal!
6. Restart X-server using (or maybe re-boot at this point?)
sudo /etc/init.d/gdm start
7. To uninstall the driver: (can be done while gnome is running(?))
sudo sh NVIDIA-Linux-x86-177.80-pkg1.run --uninstall
//// Fixing the screen resolution
Try
sudo nvidia-settings
Use the gui to set up your resolution, apply it and when happy, save the xorg.conf.
Because you are running with sudo, nvidia-settings will be able to properly save the file.
Then using
System->Perferences->Screen Resolution
make sure you choose the same screen resolution and save it.
//// After a kernel upgrade...
Check which kernel is being booted - a kernel upgrade usually alters the boot menu.
You can edit it at /boot/grub/menu.lst
Boot menu items are numbered starting from 0.
--------------------------------------
Finally here's the solution having with different nvidia drivers in different kernels.
The problem is that when running the nvidia installer, it wipes out the driver from other kernels and just installs for the current one.
The installer builds a nvidia.ko kernel object and places it in
/lib/modules/CURRENT-KERNEL-NAME/kernel/drivers/video/nvidia.ko
where CURRENT-KERNEL-NAME is that returned by uname -r
The trick is to force the installer to just build for a user-specified kernel and do nothing else.
The following worked for me. I was running the rt-kernel with the modified nvidia driver as described in this thread. I wanted to install the standard (unmodified) driver into my latest generic kernel (2.6.27-11-generic). This is what I did:
stop x server:
sudo /etc/init.d/gdm stop
(sometimes this hangs using the rt kernel - hitting crtl-alt-F1 afterwards can help - else reboot & try again)
Install nvidia using:
sudo ./nvidia-installer --kernel-name=2.6.27-11-generic -K
Note the two options here:
--kernel-name=2.6.27-11-generic
will install to the named kernel (as obtained from 'uname -r')
-K
will install the nvidia.ko object without un-installing existing drivers / kernel objects.
I found you need to use both options together!
After the install completes, you will have a new nvidia.ko in:
/lib/modules/2.6.27-11-generic/kernel/drivers/video/nvidia.ko
while the one in:
/lib/modules/2.6.27-3-rt/kernel/drivers/video/nvidia.ko
is untouched.
Restart X with:
sudo /etc/init.d/gdm start
(or simply re-boot if that fails)
Use grub to select 2.6.27-11-generic
The nvidia drivers you just compiled will load.
You can now switch between kernels as normal (using grub) without having to re-build the drivers!
From the nvidia site:
If you wish to install the NVIDIA Linux graphics driver on a Debian GNU/Linux or Ubuntu system that ships with Xorg 7.x, please ensure that your system meets the following requirements:
* development tools like make and gcc are installed
* the linux-headers package matching the installed Linux kernel is installed
* the pkg-config and xserver-xorg-dev packages are installed
* the nvidia-glx package has been uninstalled with the --purge option and the files /etc/init.d/nvidia-glx and /etc/init.d/nvidia-kernel do not exist
If you use Ubuntu, please also ensure that the linux-restricted-modules or linux-restricted-modules-common packages have been uninstalled. Alternatively, you can edit the /etc/default/linux-restricted-modules or /etc/default/linux-restricted-modules-common configuration file and disable the NVIDIA linux-restricted kernel modules (nvidia, nvidia_legacy) via:
DISABLED_MODULES="nv nvidia_new"
Additionally, delete the following file if it exists:
/lib/linux-restricted-modules/.nvidia_new_installed
================================================== =====
This is what I did to install the 177.80 drivers to the rt kernel:
(from http://meandubuntu.wordpress.com/2008/07/17/install-nvidia-17713-drivers-on-realtime-kernel )
1. Download the drivers, necessary build packages and Linux kernal source
http://www.nvidia.co.uk/object/linux_display_ia32_177.80_uk.html
3. Run the driver script with the “-x” (extract-only) option:
sudo sh NVIDIA-Linux-x86-177.80-pkg1.run -x
4. Make the replacements mentioned in the nvidia linux forums:
sudo gedit /usr/src/NVIDIA-Linux-x86-177.80-pkg1/usr/src/nv/nv-linux.h
Replace “__SEMAPHORE_INITIALIZER” with “__COMPAT_SEMAPHORE_INITIALIZER”
Replace “struct semaphore” with “struct compat_semaphore”
5. Run the installer:
cd NVIDIA-Linux-x86-177.80-pkg1
Then Kill X-server using:
sudo /etc/init.d/gdm stop
Then:
sudo ./nvidia-installer
From here on out it should work just like normal!
6. Restart X-server using (or maybe re-boot at this point?)
sudo /etc/init.d/gdm start
7. To uninstall the driver: (can be done while gnome is running(?))
sudo sh NVIDIA-Linux-x86-177.80-pkg1.run --uninstall
//// Fixing the screen resolution
Try
sudo nvidia-settings
Use the gui to set up your resolution, apply it and when happy, save the xorg.conf.
Because you are running with sudo, nvidia-settings will be able to properly save the file.
Then using
System->Perferences->Screen Resolution
make sure you choose the same screen resolution and save it.
//// After a kernel upgrade...
Check which kernel is being booted - a kernel upgrade usually alters the boot menu.
You can edit it at /boot/grub/menu.lst
Boot menu items are numbered starting from 0.
--------------------------------------
Finally here's the solution having with different nvidia drivers in different kernels.
The problem is that when running the nvidia installer, it wipes out the driver from other kernels and just installs for the current one.
The installer builds a nvidia.ko kernel object and places it in
/lib/modules/CURRENT-KERNEL-NAME/kernel/drivers/video/nvidia.ko
where CURRENT-KERNEL-NAME is that returned by uname -r
The trick is to force the installer to just build for a user-specified kernel and do nothing else.
The following worked for me. I was running the rt-kernel with the modified nvidia driver as described in this thread. I wanted to install the standard (unmodified) driver into my latest generic kernel (2.6.27-11-generic). This is what I did:
stop x server:
sudo /etc/init.d/gdm stop
(sometimes this hangs using the rt kernel - hitting crtl-alt-F1 afterwards can help - else reboot & try again)
Install nvidia using:
sudo ./nvidia-installer --kernel-name=2.6.27-11-generic -K
Note the two options here:
--kernel-name=2.6.27-11-generic
will install to the named kernel (as obtained from 'uname -r')
-K
will install the nvidia.ko object without un-installing existing drivers / kernel objects.
I found you need to use both options together!
After the install completes, you will have a new nvidia.ko in:
/lib/modules/2.6.27-11-generic/kernel/drivers/video/nvidia.ko
while the one in:
/lib/modules/2.6.27-3-rt/kernel/drivers/video/nvidia.ko
is untouched.
Restart X with:
sudo /etc/init.d/gdm start
(or simply re-boot if that fails)
Use grub to select 2.6.27-11-generic
The nvidia drivers you just compiled will load.
You can now switch between kernels as normal (using grub) without having to re-build the drivers!