Cuda 8.0 toolkit install - nvcc not found - ubuntu 16.04

Hello,

I am very new to cuda and reasonably new but comfortable to ubuntu 16.04

I have installed cuda 8.0 via the cuda 8.0 download the recommended “Download Installer for Linux Ubuntu 16.04 x86_64” and the command sudo sh cuda_8.0.61_375.26_linux.run

The install was successful and to be specific, when the install option for the cuda toolkit was provided I answered ‘Y’, as such I believe I should be able to access nvcc to compile cuda code, however after performing the install when using terminal, nvcc is not found.

For example, when typing in ~$ nvcc --version

The commandline returns a statement saying that nvcc is unavailable and to install it use

sudo apt install nvidia-cuda-toolkit.

I understand all of this but here is the problem.

If I follow the suggested command line install the old 7.5 toolkit is installed.

What do I need to do in order to have the cuda 8 toolkit installed and if I’ve done this correctly already how do I access nvcc or its equivalent to compile code?

follow the directions in the linux install guide:

[url]Installation Guide Linux :: CUDA Toolkit Documentation

these instructions to update your PATH and LD_LIBRARY_PATH are even printed out in the console when the installer that you ran finishes.

txbob,

Thanks for the prompt reply. I believe that I performed the path commands correctly - none the less I am still receiving the error previously mentioned (ie. inability to locate nvcc).

Per your suggestion I re-performed the post-install requirements. The error remained at which point I decided to purge and remove nvidia-cuda* so that I could perform a reinstall and retest. To remove I used the following:

ie. sudo apt-get --purge remove nvidia-cuda*

The return for which flagged that several packages were not installed and could not be removed.

ie.
Package ‘nvidia-cuda-dev’ is not installed, so not removed
Package ‘nvidia-cuda-doc’ is not installed, so not removed
Package ‘nvidia-cuda-gdb’ is not installed, so not removed
Package ‘nvidia-cuda-toolkit’ is not installed, so not removed

Q: If the install recommendation provided in the step 2.6 doesn’t install these items, how can they be installed cuda 8?

Do you have any advice?

Your help is appreciated in advance.

Please read the install guide carefully, in its entirety.

The installation method you chose:

sudo sh cuda_8.0.61_375.26_linux.run

is the runfile installer method. This:

sudo apt-get --purge remove nvidia-cuda*

pertains to the package manager install method.

You cannot mix the two. The removal instructions for one do not apply to the other, and vice versa.

If you install using the runfile installer:

sudo sh cuda_8.0.61_375.26_linux.run

then follow the linked section of the document I gave, in order to set your environment variables. If there is any doubt, there should be a file at

/usr/local/cuda/bin/nvcc

If it is not there, then something incorrect happened during your runfile install.

I’m not going to try and sort out or explain the result of a willy-nilly sequence of random commands from both methods, interspersed. I have no idea what it would do to your machine or what state it would leave it in.

txbob,

I honestly appreciate your feedback. I am relatively new at this which is why I am posting for help.

In respect to your comments about the state of my machine. The machine is new and it will be wiped and a completely clean install will again be made when I understand how to get the compiler working correctly - I figured that getting my hands dirty was the best way to learn so please excuse any errors I am making along the way.

My preferred install method is via the package manager.

I have been trying to use the following instructions:

http://developer.download.nvidia.com/compute/cuda/8.0/secure/Prod2/docs/sidebar/CUDA_Quick_Start_Guide.pdf?autho=1487643955_00d76e5fff179a2f02d6097114c4a3b3&file=CUDA_Quick_Start_Guide.pdf

see: 4.1.5.1. Debian Installer

My problem is that I do not know how or where to locate the -. information used to perform:

sudo dpkg --install cuda-repo--..deb

If you can help me locate that information I think that I’ll be able to resolve everything from there.

get it from here:

[url]http://www.nvidia.com/getcuda[/url]

