1

EDIT: One note I forgot to add is that I"m using Vmware to run ubuntu. I'm assuming that may be causing the problem?

New to Ubuntu (and Linux) and I'm having trouble installing Cuda 9.0.

During installation via the command sudo sh cuda_9.0.176_384.81_linux.run I'm getting this 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

First I was getting X server is still running error and by following the steps below, that error is replaced with the above error.

These are the steps I took to get rid of the X server is still running error

  1. Hit CTRL+ALT+F1 and login using your credentials.
  2. kill your current X server session by typing sudo service lightdm stop or sudo stop lightdm
  3. Enter runlevel 3 (or 5) by typing sudo init 3 (or sudo init 5) and install your .run file.

However, during step 3, when I try to install the file, I get unable to locate kernel source error.

The file that I'm trying to run is cuda_0.0.176_384.81_linux.run which is in my home folder.

During installation: I hit yes for everything (drivers, CUDA toolkit, CUDA samples) etc.

In the end I get a summary that looks something like this:

Driver: Installation failed
XXXX :  Installation skipped
XXXX: Installation skipped

How can I fix this installation error?

$ uname -r
4.10.0-37-generic

$ dpkg-query -l linux-headers-\*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  linux-headers- <none>       <none>       (no description available)
ii  linux-headers- 4.10.0-28.32 all          Header files related to Linux ker
ii  linux-headers- 4.10.0-28.32 amd64        Linux kernel headers for version 
ii  linux-headers- 4.10.0-37.41 all          Header files related to Linux ker
ii  linux-headers- 4.10.0-37.41 amd64        Linux kernel headers for version 
ii  linux-headers- 4.10.0.37.39 amd64        Generic Linux kernel headers

EDIT: My question is different from the possible duplicate question because the other question doesn't have any references to the error I'm getting:

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 already tried the marked solution from this thread.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Moondra
  • 113
  • This is likely proprietary software. Have you turned on "Proprietary Drivers For Devices" in "Software and Updates" or just executed "software-properties-gtk" from a terminal window"? – jpezz Oct 16 '17 at 01:39
  • @jpezz I think I found what I installed: sudo add-apt-repository ppa:graphics-drivers/ppa -- not sure how to get rid of this. Thank you. – Moondra Oct 16 '17 at 03:05
  • @jpezz and this was the site I followed to try to install Cuda drivers when I was having trouble initially with the installation : http://linuxbsdos.com/2017/06/11/how-to-install-nvidia-geforce-gtx-1070-drivers-on-ubuntu-16-10-17-04/ – Moondra Oct 16 '17 at 03:09
  • Did you install the kernel header package like the CUDA installer asks and like some of the answers in the linked question suggest? What's the output of uname -r and dpkg-query -l linux-headers-\*? – David Foerster Oct 16 '17 at 17:47
  • @DavidFoerster Hi. I check yes for everything the CUDA installer asks. As for the dependencies, it seems most people in the thread were able to install CUDA first before installing the dependencies. I'm still stuck on installing CUDA -- It seems the CUDA installer is having trouble installing Nvidia drivers. I will check those commands and get back to you. – Moondra Oct 16 '17 at 18:04
  • @DavidFoerster Hi, I updated my OP with the responses from those commands. Thank you. – Moondra Oct 16 '17 at 18:10
  • Two things: (1) I don't think you can use the Nvidia graphics driver or CUDA from inside a virtual machine because both require direct hardware access whereas virtual machine guest systems can only access virtual devices. (2) The CUDA installer should still be able to find the kernel source path. If all fails you can supply the path explicitly with --kernel-source-path "/usr/src/linux-headers-$(uname -r)". – David Foerster Oct 16 '17 at 18:35
  • @DavidFoerster Hi David, is this the kernel path? "/usr/src/linux-headers- Do you mean add this path with the installer like this:

    sudo sh cuda_9.0.176_384.81_linux.run -- "/usr/src/linux-headers-$(uname -r)"

    – Moondra Oct 16 '17 at 18:42
  • No, you omitted the option name. Please copy commands and command options carefully. The full command would be sudo sh cuda_9.0.176_384.81_linux.run --kernel-source-path "/usr/src/linux-headers-$(uname -r)". – David Foerster Oct 16 '17 at 18:45

0 Answers0