Error in CUDA7.0

Hi
I used this script for checking if my NVIDIA NVCC compiler has been installed properly:
#include <stdio.h>
global void helloFromGPU(void)
{
printf(“Hello World from GPU!\n”);
}
int main(void)
{
printf(“Hello world from CPU!\n”);
helloFromGPU<<<1,10>>>();
cudaDeviceReset();
return 0;
}
It should produce, as output:
Hello world from CPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Unfortunately I compiled the program without any error with the command:
nvcc -arch sm_20 hello.cu -o hello
and I got as result:
Hello world from CPU!
What is wrong with my program?
Thank you in advance for any help.

Something is wrong with your machine setup and it’s not possible to diagnose from just this program, which doesn’t do proper CUDA error checking. I suggest proper cuda error checking be added to the program. (google “proper cuda error checking” and take the first hit. Then modify your code according to those instructions, recompile, and re-run.)

A similar discussion, with apparently the same code, was just covered in this thread:

https://devtalk.nvidia.com/default/topic/825582/cuda-setup-and-installation/run-hello-world-segmentation-fault/

You may want to review it and follow some of the steps there.