OpenCL in Adobe Premiere Pro: How much faster is a GPU than a CPU?
Hello Giktayms! Having recently discovered the wonderful world of accelerating data processing using video cards using OpenCL, I decided to write a little introductory material for beginners who are not familiar with this technology in practice. The Internet often raises the questions “what kind of productivity gain will I get?”, But the answers are either abstract or overly theorized.
This post is intended to demonstrate how the use of OpenCL can accelerate the rendering of video in video editing programs. You will not find a deep immersion in theory and mathematics - there are plenty of detailed theoretical articles about OpenCL on Giktims and Habré without me. There will be only a description of the task and test results, so please treat the text exactly as a simple introductory guide for beginners.

Modern graphics cards are real computing monsters, whose full power is usually spent on games. Not stupid people realized that if programmers were granted direct access to the computing units of video chips, then all this colossal power could be used for any other tasks, and not just 3D-graphics processing.
NVIDIA was the first to succeed in implementing this idea with its Compute Unified Device Architecture (CUDA) parallel computing architecture. Using the extended syntax of the C language and a special compiler, developers were able to use a graphics chip for computational tasks. AMD, in turn, introduced the Stream SDK - its proprietary vision for CUDA.
The result was phenomenal - the processes associated with the processing of media data, which implies a high level of parallelization, completed many times faster than in the case of calculations by the central processor. The advantage of the GPU was especially pronounced when rendering in 3D-modeling programs and video processing.

A year after the release of CUDA, the Khronos Group consortium released the OpenCL framework. In fact, he had to unify the code to access the computing power of processors on different architectures, including video cores. From that moment, support for the new framework began to be actively introduced into professional software.
To date, OpenCL support Adobe programs, media converters, a number of popular 3D-renders, CAD and software for mathematical modeling.

A very frequent and very interesting question is subtitled. These two technologies are like unlike brothers. Like the long-suffering PhysX, CUDA is a closed technology supported only by NVIDIA chips and by no means all specialized software. OpenCL is an extrovert, the code is open to any enthusiast, any software that supports GPU computing by definition works with OpenCL.
NVIDIA programmers do not slurp over - if you take two spherical video cards in vacuum with the same performance, then CUDA on the NVIDIA chip shows an average of 20% more performance than OpenCL on the AMD chip. But there is a nuance, as they say - if NVIDIA’s CUDA works quickly and well, then OpenCL on the cards of this company is slightly inferior to AMD’s OpenCL processing speed. A few years ago, the situation was very deplorable, but over time, using the drivers, the gap was made up. Nevertheless, the specific performance of NVIDIA GeForce in OpenCL is still slightly lower than that of AMD Radeon. Therefore, those who have purchased an NVIDIA card to work with an application that supports exclusively OpenCL will be in the worst position - the adapter will come out more expensive, and its effectiveness may be lower than that of Radeon. Such a game is not worth the candle.

I discovered the wonderful world of OpenCL only this summer, having bought two AMD Radeon 300 series video cards at once: SAPPHIRE NITRO R9 380 and SAPPHIRE Tri-X R9 390X . One of them was planned to be handed back to the store, depending on the results of home tests. Cards were bought for video editing at home, the choice in the direction of Radeon was quite conscious: on the one hand, CUDA is faster than OpenCL. On the other hand, as it turned out, OpenCL is supported by significantly more professional software than CUDA, and the performance of NVIDIA cards in OpenCL leaves much to be desired.

Of the proposed assortment of SAPPHIRE cards, I liked it more than the rest. Unlike reference design enthusiasts, SAPPHIRE uses classic fans in the cooling system, which are much quieter than reference centrifugal wind turbines - I developed a strong hostility to them after a quick acquaintance with the Radeon 4870x2 video card vacuum cleaner.
At home, when unpacking two huge boxes, I felt like a mossy mastodon - the video cards are rather big. SAPPHIRE R9 390X is really huge, with three fans and a heatsink that exceeds the size of the printed circuit board. At first, I was even worried if these monsters would fit into my corps. Fortunately, we got in, but one hard drive had to be removed from the hard drive cage. A kilowatt power supply was also not superfluous - the R9 390X requires two four-pin power connectors, and not every PSU will pull such a current.

So, my home config, on which the OpenCL comparative tests were conducted:
If Adobe Premiere Pro CS4 was a heavy load in the office, then at home you could organize a workspace to your liking. I would hardly ever think about buying Premiere Pro if Adobe hadn’t rolled out the wonderful, in my opinion, Creative Cloud subscription system. Now for 600 rubles a month I have a legal and constantly updated Premiere Pro CC. And he, unlike the old man office, natively supports rendering using OpenCL and CUDA!
If your video card works with OpenCL or CUDA, then at the stage of creating a project in Premiere Pro you can choose a render. For hardware acceleration meets the Mercury Playback Engine GPU (OpenCL) or (CUDA). In a finished project, the renderer can be changed through Project Settings from the File menu.

As I already said, using OpenCL you can transfer calculations on the application of video effects to the video card. However, not all effects in Premiere Pro support OpenCL - you can find out about this by the presence or absence of such an icon in the list.

As a test project, I chose a two-minute video consisting of many segments from Full HD video with a bitrate of 72 Mbps and a frame rate of 24 frames per second. Above all this disgrace, the accelerated effect of Lumetri Color was applied, by which I carried out color correction. The output was to get a movie in h.264 format, in a resolution of 1920 × 1080 (that is, without changes), a bitrate of 6-7 Mbit / s, two-pass encoding was used.
To confirm the operation of the video card, I took GPU-Z parameters - looking at the frequency of the graphics core, it is easy to understand when the video is being rendered by the CPU, and when the GPU.


In the first test run, I turned off the Lumetri Color effect, so the whole rendering was to change the video bitrate.
Run 1:
project 2 minutes, h.264, 6-7 mbps, no effects
Without applying effects, the difference in rendering speed between the processor and the powerful modern graphics card is very small. When processing video with a total duration of about an hour, the gain from using OpenCL will be more noticeable, but still very small. Nevertheless, almost always during the editing process, color correction effects are applied to the video, so this test should be considered “synthetic”.
Run 2:
project 2 minutes, h.264, 6-7 mbps, Lumetri Color effect
The results speak for themselves - if both video cards effortlessly rendered the video a little slower than real time, then the processor spent almost six minutes on rendering each minute. And this is with only one effect enabled! If before the test I expected to process an hour-long movie with color correction for the entire duration, then after the results I decided to abandon this idea. In my work, I apply color correction to small segments of the video, and an hour or two of rendering do not bother me much. I had no time to lose four or five hours for test purposes.
By extrapolating the results, we can assume that the processor would have managed with color correction lasting 60 minutes in 4.5 hours, while video cards would need less than one hour!
Based on the test results, I left myself the SAPPHIRE NITRO R9 380 - the card costs much cheaper than the coolest R9 390X, but in Premiere Pro the performance of the two adapters is almost identical. Given that the adapter was bought to do the work, which means making money spent 17 thousand rubles is not at all a pity. Moreover, in GTA V the map proved to be great, but this topic is for a completely different note.
As for the experience of using OpenCL, one cannot but admit - a savior came to the world of video editing: rendering turned into a pleasure. Compared to overclocked Intel Core i5, GPUs effortlessly process video with superimposed effects in Premiere Pro. With such test results, there is no question of whether to use rendering by GPU. The only question is which video card to adapt to this. Something from the upper gaming segment will be just right, for example, AMD Radeon R9 3xx. SAPPHIRE NITRO R9 380 fully satisfied my needs. But mid-range and even entry-level adapters also support OpenCL, which means they will significantly speed up your work in professional software.
This post is intended to demonstrate how the use of OpenCL can accelerate the rendering of video in video editing programs. You will not find a deep immersion in theory and mathematics - there are plenty of detailed theoretical articles about OpenCL on Giktims and Habré without me. There will be only a description of the task and test results, so please treat the text exactly as a simple introductory guide for beginners.

