deviceQuery error on Ubuntu 16.04 cuda 8 installation (GTX 1060)

I am in the process of installing cuda in order to be able to run gpu-enabled tensorflow.

After downloading the cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb file, I followed the steps outlined in the cuda installation docs page, and eventually got stuck here: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#running-binaries

When I try to run deviceQuery in this directory…

~/NVIDIA_CUDA-8.0_Samples

…as specified in the instructions, the output says “command not found.”

So far I tried going into

~/NVIDIA_CUDA-8.0_Samples/1_Utilities/deviceQuery$

and running “make” but the output says "Nothing to be done for ‘all’.

Unsure of what to do from here. Another problem I noticed is that when I open a second terminal window and try to run nvcc -V, the output says it’s not even installed, and I need the cuda toolkit to run it. Yet with the original terminal window still open (that I used for the previous installation steps) I can run that command just fine and get the following output:

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

Not sure if this is normal.

I have all the commands and output from previous steps saved so if that info’s needed for troubleshooting, let me know.

Follow the install guide instructions carefully

To build the CUDA sample codes, change directory to:

/usr/local/cuda/samples

then, as root user, issue:

make -k

That will take a while

After that, all of the built binaries should be in:

/usr/local/cuda/samples/bin/x86_64/linux/release

If you change to that directory, you should be able to run e.g. deviceQuery by:

./deviceQuery

Regarding your second problem, note the instructions that are in the linux install guide:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

These environment variables (PATH and LD_LIBRARY_PATH) must be established in each new process or shell that you open. This is a linux characteristic, not unique to CUDA. To make these changes take effect for each new login or new shell, folks commonly put these in the appropriate .bashrc file (or one of the files scanned from .bashrc), so that these env var settings take effect all the time. A bit of googling will probably help here. There are other methods besides using .bashrc

The install guides assume a modicum of linux knowledge. One could certainly argue about where to draw the line, as each individual may have different needs. But an install guide that assumed no knowledge whatsoever would be tediously long.

Hello txbob, a quick update:

The cuda samples mostly all work now (those have been fun to mess with for the last few days to be honest). Strange that the installation page I read on the nvidia site doesn’t mention the right directory to build the samples or where the built binaries truly do go.

Now I guess I just need to do some research on properly editing the .bashrc file so I need not enter the PATH variables each time.

Once I do that I will begin the process of switching Tensorflow versions to try the GPU-enabled variant.

I suspect other people trying to install cuda on Ubuntu are doing it for the same purpose - many data scientists in training don’t want to fork the cash for a Mac.

If I encounter another error specific to CUDA, I’ll either post here or start a new thread if it’s a distinctly new problem not covered in other threads.

UPDATE: To make the changes work for all terminal sessions, I entered nano ~/.bashrc into the terminal to open it and scrolled to the very bottom where I then pasted this in:

  • export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
  • That was the same format for an anaconda path variable directly above it.

    I then saved the ~/.bashrc file, and the next command I entered was

  • source ~/.bashrc
  • So now everything from here on out will be tensorflow issues, looks like CUDA is working flawlessly.

    Just a quick follow-up for Robert:

    In the installation instructions it says that the LD_LIBRARY_PATH has to be written into the shell only for the runfile installation. Is this true, or does the local deb installation require this as well?

    Cheers,
    Jan

    deb installation requires it as well.

    incidentally my read of the installation guide:

    https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

    section 7 does not suggest that these things apply to runfile installation only. Maybe I’ve missed something.

    Got it, thanks Robert!

    To me it looked like just the bin and NSight directories needed to be appended in .bashrc.
    I then read the next paragraph as only for the runfile installation:
    “In addition, when using the runfile installation method, the LD_LIBRARY_PATH variable needs to contain /usr/local/cuda-10.2/lib64 on a 64-bit system, or /usr/local/cuda-10.2/lib on a 32-bit system”

    On a similar topic (and if you don’t mind continuing this thread), I am unable to install the NSight Eclpise using the "nsight_ee_plugins_manage.sh install " method. I keep getting an error stating it cannot find the binaries in . Where is this directory located or how can one create it?

    Thank you again for your help!

    Do you have eclipse installed? It’s looking for the eclipse binaries. Those aren’t included in the installer.

    To be more specific:

    1. The installer includes Nsight EE, which is a fully packaged/modified eclipse install. This shouldn’t require anything else (for example it does not require installation of the eclipse plugins).

    2. Alternatively, you can use your own eclipse install, and just run the eclipse plugins installer script.

    The problem you are having is with method 2, and it is basically indicating it cannot find your install of eclipse.

    Ah, ok, great.

    I did try running the “nsight -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java” but changed it to current version of java installed on my OS: “nsight -vm /usr/lib/jvm/java-11-openjdk-amd64/bin/java”

    nsight starts but crashes with the following “illegal reflective error”:

    OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
    CompileCommand: exclude java/lang/reflect/Array.newInstance
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.eclipse.osgi.storage.FrameworkExtensionInstaller (file:/usr/local/cuda-10.2/libnsight/plugins/org.eclipse.osgi_3.10.1.v20140909-1633.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
    WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.storage.FrameworkExtensionInstaller
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release

    Any suggestions? Do I need jdk 8 specifically?

    https://docs.nvidia.com/cuda/nsight-eclipse-edition-getting-started-guide/index.html#installation-jdk-jre

    Awesome, problem solved. Many thanks!