lllyasviel / Fooocus

Focus on prompting and generating
GNU General Public License v3.0
40.2k stars 5.58k forks source link

Fooocus crashes silently on second or third runs. #447

Open lanyusan opened 12 months ago

lanyusan commented 12 months ago

I am running Fooocus 2.0.72 on a ubuntu 22.04 PC, with 32G ram and 16 vram. This happens always.

Cuda version is 11.7

The console output:

[Fooocus] Initializing ...
[Fooocus] Loading models ...
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] New suffix: extremely detailed oil painting, unreal 5 render, rhads, Bruce Pennington, Studio Ghibli, tim hildebrandt, digital art, octane render, beautiful composition, trending on artstation, award-winning photograph, masterpiece
[Fooocus] Encoding base positive #1 ...
[Fooocus] Encoding base negative #1 ...
[Fooocus] Encoding refiner positive #1 ...
[Fooocus] Encoding refiner negative #1 ...
[ADM] Negative ADM = True
Killed
lllyasviel commented 12 months ago

this may happen if you have disabled swap when installing ubuntu https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04

lanyusan commented 12 months ago

I have followed the link to check my swap file info:

               total        used        free      shared  buff/cache   available
Mem:            31Gi       5.6Gi        23Gi       945Mi       1.9Gi        24Gi
Swap:          2.0Gi       2.0Gi       0.0Ki

It looks there is no free swap space. Is it normal? Should I increase swap file size? And if it is full, should Fooocus still work if the PC has sufficient ram and vram?

lllyasviel commented 12 months ago

if it says Killed then it is usually the free swap is too small and os killed it

lanyusan commented 12 months ago

My PC was really busy. 50+ browser tabs were opened. Editors etc. were also running.

After I closed a few apps, it freed up around 300M swap space.

Fooocus then worked normally.

But once I opened some apps and free swap space reached 0, Fooocus crashed again.

Is there anyways to make it more robust? I think it is quite often for a linux PC to use up all swap space.