cuda 5.5.22 on ubuntu 12.04.4 LTS

I am trying to install 64-bit cuda 5.5.22 on ubuntu 12.04.4 LTS 64-bit. I am using the .run file (as noted on the downloads page, the .deb file doesn’t work).

I can’t seem to get it to work. It fails with the error: “The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly. If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the ‘–kernel-source-path’ flag.”

I’ve installed the linux headers with

sudo apt-get install linux-headers-$(uname -r)

I’ve tried variations on “kernel-source-path”, such as

sudo ./cuda_5.5.22_linux_64.run

and

sudo ./cuda_5.5.22_linux_64.run --kernel-source-path /usr/src/linux-headers-3.11.0-15

But none of it is working.

Looking at the logs, there’s this error:

-> Building kernel module:
       executing: 'cd ./kernel; make module SYSSRC=/lib/modules/3.11.0-15-generic/build SYSOUT=/lib/modules/3.11.0-15-generic/build'...
       NVIDIA: calling KBUILD...
       test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
        echo >&2;							\
        echo >&2 "  ERROR: Kernel configuration is invalid.";		\
        echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
        echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
        echo >&2 ;							\
        /bin/false)

I’ve put the entire error log on pastebin here.

Any ideas?

Instead of using the driver included with the CUDA install, I prefer to use the Ubuntu xorg-edgers repository to install the NVIDIA drivers. The first line installs build tools/requirements that the CUDA 5.5 run file might complain that are missing. There might be a need to create symbolic links if the CUDA 5.5 installer still complains. The next lines install the actual NVidia drivers from the xorg-edgers repository:

sudo apt-get install freeglut3 freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev gcc g++ gcc-4.6 g++-4.6
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-331

Assuming this is not a laptop (you’d need bumblebee, or to configure xrandr correctly), the above procedure should work fine. After this, you can install the *.run file for CUDA and succeed (minus any symbolic links required to run some samples)

did you get this resolved? I am hitting similar errors on ubuntu 14.03 with cuda7.5.