Hello.
I wanted to experiment with the openclsrc filter. I've been able to resolve
the issues with initializing the opencl device but I still can't use the
device. I've attached the shell script, kernel (from the documentation) and
the output log. Your help would be appreciated.
Thanks.

Attachment: openclsrc_test.sh
Description: application/shellscript

__kernel void ramp(__write_only image2d_t dst,
                   unsigned int index)
{
    int2 loc = (int2)(get_global_id(0), get_global_id(1));

    float4 val;
    val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));

    write_imagef(dst, loc, val);
}

ffmpeg version N-123625-gfd9f1e9c52-20260326 Copyright (c) 2000-2026 the FFmpeg developers
  built with gcc 15.2.0 (crosstool-NG 1.28.0.23_185f348)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-zlib --enable-libxml2 --enable-libsoxr --enable-openssl --enable-libvmaf --enable-fontconfig --enable-libharfbuzz --enable-libfreetype --enable-libfribidi --enable-vulkan --enable-libshaderc --enable-libvorbis --enable-libxcb --enable-xlib --enable-libpulse --enable-opencl --enable-gmp --enable-lzma --enable-liblcevc-dec --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-libplacebo --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-liboapv --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-libvvenc --enable-whisper --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs='-lgomp -ldl' --extra-ldflags=-pthread --extra-ldexeflags=-pie --cc=x86_64-ffbuild-linux-gnu-gcc --cxx=x86_64-ffbuild-linux-gnu-g++ --ar=x86_64-ffbuild-linux-gnu-gcc-ar --ranlib=x86_64-ffbuild-linux-gnu-gcc-ranlib --nm=x86_64-ffbuild-linux-gnu-gcc-nm --extra-version=20260326
  libavutil      60. 29.100 / 60. 29.100
  libavcodec     62. 29.101 / 62. 29.101
  libavformat    62. 13.101 / 62. 13.101
  libavdevice    62.  4.100 / 62.  4.100
  libavfilter    11. 15.101 / 11. 15.101
  libswscale      9.  7.100 /  9.  7.100
  libswresample   6.  4.100 /  6.  4.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'vaapi=va:/dev/dri/renderD128'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'opencl=ocldev@va'.
