suno-ai / bark

🔊 Text-Prompted Generative Audio Model
MIT License
35.24k stars 4.13k forks source link

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 5.80 GiB total capacity; 5.64 GiB already allocated; 15.69 MiB free; 5.65 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 #407

Open yangcopnuli opened 1 year ago

yangcopnuli commented 1 year ago

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 5.80 GiB total capacity; 5.64 GiB already allocated; 15.69 MiB free; 5.65 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

praetor29 commented 1 year ago

If you're running it in an interactive notebook, try restarting the environment. That'll free up memory.

Knackii commented 1 year ago

Try this it worked for me https://github.com/suno-ai/bark/issues/315#issuecomment-1568127751

asterocean commented 6 months ago

I figured out a solution, load modules on demand rather than load them all at the same time, try this pull request: https://github.com/suno-ai/bark/pull/531