Long Running Kernel Causes Freeze

I read in the CUDA documentation and various forum posts that there is a 5 second time limit for kernels running on cards with an X display attached. I created a test program that launches one kernel with an infinite loop to see how the system reacts to the long running kernel. The following code causes my entire system (running 32-bit Ubuntu 8.04) to freeze, and require a reboot. Is this the expected behavior? I’ve seen several forum posts indicating that a timeout message should be displayed but I am not seeing that.

[codebox]#include <cuda_runtime_api.h>

#include <stdio.h>

global void timeout( void )

{

while( 1 ){}

}

int main( int argc, char *argv )

{

printf( "Invoking kernel… " );

timeout<<< 1, 1 >>>();

printf( “Done\n” );

return 0;

}[/codebox]

The watchdog timeout behavior will be highly dependent on your particular HW, OS & code. Assuming that this only reproduces with a single GPU while X is running, then this is expected behavior. If it reproduces without X running, then there might be a bug somewhere, and you’ll need to attach an nvidia-bug-report.log from your system.