[FFmpeg-devel] [PATCH] Load CUDA driver API dynamically when needed

Andrey Turkin andrey.turkin at gmail.com
Thu May 26 20:12:47 CEST 2016

Enabling CUDA support adds some extremely useful features but it also
adds hard runtime dependency on NVidia driver. This commit removes that
dependency; driver library would be loaded when required.
This allows to use same CUDA-enabled FFMpeg build on machines with and
without NVidia cards.
CUDA toolkit is still needed at build time. scale_npp filter still adds
runtime dependency on libnppc and libnppi (which is fine since these
libraries have to be redistributed with FFMpeg anyway, and they load
CUDA internally on demand as well).
Same patch was sent to libav ML

 configure                      |   9 ++--
 libavcodec/nvenc.c             |  24 ++++++----
 libavfilter/vf_hwupload_cuda.c |  22 ++++++---
 libavfilter/vf_scale_npp.c     |  12 ++++-
 libavutil/Makefile             |   4 +-
 libavutil/cuda_api.c           | 102 +++++++++++++++++++++++++++++++++++++++++
 libavutil/cuda_api.h           |  53 +++++++++++++++++++++
 libavutil/hwcontext_cuda.c     |  36 +++++++++------
 8 files changed, 227 insertions(+), 35 deletions(-)
 create mode 100644 libavutil/cuda_api.c
 create mode 100644 libavutil/cuda_api.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Load-CUDA-driver-API-dynamically-when-needed.patch
Type: text/x-patch
Size: 17750 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160526/64acbbfd/attachment.bin>

More information about the ffmpeg-devel mailing list