NVIDIA Optimus and Ubuntu 12.10

I'm new to linux environment. I have NVIDIA GEForce GT 520M which is Optimus card. I installed ubuntu 12.10 and on the top of that I installed NVIDIA's new driver 304.60 but something went wrong and display manager is totally screwed nothing is displaying properly. All fonts are big and i'm able to access only nautilus as everything went out of the screen. I tried removing it and rollback it to nouveau but it is happening in any case. I want better power management and I want to use my card for CUDA programming so I was installing driver before installing bumblebee. Can anyone please tell me simple steps to use my card for CUDA programming? with CUDA 5 .


I had problems, but I followed this steps and it comes to work well: How to install nvidia optimus driver?

Basically, taken from CruzBishop:

#if you have previously installed nvidia or bumblebee from the repos:
sudo apt-get purge bbswitch-dkms bumblebee-nvidia

#if you have previously installed nvidia drivers from the Nvidia.com binary, you can uninstall it running the same installer.

#next steps:    
sudo apt-get install linux-headers-3.5.0-17-generic
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get install bumblebee bumblebee-nvidia
#reboot
#install cuda the old way, as you have done in 12.04

It worked out for me.