Configuring timeout

Is there a way to configure a timeout for a cuda program execution? While debugging (under X), I constantly have to reboot my computer when my buggy program locks up my entire operating system. I have not experienced any automatic shutdown after 5 seconds due to a watchdog timer on linux as others have reported.


The timeout only happens if a single kernel runs for more than 5 seconds. If you end up writing past the end of an array on the GPU, you are on your own. In my experience, the system is still somewhat responsive after running such a buggy CUDA program, but when one tries to run an OpenGL program, the system freezes solid.

Is there something preventing you from debugging your program in emulation mode? valgrind is a wonderful tool for this.

Yeah I’m only running a single kernel. I’ve never had it come back after 5 seconds, is there some setting in the kernel I can enable to make this work? I noticed there is a kernel option to turn on a watchdog timer, is that what X uses?

The only way I know to disable the watchdog timer is to run in the linux console mode. It should already be enabled whenever X is running.