Jump to: Board index » General » Fusion

understanding caching

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

Rick van den Berg

  • Posts: 157
  • Joined: Tue Jun 02, 2015 7:47 am

understanding caching

PostTue Aug 29, 2017 9:02 am

I always thought caching was about the same as pre-rendering. saving the frames to the disk/ram for smooth playback.

i just dont really get the caching in fusion. in every tool there is a caching option. if i click on it i expect it to just save those frames to the disk/ram while playing back, so i can review the animation afterwards.

it just never really works, especially in heavy compositions, and thats where you need it the most.

if i consult the manual i get some results about local caching/caching limits etc, but no matter what changes i make, it still doesnt do anything.

It would be perfect if i can just click on the merge/tool i want to review, set it on cache and play it back smoothly. am i missing something?
Offline

David_Cox

  • Posts: 70
  • Joined: Thu Aug 03, 2017 11:20 pm
  • Location: London UK

Re: understanding caching

PostTue Aug 29, 2017 10:29 am

When you play your comp, you should see a green line appear along the frame numbers of the play bar. This means that Fusion is caching the result of what you are currently watching, with the quality settings you currently have set (proxies etc). Once this green line is complete (after the first run through) you should be able to get smooth playback as Fusion will be playing from that ram cache. If you make any change to what you are viewing, then that cache becomes irrelevant and the green line is cleared to show that you don't yet have a playback cache of what you are now looking at.

This is different to the cache options within each tool and these are used more strategically. Within the controls of each 2D tool is a small disk icon. Enabling this allows you to cache the result of your comp at that point to disk (to the directory set in Preferences) If anything changes upstream of that tool (i.e. something that changes the images) then that cache will be destroyed as it is now out of date.

An example of how you might use the tool disk caches is as follows. Let's say you have a scene with 5 green screen elements, each having their own keys and rotos and other effects. When you first play the comp, fusion has to render all 5 elements of course. If you then make an adjustment to one of them, Fusion will still have to render all 5 again to see the final result. However, if you enabled a disk cash at the end of each of the green screen streams, then caches would have been created for each of the individual streams and so all those not affected by a change to just one element would return the cache output for that segment, rather than re-render all the upstream effects.

Of course, whether a disk cache improves speed comes down to disk performance. It is certainly possible that the disk cache could take longer to read from a slow disk system (or where there are many caches to read) than the time taken to render the effect again.

Hope that helps.

DC
Showreels: vimeo.com/davidcoxtv
Website: www.davidcox.tv
Offline

Rick van den Berg

  • Posts: 157
  • Joined: Tue Jun 02, 2015 7:47 am

Re: understanding caching

PostTue Aug 29, 2017 12:49 pm

Thanks David, definitely helps.

I just got the feeling the green line does not always appear, also at times when im pretty sure it is cached, and vice versa. feels a little buggy.

as you said, the caching icon can be used in smart ways, i definitely see plus points there.

but if i understand it correctly, when i enable the cache icon at the end of a stream, it should simply be caching the end result right? that would be the same as the green line which fusion creates by default (for that specific node)?

if that would be true, the only reason i can imagine why its not working that well would be a slow disk speed. that would make sense, but my disk speed gets up to 1200 Mbps. thats pretty fast i guess.
Offline

Kel Philm

  • Posts: 171
  • Joined: Sat Nov 19, 2016 6:21 am

Re: understanding caching

PostTue Aug 29, 2017 1:01 pm

I have raised a bug report over the caching, sometimes it just doesn't work, even when I Force Cache it doesn't work, plenty of RAM to spare (Win 10).
Offline

David_Cox

  • Posts: 70
  • Joined: Thu Aug 03, 2017 11:20 pm
  • Location: London UK

Re: understanding caching

PostTue Aug 29, 2017 1:03 pm

The "green line" playback cache is in ram, whereas the disk cache is on the disk (obviously!) :D . So the frames from the disk cache have to be loaded into ram before they can be played. The cache files might also be quite big - such as 32 bit raw RGBA (or more) channels. So they are not likely to perform quite as well as the playback cache. However, they are permanent, at least until they get invalidated by a change.

You can check to see if the disk cache is working by right clicking on a node's disk cache icon in its control area and getting fusion to open the directory where the cache files are. Then you can inspect that they exist and how big they are etc. Also when you render, each node flashes a little light while it is being processed. Any nodes upstream of an unchanged disk cache shouldn't flash, because their result is taken from the disk cache and so don't need to be processed.

I have also sometimes seen the green line not appear, but playback is smooth none the less. So perhaps there is a bug where occasionally the green line doesn't show itself.

DC
Showreels: vimeo.com/davidcoxtv
Website: www.davidcox.tv
Offline

