PSA - Add Swap and Your Linux Box won't crash when switching models
I rebuilt my Ubuntu box which only has 16GB of RAM and everytime I switched checkpoint models in Automatic1111 Linux would freeze up or crash. After some diagnosis I found that I was running out of memory and didn't have enough swap. If this is happening to you, here is how to add more swap space.
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04
And it even gets bigger with control net, which wants another 16GB of RAM. Combined stable diffusion + control net = 40GB of RAM usage. On my 16GB machine RAM is Full and SWAP is at 30GB.
MiB Mem : 15900.2 total, 161.5 free, 13507.7 used, 2231.0 buff/cache
MiB Swap: 30517.6 total, 17671.8 free, 12845.8 used. 2060.2 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
189801 mgeorge 20 0 40.9g 12.6g 153264 S 17.9 81.4 6:54.57 python3
Edited 21 Feb 2023. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 6 · 100% up
- Kind
- Text
- ID
- 116uc69