Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#7782 closed defect (invalid)

Enabling the option --enable-cuda-nvcc results in a build failure.

Reported by: Brainiarc7 Owned by:
Priority: normal Component: build system
Version: git-master Keywords: cuda, nvcc
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Building FFmpeg with the --enable-cuda-nvcc option results in a build failure.

How to reproduce:

FFmpeg was configured as such:

cd ~/ffmpeg_sources
git clone https://github.com/FFmpeg/FFmpeg -b master
cd FFmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig:/opt/intel/mediasdk/lib/pkgconfig" ./configure \
  --pkg-config-flags="--static" \
  --prefix="$HOME/bin" \
  --bindir="$HOME/bin" \
  --extra-cflags="-I$HOME/bin/include" \
  --extra-ldflags="-L$HOME/bin/lib" \
  --enable-cuda-nvcc \
  --enable-cuvid \
  --enable-libnpp \
  --extra-cflags="-I/usr/local/cuda/include/" \
  --extra-ldflags=-L/usr/local/cuda/lib64/ \
  --enable-nvenc \
  --extra-cflags="-I/opt/intel/mediasdk/include" \
  --extra-ldflags="-L/opt/intel/mediasdk/lib" \
  --extra-ldflags="-L/opt/intel/mediasdk/plugins" \
  --enable-libmfx \
  --enable-libass \
  --enable-vaapi \
  --disable-debug \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libdrm \
  --enable-opencl \
  --enable-gpl \
  --cpu=native \
  --enable-opengl \
  --enable-libfdk-aac \
  --enable-libx265 \
  --enable-openssl \
  --extra-libs="-lpthread -lm" \
  --enable-nonfree 
PATH="$HOME/bin:$PATH" make -j$(nproc) 
make -j$(nproc) install 
hash -r

The build fails at:

NVCC	libavfilter/vf_thumbnail_cuda.ptx
In file included from libavfilter/vf_thumbnail_cuda.c:25:0:
libavfilter/vf_thumbnail_cuda.c: In function ‘filter_frame’:
libavfilter/vf_thumbnail_cuda.c:266:18: error: ‘CudaFunctions {aka struct CudaFunctions}’ has no member named ‘cuMemsetD8Async’; did you mean ‘cuMemcpy2DAsync’?
     CHECK_CU(cu->cuMemsetD8Async(s->data, 0, HIST_SIZE * sizeof(int), s->cu_stream));
                  ^
./libavutil/cuda_check.h:62:114: note: in definition of macro ‘FF_CUDA_CHECK_DL’
 #define FF_CUDA_CHECK_DL(avclass, cudl, x) ff_cuda_check(avclass, cudl->cuGetErrorName, cudl->cuGetErrorString, (x), #x)
                                                                                                                  ^
libavfilter/vf_thumbnail_cuda.c:266:5: note: in expansion of macro ‘CHECK_CU’
     CHECK_CU(cu->cuMemsetD8Async(s->data, 0, HIST_SIZE * sizeof(int), s->cu_stream));
     ^~~~~~~~
CC	libavfilter/vf_tile.o
ffbuild/common.mak:60: recipe for target 'libavfilter/vf_thumbnail_cuda.o' failed
make: *** [libavfilter/vf_thumbnail_cuda.o] Error 1
make: *** Waiting for unfinished jobs....

The build log is attached below.

Attachments (1)

config.log (556.7 KB) - added by Brainiarc7 2 months ago.
config.log

Download all attachments as: .zip

Change History (3)

Changed 2 months ago by Brainiarc7

config.log

comment:1 Changed 2 months ago by oromit

  • Resolution set to invalid
  • Status changed from new to closed

Your nv-codec-headers are too old.
Only the latest releases have the required functions.

You must have installed some commit from in the middle of bumping the SDK and doing an actual release, otherwise configure wouldn't even enable that filter.

comment:2 Changed 2 months ago by Brainiarc7

You are correct.

I had to delete the entire workspace and begin from scratch.
For whatever reason (perhaps its' by design), the ./configure script does not "reset" options passed to it but rather, updates them incrementally.

For these who run into this issue in the future, here's the fix:

Purge the ffmpeg directory:

cd ~/ffmpeg_sources && rm -fr FFmpeg

Then uninstall any older ffnvcodec header packages you may have in your system.
Mine was in the default prefix. Handled it via:

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

As it turns out, I had an old copy of these headers installed in the default prefix. That should purge the older version.

Then deploy the same to the same prefix where ffmpeg's ./configure script can pick up the library's pkgconfig:

cd ~/ffmpeg_sources/nv-codec-headers
make
make install PREFIX="$HOME/ffmpeg_build"

Then proceed to configure and build ffmpeg as desired.

Thanks for the assistance, and apologies for the noise.

Note: See TracTickets for help on using tickets.