Failed to install CUDA 7.5 in ubuntu 14.04 LTS

Hi,
We have a new assembled ubuntu server, and try to install CUDA 7.5 following the http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation (including the pre-installation and post-installation).
But after rebooting, I tried to verify the driver http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#verify-driver

cat /proc/driver/nvidia/version

It shows

cat: /proc/driver/nvidia/version: No such file or directory

And I tried

sudo nvidia-modprobe

The error message is

modprobe: ERROR: ../libkmod/libkmod-module.c:809 kmod_module_insert_module() could not find module by name='nvidia_352'
modprobe: ERROR: could not insert 'nvidia_352': Function not implemented

But

lspci | grep -i nvidia

does find the devices:

04:00.0 VGA compatible controller: NVIDIA Corporation Device 17c2 (rev a1)
04:00.1 Audio device: NVIDIA Corporation Device 0fb0 (rev a1)
05:00.0 VGA compatible controller: NVIDIA Corporation Device 17c2 (rev a1)
05:00.1 Audio device: NVIDIA Corporation Device 0fb0 (rev a1)

The kernel version is

$ uname -r
3.16.0-50-generic

BTW, it’s a headless server, used via SSH.
Any help is highly appreciated!

Here are the installed nvidia, cuda and linux-headers packages:

dpkg -l | grep ii | grep -i nvidia
ii  bbswitch-dkms                             0.7-2ubuntu1                                        amd64        Interface for toggling the power on nVidia Optimus video cards
ii  libcuda1-352                              352.39-0ubuntu1                                     amd64        NVIDIA CUDA runtime library
ii  nvidia-352                                352.39-0ubuntu1                                     amd64        NVIDIA binary driver - version 352.39
ii  nvidia-352-dev                            352.39-0ubuntu1                                     amd64        NVIDIA binary Xorg driver development files
ii  nvidia-352-uvm                            352.39-0ubuntu1                                     amd64        Transitional package for nvidia-352
ii  nvidia-modprobe                           352.39-0ubuntu1                                     amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-opencl-icd-352                     352.39-0ubuntu1                                     amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                              0.6.2                                               amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                           352.39-0ubuntu1                                     amd64        Tool for configuring the NVIDIA graphics driver
dpkg -l | grep ii | grep -i cuda
ii  cuda                                      7.5-18                                              amd64        CUDA meta-package
ii  cuda-7-5                                  7.5-18                                              amd64        CUDA 7.5 meta-package
ii  cuda-command-line-tools-7-5               7.5-18                                              amd64        CUDA command-line tools
ii  cuda-core-7-5                             7.5-18                                              amd64        CUDA core tools
ii  cuda-cublas-7-5                           7.5-18                                              amd64        CUBLAS native runtime libraries
ii  cuda-cublas-dev-7-5                       7.5-18                                              amd64        CUBLAS native dev links, headers
ii  cuda-cudart-7-5                           7.5-18                                              amd64        CUDA Runtime native Libraries
ii  cuda-cudart-dev-7-5                       7.5-18                                              amd64        CUDA Runtime native dev links, headers
ii  cuda-cufft-7-5                            7.5-18                                              amd64        CUFFT native runtime libraries
ii  cuda-cufft-dev-7-5                        7.5-18                                              amd64        CUFFT native dev links, headers
ii  cuda-curand-7-5                           7.5-18                                              amd64        CURAND native runtime libraries
ii  cuda-curand-dev-7-5                       7.5-18                                              amd64        CURAND native dev links, headers
ii  cuda-cusolver-7-5                         7.5-18                                              amd64        CUDA solver native runtime libraries
ii  cuda-cusolver-dev-7-5                     7.5-18                                              amd64        CUDA solver native dev links, headers
ii  cuda-cusparse-7-5                         7.5-18                                              amd64        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-7-5                     7.5-18                                              amd64        CUSPARSE native dev links, headers
ii  cuda-documentation-7-5                    7.5-18                                              amd64        CUDA documentation
ii  cuda-driver-dev-7-5                       7.5-18                                              amd64        CUDA Driver native dev stub library
ii  cuda-drivers                              352.39-1                                            amd64        CUDA Driver meta-package
ii  cuda-license-7-5                          7.5-18                                              amd64        CUDA licenses
ii  cuda-misc-headers-7-5                     7.5-18                                              amd64        CUDA misc headers
ii  cuda-npp-7-5                              7.5-18                                              amd64        NPP native runtime libraries
ii  cuda-npp-dev-7-5                          7.5-18                                              amd64        NPP native dev links, headers
ii  cuda-nvrtc-7-5                            7.5-18                                              amd64        NVRTC native runtime libraries
ii  cuda-nvrtc-dev-7-5                        7.5-18                                              amd64        NVRTC native dev links, headers
ii  cuda-repo-ubuntu1404-7-5-local            7.5-18                                              amd64        CUDA local repo and repo configuration files.
ii  cuda-runtime-7-5                          7.5-18                                              amd64        CUDA Runtime 7.5 meta-package
ii  cuda-samples-7-5                          7.5-18                                              amd64        CUDA example applications
ii  cuda-toolkit-7-5                          7.5-18                                              amd64        CUDA Toolkit 7.5 meta-package
ii  cuda-visual-tools-7-5                     7.5-18                                              amd64        CUDA visual tools
ii  libcuda1-352                              352.39-0ubuntu1                                     amd64        NVIDIA CUDA runtime library
dpkg -l | grep ii | grep -i linux-headers
ii  linux-headers-3.16.0-30                   3.16.0-30.40~14.04.1                                all          Header files related to Linux kernel version 3.16.0
ii  linux-headers-3.16.0-30-generic           3.16.0-30.40~14.04.1                                amd64        Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
ii  linux-headers-3.16.0-50                   3.16.0-50.67~14.04.1                                all          Header files related to Linux kernel version 3.16.0
ii  linux-headers-3.16.0-50-generic           3.16.0-50.67~14.04.1                                amd64        Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
ii  linux-headers-generic-lts-utopic          3.16.0.50.41                                        amd64        Generic Linux kernel headers

I also tried to purge cuda, and install from .run, but it stuck at

Installing the NVIDIA display driver...
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 tried to get the source by apt-get source or apt-get install linux-source, but it still cannot find the kernel source…
Totally lost, thanks in advance for any helps.

You only need the headers for your running kernel.

They have to match with the output of uname -r, so

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

should do the trick.

I did have linux-headers-3.16.0-50 installed.

I tried to install the image and headers 3.19.0-30-generic, but neither .RUN nor deb way works :(

Do you have a compiler other than gcc set as your default compiler? I saw this happen once on a system that had an Intel C compiler set as the default.

I’m having the exact same bug while installing CUDA on Amazon AWS by following this tutorial: http://markus.com/install-theano-on-aws/

I have the same packages installed as OP, and get the same modprobe error. BY_GPU, let me know if you’re able to fix it!

+1, exactly the same issue, following the same tutorial as qemqemqem.
Was anyone able to make any progress towards resolution so far?

“Solved” it by downgrading to 3.13 kernel

I feel the same nvidia linux mint 970 17.2 3.19.0-31 kernel. Apparently not work modprobe.Intentando with 3.19.0-28.
“No” is a kernel problem. The problem is cuda, try downloading “cuda 7.0 and is impossible.”
https://developer.nvidia.com/cuda-toolkit-70
cuda-repo-ubuntu1404_7.0-28_amd64.deb + cuda 7.5 = Horrible, but it works