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

torch.cuda.OutOfMemoryError with SDXL #2785

Open
Marcel0504 opened this issue Mar 11, 2024 · 2 comments
Open

torch.cuda.OutOfMemoryError with SDXL #2785

Marcel0504 opened this issue Mar 11, 2024 · 2 comments

Comments

@Marcel0504
Copy link

Hello,

I've set up my notebook on Paperspace as per the instructions in TheLastBen/PPS, aiming to run StableDiffusion XL on a P4000 GPU. However, when attempting to generate an image, I encounter a CUDA out of memory error:

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 10.00 MiB (GPU 0; 7.92 GiB total capacity; 6.79 GiB already allocated; 5.69 MiB free; 7.04 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

I've followed all setup instructions to the letter and haven't deviated from the recommended settings. Despite the detailed error message, I'm unsure how to proceed to resolve this.
Has anyone encountered a similar issue or has suggestions what I should do?

I previously tried to:

  • delete pytorch and update to a newer version that supports the CUDA Version running on the GPU (12.0)
  • use a higher PyTorch version
  • use SD 1.5 instead of SDXL, which seems to work

Thank you very much!

@TheLastBen
Copy link
Owner

try again now

@Marcel0504
Copy link
Author

Thanks for the quick response and for trying to resolve the issue, but unfortunately it still doesn't work right.

Now I don't get an error message, but when I open the WebUI and try to generate an image it shows "In queue 1/1" for a moment and then just loads forever but without generating any image.
If I try to restart the Web UI it again goes into "Reloading..." state and then nothing happens.

I hope this helps. Thanks again for the support!

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