sukebenet/dreampower

Running on 4GB RAM

zoenagy235 opened this issue · 2 comments

Anyway we could reduce the required memory from 8GB to 4GB with a parameter?
Even if it costs more time to run.
It would make the SW more accessible to people (not talking about 1st world people).

There is a malloc somewhere for 3GB, but most of the time it only uses 1-2GB RAM.

I assume we load the trained model into RAM (3x700MB), what if we will grow by 10x?
One 512x512 frame only costs 256KB, which fits 12200 times into 3GB, is that mandatory?

(without CUDA use case)

I downloaded Dreamtime and it worked in my 4ram pc, but I think that the graphic card is more important than how much ram you have. I say this because I've a non-compatible with the dreampower, so i used my cpu and with the cpu it uses the ram, if you choose gpu it uses the vram. Don't do what I did. Use the port of dreampower on google colab, it's faster and gives better results.

The issue is quite old, so I'm just commenting here in the hope that it will be useful to others facing the same problem in the future.

(I'm just talking about the case with cpu-generated results)

The algorithm performs a filter of the database, and loads the necessary models into the RAM. You are right, in 4gb it fits, but the results will not be optimal, moreover if the software needs more space to load more models, it will probably crash. I recommend the solution mentioned above, that is running the software in a VPS or something similar, or even a more powerful computer if you have one because I think it is safe to assume that a computer with 4gb of ram is not really ideal for the task due to its age.
But then, if you really want to run the software with a computer that has 4gb and good (or at least decent, shall we say) results, you have only one solution: add more ram, or, if that's not possible for some reason, add more swap. This is a possible thing under linux and windows, and emulates ram from space in the hard disk. Of course, the loading time will be longer because instead of the ram the software will do some of the operations on the hard disk, but it will make you gain in stability and quality.

Here is a link to a tutorial for windows and linux (I personally recommend linux, swap management is easier and better supported).

Windows (from google): To create a swap, or virtual memory file, in Windows, click "Start," right-click "Computer," click "Properties," "Advanced System Settings," "Performance" and "Settings." In the Settings dialog, click "Advanced," "Virtual Memory" and "Change." Clear the Automatically Manage Paging File Size for All Drives check box.

Linux: depends on your distro, but this should work for ubuntu or any other debian:
https://linuxize.com/post/how-to-add-swap-space-on-debian-10/

And here is for arch linux:
https://www.digitalocean.com/community/tutorials/how-to-add-a-swap-file-on-an-arch-linux-cloud-server

Hoping to have been useful, please close the issue if this comment solved your problem.