Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I use the CUDA toolkit to perform some computations on my Nvidia GPUs on Windows 7 SP1 x64 Ultimate. How to kill all processes that use a given GPU? (killing all processes at once)
This PowerShell command worked for me:
kill -9 $(nvidia-smi | sed -n 's/|\s*[0-9]*\s*\([0-9]*\)\d*.*/\1/p' | sort | uniq | sed '/^$/d')
Required, but never shown