Why is it needed?
Modern graphics cards are real computing monsters, whose full power is usually spent on games. Not stupid people realized that if programmers were granted direct access to the computing units of video chips, then all this colossal power could be used for any other tasks, and not just 3D-graphics processing.
NVIDIA was the first to succeed in implementing this idea with its Compute Unified Device Architecture (CUDA) parallel computing architecture. Using the extended syntax of the C language and a special compiler, developers were able to use a graphics chip for computational tasks. AMD, in turn, introduced the Stream SDK - its proprietary vision for CUDA.
The result was phenomenal - the processes associated with the processing of media data, which implies a high level of parallelization, completed many times faster than in the case of calculations by the central processor. The advantage of the GPU was especially pronounced when rendering in 3D-modeling programs and video processing.

A year after the release of CUDA, the Khronos Group consortium released the OpenCL framework. In fact, he had to unify the code to access the computing power of processors on different architectures, including video cores. From that moment, support for the new framework began to be actively introduced into professional software.
To date, OpenCL support Adobe programs, media converters, a number of popular 3D-renders, CAD and software for mathematical modeling.

Better CUDA or OpenCL?
A very frequent and very interesting question is subtitled. These two technologies are like unlike brothers. Like the long-suffering PhysX, CUDA is a closed technology supported only by NVIDIA chips and by no means all specialized software. OpenCL is an extrovert, the code is open to any enthusiast, any software that supports GPU computing by definition works with OpenCL.
NVIDIA programmers do not slurp over - if you take two spherical video cards in vacuum with the same performance, then CUDA on the NVIDIA chip shows an average of 20% more performance than OpenCL on the AMD chip. But there is a nuance, as they say - if NVIDIA’s CUDA works quickly and well, then OpenCL on the cards of this company is slightly inferior to AMD’s OpenCL processing speed. A few years ago, the situation was very deplorable, but over time, using the drivers, the gap was made up. Nevertheless, the specific performance of NVIDIA GeForce in OpenCL is still slightly lower than that of AMD Radeon. Therefore, those who have purchased an NVIDIA card to work with an application that supports exclusively OpenCL will be in the worst position - the adapter will come out more expensive, and its effectiveness may be lower than that of Radeon. Such a game is not worth the candle.

Iron
I discovered the wonderful world of OpenCL only this summer, having bought two AMD Radeon 300 series video cards at once: SAPPHIRE NITRO R9 380 and SAPPHIRE Tri-X R9 390X . One of them was planned to be handed back to the store, depending on the results of home tests. Cards were bought for video editing at home, the choice in the direction of Radeon was quite conscious: on the one hand, CUDA is faster than OpenCL. On the other hand, as it turned out, OpenCL is supported by significantly more professional software than CUDA, and the performance of NVIDIA cards in OpenCL leaves much to be desired.

Of the proposed assortment of SAPPHIRE cards, I liked it more than the rest. Unlike reference design enthusiasts, SAPPHIRE uses classic fans in the cooling system, which are much quieter than reference centrifugal wind turbines - I developed a strong hostility to them after a quick acquaintance with the Radeon 4870x2 video card vacuum cleaner.
At home, when unpacking two huge boxes, I felt like a mossy mastodon - the video cards are rather big. SAPPHIRE R9 390X is really huge, with three fans and a heatsink that exceeds the size of the printed circuit board. At first, I was even worried if these monsters would fit into my corps. Fortunately, we got in, but one hard drive had to be removed from the hard drive cage. A kilowatt power supply was also not superfluous - the R9 390X requires two four-pin power connectors, and not every PSU will pull such a current.

