Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

DAIN keeps running out of CPU RAM, not GPU VRAM, actually CPU RAM. Why?

A topic by johnnadina created Dec 08, 2020 Views: 2,895 Replies: 13
Viewing posts 1 to 5
(+1)

I have 16Gb of RAM and an RTX2060 with 6Gb of VRAM. Today I started interpolating a 30 minute video, 720x540 from 24 to 96 FPS. I let it run and when i came back DAIN had stopped around 60% completion and printed a message saying it had ran out of RAM. I thought it was a random error so i ran it again, and now its at 30% using 5Gb of RAM and it just keeps going up. Why is this happening? Virtual memory usage is at 25Gb too! DAIN dumps all the frames to the disk as soon as it interpolates them, so why does RAM usage increase as the videos are being processed?

Developer(+1)

It seen that the latest version have some memory leakage on each new frame it process, but you can use the "Resume render" option to keep going from the last frame it did.

I tried doing that, but it started loading all the frames from the start until it ran out of memory again

Same with my rtx 2060. Went back to 0.40 and it fixed the issue. 

Same with me I have 32GB with GTX 1660 Super 6GB  I already tried the "Fix out of memory options" but still it keeps saying it runs out of memory :( 

https://github.com/BurguerJohn/Dain-App/issues/6
yeah the problem apparently comes from PyTorch and not DAIN according to this page on github

I have similar issue. It looks the issue is in PyTorch itself.

https://github.com/BurguerJohn/Dain-App/issues/6

Huh, odd... Guess we wait until PyTorch gets fixed or they find a way to fix this in DAIN

In my case I have out of memory at 90% of progress (4x interpolation of 1440p video, 4000 original frames). And after several tries of resume and increasing pagefile (I am at Windows 10) to 10GB, then to 15GB, then to 28GB, interpolation was finished.

I am not sure if pagefile helps, but you can try.

hm maybe ill give it a try with absurd amounts of swap

I have seen many posts indicating the need for a GPU like the RTX 3090 to convert a native 1920 x 1080 clip.  I will say that, my PC has an i7-9700k, 32 GB RAM, and an RTX 2070 Super with 8GB VRAM.  The first time I tried to convert a 1 minute 1080 clip, I DID get the out of memory error.  But then, instead of reducing the size, I monitored the task manager to see how much of the (dedicated) VRAM was actually being used.  At any given time, the MAX amount being used by DAIN was 6.8 GB.  However, I had other programs open in the background such as Topaz Video Enhance AI (sitting idle, not converting anything. and no video loaded into it) and Chrome playing a YouTube Video.  I then closed Topaz, Chrome, and actually anything else so that the only program running (not counting system apps) was DAIN.  I was THEN able to convert that 1080 video clip without having to scale it down to 1820 x 720.  In other words, close other apps that may be utilizing the GPU and as long as you have at LEAST 8 GB VRAM, you SHOULD be able to convert WITHOUT down scaling the resolution. 

It worked for me, so perhaps it will work for you as well.  :)

Thx for the reply, but i already do that, i always run DAIN alone to give it as much of my measly 6GB of VRAM from my 2060. The issue is really the CPU RAM, not the VRAM, which has already been confirmed to be a bug in PyTorch that for some reason is causing all the rendered frames to be stored in RAM and virtual memory till both are full and the program halts. The VRAM usage never went above 4GB since it was a 540p video, and rendering it in chunks works just fine. Its just that DAIN 1.0 has this bug and idk when its getting fixed... for now my fix was to just use the 0.48 version which works just fine.

I'm running into this RAM memory leak problem also. I have 32GB of RAM.

Where can I download DAIN-APP 0.48? The original download link from https://www.patreon.com/posts/dain-app-0-48-43528108 is no longer working.

(1 edit)

Found this app which supports DAIN as well as a different algorithm RIFE:

https://github.com/n00mkrad/flowframes

Maybe it doesn't have the same memory leak issue? Also, RIFE seems really interesting given its lower VRAM requirements and higher efficiency.

Hopefully these two amazing projects can benefit each other!

ELI5 explainer video for DAIN and RIFE: