[FFmpeg-user] *_vulkan filters segmentation fault 11
Christian Ebert
bcc at phloxic.productions
Mon Apr 7 18:31:05 EEST 2025
Hi,
I cannot get hwaccel vulkan filters to work. Every filter I tried
segfaults, see nlmeans_vulkan example below.
Happy (well, not entirely) to report it as a bug, but maybe I am
missing something?
$ sw_vers
ProductName: macOS
ProductVersion: 15.4
BuildVersion: 24E248
$ vkvia
VIA_INFO: SDK Found! - Will attempt to run tests
VIA_INFO: Attempting to run ./vkcube in /Users/me/VulkanSDK/1.4.309.0/macOS/../Applications/vkcube.app/Contents/MacOS
VIA_INFO: Command-line: ./vkcube --c 100 --suppress_popups
Selected WSI platform: metal
Selected GPU 0: Apple M1 Pro, type: IntegratedGpu
VIA_INFO: Command-line: ./vkcube --c 100 --suppress_popups --validate
Selected WSI platform: metal
Selected GPU 0: Apple M1 Pro, type: IntegratedGpu
SUCCESS: Vulkan analysis completed properly using Vulkan 1.2
Here's a sample command and report:
$ FFREPORT=file=ff_test-nlmeans_vulkan.log ffmpeg -init_hw_device vulkan=vk:0 -filter_hw_device vk -f lavfi -i testsrc=duration=10 -filter:v format=yuv420p,hwupload,nlmeans_vulkan,hwdownload test-nlmeans_vulkan.mpg
ffmpeg started on 2025-04-07 at 16:18:15
Report written to "ff_test-nlmeans_vulkan.log"
[...]
see report below
[...]
Input #0, lavfi, from 'testsrc=duration=10':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: wrapped_avframe, rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
Segmentation fault: 11
Report:
ffmpeg started on 2025-04-07 at 16:18:15
Report written to "ff_test-nlmeans_vulkan.log"
Log level: 48
Command line:
ffmpeg -init_hw_device "vulkan=vk:0" -filter_hw_device vk -f lavfi -i "testsrc=duration=10" -filter:v "format=yuv420p,hwupload,nlmeans_vulkan,hwdownload" test-nlmeans_vulkan.mpg
ffmpeg version N-119137-g46762c8b82 Copyright (c) 2000-2025 the FFmpeg developers
built with Apple clang version 17.0.0 (clang-1700.0.13.3)
configuration: --prefix=/Users/me/.local --enable-gpl --enable-nonfree --enable-shared --enable-openssl --enable-pic --enable-libspeex --enable-libopus --enable-libfdk-aac --enable-libsvtav1 --enable-libx265 --enable-librav1e --enable-libx264 --enable-libmp3lame --enable-libbluray --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libaom --enable-libfreetype --enable-libfreetype --enable-libzimg --enable-libass --enable-libdvdread --enable-libdvdnav --enable-libvvenc --enable-vulkan --enable-libshaderc --extra-cflags='-I/opt/local/include -I/Users/me/VulkanSDK/1.4.309.0/macOS/include -I/opt/local/include/X11' --extra-libs='-L/opt/local/lib -L/Users/me/VulkanSDK/1.4.309.0/macOS/lib' --disable-htmlpages
libavutil 60. 0.100 / 60. 0.100
libavcodec 62. 0.101 / 62. 0.101
libavformat 62. 0.100 / 62. 0.100
libavdevice 62. 0.100 / 62. 0.100
libavfilter 11. 0.100 / 11. 0.100
libswscale 9. 0.100 / 9. 0.100
libswresample 6. 0.100 / 6. 0.100
libpostproc 59. 0.100 / 59. 0.100
Splitting the commandline.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'vulkan=vk:0'.
Reading option '-filter_hw_device' ... matched as option 'filter_hw_device' (set hardware device used when filtering) with argument 'vk'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'lavfi'.
Reading option '-i' ... matched as input url with argument 'testsrc=duration=10'.
Reading option '-filter:v' ... matched as option 'filter' (apply specified filters to audio/video) with argument 'format=yuv420p,hwupload,nlmeans_vulkan,hwdownload'.
Reading option 'test-nlmeans_vulkan.mpg' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option init_hw_device (initialise hardware device) with argument vulkan=vk:0.
[AVHWDeviceContext @ 0x6000031e0000] Supported layers:
[AVHWDeviceContext @ 0x6000031e0000] VK_LAYER_LUNARG_api_dump
[AVHWDeviceContext @ 0x6000031e0000] VK_LAYER_LUNARG_gfxreconstruct
[AVHWDeviceContext @ 0x6000031e0000] VK_LAYER_KHRONOS_profiles
[AVHWDeviceContext @ 0x6000031e0000] VK_LAYER_KHRONOS_validation
[AVHWDeviceContext @ 0x6000031e0000] VK_LAYER_LUNARG_screenshot
[AVHWDeviceContext @ 0x6000031e0000] VK_LAYER_KHRONOS_synchronization2
[AVHWDeviceContext @ 0x6000031e0000] VK_LAYER_KHRONOS_shader_object
[AVHWDeviceContext @ 0x6000031e0000] Using instance extension VK_EXT_layer_settings
[AVHWDeviceContext @ 0x6000031e0000] Using instance extension VK_KHR_portability_enumeration
[AVHWDeviceContext @ 0x6000031e0000] GPU listing:
[AVHWDeviceContext @ 0x6000031e0000] 0: Apple M1 Pro (integrated) (0xf030207)
[AVHWDeviceContext @ 0x6000031e0000] Device 0 selected: Apple M1 Pro (integrated) (0xf030207)
[AVHWDeviceContext @ 0x6000031e0000] Using device extension VK_KHR_portability_subset
[AVHWDeviceContext @ 0x6000031e0000] Using device extension VK_KHR_push_descriptor
[AVHWDeviceContext @ 0x6000031e0000] Using device extension VK_EXT_shader_atomic_float
[AVHWDeviceContext @ 0x6000031e0000] Using device extension VK_EXT_external_memory_host
[AVHWDeviceContext @ 0x6000031e0000] Queue families:
[AVHWDeviceContext @ 0x6000031e0000] 0: graphics compute transfer (queues: 1)
[AVHWDeviceContext @ 0x6000031e0000] 1: graphics compute transfer (queues: 1)
[AVHWDeviceContext @ 0x6000031e0000] 2: graphics compute transfer (queues: 1)
[AVHWDeviceContext @ 0x6000031e0000] 3: graphics compute transfer (queues: 1)
[AVHWDeviceContext @ 0x6000031e0000] Using device: Apple M1 Pro
[AVHWDeviceContext @ 0x6000031e0000] Alignments:
[AVHWDeviceContext @ 0x6000031e0000] optimalBufferCopyRowPitchAlignment: 1
[AVHWDeviceContext @ 0x6000031e0000] minMemoryMapAlignment: 64
[AVHWDeviceContext @ 0x6000031e0000] nonCoherentAtomSize: 16
[AVHWDeviceContext @ 0x6000031e0000] minImportedHostPointerAlignment: 16384
[AVHWDeviceContext @ 0x6000031e0000] Using queue family 0 (queues: 1) for graphics
[AVHWDeviceContext @ 0x6000031e0000] Using queue family 1 (queues: 1) for compute
[AVHWDeviceContext @ 0x6000031e0000] Using queue family 2 (queues: 1) for transfers
Applying option filter_hw_device (set hardware device used when filtering) with argument vk.
Successfully parsed a group of options.
Parsing a group of options: input url testsrc=duration=10.
Applying option f (force container format (auto-detected otherwise)) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: testsrc=duration=10.
[AVFilterGraph @ 0x600000fe9ff0] Setting 'duration' to value '10'
detected 10 logical cores
[Parsed_testsrc_0 @ 0x6000011e8600] size:320x240 rate:25/1 duration:10.000000 sar:1/1
[AVFilterGraph @ 0x600000fe9ff0] query_formats: 2 queried, 3 merged, 0 already done, 0 delayed
[lavfi @ 0x152e0a7c0] All info found
Input #0, lavfi, from 'testsrc=duration=10':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0, 1, 1/25: Video: wrapped_avframe, rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn
Successfully opened the file.
Parsing a group of options: output url test-nlmeans_vulkan.mpg.
Applying option filter:v (apply specified filters to audio/video) with argument format=yuv420p,hwupload,nlmeans_vulkan,hwdownload.
Successfully parsed a group of options.
Opening an output file: test-nlmeans_vulkan.mpg.
[out#0/mpeg @ 0x6000011ec600] No explicit maps, mapping streams automatically...
[vost#0:0/mpeg1video @ 0x152f0b8a0] Created video stream from input stream 0:0
[AVFilterGraph @ 0x600000fedea0] Setting 'pix_fmts' to value 'yuv420p'
[file @ 0x600000ae3b00] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> mpeg1video (native))
[vost#0:0/mpeg1video @ 0x152f0b8a0] Starting thread...
[vf#0:0 @ 0x6000015e0320] Starting thread...
[vist#0:0/wrapped_avframe @ 0x152f0aea0] [dec:wrapped_avframe @ 0x152f0a030] Starting thread...
[in#0/lavfi @ 0x1548047d0] Starting thread...
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x600000fe0000] Setting 'pix_fmts' to value 'yuv420p'
[graph -1 input from stream 0:0 @ 0x6000011e0300] w:320 h:240 pixfmt:rgb24 tb:1/25 fr:25/1 sar:1/1 csp:gbr range:pc
[format @ 0x6000011e0480] Setting 'pix_fmts' to value 'yuv420p'
[format @ 0x6000011e0480] Setting 'color_ranges' to value 'tv'
[auto_scale_0 @ 0x6000011ec840] w:iw h:ih flags:'' interl:0
[Parsed_format_0 @ 0x6000011e0000] auto-inserting filter 'auto_scale_0' between the filter 'graph -1 input from stream 0:0' and the filter 'Parsed_format_0'
[AVFilterGraph @ 0x600000fe0000] query_formats: 7 queried, 15 merged, 3 already done, 0 delayed
[auto_scale_0 @ 0x6000011ec840] w:320 h:240 fmt:rgb24 csp:gbr range:pc sar:1/1 -> w:320 h:240 fmt:yuv420p csp:unknown range:tv sar:1/1 flags:0x00000004
[auto_scale_0 @ 0x6000011ec840] [framesync @ 0x152f0d790] Selected 1/25 time base
[auto_scale_0 @ 0x6000011ec840] [framesync @ 0x152f0d790] Sync level 1
[hwupload @ 0x600002ae0150] Surface format is yuv420p.
[Parsed_nlmeans_vulkan_2 @ 0x6000011e0180] Reusing existing frames context
Ideas anyone?
TIA,
Christian
More information about the ffmpeg-user
mailing list