Cuda infinite core

I am working on an application for which it is necessary to run the CUDA kernel indefinitely. I have one CPU thread that writes stg to a list, and gpu reads this list and flushes (at least for starters). When I write inside the kernel

while(true) { //kernel code } 

the system freezes. I know that the GPU is still being processed, but of course nothing happens. And I'm not sure what will reset in the list.

I should mention that the GPU used for calculations is not used for display, so there is a watchdog problem.

OS - Ubuntu 11.10 and cuda toolkit 4.1. I could use any help / examples / links to successfully write an infinite kernel.

+3
source share
1 answer

The CUDA programming language and CUDA architecture do not currently support infinite kernels. I suggest you consider Roger's suggestion.

If you want to continue this, I suggest you add the following debugging code to your kernel:

  • The increment of the variable in the committed memory every N hours (may require a different location for each SM) and
  • Periodically read the memory location that the CPU can update to report kernel output.

This is a software watchdog.

You can use clock () or clock64 () to control how often you do (1) and (2).

You can use cuda-gdb to debug your problem.

Endless loops are not supported on the language. The compiler may be stripping code. You can view PTX and SASS. If the compiler generates bad code, you can fake it if the compiler thinks that there is a valid exit condition.

+1
source

All Articles