Tuesday 12 January 2016

Improving render performance Sony MovieStudio 13 with Nvidia GPU Acceleration

Currently using Sony MovieStudio 13 Platinum (SMS13P) to cut video files together but have been looking for increased performance on final (mp4/h264) rendering and found this isn’t so simple for the initiated. To put some context: video rendering is processor intensive but over recent years some rendering (to file) tasks can be taken up by the graphics card GPU as well being done by the CPU. Whilst this may seem counterinteritive at first, the CPU has a limited set of (typically of consumer systems, 4 to 8) cores but a GPU may have cores numbering in 1000s (a high end consumer Nvidia GTX Titan has over 3000 cores) and the GPU can be more efficient on simple repetitive tasks.

Of course, to take advantage of CPU or GPU cores the underlying software needs to be coded appropriate. For the Sony MovieStudio 13 product, it summary page notes that it support GPU acceleration via OpenCL (an vendor independent standard and API) and CUDA (Nvidia card specific API) but with a number of caveats. In my setup, I was using a Nvidia Geforce GT 310 so was interested in the options for Nvidia although h/w GPU acceleration support was restricted to Nvidia Fermi chipset for CUDA support - undisclosed in that statement is that Fermi chips were last release in ~2012 (the GTX500 range), although Nvidia's products also can be accelerated via the OpenCL API.

My setup is old (~2010) and I found that SMS13P rendering a simple 1min iphone HD video and encoding to Sony AVC (down sampled to 720p at 8kbps) mp4 would take around 3m50s using “CPU only” and “GPU if available” option being even longer. Other projects would typically be 3.5x slower than realtime. This is obviously a pain that I wanted to reduce, however there were challenges based on my setup which was a Dell Vostro 430.

Improving the Hardware

The Dell Vostro 430 was a simple home desktop available circa 2010/2011 that provided a Socket H/LGA1156 CPU motherboard that allowed max 16GB and 1x PCI-E x16 slot for separate graphics card and a 350W PSU running 64bit Windows 7. The case is fairly small although it does have sufficient space for a second HDD (it has 4x SATA interfaces on the motherboard) and also a 3.5 bay, presumably for a legacy floppy drive.

The configuration I had was a i5-760 (4x cores, no hyper threading), 12GB of RAM, a Geforce GT310 graphics card and a second HDD.

Options

To improve performance, there were a 2 options:
  • upgrade CPU to (a legacy) Intel i7-880 3.07Ghz 4 core hyperthread (the biggest LGA1156 chip produced at the time)
  • upgrade GPU/graphics card
The GPU upgrade appeared to offer greatest potential gain but initial research suggested that that latest Nvidia cards (the GTX970) were now non-Fermi architecture (ie Maxwell) and there were issues in various forums reported unsuccessful/no GPU acceleration although its not clear if that OpenCL based although as customer response stated
GPU-accelerated rendering is not available for the Sony AVC/MVC format when using the latest drivers for NVIDIA Maxwell-based GPUs (such as the GeForce GTX 750 and GTX 970). GeForce 337.88 or Quadro/Tesla 341.05 (an R340 driver) or older is required for GPU-accelerated AVC rendering
Not promising.

I didn’t want to risk the newer cards and thus was left with legacy h/w - the SMS13 h/w acceleration information the CPU GTX 500 series were supported so I explored the GTX 550TI/560TI/570/580 set of cards – most of these are minimum dual PCI slot width to support the heatsinks and fans and some design taking 3 slots. What was immediately apparent was that the existing Vostro 430 350W PSU was not sufficient and the size of the GTX 500 series cards were much longer than the current GT 310 card which may potentially interfere with the location of the second HDD in the desktop case. Further complications were that the GTX 500 cards need power from the PSU via 2x 6pin cables which, depending on the OEM (Gigabyte, MSI, Asus…) places the connectors in different locations that could further interfere with the placement of the second HDD due to the limited clearance.

Implications of Selecting a GTX 560TI with the Vostro 430

