Can I stop all processes using CUDA in Linux without rebooting?

Christopher Dorian picture Christopher Dorian · Dec 4, 2010 · Viewed 20k times · Source

Is it possible to stop all running processing using the GPU via CUDA, without restarting the machine?

Answer

i_grok picture i_grok · Dec 31, 2010

The lsof utility will help with this. You can get a list of processes accessing your NVIDIA cards with:

lsof /dev/nvidia*

Then use kill or pkill to terminate the processes you want. Note that you may not want to kill X if it's running. On my desktop system, both X and kwin are also accessing the GPU.