Sygil-Dev / sygil-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
7.86k stars 883 forks source link

[Bug]: Error: CUDA error: out of memory CUDA #1493

Open c8501024 opened 1 year ago

c8501024 commented 1 year ago

What happened?

  1. I started the program and entered the webui
  2. I click "Generate", it instantly shows: Error: CUDA error: out of memory CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

NVIDIA GTX1650 Ti 4GB RAM

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Windows

Custom settings

I changed in scripts/relauncher.py:

optimized=True
and
os.system(f"python scripts/webui.py --no-half --precision=full ....

Relevant log output

Running on local URL:  http://localhost:7860/

To create a public link, set `share=True` in `launch()`.
Exception processing job JobInfo(inputs=('dog', 50, 'k_lms', [1, 2, 3, 4, 5], 'RealESRGAN_x4plus', 0, 1, 1, 7.5, '', 128, 128, None, 0, ''), func=<function txt2img at 0x0000025C9B0419D0>, session_key='"86d6c1e835304f02af52fd1e2e49f19f"', job_token=0, images=[], active_image=None, rec_steps_enabled=False, rec_steps_imgs=[], rec_steps_intrvl=3, rec_steps_to_gallery=False, rec_steps_to_file=False, should_stop=<threading.Event object at 0x0000025BBB018100>, refresh_active_image_requested=<threading.Event object at 0x0000025BBB012B80>, refresh_active_image_done=<threading.Event object at 0x0000025BBB0127C0>, stop_cur_iter=<threading.Event object at 0x0000025BBB012D30>, active_iteration_cnt=0, job_status='Error: CUDA error: out of memory\nCUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.\nFor debugging consider passing CUDA_LAUNCH_BLOCKING=1.', finished=False, started=True, timestamp=1665333742.3886633, removed_output_idxs=[0]): CUDA error: out of memory
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Traceback (most recent call last):

Code of Conduct

timothy-WangS commented 1 year ago

you might need a GPU with more memory. In my case, 3080 with 10 GB memory, stable-diffusion-v1.4 takes up about 6.7 GB while waifu takes up 7.3 GB memory.

timothy-WangS commented 1 year ago

or, you can use smaller picture size for generating, that might work

codefaux commented 1 year ago

See my comment here; https://github.com/Sygil-Dev/sygil-webui/issues/1507#issuecomment-1292454581