·8 min read
Fix "CUDA out of memory" Errors in PyTorch
CUDA out of memory in PyTorch often fires while nvidia-smi still shows free VRAM, because the caching allocator needs a contiguous block, not just free space. This guide gives a copy-paste triage path from fastest fixes to fragmentation tuning, plus how to tell a real leak apart from fragmentation.
Troubleshooting