diff --git a/scripts/killall_sglang.sh b/scripts/killall_sglang.sh index 3696a1c35f4..d9899c95b6a 100755 --- a/scripts/killall_sglang.sh +++ b/scripts/killall_sglang.sh @@ -8,7 +8,6 @@ kill -9 $(ps aux | grep 'sglang::' | grep -v 'grep' | awk '{print $2}') 2>/dev/n kill -9 $(ps aux | grep 'sglang.launch_server' | grep -v 'grep' | awk '{print $2}') 2>/dev/null kill -9 $(ps aux | grep 'sglang.bench' | grep -v 'grep' | awk '{print $2}') 2>/dev/null -# Clean all GPU processes if any argument is provided -if [ $# -gt 0 ]; then - kill -9 $(nvidia-smi | sed -n '/Processes:/,$p' | grep " [0-9]" | awk '{print $5}') 2>/dev/null -fi +# Clean all GPU processes +kill -9 $(nvidia-smi | sed -n '/Processes:/,$p' | grep " [0-9]" | awk '{print $5}') 2>/dev/null +lsof /dev/nvidia* | awk '{print $2}' | xargs kill -9 2>/dev/null