Thursday, April 11, 2013
How to get the proprietary NVIDIA drivers working on Debian (Knoppix)
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)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.
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 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.
# rebootNow 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 2Or just
# init 2Now remove all of the nouveau crap.
# apt-get --purge remove xserver-xorg-video-nouveau nvidia-kernel-common nvidia-kernel-dkms nvidia-glx nvidia-smiThen 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 nvidiaIf 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??? --uninstallNow 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.confUnder the section "Device" change or add
Identifier "n"If you want (to continue using) compiz, also add the following under the same section.
Driver "nvidia"
Option "AllowGLXWithComposite" "true"Under the section Screen, change or add
Option "TripleBuffer" "true"
Option "XAANoOffscreenPixmaps" "true"
Option "RenderAccel" "true"
Option "AddARGBGLXVisuals" "true"Under the section Extensions, change or add
Option "AddARGBVisuals" "true"
Option "Composite" "enable"That should be it. Now enter runlevel 5 and see if everything is working.
# telinit -t 0 5Try 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 2Then 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 knoppixOn other Debian based distros, the following may also work.
# /etc/init.d/kdm stopThat's it. I hope this helps someone out there. It's as much for my own reference as for all of you.
Friday, February 15, 2013
qemu is a Bitch
I was trying to use qemu to test a bootable USB drive and found out just how difficult it is to use. There are like 1,000 command line options, some of which don't even work.
Good luck getting a log of the output. There are literally like 4 different ways of logging the text generated in the qemu window to a text file, none of which could I get to work.
Speaking of things that don't work, the host keyboard commands do nothing. That means there is no way to do a clean exit. You have to click the x provided by the window manager.
Anyway, I'm going to post a few command lines in case there are others out there trying to make sure their bootable thumb drive is working. Unfortunately you'll have to have quick eyes or use screenshots or something until I figure out how to log the output. Perhaps some kind soul will provide a comment on how to do this.
To get a list of the USB devices on your system, issue an
Once you figure this out,
Good luck getting a log of the output. There are literally like 4 different ways of logging the text generated in the qemu window to a text file, none of which could I get to work.
Speaking of things that don't work, the host keyboard commands do nothing. That means there is no way to do a clean exit. You have to click the x provided by the window manager.
Anyway, I'm going to post a few command lines in case there are others out there trying to make sure their bootable thumb drive is working. Unfortunately you'll have to have quick eyes or use screenshots or something until I figure out how to log the output. Perhaps some kind soul will provide a comment on how to do this.
To get a list of the USB devices on your system, issue an
lspciIt's up to you to figure out which device is your flash drive.
Once you figure this out,
sudo qemu -usb -usbdevice host:XXXX:XXXX -boot menu=onShould get you going. Replace the XXXX:XXXX with the vendor_id:product_id from above. The beauty of this is that it passes the actual USB device to qemu. This more closely emulates the behavior of an actual system startup.
Subscribe to:
Posts (Atom)