Since I managed to figure it out, I will answer the question myself!
The driver we should install for this series of video cards is nvidia 304.XXX series.
I tried the following.
remove anything related to nvidia using (I would advise caution!)
sudo apt-get install --purge nvidia*
you can do either of the two things below:
1: Install nvidia drivers from the nvidia site
- download the nvidia driver from the nvidia site:
- reboot the system in safe mode and drop to root shell.
make the filesystem writable:
mount -o remount,rw /
run the downloaded nvidia driver installer
once the installer completes Do not do start the x server but reboot the system. If you start the x server there,
~/.Xauthority file gets created as root, and hence, further when you try to log in as a regular user, x crashes/restarts trying to access this file and UI wont start.
I had some issues with this method; I got an error indicating api-mismatch. I believe I had not fully removed all nvidia related packages earlier.
The following method worked well in the end.
2: a slightly easier method is using the ubuntu-x-swat ppa.
add the x-swat repository:
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
refresh the sources
sudo apt-get update
install the nvidia packages using this repository
sudo apt-get install nvidia-current nvidia-settings
I had some troubles using
add-apt-repository. Hence I added the following line in my sources list
deb http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu YOUR_UBUNTU_VERSION_HERE main
rest of the steps are the same as (2) above