Reading option '-filter_hw_device' ... matched as option 'filter_hw_device' (set hardware device used when filtering) with argument 'ocldev'.
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 'openclsrc=kernel=ramp:size=hd1080 :format=yuv420p:rate=60:source='kernel.cl''.
Reading option '-vframes' ... matched as option 'vframes' (set the number of video frames to output) with argument '1'.
Reading option 'openclsrc_test.png' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option init_hw_device (initialise hardware device) with argument vaapi=va:/dev/dri/renderD128.
[VAAPI @ 0x631982907440] libva: VA-API version 1.22.0
[VAAPI @ 0x631982907440] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
[VAAPI @ 0x631982907440] libva: Found init function __vaDriverInit_1_22
[VAAPI @ 0x631982907440] libva: va_openDriver() returns 0
[VAAPI @ 0x631982907440] Initialised VAAPI connection: version 1.22
[VAAPI @ 0x631982907440] Format 0x41524742 -> bgra.
[VAAPI @ 0x631982907440] Format 0x41424752 -> rgba.
[VAAPI @ 0x631982907440] Format 0x58524742 -> bgr0.
[VAAPI @ 0x631982907440] Format 0x58424752 -> rgb0.
[VAAPI @ 0x631982907440] Format 0x30335241 -> unknown.
[VAAPI @ 0x631982907440] Format 0x30334241 -> unknown.
[VAAPI @ 0x631982907440] Format 0x30335258 -> x2rgb10le.
[VAAPI @ 0x631982907440] Format 0x30334258 -> unknown.
[VAAPI @ 0x631982907440] Format 0x36314752 -> unknown.
[VAAPI @ 0x631982907440] Format 0x56555941 -> unknown.
[VAAPI @ 0x631982907440] Format 0x56555958 -> vuyx.
[VAAPI @ 0x631982907440] Format 0x30303859 -> gray.
[VAAPI @ 0x631982907440] Format 0x3231564e -> nv12.
[VAAPI @ 0x631982907440] Format 0x3132564e -> unknown.
[VAAPI @ 0x631982907440] Format 0x32595559 -> yuyv422.
[VAAPI @ 0x631982907440] Format 0x59565955 -> uyvy422.
[VAAPI @ 0x631982907440] Format 0x32315659 -> yuv420p.
[VAAPI @ 0x631982907440] Format 0x30323449 -> yuv420p.
[VAAPI @ 0x631982907440] Format 0x50313134 -> yuv411p.
[VAAPI @ 0x631982907440] Format 0x48323234 -> yuv422p.
[VAAPI @ 0x631982907440] Format 0x56323234 -> yuv440p.
[VAAPI @ 0x631982907440] Format 0x50343434 -> yuv444p.
[VAAPI @ 0x631982907440] Format 0x33434d49 -> unknown.
[VAAPI @ 0x631982907440] Format 0x30313050 -> p010le.
[VAAPI @ 0x631982907440] Format 0x32313050 -> p012le.
[VAAPI @ 0x631982907440] Format 0x36313050 -> unknown.
[VAAPI @ 0x631982907440] Format 0x30313259 -> y210le.
[VAAPI @ 0x631982907440] Format 0x32313259 -> y212le.
[VAAPI @ 0x631982907440] Format 0x36313259 -> unknown.
[VAAPI @ 0x631982907440] Format 0x30313459 -> xv30le.
[VAAPI @ 0x631982907440] Format 0x32313459 -> xv36le.
[VAAPI @ 0x631982907440] Format 0x36313459 -> unknown.
[VAAPI @ 0x631982907440] Format 0x50424752 -> unknown.
[VAAPI @ 0x631982907440] Format 0x50524742 -> unknown.
[VAAPI @ 0x631982907440] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 25.2.3 ().
[VAAPI @ 0x631982907440] Driver not found in known nonstandard list, using standard behaviour.
Applying option init_hw_device (initialise hardware device) with argument opencl=ocldev@va.
[OpenCL @ 0x631982965cc0] 1 OpenCL platforms found.
[OpenCL @ 0x631982965cc0] 0.0: Intel(R) OpenCL Graphics / Intel(R) UHD Graphics
[OpenCL @ 0x631982965cc0] cl_intel_va_api_media_sharing found as platform extension.
[OpenCL @ 0x631982965cc0] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
[OpenCL @ 0x631982965cc0] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
[OpenCL @ 0x631982965cc0] Intel QSV in OpenCL release function found (clEnqueueReleaseVA_APIMediaSurfacesINTEL).
Applying option filter_hw_device (set hardware device used when filtering) with argument ocldev.
Successfully parsed a group of options.
Parsing a group of options: input url openclsrc=kernel=ramp:size=hd1080 :format=yuv420p:rate=60:source='kernel.cl'.
Applying option f (force container format (auto-detected otherwise)) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: openclsrc=kernel=ramp:size=hd1080 :format=yuv420p:rate=60:source='kernel.cl'.
[AVFilterGraph @ 0x631983e97fc0] Setting 'kernel' to value 'ramp'
[AVFilterGraph @ 0x631983e97fc0] Setting 'size' to value 'hd1080'
[AVFilterGraph @ 0x631983e97fc0] Setting 'format' to value 'yuv420p'
[AVFilterGraph @ 0x631983e97fc0] Setting 'rate' to value '60'
[AVFilterGraph @ 0x631983e97fc0] Setting 'source' to value 'kernel.cl'
detected 4 logical cores
[in#0 @ 0x63198423b680] Filter 'Parsed_openclsrc_0' formats:
[in#0 @ 0x63198423b680]   out[0] 'default':
[in#0 @ 0x63198423b680]     Pixel formats: opencl
[in#0 @ 0x63198423b680]     Color spaces: unknown gbr bt709 fcc bt470bg smpte170m smpte240m ycgco bt2020nc bt2020c smpte2085 chroma-derived-nc chroma-derived-c ictcp ipt-c2 ycgco-re ycgco-ro
[in#0 @ 0x63198423b680]     Color ranges: unknown tv pc
[in#0 @ 0x63198423b680]     Alpha modes: unspecified premultiplied straight
[in#0 @ 0x63198423b680] Filter 'out' formats:
[in#0 @ 0x63198423b680]   in[0] 'default':
[in#0 @ 0x63198423b680]     Pixel formats: yuv420p yuyv422 rgb24 bgr24 yuv422p yuv444p yuv410p yuv411p gray monow monob pal8 yuvj420p yuvj422p yuvj444p uyvy422 uyyvyy411 bgr8 bgr4 bgr4_byte rgb8 rgb4 rgb4_byte nv12 nv21 argb rgba abgr bgra gray16be gray16le yuv440p yuvj440p yuva420p rgb48be rgb48le rgb565be rgb565le rgb555be rgb555le bgr565be bgr565le bgr555be bgr555le vaapi yuv420p16le yuv420p16be yuv422p16le yuv422p16be yuv444p16le yuv444p16be dxva2_vld rgb444le rgb444be bgr444le bgr444be ya8 bgr48be bgr48le yuv420p9be yuv420p9le yuv420p10be yuv420p10le yuv422p10be yuv422p10le yuv444p9be yuv444p9le yuv444p10be yuv444p10le yuv422p9be yuv422p9le gbrp gbrp9be gbrp9le gbrp10be gbrp10le gbrp16be gbrp16le yuva422p yuva444p yuva420p9be yuva420p9le yuva422p9be yuva422p9le yuva444p9be yuva444p9le yuva420p10be yuva420p10le yuva422p10be yuva422p10le yuva444p10be yuva444p10le yuva420p16be yuva420p16le yuva422p16be yuva422p16le yuva444p16be yuva444p16le vdpau xyz12le xyz12be nv16 nv20le nv20be rgba64be rgba64le bgra64be bgra64le yvyu422 ya16be ya16le gbrap gbrap16be gbrap16le qsv mmal d3d11va_vld cuda 0rgb rgb0 0bgr bgr0 yuv420p12be yuv420p12le yuv420p14be yuv420p14le yuv422p12be yuv422p12le yuv422p14be yuv422p14le yuv444p12be yuv444p12le yuv444p14be yuv444p14le gbrp12be gbrp12le gbrp14be gbrp14le yuvj411p bayer_bggr8 bayer_rggb8 bayer_gbrg8 bayer_grbg8 bayer_bggr16le bayer_bggr16be bayer_rggb16le bayer_rggb16be bayer_gbrg16le bayer_gbrg16be bayer_grbg16le bayer_grbg16be yuv440p10le yuv440p10be yuv440p12le yuv440p12be ayuv64le ayuv64be videotoolbox_vld p010le p010be gbrap12be gbrap12le gbrap10be gbrap10le mediacodec gray12be gray12le gray10be gray10le p016le p016be d3d11 gray9be gray9le gbrpf32be gbrpf32le gbrapf32be gbrapf32le drm_prime opencl gray14be gray14le grayf32be grayf32le yuva422p12be yuva422p12le yuva444p12be yuva444p12le nv24 nv42 vulkan y210be y210le x2rgb10le x2rgb10be x2bgr10le x2bgr10be p210be p210le p410be p410le p216be p216le p416be p416le vuya rgbaf16be rgbaf16le vuyx p012le p012be y212be y212le xv30be xv30le xv36be xv36le rgbf32be rgbf32le rgbaf32be rgbaf32le p212be p212le p412be p412le gbrap14be gbrap14le d3d12 ayuv uyva vyu444 v30xbe v30xle rgbf16be rgbf16le rgba128be rgba128le rgb96be rgb96le y216be y216le xv48be xv48le gbrpf16be gbrpf16le gbrapf16be gbrapf16le grayf16be grayf16le amf gray32be gray32le yaf32be yaf32le yaf16be yaf16le gbrap32be gbrap32le yuv444p10msbbe yuv444p10msble yuv444p12msbbe yuv444p12msble gbrp10msbbe gbrp10msble gbrp12msbbe gbrp12msble ohcodec
[in#0 @ 0x63198423b680]     Color spaces: unknown gbr bt709 fcc bt470bg smpte170m smpte240m ycgco bt2020nc bt2020c smpte2085 chroma-derived-nc chroma-derived-c ictcp ipt-c2 ycgco-re ycgco-ro
[in#0 @ 0x63198423b680]     Color ranges: unknown tv pc
[in#0 @ 0x63198423b680]     Alpha modes: unspecified premultiplied straight
[AVFilterGraph @ 0x631983e97fc0] query_formats: 2 queried, 4 merged, 0 already done, 0 delayed
[Parsed_openclsrc_0 @ 0x631983e9bc00] OpenCL filtering requires an OpenCL device.
[Parsed_openclsrc_0 @ 0x631983e9bc00] Failed to configure output pad on Parsed_openclsrc_0
[in#0 @ 0x631983e9cf00] Error opening input: Invalid argument
Error opening input file openclsrc=kernel=ramp:size=hd1080 :format=yuv420p:rate=60:source='kernel.cl'.
Error opening input files: Invalid argument

Exiting with exit code -22
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to