Error while trying to start the examples

When I try to run asyncAPI I get the following error:
CUDA error at …/…/common/inc/helper_cuda.h:1032 code=35(cudaErrorInsufficientDriver) “cudaGetDeviceCount(&device_count)”
I use cuda toolkit 6.5 ,ubuntu 14.04 gtx 660M drivers:340.58.

I would assume that the driver you have loaded is not 340.58, or else your driver install is broken.

Do you get an error like this when tryning to run other cuda samples as well?

What is the output of the nvidia-smi command?

Yes the other sample have the same problem.The smi returns : NVIDIA-SMI couldn’t find library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains to your system PATH.
But i CAN find this lib in my laptop.

So your driver install is broken. I suggest re-installing the driver.

And how to install it properly?

I would suggest downloading the latest runfile installer from and running it as root user.
You’ll also want to be sure to disable/remove nouveau driver, which is covered in various places on the web as well as in the driver readme file.