Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I successfully installed the nvidia driver and toolkit for cuda 5 (but not the samples) on a 64 bit Ubuntu 12.04 box. The samples failed to install even though I previously ran

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

I can't seem to find nvcc. I ran

export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:$LD_LIBRARY_PATH 

nvcc -v reports that the compiler is not found:

nvcc -V No command 'nvcc' found, did you mean:
 Command 'nvlc' from package 'vlc-nox' (universe)
nvcc: command not found

The getting started guide hasn't been of much help here.

What's going on here? Do I need to install the gpu computing sdk samples to get nvcc?

share|improve this question

3 Answers 3

It looks like you installed nvcc but it's not in the executable path.

The libraries are located in /usr/local/cuda-5.0/lib and /usr/local/cuda-5.0/lib64, so the executables are probably located in /usr/local/cuda-5.0/bin. Check in that directory, to see if there is a file called nvcc. If so, add /usr/local/cuda-5.0/bin to your PATH environment variable.

If nvcc is not located there, search the entire /usr/local/cuda-5.0 directory. One way to do that is to run the command:

find /usr/local/cuda-5.0 -name nvcc

Once you find it, you can add the directory that contains it to your PATH variable, or you can make a symbolic link to it in a directory that's in your PATH, or you can invoke it by its full path name (e.g., /usr/local/cuda-5.0/someplace/nvcc).

share|improve this answer

In my build (Ubuntu Server 13.10), nvcc ended up in /usr/lib/nvidia-cuda-toolkit (in the 'bin' directory) - adding a symlink to there from /usr/local/cuda fixed up all of my CUDA problems.

sudo ln -s /usr/lib/nvidia-cuda-toolkit /usr/local/cuda


share|improve this answer

// , Follow the instructions outlined here:


NVCC is part of the CUDA Toolkit.

I recommend installing the CUDA Toolkit directly from NVIDIA's site for such things:


Visit the above link, select the Linux x86 tab, and pick the .deb file for your distribution.

Like Eliah Kagan said, you'll find it in the default installation directory for the Toolkit files.

e.g., if you had CUDA 7.0 one would search in the /usr/local/cuda-7.0 directory:

find /usr/local/cuda-7.0 -name nvcc

The above command should generate output like /usr/local/cuda-7.0/bin/nvcc

If that doesn't work, try a more general search, like

find /usr/local -name nvcc

...or check where that version installed itself.

If one installs a different version, obviously the directory where it flings its files will vary accordingly.

Also, make sure that the shell gets nvcc and other runnables in its executable path by adding the following in the .bashrc file of your home folder.

export CUDA_HOME=/usr/local/cuda-7.0 
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64 

export PATH 

The above will allow you to run make for CUDA projects without errors about the meaninglessness of nvcc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.