21

I am trying to compile FFMPEG with Nvidia Cuda support, on Debian 9.3. Parameters, what I am using:

--enable-cuda --enable-cuvid --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-libx264 --disable-x86asm --enable-libx265 --enable-libfdk-aac --enable-nonfree

Nvidia Cuda with drivers are installed. When I try to configure ffmpeg, it says:

ERROR: cuvid requested, but not all dependencies are satisfied: cuda

Newer ffmpeg will show a similar, re-worded message:

ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec

I absolutely don't know why I'm having this issue, because I am compiling ffmpeg on all of our trans-coding servers.

1
  • What does config.log say towards the end? It will be in ffbuild/
    – Gyan
    Feb 28, 2018 at 8:39

4 Answers 4

60

The NVIDIA headers were moved out of the FFmpeg codebase to a standalone repository in commit 27cbbbb. From the commit message:

External headers are no longer welcome in the ffmpeg codebase because they increase the maintenance burden. However, in the NVidia case the vanilla headers need some modifications to be usable in ffmpeg therefore we still provide them, but in a separate repository.

Also, from FFmpeg Wiki: HWAccelIntro:

FFmpeg now uses its own slightly modified runtime-loader for nvidias CUDA/nvenc/nvdec related libraries. If you get an error from configure complaining about missing ffnvcodec, this is what you need.

It has a working Makefile with an install target:

make install PREFIX=/usr

FFmpeg will look for its pkg-config file, called ffnvcodec.pc. Make sure it is in your PKG_CONFIG_PATH.

To compile the FFmpeg NVIDIA headers ("ffnvcodec"):

git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
make
sudo make install

Now compile ffmpeg as usual. The headers should be autodetected. If not then declare the PKG_CONFIG_PATH pointing to the path where ffnvcodec.pc is located when running configure for FFmpeg. For example:

PKG_CONFIG_PATH="/path/to/lib/pkgconfig" ./configure
0
8

I encountered a similar error but it turns out, it was caused by missing tool package config. On Ubuntu 16.04 you can run

apt-get install pkgconf

and check whether the missing package is really missed or not:

pkgconf --list-all | grep package-name
2
2

This can arise due to a version mismatch between nv-codec-headers and FFmpeg. Cause: I followed specific instructions which pinned nv-codec-headers to n8.2.15.8 but left FFmpeg at master.

Starting with tag n4.4 FFmpeg requires the CUVIDAV1PICPARAMS struct. This is only found in dynlink_cuviddec.h of nv-codec-headers starting with tag n11.0.10.0.

I successfully configured/compiled with nv-codec-headers n11.1.5.1 and FFmpeg n5.1.2 for CUDA 11.4 in an Ubuntu 18.04LTS nvidia-docker image (additional arguments/env. vars. needed:
PKG_CONFIG_PATH="<path_to_ffnvcodec.pc_folder>" and --nvccflags="-gencode arch=compute_52,code=sm_52 -O2" )

1
  • I downgrade to version 11.1 and driver 490, ffmpeg 4.4, it works! thanks a lot Aug 12, 2023 at 21:31
-2

https://github.com/FFmpeg/FFmpeg/commit/27cbbbb33f259de7c795d2b75edf7b240f0f82e6

I found this commit code occur error. Use previous commit code

git clone https://github.com/FFmpeg/FFmpeg.git

git checkout 7414d0bda7763f9bd69c26c068e482ab297c1c96

git reset --hard

1
  • This will limit you to be stuck with commit 7414d0b indefinitely. Just download and install the NVIDIA headers before compiling ffmpeg.
    – llogan
    Feb 28, 2018 at 20:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .