diff --git a/.gear/ffmpeg.spec b/.gear/ffmpeg.spec index 72a925cf3e..2854155eeb 100644 --- a/.gear/ffmpeg.spec +++ b/.gear/ffmpeg.spec @@ -13,7 +13,7 @@ # License %def_enable gpl %def_enable version3 -%def_disable nonfree +%def_enable nonfree # Enable/Disable stuff %def_enable doc @@ -142,10 +142,20 @@ # nvidia cuda doesn't support arm, mips and others # https://developer.nvidia.com/nvidia-video-codec-sdk/download +# --- +# Describing Nvidia specific options --nvccflags: +# nvcc from CUDA toolkit version 11.0 or higher does not support compiling for 'compute_30' (default in ffmpeg) +# 52 is the minimum required for the current CUDA 11 version (Quadro M6000 , GeForce 900, GTX-970, GTX-980, GTX Titan X) +# https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ +# Anyway below 50 arch card don't support nvenc encoding hevc https://developer.nvidia.com/nvidia-video-codec-sdk (Supported devices) +# Nvidia docs: +# https://docs.nvidia.com/video-technologies/video-codec-sdk/12.1/pdf/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration.pdf %ifarch %ix86 x86_64 aarch64 ppc64le %def_enable cuvid +%def_enable cuda %else %def_disable cuvid +%def_enable cuda %endif # cuvid %define avdevicever 60 @@ -251,6 +261,7 @@ BuildRequires: yasm %{?_enable_vdpau:BuildRequires: libvdpau-devel} %{?_enable_vulkan:BuildRequires: libvulkan-devel} %{?_enable_cuvid:BuildRequires: nv-codec-headers} +%{?_enable_cuda:BuildRequires: nvidia-cuda-toolkit} %define common_descr \ FFmpeg is a collection of libraries and tools to process multimedia content\ @@ -690,6 +701,11 @@ xz Changelog %{subst_enable cuvid} \ --enable-hardcoded-tables \ --enable-runtime-cpudetect \ +%if_enabled cuda + --enable-cuda-nvcc \ + --enable-libnpp \ + --nvccflags="-gencode arch=compute_52,code=sm_52 -O2" \ +%endif %if_enabled debug --enable-debug \ %else