Getting the proprietary NVIDIA drivers working on Debian based distros can be somewhat of a challenge, particularly on Knoppix. There is no concise guide for doing so anywhere on the Internet. It is doable, though and fairly straightforward once you know how.
The benefits of using the proprietary driver are huge. For instance, Minecraft went from an unplayable 12 to over 200fps on my system. Spectraball was unplayable before the switch.
To see what graphics subsystem is running, issue the following command.
# lspci | grep VGA && glxinfo | grep -w 'direct\|OpenGL'
On my system, running the proprietary driver, the output looks like this.
03:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1)
direct rendering: Yes
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 460/PCIe/SSE2
OpenGL version string: 4.2.0 NVIDIA 304.64
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler
OpenGL extensions:
The absolute wrong thing to do is download the driver from geforce.com and use their installer. Knoppix in particular has a 64 bit kernel but is not a true 64 bit OS but a hybrid which is only set up to run 32 bit software. The Debian folks don't recommend doing it this way either.
The first order of business is to download the build-essentials and linux headers.
# sudo apt-get install build-essential linux-headers-$(uname -r)
Once that's done, the biggest challenge by far was figuring out how to get rid of the open-source NVIDIA driver, nouveau. If even the slightest particle of it is left on the system, Xorg will try to use it. Even blacklisting the driver by editing files in /etc/modprobe.d doesn't work. We have to reboot and add the nomodeset option to the kernel in GRUB.
# reboot
Now in Knoppix, this will throw the system into a tizzy complaining that it cannot start Xorg and messing up your shell prompt every few seconds. Issue the following command to enter single user mode and shut it up.
# telinit -t 0 2
Or just
# init 2
Now remove all of the nouveau crap.
# apt-get --purge remove xserver-xorg-video-nouveau nvidia-kernel-common nvidia-kernel-dkms nvidia-glx nvidia-smi
Then issue this command to see if there are any other NVIDIA related packages on the system and remove those as well.
# dpkg --list | grep -i --color nvidia
If you had previously tried using NVIDIA's installer from geforce.com or nvidia.com to install the drivers, remove those by rerunning the installer with a special uninstall option.
# sh NVIDIA-Linux-x86??? --uninstall
Now finally we can install the proprietary drivers. Issue
# aptitude versions nvidia-kernel-dkms
# apt-get install nvidia-kernel-dkms=(latest version from above)
Hit Y to install all required packages. It will automatically compile the kernel module for your kernel using DKMS.
Now the fun part. You'll have to edit /etc/X11/xorg.conf to tell Xorg to use the new drivers. First back up the old configuration.
# cp -v /etc/X11/xorg.conf{,.bak}
Then use your favorite editor to modify xorg.conf.
# vim /etc/X11/xorg.conf
Under the section "Device" change or add
Identifier "n"
Driver "nvidia"
If you want (to continue using) compiz, also add the following under the same section.
Option "AllowGLXWithComposite" "true"
Option "TripleBuffer" "true"
Option "XAANoOffscreenPixmaps" "true"
Option "RenderAccel" "true"
Under the section Screen, change or add
Option "AddARGBGLXVisuals" "true"
Option "AddARGBVisuals" "true"
Under the section Extensions, change or add
Option "Composite" "enable"
That should be it. Now enter runlevel 5 and see if everything is working.
# telinit -t 0 5
Try issuing the above graphics subsystem check to make sure you are truly running the proprietary NVIDIA driver.
If something goes wrong or if for any reason you have to get out of Xorg and back into single user mode, do the following.
Open a shell prompt and issue
# telinit -t 0 2
Then log out of X. This is the only way to close out of Xorg in Knoppix without having it restart on you. You may also have to switch to a different console (Ctrl + Alt + F1-F4) and issue
# killall -u knoppix
On other Debian based distros, the following may also work.
# /etc/init.d/kdm stop
That's it. I hope this helps someone out there. It's as much for my own reference as for all of you.