| name | kill-gpu |
| description | Kill GPU-occupying Python/vLLM processes to free GPU memory. Use when nvidia-smi shows memory in use by dead or unwanted processes. |
Kill GPU Processes
Steps
- Show which PIDs are using GPU memory:
nvidia-smi --query-compute-apps=pid,used_memory,name --format=csv,noheader
- Find candidate Python and vLLM processes:
pgrep -a python; pgrep -a vllm
- Kill identified PIDs:
kill -9 <PID>
- Wait 2–3 seconds, then verify memory is freed:
nvidia-smi | grep -E "MiB.*MiB"
Notes
- If
nvidia-smi --query-compute-apps shows a PID that no longer exists in pgrep, it's a zombie CUDA context — killing the parent process or waiting a few seconds usually clears it.
- Confirm with user which PIDs to kill unless they said "kill all".