2

I would like to interrupt "gently" a running kernel, that is: send it a signal of some sort (via global memory?), let it do its cleaning stuff and return to host.

I tried a simple program, using the *nix signal() function to change a bit on the global memory using a regular cudaMemcpy, but without success.

Is it possible? Is it possible for the host to write onto the device's memory while a kernel is running?

AkiRoss
  • 11,745
  • 6
  • 59
  • 86

1 Answers1

3

No it isn't possible.

While you might be tempted to think that zero copy allows this, there is no guarantee of memory coherence between the host and device across the PCI express bus while a kernel is running.

talonmies
  • 70,661
  • 34
  • 192
  • 269
  • Does this mean that there is *no way* of passing data from host and device without stopping the kernel? That's a pity :( – AkiRoss May 06 '13 at 19:47
  • 1
    You can pass data, CUDA fully supports simultaneous kernel execution with data transfer. But what isn't supported is any notion or guarantee of data coherence between a running kernel and a concurrently running data transfer. – talonmies May 06 '13 at 19:54
  • @talonmies no guarantees doesn't mean it is impossible – RSFalcon7 May 06 '13 at 20:33
  • 1
    @RSFalcon7: It doesn't mean it is possible either. You might be able to find some combination of chipset, device, operating system and driver where it might work some of the time, but all of the PCI express standards released to date say it doesn't have to work and, as a result, it mostly doesn't. If you want to design software based on accidental, undefined hardware behaviour, by all means go ahead and do so...... – talonmies May 06 '13 at 20:46