Ubuntu: Cannot install CUDA 8.0 on Ubuntu 16.04.3


This is what I have done as per the info available on the web. I have 3 files in /etc/modprobe.d "blacklist-nouveau.conf" having content

blacklist nouveau  blacklist lbm-nouveau  options nouveau modeset=0  alias nouveau off  alias lbm-nouveau off  


options nouveau modeset=0  

and "nvidia-installer-disable-nouveau.conf"(generated by cuda runfile) having

blacklist nouveau  options nouveau modeset=0  

My /usr/src have below directories:

linux-headers-4.10.0-28          linux-hwe-4.10.0  linux-headers-4.10.0-28-generic  linux-source-4.4.0  linux-headers-4.10.0-40          linux-source-4.4.0.tar.bz2  linux-headers-4.10.0-40-generic  

I have performed

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade  sudo apt-get install linux-source  sudo apt-get source linux-image-$(uname -r)  sudo apt-get install linux-headers-$(uname -r)  sudo update-initramfs -u  

When I run

sudo ./cuda_8.0.61_375.26_linux.run --kernel-source-path=/usr/src/linux-hwe-4.10.0  

I am getting the --kernel-source-path not valid error with below log.

nvidia-installer log file '/var/log/nvidia-installer.log'  creation time: Thu Dec  7 01:45:55 2017  installer version: 375.26    PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin    nvidia-installer command line:      ./nvidia-installer      --ui=none      --no-questions      --accept-license      --disable-nouveau      --kernel-source-path=/usr/src/linux-hwe-4.10.0    Using built-in stream user interface  -> Detected 2 CPUs online; setting concurrency level to 2.  -> License accepted by command line option.  -> Installing NVIDIA driver version 375.26.  -> Running distribution scripts     executing: '/usr/lib/nvidia/pre-install'...  -> done.  -> The distribution-provided pre-install script failed!  Are you sure you want to continue? (Answer: Continue installation)  WARNING: One or more modprobe configuration files to disable Nouveau are already present at: /etc/modprobe.d/nvidia-installer-disable-nouveau.conf.  Please be sure you have rebooted your system since these files were written.  If you have rebooted, then Nouveau may be enabled for other reasons, such as being included in the system initial ramdisk or in your X configuration file.  Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.  -> For some distributions, Nouveau can be disabled by adding a file in the modprobe configuration directory.  Would you like nvidia-installer to attempt to create this modprobe file for you? (Answer: Yes)  -> One or more modprobe configuration files to disable Nouveau have been written.  For some distributions, this may be sufficient to disable Nouveau; other distributions may require modification of the initial ramdisk.  Please reboot your system and attempt NVIDIA driver installation again.  Note if you later wish to reenable Nouveau, you will need to delete these files: /etc/modprobe.d/nvidia-installer-disable-nouveau.conf  -> Performing CC sanity check with CC="/usr/bin/cc".  -> Using the kernel source path '/usr/src/linux-hwe-4.10.0' as specified by the '--kernel-source-path' commandline option.  ERROR: Neither the '/usr/src/linux-hwe-4.10.0/include/linux/version.h' nor the '/usr/src/linux-hwe-4.10.0/include/generated/uapi/linux/version.h' kernel header file exists.  The most likely reason for this is that the kernel source files in '/usr/src/linux-hwe-4.10.0' have not been configured.  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.  

I have tried giving every version of kernel source from /usr/src but still getting the same issue.

I am understanding that as "version.h" is not found, the kernel sources are not correct, possibly. But I am not sure what location I have to give there or I have to download some additional sources. I have re-installed Ubuntu 16.04.3 but no luck. Please help, I am stuck at it for very long. Thanks in advance.


Your Hardware Enablement Stack on Ubuntu 16.04 gives you kernel 4.10... but the Intel docs for CUDA (Instructions)state support for Ubuntu 16.04 for kernel 4.4... (for CUDA 9, so 8 would be similar).
The Ubuntu 14.01.1 ISO comes with kernel 4.4... series. If you reinstall starting with that ISO you will get the supported kernel. That would probably be easier than installing the 4.4 series on your current system and then trying to unwind anything else the HWE stack brought in.

Nevertheless, it might work if you:

1) Install the Nvidia proprietary drivers first. Get those working, then deal with CUDA.

2) Use the .deb(local) files for installation instead of the .run files. The cuda 8.0 download is legacy now and is may be found at https://developer.nvidia.com/cuda-80-ga2-download-archive The cudnn download is from https://developer.nvidia.com/cudnn

 dpkg -i ...deb   

should do it.

3) Install the cuda package from the Ubuntu repositories. That should bring in the cuda-toolkit package and most CUDA library packages you need. Note,some samples may need additional libraries, but most will be runnable with the above.

You seem to be missing necessary kernel headers -- they are normally found under /usr/src/linux-headers-4...., not what you specified . There's nothing to specify like that for the .deb installation, so I don't know what you need there (some .run file requirement?). Anyway, The above link has instructions for altering the PATH and LD_LIBRARY_PATH variables to pick up the necessary CUDA binaries and libraries.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »