Created
April 23, 2022 05:02
-
-
Save OhadRubin/3e9d793223566684b74311fc56a63ca0 to your computer and use it in GitHub Desktop.
Kill all the processes on a given GPU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: `killgpu 0` will kill all the processes that are using gpu 0 | |
killgpu (){ | |
# https://forums.developer.nvidia.com/t/11-gb-of-gpu-ram-used-and-no-process-listed-by-nvidia-smi/44459/14 | |
fuser -v /dev/nvidia$@ 2>&1 | grep python | grep -o -E " [0-9]+ " | xargs kill -9 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment