Ubuntu 13.04 Nvidia Geforce 9300 GS driver installation

Hi,
I’ve created topic on ubuntuforums but now I think this might be a little bit better forum to ask for help. This is my problem copied from ubuntuforums:
Hi all,
I’m new here, hope I’m not breaking any rules. I’d like to get help with nvidia driver installation for my lenovo N500 laptop. I’ve been using ubuntu 12.04 for a year or so. I had problems installing nvidia driver with 12.04 as well, but I finally got it working and ubuntu was running smooth. But few days ago, I wanted to change unity to gnome3. When I wanted to install gnome3, terminal suggested I upgrade my ubuntu first. So I upgraded to 12.10 and than to 13.04. When loaded ubuntu, I got login screen as usual. After I typed in my password, blank screen appeared with cursor and I could not do anything. Run terminal, etc. I could switch to tty1-tty6 though.
I googled for a little bit and found, that I should upgrade kernel and it will work in some cases. I had 3.8.something as latest. After I installed newest kernel, it was 3.9.something. But it was worse. Right after grub laptop rebooted. Currently I am running on 3.2.0-52-generic.
I thought the problem was nvidia driver, so I installed nvidia-304, then tried 310, 325, 313 and 173. Not changed a thing.
I tried to install following few tutorials as well.
http://www.dedoimedo.com/computers/ubuntu-ringtail-nvidia.html


I believe, that when I looked into logs, I found following error:

sudo nvidia-modprobe
    libkmod: ERROR ../libkmod/libkmod-module.c:791 kmod_module_insert_module: could not find module by name='nvidia_current'
    ERROR: could not insert 'nvidia_current': Function not implemented

and than link:


I did their solution:

1) dkms remove -m nvidia-current -v 319.21 --all
2) edit /usr/src/nvidia-current-319.21/dkms.conf and remove the "PATCH" and "PATCH_MATCH" lines
3) dkms install -m nvidia-current -v 319.21

with an replacement of nvidia-current to nvidia-304 and different version. However it did not help either.
I was frustrated after few days and removed nvidia drivers completely. I’m using nouveau drivers, but now my laptop is super slow and overheated. I can not even watch movies or work fluently. I hoped some of you might help me, what logs should I look into and how to fix it. When I install nvidia driver, I have only tty1-6 accessible. With newer kernel versions not even that.
There might be some inconsistency in my post because I’m writing it by heart. Sorry for that.

In regards with this, I don’t have any nvidia-*.log in my /var/log directory. I installed driver by apt-get or from update manager -> no idea where log could be located.

I am sorry if I broke any of your rules, I tried my best.

This is an Ubuntu-specific problem in its repackaging of the driver, so ubuntuforums.org is definitely your best bet.

It sounds like you somehow got the user-space parts of the driver installed, but whatever package is supposed to supply the kernel module failed to do so. Are all of your packages fully configured? (Try running “dpkg --configure -a”)

How did you upgrade your kernel? Did you compile it by hand or did you install an Ubuntu package for it?

thanks for reply. I did not do dpkg --configure -a. I will try it tomorrow.
I used ubuntu package for it.

So I repeated steps from this link: falkvinge.net/2013/02/15/how-to-install-nvidia-drivers-in-ubuntu-12-10-quantal/
and did “dpkg --configure -a”. Did not help.
Latest error message in Xorg.0.log is:

[    37.799] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)

I’m going to uninstall nvidia-glx and linux-restricted-modules packages.
And here is something more, but I’m afraid not all for ubuntu.

I don’t have nvidia-glx nor linux-restricted-modules installed.
I tried this(last post):

mv /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.backup
ln /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/nvidia-304-updates/xorg/libglx.so

Did not help eithher, some more error appeared in Xorg.0.log.
I gave a shot to this again:

1) dkms remove -m nvidia-304-updates -v 314.88 --all
2) edit /usr/src/nvidia-current-314.88/dkms.conf and remove the "PATCH" and "PATCH_MATCH" lines
3) dkms install -m nvidia-current -v 314.88

Error message appeared:

Error: Your kernel headers for kernel 3.2.0-52-generic cannot be found. Please install the linux-headers-3.2.0-52-generic package, or use the --kernelsourcedir option to tell dkms where it's located

I guess I should not have use “apt-get install linux-heaeders-3.2.0-52-generic”, but I did:

E: Unable to locate package linux-headers-3.2.0.52-generic
E: could not find any package by regex 'linux-headers-3.2.0-52-generic'