0

I wish to terminate a running CUDA kernel (A) incase I wish to run another higher priority kernel (B) immediately. Is this possible (or something like setting a watchdog timer before launching (A) to bound the time (A) runs)?

Also, if possible, would this termination have any impact on the CUDA context of (A) i.e. if (A) completed partially before termination, would I be able to read in that partial output from GPU memory?

Also, what would be the overhead of much a termination?

Edit: How to interrupt or cancel a CUDA kernel from host code doesn't answer my question, because my kernel (A) would not be polling for any "command" from host. The termination command from host is completely asynchronous from the GPU. Also, I would like as little latency between host wanting to terminate (A) and (A) being terminated.

Saksham Jain
  • 537
  • 3
  • 14
  • The answers in that question don't satisfy my criteria. In my scenario, the kernel is not polling any global memory to check any command from host. I will mention in my question that the termination command is needed to be asynchronous to the GPU kernel. – Saksham Jain Mar 17 '18 at 12:40
  • 2
    None of the things you mention are possible. Without assistance from the kernel itself (i.e. polling) you cannot 1. remove a kernel that is already queued from the launch queue. 2. terminate a kernel that is already running 3. limit (bound) the runtime of a kernel. Note that the linked duplicate **really is** a duplicate of your (original) question, because the linked duplicate question itself makes no mention of wanting or intending to use polling from the kernel. The answers (both of them) propose that because that is the **only** possible method to achieve something like it. – Robert Crovella Mar 17 '18 at 13:17

0 Answers0