Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRAM does not released #724

Closed
daxijiu opened this issue Oct 18, 2023 · 8 comments
Closed

VRAM does not released #724

daxijiu opened this issue Oct 18, 2023 · 8 comments

Comments

@daxijiu
Copy link

daxijiu commented Oct 18, 2023

I don't know from when it started.
After generating an image, the VRAM does not get released (21.5/24 on 4090). Subsequent image generation becomes very slow (due to VRAM being full). I'm using the Windows compressed package "Fooocus_win64_2-1-60.7z". My Windows 10 driver version is 531.61.

@lllyasviel
Copy link
Owner

show full log

@daxijiu
Copy link
Author

daxijiu commented Oct 18, 2023

D:\Fooocus_webui>.\python_embeded\python.exe -s Fooocus\entry_with_update.py
Fast-forward merge
Update succeeded.
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Fooocus version: 2.1.697
Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch().
Total VRAM 24564 MB, total RAM 65237 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : native
VAE dtype: torch.bfloat16
Using pytorch cross attention
model_type EPS
adm 2560
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
missing {'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}
Refiner model loaded: D:\Fooocus_webui\Fooocus\models\checkpoints\sd_xl_refiner_1.0_0.9vae.safetensors
model_type EPS
adm 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
missing {'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}
Base model loaded: D:\Fooocus_webui\Fooocus\models\checkpoints\sd_xl_base_1.0_0.9vae.safetensors
LoRAs loaded: [('sd_xl_offset_example-lora_1.0.safetensors', 0.5), ('None', 0.5), ('None', 0.5), ('None', 0.5), ('None', 0.5)]
Fooocus Expansion engine loaded for cuda:0, use_fp16 = True.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
[Fooocus Model Management] Moving model(s) has taken 0.28 seconds
App started successful. Use the app with http://127.0.0.1:7860/ or 127.0.0.1:7860
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 7.0
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 20
[Fooocus] Initializing ...
[Fooocus] Loading models ...
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] New suffix: intricate, sharp focus, illustration, highly detailed, digital painting, concept art, matte, art by wlop and artgerm and ivan shishkin and andrey shishkin, masterpiece
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] New suffix: extremely fine details, realistic shaded lighting, dynamic background, artgerm, 8 k ultra realistic, highly detailed, art by christopher balaskas, alphonse mucha, craig mullins, alena aenami, ultra detailed
[Fooocus] Encoding positive #1 ...
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
Preparation time: 1.14 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.02916753850877285, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.95 seconds
[Sampler] Fooocus sampler is activated.
67%|██████████████████████████████████████████████████████▋ | 20/30 [00:03<00:01, 6.84it/s]Requested to load SDXLRefiner
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.84 seconds
Refiner Swapped
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:05<00:00, 5.48it/s]
Image generated with private log at: D:\Fooocus_webui\Fooocus\outputs\2023-10-18\log.html
Generating and saving time: 7.27 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.02916753850877285, sigma_max = 14.614643096923828
[Sampler] Fooocus sampler is activated.
67%|██████████████████████████████████████████████████████▋ | 20/30 [00:07<00:14, 1.40s/it]Refiner Swapped
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:25<00:00, 1.16it/s]
Image generated with private log at: D:\Fooocus_webui\Fooocus\outputs\2023-10-18\log.html
Generating and saving time: 57.52 seconds
Total time: 67.29 seconds

@daxijiu
Copy link
Author

daxijiu commented Oct 18, 2023

After generating the first image, the VRAM usage is 21.5GB. During the generation of the second image, the VRAM usage increases to 23.5GB. After both images are generated, the VRAM usage remains at 23.5GB.

@lllyasviel
Copy link
Owner

lllyasviel commented Oct 18, 2023

will take a look soon
you can try to add --disable-smart-memory to run.bat and see what happen

@daxijiu
Copy link
Author

daxijiu commented Oct 18, 2023

with --disable-smart-memory,
it looks OK now. After generating the first image, the VRAM usage is around 8.6GB. When generating again, there may be fluctuations in between, but after the generation is complete, the VRAM usage remains at 8.6GB. The speed is also normal.

@lllyasviel
Copy link
Owner

fixed in 2.1.699.
Now this is always off

@lllyasviel
Copy link
Owner

Please remove --disable-smart-memory and see if problem still there in 2.1.699

@lllyasviel lllyasviel reopened this Oct 18, 2023
@daxijiu
Copy link
Author

daxijiu commented Oct 18, 2023

2.1.699 is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants