22 Replies Latest reply on Jan 4, 2013 2:41 PM by flbreen

    GPU Acceleration Explanation?

    flbreen Level 1

      I am trying to come up with a convenient explanation of GPU acceleration and video editing.

      I would like to put out some statements and get comments on them.

       

      The major push for the development of graphic cards is to improve the performance of gaming PCs.

      The graphics processing for a video game takes a 3D representation of a simulated world and and renders it into a 2D viewing screen for interactive game play.

      The graphics processing for Pr takes compressed HD video data and renders it to smooth reviewable on-screen video for interactive editing.

      When the editing is complete the, video processor reads the accumulated edited instructions and HD raw files to produce highly compressed HD video (media) files for DVD production and files to be uploaded for online viewing.

       

      Powerful graphic cards (GPUs) have been developed for the gaming industry.

      Video editing application developers are utilizing the computing power of the new GPUs to speed up video editing and media file production.

      Without GPU assistance the CPU must do most of the video processing.

      When the CPU usage reaches 100% the smooth review becomes choppy and irritating

      Choppy review reduces the throughput of the editing session.

      With GPU acceleration the GPU does most of the video processing and this allows the CPU to process video faster.

      GPU acceleration also speeds up the production of media files.

        • 2. Re: GPU Acceleration Explanation?
          flbreen Level 1

          I was looking for comments on the statements that I made rather than articles on the meaning of Pr color bars.

          I would like to know if I am wrong in the assumptions that I have made.

          For example I would like to know if the GPU acceleration was developed for the gaming industry and not for video editing.

          I would also like to know how the functions of the CPU and GPU change with and without GPU acceleration.

          • 3. Re: GPU Acceleration Explanation?
            Noel Carboni Level 8

            Francis Breen wrote:

             


            For example I would like to know if the GPU acceleration was developed for the gaming industry and not for video editing.

             

            Yes, the gaming market has funded (and is funding) the development of massively parallel and hugely powerful GPUs.  

             

            Young people will spare no expense to animate every droplet of blood splatter in gory detail.

             

            -Noel

            • 4. Re: GPU Acceleration Explanation?
              flbreen Level 1

              I guess the question might be is it just a coincidence that the GPU designed to render blood spatter can also be used by Pr to render MP4 files?

              And does Pr utilize a lot of the GPU processing power or just a small portion of it?

              • 5. Re: GPU Acceleration Explanation?
                Bill Gehrke Adobe Community Professional & MVP

                Francis Breen wrote

                 

                And does Pr utilize a lot of the GPU processing power or just a small portion of it?

                That all depends on how many CUDA accelerated effects and features you use here is a GPU-Z senors plot when using my own personal benchmark that has an AVCHD timeline that is 1 minute 19 seconds long and it is loaded with effects and features that are CUDA accelerated.  Here is the GPU-Z plot of GPU usage.

                GPU-Load.jpg

                (By holding the cursor on the GPU waveform you can read the peak of the usage resulting in the 93% usage shown) 

                 

                The GPU usage is 21 seconds long.  When I went back and turned off the GPU (Mercury Playback Software Only) and rerendered the timeline it took 484 seconds.  A 23x speedup.  The CPU was on an i7-2600K at stock 3.5 GHz speed.  It probably would have shown 100% usage with an overclocked CPU, but then the CPU-only time would also decrease significantly.

                • 6. Re: GPU Acceleration Explanation?
                  Jim_Simon Level 9

                  Your statements are...not entirely accurate.

                  • 7. Re: GPU Acceleration Explanation?
                    Noel Carboni Level 8

                    I don't think it's possible to (over)simplify the world into single cause and effect statements.

                     

                    Has GPU development been influenced by the needs of people, for example, doing 3D CAD work on workstations?  Sure.

                     

                    Has GPU development been influenced by the needs of other graphics computation intensive jobs, such as video rendering?  No doubt in some ways.  How much?  Who knows?

                     

                    There has certainly been development of such subsystems as CUDA and OpenCL because developers want to be able to take advantage of the compute potential of modern GPUs outside of the "traditional" 3D rendering world(s) (e.g., of games).

                     

                    Today we see ever faster video cards in large part because video games need as much performance as they can get, and there's good money in selling them.  Those of us who don't game but happen to be able to take advantage of the technological development for other things are lucky.

                     

                    -Noel

                    • 8. Re: GPU Acceleration Explanation?
                      flbreen Level 1

                      I am assuming that the CPU does a lot less work when GPU acceleration is on.

                      The CPU passes on partially processed video data to the GPU and the GPU completes the processing before displaying the video.

                      Based on the model I have in my mind the CPU sends data to the GPU and the GPU manipulates the pixels to show the screen image that the CPU needs to display.

                      With games and normal computer interactions it is a on-way transfer CPU -> GPU.

                      With the Adobe Media Encoder there seems to be a CPU -> GPU -> CPU transfer.

                      The CPU sends data to the GPU and the GPU processes it and sends back in a form that allows the CPU (Media Encoder) to encode files faster.

                      Please comment.

                      • 9. Re: GPU Acceleration Explanation?
                        Bill Gehrke Adobe Community Professional & MVP

                        Francis, that sounds like a pretty logical conclusion.

                        • 10. Re: GPU Acceleration Explanation?
                          ECBowen Most Valuable Participant

                          The CPU doesn't necessarily handle less load in a given time period. Instead the CPU is focused on the Decoding and Encoding while the GPU is handling other instructions. The accurate statement would be the GPU acceleration allows your system to process for more data in a given time period.

                           

                          Eric

                          ADK

                          • 11. Re: GPU Acceleration Explanation?
                            flbreen Level 1

                            I guess the question then is why would a system that is designed to go only one way CPU-> GPU for games be able to process data GPU -> CPU for Media Encoder? It looks like the GPU designers added at least the firmware to send data back to the GPU even though only video editing applications need that function. Unless some gaming applications also need to send data back to the CPU.

                            • 12. Re: GPU Acceleration Explanation?
                              ECBowen Most Valuable Participant

                              That has to do with how CUDA works. With GPU acceleration, specifically CUDA, the system ram becomes the Grand Central Station for Data going to the video card and coming back again. The simple explanation is a portion of system ram is allocated for GPU data and the GPU data stores there and then buffers down to the Ram on the video card and back again after. That is how the CPU and GPU work together.

                               

                              Eric

                              ADK

                              • 13. Re: GPU Acceleration Explanation?
                                flbreen Level 1

                                I think you are saying that without GPU acceleration communication between the CPU and the GPU is strickly CPU -> GPU and through channels in the mother board. With GPU acceleration  (processing Media Encoder) the GPU can process video and send it back to the CPU by writing it to the mother board RAM. The CPU grabs the processed video data and writes it to file.

                                • 14. Re: GPU Acceleration Explanation?
                                  Noel Carboni Level 8

                                  Francis Breen wrote:

                                   

                                  I guess the question then is why would a system that is designed to go only one way CPU-> GPU for games be able to process data GPU -> CPU for Media Encoder?

                                   

                                  Again, your assumption is an oversimplification, technically.  CPU-GPU communications are always two way.  This stuff is FAR from simple!

                                   

                                  -Noel

                                  • 15. Re: GPU Acceleration Explanation?
                                    flbreen Level 1

                                    Actually you are saying that the statement is wrong not too simple. If CPU-GPU communications are always two way then please explain.

                                    • 16. Re: GPU Acceleration Explanation?
                                      Noel Carboni Level 8

                                      No, I think it's just an overgeneralization (if the term oversimplification bothers you).

                                       

                                      I know enough about GPU programming to be dangerous but I can't hope to "explain" how it all works.  Consider that display driver releases easily exceed 100 megabytes in size (!!) to get a hint of how complex this realm is.

                                       

                                      Take this as an example:  In a CPU resident application you might create a Frame Buffer Object, then render some pixels into it using OpenGL commands and data from other buffers you have prepared, do some manipulations using shader programs written to run on the GPU, then you might combine the data from that frame buffer with other data using the CPU.  You might then submit that frame buffer to an OpenCL program for processing.  Complex graphics programs such as video games or applications written by Adobe do this and MUCH more all the time.

                                       

                                      As a programmer you might not even know nor care where your data is at a given moment.  The computer hardware, under control of the display driver, busily and dutifully transfers blocks of data back and forth at eyeblink speed from CPU to GPU to CPU to GPU as it is needed. 

                                       

                                      The CPU is good at doing things linearly - like making decisions and controlling the flow of the logic - and the GPU is good at doing repetitive things hugely in parallel - such as an operation on each pixel of an entire image.  The best modern programs get both working simultaneously on the parts they do best.

                                       

                                      And note that we're not even beginning to talk yet about multiple CPUs (multiple cores), or multiple GPUs.

                                       

                                      When you think about it, it's kind of a wonder something this utterly complex could ever be made to work.

                                       

                                      -Noel

                                      • 17. Re: GPU Acceleration Explanation?
                                        ECBowen Most Valuable Participant

                                        The important concept to understand in this is the System ram is the transit point for the data back and forth between the CPU and GPU. This is a big reason why having enough ram is extremely important for GPU acceleration.


                                        Eric

                                        ADK

                                        • 18. Re: GPU Acceleration Explanation?
                                          flbreen Level 1

                                          Eric

                                           

                                          Could you explain the communication?

                                          I thought for Pr operations, the only communication is from the CPU to the GPU through buses in the mother board.

                                          And that would be the case with or without GPU acceleration.

                                          But the Media Encoder with GPU acceleration causes the GPU to write data somewhere (mother board RAM) so that eventually it gets to a file on disc.

                                          Now I assume that the CPU grabs the data from the mother board RAM and writes it to file on disc.

                                          I have noticed that it take some time after the Media Encoder indicates it has completed processing before it shuts down.

                                          This could be the time it takes the CPU to move the encoded file from RAM to a file on disc.

                                          • 19. Re: GPU Acceleration Explanation?
                                            ECBowen Most Valuable Participant

                                            According to the Nvidia Whitepapers on CUDA the communication from the cpu is via the system ram. Essentially buffers are created in the system ram and then shadowed down to the GPU buffer where they then go through the parallel processing. This is how CUDA is able to scale across multiple GPU's if the programming accounts for that. When the processing is finished in the GPU then the data is sent back to the GPU ram and then shadowed back to the system ram for further processing if required. Nvidia use to keep the white papers on CUDA on their website for public viewing. I have not seen those in a while and I believe you have to request them now. The papers were detailed in the entire process pipeline but the over all summary is what I listed.

                                             

                                            Eric

                                            ADK

                                            • 20. Re: GPU Acceleration Explanation?
                                              flbreen Level 1

                                              When you report that CUDA the communication from the cpu is via the system ram does that mean that the CPU does not communicate with the GPU via PCI Express?

                                              Are you describing the process by which the GPU enables video file encoding?

                                              When I am not doing file encoding, is system RAM used for CPU - GPU communication.

                                              Sorry.

                                              • 21. Re: GPU Acceleration Explanation?
                                                ECBowen Most Valuable Participant

                                                I am referring strictly to the CUDA acceleration and not the normal Display operations. CUDA is outside the normal GPU operations and Adobe's MPE engine with it does not currently support decoding or encoding. BTW the system ram is used by many devices for buffering and caching to improve performance and lower cost of manufacturing by removing the need for more device cache on the device. It's also used by video cards for normal display operations.

                                                 

                                                Eric

                                                ADK

                                                • 22. Re: GPU Acceleration Explanation?
                                                  flbreen Level 1

                                                  I made a drawing of the editing system I am planning to build. I have been trying to figure out what exactly goes on among the CPU, GPU, and system RAM with and without GPU acceleration. I guess I have given up except to say that with GPU acceleration the GPU can access the system RAM to communicate with the CPU and without GPU acceleration the CPU communicates with the GPU through motherboard buses only.

                                                  flowChart.jpg