[FFmpeg-devel] [PATCH]opencl: automatically select the fastest opencl device

Lenny Wang lenny at multicorewareinc.com
Thu Nov 21 13:58:32 CET 2013


On Thu, Nov 21, 2013 at 6:40 AM, Stefano Sabatini <stefasab at gmail.com>wrote:

> On date Thursday 2013-11-21 06:05:19 -0600, Lenny Wang encoded:
> > Hi,
> >
> > Use -opencl_options device_idx=-1 or platform_idx=-1 to enable
> > automatic opencl device selection.
> >
> > There are usually more than a couple (CPU, iGPU, dGPU) opencl capable
> > devices present in a mainstream platform.  We wanted something less
> > heuristic and effective in ffmpeg with automatic opencl device
> > selection.  This is achieved by running a small representative
> > workload (unsharp) across all available devices, and the one with the
> > shortest processing time will be picked.  The entire benchmark only
> > takes a few seconds to execute.
>
> I don't think it is acceptable to call libavfilter (or any other
> library) from libavutil.


> If you need to select the fastest device, you could add a dedicated
> tool (e.g. ffmpeg/tools/opencl-find-fastest-device), but this should
> not be part of the library.
> --
> FFmpeg = Foolish & Fanciful Merciful Programmable Exploitable Gorilla
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


No, it doesn't call any libavfilter APIs.   We only 'borrow' the kernel
from unsharp opencl fitler and use it in the benchmark.

It's not designed as a tool but rather part of the opencl-util framework
using the existing 'opencl_options'.


More information about the ffmpeg-devel mailing list