In the end, the GTX 560TI was my preferred option and provided 348 CUDA GPU cores @ 822Mhz (over the 16cores @ 589Mhz of the current GT 310 card) as it was shorter than the GTX570 and GTX580 cards even though these would provide further gains. The higher power requirement meant that the stock Vostro PSU was upgraded with a ~65GBP Corsair CX750W (Builder Series) that matched the ATX spec required: it ended up providing more power connectors than necessary and actually took up a significant portion of the desktop case and indeed reduced the space between the PSU and the DVD drive but it was workable. The required power connections were plentiful: 1x 24pin + 1x 4pin (a 4+4pin) 12V motherboard, 6x SATA drive and multiple 6+2pin PCI-E.

The second HDD was relocated to the 3.5” bay accessible with the front panel and although it only provides one screw port for securing (the HDD bays allow 4 screws on the underside of the HDD) but it appears secure although the alignment of the screw hole had to be modified (drilled) to secure.

The GTX 560TI card that I was able to find on ebay for ~48GBP (a little overpriced but it came with the original box and secured well in antistatic envelope etc) was a Gigabyte branded factory overclocked (at 900Mhz vs the 822Mhz reference design) card that has power connectors at the rear of the card – opposite end of the 2x DVI external connectors. When this card was installed and power connected, there was sufficient clearance for the second HDD to live in it’s intended bay. However, a GTX card that accepted power at the top of the card (opposite to the motherboard) would have fit into the case with an empty second HDD bay and certainly the larger GTX570/580 cards with this setup may not fit.

Results - GTX560TI/i5 760

The new GTX560TI installed in the Dell Vostro 430 case and annotated below.

In the end, the new card appeared to leave sufficient room and clearance in the second HDD bay that I will at some point relocate the HDD back. As noted, the unused connectors (I believe at least 2x 6+2pin PCIE connectors) are pushed into the empty 5 1/4" bay.

With the additional ~115GBP worth of kit it was time to test the system.

The original 1min clip that rendered at 3m50s was rerun through SMS13P with the, previously slower, "use GPU if available" option for the Sony AVC - the rendering with this option change rendered in 2m30s so a reasonable uptick (+34%) in performance and now other projects were being rendered in 2.5x realtime improved from 3.5 previously so the new GPU certainly helped. MovieStudio also lists some media effects/transitions as GPU accelerated so I am expecting to realise gains here too. With GPU-Z monitoring, it did note that only 55% of the GPU was in use on this render. I had stupidly forget to verify this with the old card in place.

To conclude, the 64bit Sony MovieStudio 13 Platinum (build 955, Sept 2015) does indeed benefit from a better GPU as seen with MovieStudio supporting CUDA hardware acceleration/rendering offered by the Nvidia GTX 500 series of Fermi based cards and the 361.43 driver (Dec 2015). Further gains can be achieved by jumping up to the i7-880 chip (4x core/8x threads 3.06Ghz vs the 4x core/threads 2.8Ghz of i5-760) is the next step to max out the Vostro 430 as it stands but with ebay pricing in the ~65GBP range may not be a bad hedge.

Results - GTX560TI/i7 870

UPDATE - To look to get more from the system, I sourced an i7 870 2.93Ghz 4x core hyperthread chip and installed it into the Dell, after updating the BIOS to v2.4.0. Rendering speed for the same test 49second clip rendered to Sony AVC/12kbps/24fps/mp4 1m35s (down from i5 760's 3m57s and then i5 + GTX560's 1m53s) - using GPU if available option didn't improve the rendering in this case.


MovieStudio Bugs

With some time using MovieStudio in trying to piece together various movie files from various phones/DSLRs etc I've come across a few of annoying bugs (never mind crashes/lockups during render). The main item - and it appears common - is MovieStudio either displays black screen in its preview window when scrubbing a timeline or the output/rendered video just contains black; in both cases, audio is fine. If you have static images/jpegs in your track, these are rendered/previewed fine.

This MovieStudio black screen problem appears to be caused by having a video included, either in your set of video tracks that it doesn't like OR simply having a video file in the list of media associated with the project. For the first problem, it can be noticable when you add the new media file as you will notice that as you scrub/preview the timeline suddenly displays black. For the second problem, I've found that you can inspect the "use count" and remove unnecessary media which seems to then allow MovieStudio to preview/render again.

This is however, to say that videos of different formats and frame rates can't be used (mixing 1080/720 videos with a combination of 30/25/23.976 fps etc) into a single project as I've managed to do this - but for some reason, certain files with certain properties have caused the black preview/render issues.

Both these issues are annoying bugs that clearly should be fixed.

No comments:

Post a Comment