Problem with cuda 7 toolkit Samples

Hi all,

I installed Cuda 7.0. I did verify that I have a GPU, Ubuntu 14.04, etc for the installation process.
However, when I try to run the examples (make first), i get CUDA related errors:

[i]sudo ./vectorAdd
[Vector addition of 50000 elements]
Failed to allocate device vector A (error code no CUDA-capable device is detected)!

sudo ./simplePrintf
CUDA error at …/…/common/inc/helper_cuda.h:1105 code=38(cudaErrorNoDevice) “cudaGetDeviceCount(&device_count)”[/i]

I though the paths were not set properly, but i think they are:
bash: /usr/local/cuda-7.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: No such file or directory
bash: /usr/local/cuda-7.0/lib64:: No such file or directory

Any ideas on how to solve this potential installation issue?


How exactly did you install CUDA 7?
Was this done on a clean load of Ubuntu 14.04, or is there some history here? (e.g. prior cuda versions loaded, etc.)
which GPU specifically?
what is the result of running:




Thanks for the reply.

I followed these:

I did install CUDA 7 before, then uninstalled it using these commands:
sudo apt-get purge nvidia-*
sudo apt-get autoremove

lspci | grep -i nvidia
did give some Nvidia thingy, which should be ok right?

I get this when I do


| NVIDIA-SMI 346.46 Driver Version: 346.46 |
| 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 GTX 970 Off | 0000:02:00.0 N/A | N/A |
| 29% 31C P8 N/A / N/A | 122MiB / 4095MiB | N/A Default |

| Processes: GPU Memory |
| GPU PID Type Process name Usage |
| 0 C+G Not Supported |

ok now it is working.

sudo ./vectorAdd
[Vector addition of 50000 elements]
Copy input data from the host memory to the CUDA device
CUDA kernel launch with 196 blocks of 256 threads
Copy output data from the CUDA device to the host memory

I just restarted Ubuntu (was that required though?).

Hey, I have encountered a similar problem with the examples.
What do you mean by run nvidia-smi?