when you download a .deb file from there, it will look something like:

cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb

rather than trying to parse it all, the point of that statement is you will download a file like the one above, then you will do:

sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb

except you will replace everything after the -i with the file name that you actually downloaded.

If it matters (I don’t think it does), for the above file,

= ubuntu1404
= 8-0-local-ga2_8.0.61-1
= amd64

Obviously, those may be different depending on what file you actually download.

txbob,

A huge thanks for the tip and being so clear - I’ll give it a go now.

txbob,

Just letting you know that everything worked out with the package manager install. Thanks with the help.

Much appreciated.

@txbob,
As you said, I can see a file at usr/local/cuda/bin/nvcc

I followed exactly the steps as mentioned, and I was using the deb installer, and I have the same problem - My system can’t find nvcc.

One thing I noticed is that I am using tensorflow for a project, and when I import TF in python, I see that it successfully opens the libcublas.so.8.0 library. When I type sudo apt install nvidia-cuda-toolkit, In the section in which it says “The following new packages will be installed :” I see the libcublas7.5 library. This means that somehow my system fails to recognise the libcublas8.0 as a part of the nvcc.

I think I may have messed up in setting the environment variables. Is it just copy paste as they print it on the installation guide?

Please help me

Yes, it should be pretty much a copy and paste of what is in the install guide.

sudo apt install nvidia-cuda-toolkit

is not the correct command, and that command appears nowhere in the install guide, so I think you are not following the install guide.

try running:

which nvcc

and

echo $PATH

and

ls /usr/local

and paste the results here.

@lin1604 I was having virtually the same issue as you. As far as I can tell, the post-installation instructions are simply (very slightly) wrong. In particular, they instruct you to include paths beginning with “/usr/local/cuda-8.0.61/”. On my machine, the runfile did not create that directory. Instead, it put everything in “/usr/local/cuda-8.0/”. When I made that modification to the PATH and LD_LIBRARY_PATH variables, the system recognized nvcc. I haven’t had time to test to make sure that CUDA is actually working, but this fixed that problem, at least.

@reesej2 Thanks a lot! You are correct, there is apparently a mistake in the instructions.
I had to change:
export PATH=/usr/local/cuda-8.0.61/bin${PATH:+:${PATH}}
To:
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
And:
export LD_LIBRARY_PATH=/usr/local/cuda-8.0.61/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
To:
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

And nvcc is now recognized at least

Thank you @reesej2 and Tardigrade, it really helped with the NVCC issue :)

Just adding this in the case that it’s helpful to anyone. Much of the above has already discussed PATH variable considerations and I just wanted to add what I had done. Since I had installed the CUDA toolkit via their local script, the PATH vars weren’t persistent between reboots. I did two modifications to my Ubuntu 16.04 system, as defined below:

  1. I added the include type of library and header locations into a custom file in the /etc/ld.so.conf.d directory. My file looks like this:
~NVIDIA_CUDA-8.0_Samples/common/inc
/usr/local-8.0/lib64
/usr/local/cudnn-v5.1/include
  1. To export the paths for every BASH session, I simply added the EXPORT lines in the post-installation instructions to my
.bashrc

file in my home directory.

Typically, if you install from a package and via the package manager/repo, you’ll not need extra steps to solidify paths.

I have been through the same problem, I followed the installation guide in here [url] Installation Guide Linux :: CUDA Toolkit Documentation

launching the command
$ sudo apt-get install cuda
on the extracted deb(local) installer file the process ends up with these lines:

/sbin/ldconfig.real: /usr/lib/nvidia-375/libEGL.so.1 is not a symbolic link
/sbin/ldconfig.real: /usr/lib32/nvidia-375/libEGL.so.1 is not a symbolic link

I tried the solution within this link [url] 16.04 - libEGL.so.1 is not a symbolic link - Ask Ubuntu

I added the cuda 8 bin folder to the PATH variables with respect to [url]Installation Guide Linux :: CUDA Toolkit Documentation

