Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917796 - media-video/ffmpeg-6.1[vulkan] fails to build
Summary: media-video/ffmpeg-6.1[vulkan] fails to build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-23 10:26 UTC by MrPenguin07
Modified: 2023-12-16 11:12 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge --info.txt,21.45 KB, text/plain)
2023-11-23 10:26 UTC, MrPenguin07
Details
build.log (ffmpeg-6.1.build.log,328.49 KB, text/x-log)
2023-11-23 10:29 UTC, MrPenguin07
Details
emerge --info (emerge--info.txt.lz,3.81 KB, application/x-lzip)
2023-11-23 16:18 UTC, Jorge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MrPenguin07 2023-11-23 10:26:06 UTC
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: libavutil/libavutil.a(vulkan.o):(.rodata+0x60): multiple definition of `ff_comp_identity_map'; libavcodec/libavcodec.a(vulkan.o):(.rodata+0x60): first defined here
collect2: error: ld returned 1 exit status
make: *** [/var/tmp/portage/media-video/ffmpeg-6.1/work/ffmpeg-6.1/ffbuild/libffmpeg.mak:14: libffmpeg.so] Error 1

# USE="-vulkan" emerge =media-video/ffmpeg-6.1
Successfully builds.

Build log:
https://pastebin.com/snmcFyFV
(truncated as full log rather large)

Have rebuilt vulkan headers/tools/loader to no benefit, continues to fail building.

Reproducible: Always

Steps to Reproduce:
1. # USE="vulkan" emerge =media-video/ffmpeg-6.1
2. 

Actual Results:  
Fails

Expected Results:  
ffmpeg compiles +vulkan
Comment 1 MrPenguin07 2023-11-23 10:26:32 UTC
Created attachment 875415 [details]
emerge --info
Comment 2 MrPenguin07 2023-11-23 10:29:10 UTC
Created attachment 875416 [details]
build.log
Comment 3 Mike Lothian 2023-11-23 12:31:21 UTC
Clang also has issues with the vulkan stuff but gives very different errors:

rc/libavcodec/vulkan_av1.c:183:43: error: incompatible pointer to integer conversion initializing 'VkVideoSessionParametersKHR' (aka 'unsigned long long') with an expression of type 'void *' [-Wint-conversion]
  183 |         .videoSessionParametersTemplate = NULL,
      |                                           ^~~~
/usr/lib/llvm/17/bin/../../../../lib/clang/17/include/stddef.h:89:16: note: expanded from macro 'NULL'
   89 | #  define NULL ((void*)0)
      |                ^~~~~~~~~~
1 error generated.
make: *** [/var/tmp/portage/media-video/ffmpeg-6.1/work/ffmpeg-6.1/ffbuild/common.mak:81: libavcodec/vulkan_av1.o] Error 1
make: *** Waiting for unfinished jobs....
src/libavcodec/vulkan_h264.c:318:43: error: incompatible pointer to integer conversion initializing 'VkVideoSessionParametersKHR' (aka 'unsigned long long') with an expression of type 'void *' [-Wint-conversion]
  318 |         .videoSessionParametersTemplate = NULL,
      |                                           ^~~~
/usr/lib/llvm/17/bin/../../../../lib/clang/17/include/stddef.h:89:16: note: expanded from macro 'NULL'
   89 | #  define NULL ((void*)0)
      |                ^~~~~~~~~~
1 error generated.
make: *** [/var/tmp/portage/media-video/ffmpeg-6.1/work/ffmpeg-6.1/ffbuild/common.mak:81: libavcodec/vulkan_h264.o] Error 1
src/libavcodec/vulkan_hevc.c:656:43: error: incompatible pointer to integer conversion initializing 'VkVideoSessionParametersKHR' (aka 'unsigned long long') with an expression of type 'void *' [-Wint-conversion]
  656 |         .videoSessionParametersTemplate = NULL,
      |                                           ^~~~
/usr/lib/llvm/17/bin/../../../../lib/clang/17/include/stddef.h:89:16: note: expanded from macro 'NULL'
   89 | #  define NULL ((void*)0)
      |                ^~~~~~~~~~
1 error generated.
make: *** [/var/tmp/portage/media-video/ffmpeg-6.1/work/ffmpeg-6.1/ffbuild/common.mak:81: libavcodec/vulkan_hevc.o] Error 1
src/libavcodec/vulkan_decode.c:191:26: error: incompatible pointer to integer conversion assigning to 'VkImageView' (aka 'unsigned long long') from 'void *' [-Wint-conversion]
  191 |     vkpic->img_view_ref  = NULL;
      |                          ^ ~~~~
src/libavcodec/vulkan_decode.c:192:26: error: incompatible pointer to integer conversion assigning to 'VkImageView' (aka 'unsigned long long') from 'void *' [-Wint-conversion]
  192 |     vkpic->img_view_out  = NULL;
      |                          ^ ~~~~
src/libavcodec/vulkan_decode.c:193:26: error: incompatible pointer to integer conversion assigning to 'VkImageView' (aka 'unsigned long long') from 'void *' [-Wint-conversion]
  193 |     vkpic->img_view_dest = NULL;
      |                          ^ ~~~~
3 errors generated.
make: *** [/var/tmp/portage/media-video/ffmpeg-6.1/work/ffmpeg-6.1/ffbuild/common.mak:81: libavcodec/vulkan_decode.o] Error 1
Comment 4 Jorge 2023-11-23 16:17:08 UTC
I also got linker erros when compiling media-video/ffmpeg (+vulkan) with GCC.

Full build log: https://bin.disroot.org/?7931a43b7222673e#GS5eCTMaY2ZLpRGi68TpGom23AedU8i2nyW9DktWXCZp

emerge -pqv '=media-video/ffmpeg-6.1::gentoo':
[ebuild     U ] media-video/ffmpeg-6.1 [6.0.1] USE="X alsa bzip2 chromium dav1d encode fontconfig gnutls gpl iconv jpegxl lcms libaom libplacebo libxml2 lzma mp3 network opencl opengl opus postproc pulseaudio samba sdl svg svt-av1 theora threads truetype vaapi vorbis vpx vulkan webp x264 x265 xvid zlib -amf -amr -amrenc (-appkit) -bluray -bs2b -cdio -chromaprint -codec2 -cpudetection -cuda -debug -doc -fdk -flite -frei0r -fribidi -gcrypt -glslang% -gme -gmp -gsm -hardcoded-tables -iec61883 -ieee1394 -jack -jpeg2k -kvazaar -ladspa -libaribb24 -libass -libcaca -libdrm -libilbc -librtmp -libsoxr -libtesseract -libv4l -lv2 (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -modplug -nvenc -openal -openh264 -openssl -oss -pic -qsv -rav1e -rubberband -shaderc% -snappy -sndio -speex -srt -ssh -static-libs -test -twolame -v4l -vdpau -verify-sig -vidstab -vmaf -zeromq -zimg -zvbi" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 -3dnow -3dnowext -fma4 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher"
Comment 5 Jorge 2023-11-23 16:18:02 UTC
Created attachment 875423 [details]
emerge --info
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-26 00:28:41 UTC
(In reply to Mike Lothian from comment #3)
> Clang also has issues with the vulkan stuff but gives very different errors:
> 

New bug please with the full log.
Comment 7 Ben Cunningham 2023-11-29 13:45:03 UTC
USE="-opencl"

Built fine on my laptop but not on my desktop that has a more complex use flag setup. Comparing the two and the use flags from Jorge in comment 6, I started experimenting with removing use flags, one at a time. 

Command that got FFMPEG-6.1 to build without error: 
USE='-opencl' emerge -1av ffmpeg

Hope that helps people.
Comment 8 MrPenguin07 2023-11-29 14:25:08 UTC
(In reply to Ben Cunningham from comment #7)
> USE="-opencl"
> 
> Built fine on my laptop but not on my desktop that has a more complex use
> flag setup. Comparing the two and the use flags from Jorge in comment 6, I
> started experimenting with removing use flags, one at a time. 
> 
> Command that got FFMPEG-6.1 to build without error: 
> USE='-opencl' emerge -1av ffmpeg
> 
> Hope that helps people.

I would suggest to you that you have hit a different issue and may be worth it's own bug.

This particular issue is +vulkan.

P.S I don't seem to have issues with opencl, both my desktop and binhost build 6.1 fine with (-vulkan +opencl)
Comment 9 Mike Lothian 2023-11-29 18:02:59 UTC
I think this is an opencl/rusticl + vulkan issue

Things compile fine with USE="-opencl vulkan" or USE="opencl -vulkan" but not USE="opencl vulkan" which gets the duplicated symbols
Comment 10 Pablo Cholaky 2023-11-30 18:23:27 UTC
Just two questions.

In the practical sense, is there any use for +opencl or +vulkan on ffmpeg? I can't see any benefit from ffmpeg using GPU compilers.

Also, if they are using the same headers/symbols, is there any real difference by using one or another for ffmpeg?
Comment 11 Bearcat M. Şándor 2023-11-30 18:41:22 UTC
As a replacement/upgrade of OpenGL, doesn't using Vulkan allow for graphics acceleration while watching video?
Comment 12 MrSnivvel 2023-11-30 18:45:26 UTC
(In reply to Pablo Cholaky from comment #10)
> Just two questions.
> 
> In the practical sense, is there any use for +opencl or +vulkan on ffmpeg? I
> can't see any benefit from ffmpeg using GPU compilers.
> 
> Also, if they are using the same headers/symbols, is there any real
> difference by using one or another for ffmpeg?

GPU accelerated decoding:  https://www.phoronix.com/news/FFmpeg-6.1-Released
Comment 13 Mark 2023-11-30 22:41:31 UTC
I had the same issue and can confirm that ffmpeg 6.1 builds without opencl now.
Comment 14 MrPenguin07 2023-12-16 11:12:34 UTC
Appears to be resolved with ffmpeg-6.1-r1.

Closing