Rick van den Berg

  • Posts: 157
  • Joined: Tue Jun 02, 2015 7:47 am

Re: understanding caching

PostTue Aug 29, 2017 1:48 pm

i checked, the disk cache is indeed working. you are right about the file sizes, they are massive. but still theoretically not big enough to be a bottleneck. maybe the part where it has to be loaded into the ram could be the part where it slows down? i'm not too technical, but wouldnt it be better then to just play it directly from the disk? or maybe compress the files while caching? although that could affect the changes after the stream...

it just feels like this could be alot faster. but maybe i'm wrong (big chance :) )
Offline

Grant Tompkins

  • Posts: 36
  • Joined: Tue Jul 28, 2015 5:42 pm

Re: understanding caching

PostTue Aug 29, 2017 10:20 pm

What threw me off at first having come from AE a couple years back, whichever node is being rendered-into-ram / in-the-viewer has to be selected to see the green bar in the timeline. If you deselect the node the green line will disappear but the cache will still be there assuming you haven't changed anything. Select the node again and again it will appear. I've found that having gizmos turned on in the viewer can also make cached playback stutter. This also happens with v9 and the most recent firmware updates when viewing through a video-out device like the Intensity or Ultrastudio devices.

Disk caching ( the little cache icon on every node ) still has to be cached into ram to play back in real time. It just saves you from having to perform the actual comp calculation up until that point in the node flow.
Offline

Kel Philm

  • Posts: 171
  • Joined: Sat Nov 19, 2016 6:21 am

Re: understanding caching

PostWed Aug 30, 2017 2:30 am

Rick,

Are you on Win 10? I know the problems you are talking about and it is not the expected behavior. Sometimes when it should be caching it just doesn't and it re-renders the frame on the next cycle through (even with plenty of ram to spare). I was working on a single input HD comp the other day and after about 20 mins work it had used up 64GB of Ram. It was a 200 frame comp with not that much going on, shutting it down and starting again sorted it out but it looks like a whole lot of memory leaking going on. It also struggles to playback sometimes in realtime which on a 36 core Xeon with 1080 GTX?

Would be great if there was a tool to analyse how much CPU time/Cache Mem each tool was using (like the one in Nuke).

Rick, are you by chance using a planar tracker in the comp?
Offline

Rick van den Berg

  • Posts: 157
  • Joined: Tue Jun 02, 2015 7:47 am

Re: understanding caching

PostWed Aug 30, 2017 6:53 am

Im on windows 10, no planar tracking so far.
Gonna do some more tests later today.
Offline

David_Cox

  • Posts: 70
  • Joined: Thu Aug 03, 2017 11:20 pm
  • Location: London UK

Re: understanding caching

PostWed Aug 30, 2017 8:33 am

The amount of memory that the cache uses is shown in the bottom right hand corner of the interface. A hidden feature is that you can right click this number and clear the cache if you want to. This might help diagnose whether the increasing use of memory is related to stored caches or other processes (or a memory leak). The maximum amount of memory that the ram cache is allowed to use is set in Preferences>Global>Memory and is set to be a percentage of available ram. If it is too high, not enough memory will be left over for the actual processing, which would slow things down also.

DC
Showreels: vimeo.com/davidcoxtv
Website: www.davidcox.tv
Offline

Kel Philm

  • Posts: 171
  • Joined: Sat Nov 19, 2016 6:21 am

Re: understanding caching

PostWed Aug 30, 2017 9:30 am

The Purge Cache also function doesn't seem to work for me a lot of the time in V9, which could indicate that it is not the Cache that is leaking memory?
Offline

Rick van den Berg

  • Posts: 157
  • Joined: Tue Jun 02, 2015 7:47 am

Re: understanding caching

PostWed Aug 30, 2017 12:28 pm

i tested a few different comps, they all suffer from caching-related problems. when i playback the comps and wait a minute or 2 to cache, it doesn't help that much, the comps aren't playing back smoothly afterwards. no green line too, also when i click on the nodes which i should have cached. In the right/lower corner it says 20/30% used from the memory. i clicked on the cache node, turned it off, etc. the cached frames appear in the folder structure as img files though.

i tried these things several times now. only the really lightweight animations are able to playback.
i think i had this before fusion9 too. i just didnt do anything about it.
Offline

David_Cox

  • Posts: 70
  • Joined: Thu Aug 03, 2017 11:20 pm
  • Location: London UK

Re: understanding caching

PostWed Aug 30, 2017 12:41 pm

Interesting...

For smooth playback, you should be able to rely on the green line ram cache. This is made from the images created for the viewer. So if you select a node, view it on a monitor and hit play, do you not get a green line along the frame numbers at the bottom of the interface?

