Fooocus
Fooocus copied to clipboard
[Bug]: ROCm Fooocus doesn't garbage collect allocated VRAM
Checklist
- [x] The issue has not been resolved by following the troubleshooting guide
- [x] The issue exists on a clean installation of Fooocus
- [x] The issue exists in the current version of Fooocus
- [x] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet
What happened?
On ROCm / amdgpu, Fooocus doesn't garbage collect used VRAM even after several hours. This means that other applications, such as other AI image generators, cannot use the VRAM and give "out of memory" errors.
Steps to reproduce the problem
- With ROCm with an AMD GPU, use Fooocus as normal - generate a few random pictures with default settings.
- Wait a few hours then run
radeontop
. See that VRAM allocation is still many GB. - Use some other AI tool such as InvokeAI - generate a few random pictures with default settings.
- See that this other AI tool gives Out of VRAM errors.
- Close Fooocus and repeat (2, without waiting) and (3).
- VRAM allocation in
radeontop
is back down to normal levels. Also, the other AI tool succeeds.
What should have happened?
- Fooocus should release VRAM after it is finished generating images.
What browsers do you use to access Fooocus?
No response
Where are you running Fooocus?
Locally
What operating system are you using?
Debian GNU/Linux
Console logs
No relevant logs in Fooocus.
As described above, behaviour is observed empirically via other means, i.e.
1. `radeontop` VRAM usage before and after shutting down Fooocus
2. console logs of {other AI tool} before and after shutting down Fooocus.
- before: OutOfMemoryError specifically VRAM
- after: works fine
Additional information
No response