13 Replies Latest reply on Mar 27, 2014 12:02 PM by Eric T Arroyo

    How does After Effects use VRAM? (question for Todd Kopriva)

    Eric T Arroyo Level 1

      Hello Todd, for the past few years I've been reading through many of your posts as well as Harm Millaard's posts about how to properly set up and upgrade your PC while keeping everything balanced. I followed the advice of upgrading the processor to an i7-3930k and OC'd it to 4.5+GHz as well as achieved 500+MB/s transfer rates for my media and scratch disks on separate hard drives and I'm almost done maxing out my RAM. With all that said I am now at the last piece to the build. The GPU.

       

      I've spent a crazy amount of hours reading through as many articles as I possibly can as well as posting in multiple forums to shine some light on this decision and have narrowed it down to either the GTX 770 (4GB) or the GTX 780 (not the TI). Most people would say to just get the GTX 780 if cost isn't an issue, but here is my dilemma, I frequently use many high polycount 3D bodies in my work. Either ray-traced right in AE or with the Element 3D plugin.

       

      The question that no one can seem to answer is "what does AE do when my VRAM fills up?" Or, "How does AE use VRAM?" If AE switches to just processing on the CPU once the VRAM fills up then getting the 770 with 4GB of VRAM makes more sense because I'll be able to push through more of the scene without a sudden and drastic slowdown. However, if AE loads a single frame or even a handful of frames into VRAM, does it's calculations, then spits it out to the RAM before grabbing the next frame/s then 3GB of VRAM would be more than sufficient for the work I do and the GTX 780 will be a significantly better choice due to it's increased bandwidth and CUDA cores. If you know the answer to this question, or if you could direct me to someone who does it would be an enormous help.

       

      PS: If anyone other than Todd happens to be positive on how AE uses VRAM because they spoke to an Adobe employee who told them, or if you happen to be an Adobe employee then feel free to add what you know

       

      One more clarification. This isn't a GTX770 vs GTX780 question, it's a "more VRAM or more processing power" question that can be applied to any two video cards either now or in the future.

       

      Regards,

      -Eric

        • 1. Re: How does After Effects use VRAM? (question for Todd Kopriva)
          Mylenium Most Valuable Participant

          I'm obviously not Todd, but as someone who knew OpenGL since the days when it only was available on SGI IRIX workstations, let me try to alleviate your confusion at least a bit.

          "what does AE do when my VRAM fills up?"

           

          This, by all means, should never happen. While in particular OpenGL is a "greedy" processing model that will consume resources until they may run out, the combination of a client program's own intelligence, the graphics driver and the cards own safeguards built into the chips and firmware should just not allow it. whenever it happens, these are bugs somewhere in that chain. Otherwise the program is supposed to simply revert to emulated OpenGL (if available) or other fallback options or at least exit gracefully, if it can't work without OpenGL. This is even in parts defined in the spec itself. CUDA and OpenCL work differently and are more complex processing models that offer more detailed control about GPU and memory usage, but in a sense function similarly - even OpenCL functions have to be anchored and defined in the hardware driver that manages the whole show.

           

          In turn this means that whenever AE falls back to CPU only modes it does so because one of the aformentioned requirements is not met and the program has the good sense of not forcing the issue and crash. The same would be true for Element 3D - if it refuses to work then something is afoot and, contrary to your thinking, just using excessive amounts of VRAM may not at all be the solution to the problem. Unless you use large textures it wouldn't matter, anyway. Mere geometry handling is relatively light weight and before you could cram a 20million polygon model into Element 3D it would have crashed for other reasons. The same would be true for Raytrace 3D or other plug-ins like Freeform Pro: The tesseleation is unlikely to ever reach a complexity that would exhaust all VRAM, but adding an 8k reflection texture might because it would have to be kept in memory all the time.

           

          Conversely all other places where AE uses GPU acceleration would primarily be affected by how large pixel buffers are because that's the real crunch here - AE does not support tiled or multi-res image formats nor similar rendering techniques, so it often needs to keep data around even if only part of it is visible. Furthermore of course the various options for decoding and encoding certain formats may use GPU functions as do some things like drawing stuff in the 3D Tracker interface for instance.

           

          So to sum it up and return to your original: More VRAM does not necessarily mean more rendering power. It's much more important to have a well-tuned overall setup.

           

          Mylenium

          • 2. Re: How does After Effects use VRAM? (question for Todd Kopriva)
            Todd_Kopriva Level 8

            The main thing that more VRAM over a certain minimum amount gets you in After Effects is the ability to hold more large textures in VRAM without needing to swap them out as often. This can matter when, for example, using an animated environment map layer; things can slow down if the environment needs to be loaded and unloaded on every frame.

             

            Element 3D has some crashing problems when you try to use overly complex models on systems with little VRAM, so more VRAM can increase stability in some contexts, too.

             

            Also, note that many other applications---Photoshop, web browsers, etc---and just having a second large monitor connected use a lot of VRAM, so having more allows you to use the applications and features while using a program like After Effects.

            • 3. Re: How does After Effects use VRAM? (question for Todd Kopriva)
              Rick Gerard Adobe Community Professional & MVP

              Speaking of Optimizing your system, spend an hour on THIS on demand event presented by Todd and you'll learn more about optimizing your system than you will in a full day of poking around forums.

              • 4. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                Eric T Arroyo Level 1

                This is all great info guys! Mylenium, so basically you are saying that while having some VRAM is important it is unlikely that I would run into the issue that Todd mentioned where After Effects would have to keep swapping large texture files in and out of the VRAM because the texture files would have to indeed be very large. So if I did frequently work with huge textures and things that need to be stored in VRAM like the 8K reflection texture you mentioned then it would be more important to have more VRAM without sacrificing too much bandwidth. But to your point, it is indeed unlikely that I'll be using 8k reflections for the type of work I do so the difference between 3GB and 4GB of VRAM isn't too significant for me... unless I wanted to do transformers level 3d modeling... which would be fun, but I doubt I'll ever work on a project that requires THAT much detail. Am I on track with what you're saying?

                 

                Thanks for the response Todd! It seems that you are erring on the side of having more VRAM on setups with multiple monitors (which I have) while also using other applications (which I frequently do). Granted I'm only using two 23" 1920 x 1080 monitors which I'm sure is significantly less taxing than 27" 4k monitors. What if the project is only using relatively basic 3D models with a modest poly count and lower res textures? Am I correct in assuming that the total VRAM available becomes less important such that having a higher bandwidth would allow for closer to real-time model manipulation than a card with more VRAM, but less bandwidth? Or is hard drive speed the limiting factor there? I guess that all depends on how AE handles it's 3D models for ray-traced and Element 3D. Are the models only stored on the hard drive or are they pulled onto the GPU while you are working on them?

                 

                Thinking about what get's pulled onto the GPU, here's another question. If you run a RAM preview does the GPU unload everything into the RAM after it finishes its calculations? The reason I ask is because if it does unload it to the RAM when it finishes it's calculations then I'm assuming that means I'd only need as much VRAM as a single frame of my scene requires. Or does the VRAM store more than just the current frame's worth of information?

                 

                I think the answer to this question would help clear even more up. What types of things stay in VRAM regardless of what frame you are viewing and what types of things are only in VRAM for that one frame? From what I understand it sounds like global effects such as lighting, textures, reflection maps, shadows, and similar effects remain in VRAM provided you have enough space. Then the 3D objects that the global effects act on are only stored in VRAM for the current frame you are looking at. Then when you scrub through to another frame the software checks to see if the objects in the new frame are currently in VRAM. If they are the GPU runs it's calculations for all of the global effects on the objects and displays the updated image. However, if a different object appears in the new frame then it finds the object on your hard drive and, if there is enough room, loads that into the VRAM as well. If there isn't enough room it unloads anything that might not be in the frame anymore to make room for the new object. If it can't remove something to fit the new object then I'm assuming the processing for the new object then gets handled by the CPU? Or maybe it processes the object that is already in VRAM, moves that object to RAM, then pulls the new object in and processes that one?

                 

                After all that I suppose the only thing left to determine is how much space is required for effects like 8k reflections, lighting, etc. If it's only 1 to 2GB to store those types of effects then we'd know that someone who uses a given set of effects would need 1 to 2GB plus the collective size of the raw 3D models they are working with. All of which can be calculated providing you have enough VRAM to test individual parameters. For example. Start with an empty project and look at VRAM usage. Then add a 3D Cube with flat faces and see how much the VRAM usage goes up. That will give a rough estimate of the 3D Cube size (in MB). Now add an effect like an 8k reflection or a light and see how much the VRAM usage goes up again. I'm assuming this will give at least a ballpark idea of how much space different effects take up in VRAM. I'll be running this test myself once I get a new GPU. I can't now because I currently only have about 600Mb available for AE to use which fills up too quick to accurately measure anything.

                 

                Sorry for the very technical questions. As an electrical engineer it's my job to find the best solution possible without wasting resources or skimping on resources that may benefit a specific design under special circumstances. Everything can be quantified and broken down into relatively basic math. While choosing a GPU is a subjective matter that changes based on a person's uses I do believe that, given enough information, a definitive answer can be found when applying the learned principles to user specific needs. I did a study on RAM for the exact same reason a while back. It took a decent amount of research, but I was able to put together a few equations that would determine which speed vs cas latency would yield the best results for any given hardware. While it's obviously unrealistic to break these calculations down all the way to poly count, reflection resolutions and the like I believe that with a bit more technical info a generalized guide can be put together to help anyone determine what the best card is for them personally regardless of whether they are shopping for cards now or a year from now.

                 

                Rick, thanks for that link. I'll definitely be watching that in the near future!

                 

                Thanks for all the help so far guys! It's definitely getting me much closer to the bottom of this!

                 

                Regards,

                -Eric

                • 5. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                  Eric T Arroyo Level 1

                  ... Maybe I asked too many questions in one shot. I did some testing on AE last night to figure out what my VRAM usage was. It turns out that it doesn't take as much as I thought to blow through VRAM. Just two or three 20k to 60k poly models in Element 3D put me over 1GB VRAM and started having to swap things in and out of VRAM. Which means a single model with a poly count in the 100k to 1million range is going to have some issues because there will be less room to swap things in and out of VRAM.

                   

                  I messaged back and forth with Harm Millaard about this as well and from a Premiere Pro standpoint he told me that 3GB wouldn't quite cut it for 4k editing if I decided to go that route. Similarly, stacking loads of 1080 layers with a handful of PIPs and blends would also bog a 3GB card down. So after all the conversations and research I've settled on the GTX 770 4GB for my personal needs.

                   

                  I put together a few questions for someone to ask themselves when determining which GPU to get when comparing two similarly priced GPUs where one trades more VRAM for a slight loss in processing power and bandwidth and the other trades more processing power and bandwidth for less VRAM. Anyone please chime in if you think this is accurate or needs to be modified in some way to be more accurate.

                   

                  1. Have you upgraded your CPU, RAM, and disk speed first? eg: 6 core processor (12 threads), 32 to 64GB of RAM, and 400 to 500+MB/s transfer rates for media and scratch files.

                  Yes: Go to question 2.

                  No: Upgrade your other components first. Start here for help upgrading your system: http://ppbm7.com/index.php/tweakers-page

                   

                  2. Do you do any 3D editing?

                  Yes: Go to question 3.

                  No: Go to question 5.

                   

                  3. Do you frequently work with higher poly count models (100k+)?

                  Yes: Get the slower card with more VRAM.

                  No: Go to question 4.

                   

                  4. Do you frequently use MANY lower poly count models (simulating slow motion rain, hundreds of leaves falling, etc)?

                  Yes: Get the slower card with more VRAM.

                  No: Go to question 5.

                   

                  5. Do you use Premiere Pro?

                  Yes: Go to question 6.

                  No: Get the faster card with less VRAM.

                   

                  6. Do you edit, or plan to edit 4k video. Or do you often use picture in picture with multiple 1080 videos?

                  Yes: Get the slower card with more VRAM.

                  No: Get the faster card with less VRAM.

                   

                  Todd and Mylenium, does this list of questions seem like a good rough guidline to you?

                   

                  Regards,

                  -Eric

                  • 6. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                    Mylenium Most Valuable Participant

                    I can't say much about the specifics of Premiere, but for AE at this point more VRAM has litlle or no payoff, even with many third-party effects. Also not trying to dismiss your testing methodology, but trying to gauge VRAM usage by the plain number of polygons is not necessarily a predictable accurate measure. Multiple separate meshes will use more VRAM than one contiguous mesh and deformable meshes again figure in differently with their vertex transform operations than a rigid mesh. You couold be loading a model in Element 3D one day and it swishes around smoothly and the otehr day the plug-in crashes all the time. And then there is things like texture compression or E3D's custom shaders to consider. Either way, I think your findings make sense. With 6GB and 8GB cards already out there it won't matter much - we wil lsoon enough have more VRAM than we can use - unless of course we crank up things and work 4k or 8k all the time and eat up the advantage again.

                     

                    Mylenium

                    • 7. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                      Eric T Arroyo Level 1

                      Thanks for explaining why my test methodology wouldn't be very accurate. I see now why it is extremely difficult to get to the bottom of this. One week I could work on a project with a model that has a high poly count, but more simple meshes and be fine with 3GB of VRAM, but the next week I could work on a project with hundreds or thousands of lower poly count models with complex meshes and other VRAM instensive effects and end up not having enough VRAM. I suppose the real question become, "can I manipulate my models in real time with X or Y GPU?" I very well might be able to manipulate the models in real time with both cards which is all I really care about. Final render time isn't too much of a concern for me.

                       

                      Are you familiar with the AutoCAD 3D Performance, Autodesk Inventor, and Maya benchmarks? Those seem to be geared towards measuring a GPU's performance for complex 3D modeling and real-time rendering, not just gaming like most of the other benchmarks are. Do you know if these are helpful at all for determining the effectiveness of a GPU with highly complex modeling?

                       

                      Thanks again for all the help!

                       

                      Regards,

                      -Eric

                      • 8. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                        Eric T Arroyo Level 1

                        Update:

                         

                        I bought the GTX 770 4GB since I have a dual monitor setup, frequently have a web browser open while I'm editing, and plan on expanding my projects to even more complex 3D work. The great news is that my render times when compared to my old GTX 460 SE went from 81 minutes to 23 minutes on one project and 45 minutes to 24 minutes on another project. Definitely a huge time saver!

                         

                        My only issue now is that I noticed that AE CS5.5 isn't allowing me to use more than 800MB of VRAM regardles of how many models I'm using. A single 300k poly model takes me to 700MB. Adding 20 more models ranging from 20k to 400k doesn't change my VRAM usage at all. It just stays around 700MB. That's getting a bit off topic here so I'll start a new discussion about that particular issue. Thanks again for all the help guys!

                         

                        -Eric

                        • 9. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                          Todd_Kopriva Level 8

                          What is your texture memory set to in the After Effects preferences?

                          • 10. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                            Eric T Arroyo Level 1

                            It was set to 200MB, but I boosted it to the max which was only 2000MB and it didn't make a difference. Not sure if I did a restart of AE after changing the setting though. I'll give that a shot now.

                            • 11. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                              Eric T Arroyo Level 1

                              Doesn't look like that helped either. Just to make sure I changed the correct settings... The snapshot below shows the texture memory setting you were talking about correct?

                               

                              raw_image0.png

                              • 12. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                                Todd_Kopriva Level 8

                                I see that you started a separate thread about this (http://forums.adobe.com/thread/1437692). Let's stick to that new thread for this issue.

                                • 13. Re: How does After Effects use VRAM? (question for Todd Kopriva)
                                  Eric T Arroyo Level 1

                                  Good idea. I added a comment in the other thread about your suggestion to check the texture memory setting. I'll keep everything related to this new issue in that thread.

                                   

                                  Thanks again!

                                  -Eric