Hello,
I just started programming with Cuda, and I already face a problem. The hello world does not work. I have installed the latest version of Cuda, and I code in Visual Studio. I specify that my graphic card drivers are up to date. I’ve seen other similar topics on other forums but none have helped me.
Here is the code that I run as Hello Word :
It does not show me any compile-time errors or warnings. It simply runs but does not display anything.
If anyone has an idea what the problem could be, I’m interested.
Thanks in advance.
Try adding a call cudaDeviceSyncrhonize() after the kernel invocation. Device-side printf() prints into a buffer that is transferred to the host, and adding this API call should ensure that the buffer is emptied (similar to what fflush(stdout) might accomplish in host code) before the program terminates.
It is also possible that the kernel does not even execute, e.g. due to a runtime/driver mismatch. You would want to add proper CUDA status (error) checking. if you don’t know what that is, Google for “proper CUDA error checking” and much useful information will come up in the first page of search results. Running compute-sanitizer [your executable] can provide a useful quick check whether there are any basic issues with the executable.
Thanks for your anwser, I finally found the problem, it’s that my graphic card doesn’t support this configuration of Cuda. If anyone has a Nvidia 920 Mx, it only works with older versions of Cuda.
So the subject is closed, have a nice day !