Fooocus-API icon indicating copy to clipboard operation
Fooocus-API copied to clipboard

VRAM of 8GB - Memory issues - anyone has a suggestion?

Open miraculix95 opened this issue 1 year ago • 3 comments

If I play too much around with FaceSwaps, Loras, different checkpoints and refiners I regularly get memory errors and the API request fails. This looks like this:

Mar 25 12:15:11 pst9hxxwlbdr python3[8289]: ERROR diffusion_model.output_blocks.1.1.transformer_blocks.1.ff.net.0.proj.weight CUDA out of memory. Tried to allocate 50.00 MiB. GPU 0 has a total capacty of 7.79 GiB of which 44.50 MiB is free. Including non-PyTorch memory, this process has 7.74 GiB memory in use. Of the allocated memory 7.24 GiB is allocated by PyTorch, and 382.24 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Now, the strange thing. If this happens, I even get into trouble to continue with a simple prompt without loras, refiners, ... Even restarting Fooocus-API does not help.

Using Fooocus 2.3. Has anyone an idea what I can do?

miraculix95 avatar Mar 25 '24 12:03 miraculix95

Is this happening when only using Fooocus itself?

zeason avatar Apr 06 '24 15:04 zeason

try these paremeters when startup --always-low-vram --always-offload-from-vram

mrhan1993 avatar Apr 12 '24 03:04 mrhan1993

I experienced the same issue on my Windows and MacBook devices, but worked when I moved to paperspace using A100-80G machine. Worked perfectly.

Mutai-Gilbert avatar Apr 12 '24 10:04 Mutai-Gilbert