Why does it crash?

Hi.

I’m a newbie so don’t throw stones just yet.
My CUDA program keeps crashing for the strangest reasons but debugging seems to be a pain in the …

How do I know the reason it crashed or how do I know the kernel even executed?

Thanks for any useful suggestions.

use

cudaError error = cudaThreadSynchronize();

after each kernel call and checking the value of error. If its value is cudaSucess( or 0) than your kernel is executed sucessfully other wise there is some problem in your kernel(Depende on type of error.).

Thanks a lot!

Now I have to find what “the launch timed out and was terminated” means. :rolleyes:

So thanks to CUDAkk I know that my crashes are accompanied by “the launch timed out and was terminated” error. Is there any general reason for this error? (except timing-out which is obviously bogus because the kernel terminates after ridiculously short time)

The error means there was a timeout. Google for “watchdog,windows,nVidia” (if you’re using windows or X).

Still it would be helpful to see your host and kernel code, you’re probably either have an infinite loop or dont measure the time

correctly and therefore assume the kernel terminates after ridiculously short time (which is what btw? )

eyal

error “the launch timed out and was terminated” means your kernel takes large time to execute.

actually each kernel execution time must be less than 5 sec( please check the time value ) . If execution time exceeds this then you get “the launch timed out and was terminated”.