I do think that Fusion's disk read speed isn't particularly overwhelming. For example, there are shots I can play straight off in real time in Resolve that play at 1/3 speed in Fusion (until they are cached). So i can imagine that a disk cache might not lead to real time playback on its own. Disk caches are there mainly as an improvement over rendering their upstream effects afresh.

DC
Showreels: vimeo.com/davidcoxtv
Website: www.davidcox.tv
Offline
User avatar

KonradWelz

  • Posts: 48
  • Joined: Sun Feb 23, 2014 4:26 pm
  • Location: Bracknell, UK

Re: understanding caching

PostWed Aug 30, 2017 2:45 pm

I was going crazy with RAM playback being about half of the actual project frame rate. I had UI windows on two separate monitors - I had my Timeline and Spline windows on the second screen. When I reset Fusion to a single-screen UI, I magically had proper RAM playback. I'm just mentioning this in case someone else has this issue which might be causing slow RAM playback.
Offline

Vladimir LaFortune

  • Posts: 105
  • Joined: Mon Nov 17, 2014 3:37 am

Re: understanding caching

PostWed Aug 30, 2017 3:26 pm

Cache function is great to lock the certain portions of the comp that you are satisfied with. I usually do this with particles and shaders.
Offline

Grant Tompkins

  • Posts: 36
  • Joined: Tue Jul 28, 2015 5:42 pm

Re: understanding caching

PostWed Aug 30, 2017 7:16 pm

It's nice to see someone else having playback problems with a multi-monitor UI. I mentioned before that the same thing was happening when outputting through an Intensity or Ultrastudio device, but I forgot to mention the same thing would happen when using the new full-screen viewer that works on a standard UI monito ( Mac or PC ) If it helps, I never had this problem with v8.
Offline

Rick van den Berg

  • Posts: 157
  • Joined: Tue Jun 02, 2015 7:47 am

Re: understanding caching

PostThu Aug 31, 2017 7:38 am

Vladimir LaFortune wrote:Cache function is great to lock the certain portions of the comp that you are satisfied with. I usually do this with particles and shaders.

Well yeah i read that alot, but im not experiencing it the same.
Offline
User avatar

Jed Mitchell

  • Posts: 60
  • Joined: Tue Nov 03, 2015 11:04 pm
  • Location: New York, NY

Re: understanding caching

PostThu Sep 07, 2017 9:16 pm

I also seem to be experiencing some kind of memory leak when playing back to a second screen through a Mini Monitor.

When using just the single-screen GUI viewers my cache builds up as expected, purges as expected, and I can see on a system performance viewer that RAM is filling up / emptying as expected when I cache or purge.

When I switch a node to view through the Mini Monitor it caches and then seems to just keep on caching on with each playback loop.

It's actually quite clear when watching the system performance monitor what's happening -- as soon as you top out on system RAM the green cache indicator begins shrinking until eventually it loses the ability to cache any more frames.

The increased RAM usage also seem to be reflected in Fusion's cache monitor, but purging has no effect on the "leaked" RAM after it builds up this way (though interestingly, you *can* see the tiny drop in non-leaked RAM being purged). Only by restarting Fusion can I recover the leaked memory.

I don't remember this behavior in Fusion 7 or 8, but I'm also not sure I ever tried running it through the video I/O box before. For reference I'm on a maxed-out 2013 Mac Pro running OS X 10.10.5
"It's amazing what you can do when you don't know you can't do it."
Offline
User avatar

Jed Mitchell

  • Posts: 60
  • Joined: Tue Nov 03, 2015 11:04 pm
  • Location: New York, NY

Re: understanding caching

PostTue Sep 26, 2017 5:15 pm

Just to keep this up to date, it seems like the memory leak is fixed in 9.0.1 on OSX, at least on my system. The viewer cache no longer overflows and purging works as expected. Great work -- hopefully this is true for others experiencing the same issue.
"It's amazing what you can do when you don't know you can't do it."
Offline

Sjur Pollen

  • Posts: 69
  • Joined: Thu Jan 19, 2017 12:47 pm

Re: understanding caching

PostSat Jan 20, 2018 9:07 pm

I'm having trouble with ram caching, single screen setup.

A branch of my flow is breaking ram caching for some reason. The only way I can get a preview at full framerate is disk caching the tool *after* the one causing the trouble. Can anyone explain why I'm experiencing this? Is it just a bug?

The flow is HD, 16bit float, and the tool creating the hickup is a gridwarp with two trackers attached to two published points in respectively the source and destination grids.
http://www.sjurpollen.com
-------
Resolve Studio 14. Fusion Studio 9. Windows 10. Ryzen 1700x 32GB GTX1080

Return to Fusion

Who is online

Users browsing this forum: Bing [Bot], nagelbmx and 3 guests