Kill all threads currnetly running on GPU using CUDA Not able to kill bad kernel running on NVIDIA G


I am in a real fix. Please help. Its urgent.

I have a host process that spawns multiple host(CPU) threads (pthreads). These threads in turn call the CUDA kernel. These CUDA kernels are written by external users. So it might be bad kernels that enter infinite loop. In order to overcome this I have put a time-out of 2 mins that will kill the corresponding CPU thread.

Will killing the CPU thread also kill the kernel running on the GPU? As far as what I have tested it does’nt.

How can I kill all the threads currently running in the GPU?

The reason I am using CPU threads that call the kernel is because, the sever has two Tesla GPU’s. So the thread will schedule the kernel on the GPU device alternatively.