BtbN / FFmpeg-Builds

MIT License
7.42k stars 1.02k forks source link

[6.1] libplacebo filter fails to initialize without both `init_hw_device vulkan` and `filter_hw_device vulkan` #378

Closed akshetpandey closed 4 months ago

akshetpandey commented 4 months ago
[libplacebo @ 0x55e387b95740] No `vkGetInstanceProcAddr` function provided, and libplacebo built without linking against this function!
[libplacebo @ 0x55e387b95740] Failed initializing vulkan device
[libplacebo @ 0x55e387b95740] Failed creating Vulkan device!
[Parsed_libplacebo_0 @ 0x55e387b95640] Query format failed for 'Parsed_libplacebo_0': Generic error in an external library
[vf#0:0 @ 0x55e386a79e80] Error reinitializing filters!
Failed to inject frame into filter network: Generic error in an external library
Error while filtering: Generic error in an external library
[out#0/mp4 @ 0x55e386a16800] Nothing was written into output file, because at least one of its streams received no packets.
akshet@l4:~/ffmpeg$ find / -name "*libvulkan*" 2>/dev/null
/usr/local/cuda-12.4/nsight-systems-2023.4.4/host-linux-x64/Plugins/wayland-graphics-integration-client/libvulkan-server.so
/usr/local/cuda-12.4/nsight-compute-2024.1.1/host/linux-desktop-glibc_2_11_3-x64/Plugins/wayland-graphics-integration-client/libvulkan-server.so
/usr/lib/x86_64-linux-gnu/libvulkan.so.1.3.204
/usr/lib/x86_64-linux-gnu/libvulkan_lvp.so
/usr/lib/x86_64-linux-gnu/libvulkan_intel.so
/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so
/usr/lib/x86_64-linux-gnu/libvulkan.so.1
/usr/lib/x86_64-linux-gnu/libvulkan_intel_hasvk.so
/usr/lib/x86_64-linux-gnu/libvulkan_virtio.so
/usr/share/doc/libvulkan1
/var/lib/dpkg/info/libvulkan1:amd64.symbols
/var/lib/dpkg/info/libvulkan1:amd64.list
/var/lib/dpkg/info/libvulkan1:amd64.md5sums
/var/lib/dpkg/info/libvulkan1:amd64.triggers
/var/lib/dpkg/info/libvulkan1:amd64.shlibs
akshet@l4:~/ffmpeg$ echo $LD_LIBRARY_PATH
/usr/lib/x86_64-linux-gnu:/usr/local/cuda-12.4/lib64
akshet@l4:~/ffmpeg$ apt search libvulkan
Sorting... Done
Full Text Search... Done
libvulkan-dev/jammy 1.3.204.1-2 amd64
  Vulkan loader library -- development files

libvulkan-volk-dev/jammy 1.2.198-1 all
  Meta-loader for Vulkan API

libvulkan1/jammy,now 1.3.204.1-2 amd64 [installed]
  Vulkan loader library
akshet@l4:~/ffmpeg$ apt search vulkan-tools
Sorting... Done
Full Text Search... Done
vulkan-tools/jammy,now 1.3.204.0+dfsg1-1 amd64 [installed]
  Miscellaneous Vulkan utilities
BtbN commented 4 months ago

That's an issue in FFmpeg. I can't link against libvulkan, for hopefully obvious reasons. So FFmpeg has to provide the loader. Older versions apparently don't do this properly. Nothing I can do about that from this side.

akshetpandey commented 4 months ago

I am surprised even 6.1 doesn't provide this correctly?! I can't figure out how I would test the static builds vs some other build because I can't find anything else that builds with libplacebo.

But just looking at stackoverflow and other forums, it seems like people are under the impression that this should work. I have ran into a bunch of accepted answers that just crashes on this build.

akshetpandey commented 4 months ago

Alternatively, I guess I am not sure what libraries I need to install to get the shared build to work correctly.

BtbN commented 4 months ago

It would work if you manually build libplacebo (and ffmpeg) and link it directly against the vulkan libraries. But like I said, I can't do that for the static builds, since the resulting binary would then have a dependency against vulkan libs, which defeats the point of a static build. Latest ffmpeg master should work fine, and maybe 7.0 as well. The massive Vulkan-Overhaul won't be backported to 6.1, so that version is just not gonna work.

akshetpandey commented 4 months ago

Hmm, let me try 7.0/master again. I ran into some cuda version incompatibility issue with is last week since server drivers are still 535/cuda 12.2

BtbN commented 4 months ago

Yes, you need fairly up to date drivers, since master and 7.0 use up-to-date video codec headers.

akshetpandey commented 4 months ago

Haha, Sorry, this is way beyond the scope of this repo.

Do I necessarily need the latest driver or are the latest versions of cuda libraries and cuda compat enough?

BtbN commented 4 months ago

Everything except for the driver is irrelevant as far as ffmpeg is concerned.

akshetpandey commented 4 months ago

Tysm for the context! I will mess around with shared builds.