Disable kernelExecTimeoutEnabled

Hi,
I want to run my Kernel in a Loop, until it gets a condition from the host.
similar to this.

global void myKernel(bool *devBool, other Parameters)
{
while(*devBool)
{
… do something …
}
}

int main(int argc, char** argv)
{
bool *hostBool;
bool *deviceBool;

cudaSetDeviceFlags(cudaDeviceMapHost);
cudaHostAlloc((void**)&hostBool, sizeof(bool), cudaHostAllocMapped);
cudaHostGetDevicePointer((void**)&deviceBool, (void*)hostBool, 0);
*hostBool = true;

dim3 dimBlock(10);
dim3 dimGrid(1);
myKernel<<dimGrid, dimBlock>> (devBool, other Parameters);

sleep(10000); //or something else what takes a long time

*hostBool = false;

cudaFreeHost(hostBool);
cudaFree(devBool);
}

How can I be on the safe side, that the threads are never killed, because the kernelExecTimeoutEnabled is true?

You should assume that any kind of host<->device memory access during kernel execution won’t give any sort of useful coherence, and the style of “signalling” from host to running kernel (or vice verse) can’t be done. Apart from that, the you cannot use the results of cudaHostGetDevicePointer() in the way your proposed code does.

You might want to think about using a host side loop with a kernel design that is effectively re-entrant instead. If you need to get a flag or small set of values back from device memory to the host loop, consider using zero-copy memory.

As for timeouts, the only way to avoid the timeout/watchdog timer problem is to either have short running kernels, or use a dedicated compute GPU without an attached display manager.