After that the
$nvcc --version
command does show no nvcc installed with proposing to execute:
$ sudo apt install nvidia-cuda-toolkit

wich I did without purging cuda or nvidia.

and when I launched nvcc --version I get cuda 7.5 installed.

and with entering this command

$ ldconfig -p | grep cuda

it looks that the packages where installed within the cuda 8.0 directories

libnvrtc.so.8.0 (libc6,x86-64) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libnvrtc.so.8.0
libnvrtc.so (libc6,x86-64) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libnvrtc.so
libnvrtc-builtins.so.8.0 (libc6,x86-64) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libnvrtc-builtins.so.8.


After a while I launched $sudo apt-get update
and
$sudo apt-get upgrade

meanwhile I rebooted my system.

I checked the PATH to my PATH variables, I could not find /usr/local/cuda-8.0/bin
So I added it again.
And launching the nvcc --version I get cuda 8 recognized:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

I do not know why the environment setup did not work at the first place, I were distracted by the symbolic link warning (and not seeing done at the end of the installation process of cuda 8.0 deb local). May be a reboot was needed after the environment setup.

I hope this is not too messy ad it will work fine along the way to learn TensorFlow.

A last thing, there were instructions to install cuda8 but there were not for the accompanying Patch (cublas). So I followed thid link [url]How to complete a dpkg cuBLAS Patch Update to CUDA 8 installation in 16.04? - Ask Ubuntu.

Thank you @reesej2 and @Tardigrade, it solved the problem of nvcc!

hello everyone.

I am trying to compile cudaSolvers for some opensource toolbox in ubuntu16.04.

However, I am getting this error:

no nvcc - CUDA not found.

I dont knw what this error means because the driver is correctly installed and nvcc also works fine for other applications.

I am running CUDA 8.0.

Also when I run an application on gpu, nvidia-smi shows this:

±----------------------------------------------------------------------------+
| NVIDIA-SMI 375.82 Driver Version: 375.82 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce 920M Off | 0000:08:00.0 N/A | N/A |
| N/A 65C P0 N/A / N/A | 581MiB / 4045MiB | N/A Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
±----------------------------------------------------------------------------+

Well, we see memory consumption, but no other details.

will appreciate any help or guidance.

Thanks

Hello

Installed CUDA 9.0, and everything seemed to be going fine, I added the path and everything and once i rebooted my system and typed the command nvcc -V it’s giving me the following error

The program ‘nvcc’ is currently not installed. You can install it by typing:
sudo apt install nvidia-cuda-toolkit.

The problem is that when I am giving the PATh again the nvcc works fine

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH

nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

But if I reboot my system or close the terminal and the reopen and type nvcc -V, it does not work.

I also added the path in

gedit ~/.profile

still the problem persists.

Assuming you have correctly followed all the steps in the Installation Guide yet still when

nvcc --version

is run it still doesn’t output something like this

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85

then this situation might be similar with mine. I found out that nvcc is a hidden file that’s why the system can’t find it. I followed the solution here: https://askubuntu.com/questions/885610/nvcc-version-command-says-nvcc-is-not-installed
and it worked!

Hope this helps!

Hello,
How about to solve my error, i have been installed cuda 9.0 but when i run nvcc–version its still not found and when i trying to run echo $PATH of nvcc the location of cuda 9.0 show on /opt/ros/kinetic/bin:/usr/local/cuda-9.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

then i trying to run ldconfig -p | grep cuda and the result shown

libnvsample_cudaprocess.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libnvsample_cudaprocess.so
libicudata.so.55 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libicudata.so.55
libicudata.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libicudata.so
libcuda.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1
libcuda.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libcuda.so
libcuda.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/tegra/libcuda.so

but, when i trying to install cuda toolkit by run the sudo apt install nvidia-cuda-toolkit

is not available and its referred to another package.

hope for the help…