the exact error:

CUDA error at ../../common/inc/helper_cuda.h:1263 code=30(cudaErrorUnknown) "cudaGetDevice(&dev)"

I'm installing cuda for tensorflow gpu. I have cuda 8 installed (following these instructions for ubuntu 16.04), and I'm having an error with just testing out the writable samples (section 6.2.1 in that link). I keep getting that error across all samples, and nothing I google comes up with that error (only cudaGetDeviceCount() errors). What could this be? I originally installed cuda 9.1 toolkit by accident (tensorflow needs 8.0), but I fully un-installed it and removed any path variables or directories associated with it.

That error comes up when running the executable that the makefile is supposed to create in the sample directories, and the make file itself produces this warning/error:

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

I think the make file doesn't create anything at all, because the make file also runs this at the end:

cp simpleZeroCopy ../../bin/x86_64/linux/release

which is copying the executable from some directory of cached executables of all the examples. The makefile and the source code for that sample are large, and I don't know if they'll be helpful with this, but I'll post them if need be.

This sample code I'm trying to run is directly from cuda, so none of it was programmed by me, which leads me to believe I may be missing either some type of NVIDIA drivers, or I just installed cuda incorrectly/didn't set the appropriate path variables (though I'm pretty sure I did that all just fine).

I'm running ubuntu 16.04, x86_64, and the graphics card is a gtx 780 ti.

I want to clarify that the error is before installing tensorflow-gpu.Their instructions are to first install cuda separately, then tensorflow. I am getting this error just testing out cuda, before the tensorflow install

Edit: Path variables are:




  • The copy of the executable just made is normal, all executables are gathered in the ...bin area as well as being left in the build dir. Please post the results of echo $PATH and echo $LD_LIBRARY_PATH. You are right to fix this error before going on to Tensorflow.
    – ubfan1
    Feb 1, 2018 at 16:15
  • @ubfan1I'm in lecture right now but I'll post them in a little. Feb 1, 2018 at 16:35
  • @ubfan1 I Edited the post to add the path variables Feb 1, 2018 at 18:05
  • Paths seem OK, please post the output of nvidia-smi. The compiler warning is normal.
    – ubfan1
    Feb 1, 2018 at 21:02
  • nvidia-smi command is not found. All i have is nvidia-detector command, which has an output of "None"... That seems like an issues @ubfan1 Feb 1, 2018 at 21:59

1 Answer 1


Your link for the installation instructions is bad. Take a look at https://docs.google.com/viewer?url=https%3A%2F%2Fdeveloper.download.nvidia.com%2Fcompute%2Fcuda%2F9.1%2FProd%2Fdocs%2Fsidebar%2FCUDA_Installation_Guide_Linux.pdf&pdf=true

Basically, use the Ubuntu offered drivers (if possible, not sure about a 980 ti), use the Intel deb cuda installation, and install the Ubuntu cuda package, which gets the toolkit. Copy the samples to a writeable location, modify the paths, and CUDA should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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