apt-get purge nvidia*
apt-get purge bumblebee*
apt-get update
apt-get dist-upgrade
apt-get install linux-headers-generic
add-apt-repository ppa:bumblebee/stable
For more up-to-date nvidia drivers, you need to add another PPA. As of 12.04, this is still necessary for Nvidia GT 6xxM cards. It may be optional for the GT 4xxM and GT 5xxM series on 12.04. When in doubt, just install it.
add-apt-repository ppa:ubuntu-x-swat/x-updates
apt-get update
Install Bumblebee using the proprietary nvidia driver:
apt-get install bumblebee bumblebee-nvidia
Reboot or re-login
If you have 32-bit applications like Wine, and run 11.10 Oneiric or later, you will need extra libraries:
sudo apt-get install virtualgl-libs:i386
Allow yourself to use Bumblebee by adding yourself to the ‘bumblebee’ group. (replace $USER by your username)
sudo usermod -a -G bumblebee $USER
Reboot or re-login to apply the group changes If you’d like to run a program on the nvidia card now, use the optirun program:
optirun firefox &