-
Full error description: RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 3.42 GiB already allocated; 0 bytes free; 3.48 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 tried to solve this on my own, as this seems like a rather simple fix, just allocate more memory; the other discussions mention that 4-5 GiB is the typical size. But I can't seem to find the documentation or the .py file mentioned at the end of the error statement. Could you point me in the right direction, or is there something else I'm missing? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That error message is a bit misleading. What it's actually saying is that it ran out of space while trying to allocate memory. Meaning your system did not have enough free memory. Some of your VRAM will be used just to render your desktop and other graphical utilities. So a 4GB card can't actually run something that requires more than 4GB by itself. You should be able to run using the optimized mode though. There are two optimized modes available that sacrifice speed but lower VRAM requirements. The standard optimize mode lowers VRAM a lot but also massively affects speed. The optimize-turbo mode uses a bit more VRAM but runs with little speed penalty. To enable the optimized mode open the "relauncher.py" file found under the scripts folder and change: optimized = False To: optimized = True To enable optimized-turbo do the same thing but for the "optimized_turbo" option. Though only one of them should be enabled (set to True) at a time. With only 4GB of VRAM you will likely have to use the standard optimized mode for now, but there is a PR open right now that will lower VRAM requirements a bit further once merged without a speed penalty. And another that should lower it even further but with a bit of a speed penalty. So you might be able to switch to optimized-turbo in the near future. |
Beta Was this translation helpful? Give feedback.
That error message is a bit misleading. What it's actually saying is that it ran out of space while trying to allocate memory. Meaning your system did not have enough free memory. Some of your VRAM will be used just to render your desktop and other graphical utilities. So a 4GB card can't actually run something that requires more than 4GB by itself.
You should be able to run using the optimized mode though. There are two optimized modes available that sacrifice speed but lower VRAM requirements. The standard optimize mode lowers VRAM a lot but also massively affects speed. The optimize-turbo mode uses a bit more VRAM but runs with little speed penalty.
To enable the optimized mode open th…