So, my home config, on which the OpenCL comparative tests were conducted:
- Processor: Intel Core i5-2500K, overclocked to 3.7 GHz
- RAM: 12 GB DDR-1333
- Motherboard: ASUS P8Z77-V PRO
- Drives: 120 GB A-DATA system SSD, 2 TB HDD WD Black WD20EARS content
- Power Supply: Corsair 1000 W
Software
If Adobe Premiere Pro CS4 was a heavy load in the office, then at home you could organize a workspace to your liking. I would hardly ever think about buying Premiere Pro if Adobe hadn’t rolled out the wonderful, in my opinion, Creative Cloud subscription system. Now for 600 rubles a month I have a legal and constantly updated Premiere Pro CC. And he, unlike the old man office, natively supports rendering using OpenCL and CUDA!
If your video card works with OpenCL or CUDA, then at the stage of creating a project in Premiere Pro you can choose a render. For hardware acceleration meets the Mercury Playback Engine GPU (OpenCL) or (CUDA). In a finished project, the renderer can be changed through Project Settings from the File menu.
As I already said, using OpenCL you can transfer calculations on the application of video effects to the video card. However, not all effects in Premiere Pro support OpenCL - you can find out about this by the presence or absence of such an icon in the list.
Tests
As a test project, I chose a two-minute video consisting of many segments from Full HD video with a bitrate of 72 Mbps and a frame rate of 24 frames per second. Above all this disgrace, the accelerated effect of Lumetri Color was applied, by which I carried out color correction. The output was to get a movie in h.264 format, in a resolution of 1920 × 1080 (that is, without changes), a bitrate of 6-7 Mbit / s, two-pass encoding was used.
To confirm the operation of the video card, I took GPU-Z parameters - looking at the frequency of the graphics core, it is easy to understand when the video is being rendered by the CPU, and when the GPU.
In the first test run, I turned off the Lumetri Color effect, so the whole rendering was to change the video bitrate.
Run 1:
project 2 minutes, h.264, 6-7 mbps, no effects
CPU | 3:09 |
SAPPHIRE Tri-X R9 390X | 2:33 |
SAPPHIRE NITRO R9 380 | 2:38 |
Without applying effects, the difference in rendering speed between the processor and the powerful modern graphics card is very small. When processing video with a total duration of about an hour, the gain from using OpenCL will be more noticeable, but still very small. Nevertheless, almost always during the editing process, color correction effects are applied to the video, so this test should be considered “synthetic”.
Run 2:
project 2 minutes, h.264, 6-7 mbps, Lumetri Color effect
CPU | 11:33 |
SAPPHIRE Tri-X R9 390X | 2:42 |
SAPPHIRE NITRO R9 380 | 2:48 |
The results speak for themselves - if both video cards effortlessly rendered the video a little slower than real time, then the processor spent almost six minutes on rendering each minute. And this is with only one effect enabled! If before the test I expected to process an hour-long movie with color correction for the entire duration, then after the results I decided to abandon this idea. In my work, I apply color correction to small segments of the video, and an hour or two of rendering do not bother me much. I had no time to lose four or five hours for test purposes.
By extrapolating the results, we can assume that the processor would have managed with color correction lasting 60 minutes in 4.5 hours, while video cards would need less than one hour!
findings
Based on the test results, I left myself the SAPPHIRE NITRO R9 380 - the card costs much cheaper than the coolest R9 390X, but in Premiere Pro the performance of the two adapters is almost identical. Given that the adapter was bought to do the work, which means making money spent 17 thousand rubles is not at all a pity. Moreover, in GTA V the map proved to be great, but this topic is for a completely different note.
As for the experience of using OpenCL, one cannot but admit - a savior came to the world of video editing: rendering turned into a pleasure. Compared to overclocked Intel Core i5, GPUs effortlessly process video with superimposed effects in Premiere Pro. With such test results, there is no question of whether to use rendering by GPU. The only question is which video card to adapt to this. Something from the upper gaming segment will be just right, for example, AMD Radeon R9 3xx. SAPPHIRE NITRO R9 380 fully satisfied my needs. But mid-range and even entry-level adapters also support OpenCL, which means they will significantly speed up your work in professional software.