I did the following link to install Nvidia driver on Ubuntu 12.10
http://ubuntuforums.org/showthread.php?t=813931&highlight=nvidia#post_5086971
But I don't know why I get error "installation failed".
I have to notice that I didn't found xorg.conf in the 6th step
here is my installation log from nvidia-installer.log file :
nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Mon Jan 13 19:28:43 2014
installer version: 331.20
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
nvidia-installer command line:
./nvidia-installer
Using: nvidia-installer ncurses user interface
-> License accepted.
-> Installing NVIDIA driver version 331.20.
-> Running distribution scripts
executing: '/usr/lib/nvidia/pre-install'...
-> done.
-> The distribution-provided pre-install script failed! Continue installation anyway? (Answer: Yes)
-> Performing CC sanity check with CC="cc".
ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.
ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.