[FFmpeg-trac] #9933(avfilter:new): `xfade_opencl` doesn't build

FFmpeg trac at avcodec.org
Wed Sep 21 10:24:22 EEST 2022


#9933: `xfade_opencl` doesn't build
-------------------------------------+-------------------------------------
             Reporter:  Johnny       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avfilter     |                  Version:
             Keywords:  opencl       |  unspecified
  openCL xfade                       |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:

 The underlying [opencl
 program](https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/opencl/xfade.cl)
 for `xfade_opencl` doesn't seem to build.

 How to reproduce:
 {{{
 % ffmpeg -v verbose -nostdin -init_hw_device opencl=opencl:0.0
 -filter_hw_device opencl \
 -i input.mp4 \
 -filter_complex "\
     [0:v]format=yuv420p,hwupload,split=2[base][blurred];

     [blurred]boxblur_opencl[blurred];
     [base][blurred]xfade_opencl[base];

     [base]hwdownload,format=yuv420p[base]
 " \
 -map [base] -y output.mp4

 ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
   built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
   configuration: --prefix=/usr/local --extra-
 cflags=-I/usr/local/cuda/include --extra-cflags=-I/usr/local/include
 --extra-ldflags=-L/usr/local/cuda/lib64 --disable-debug --disable-
 stripping --disable-static --enable-shared --enable-nonfree --enable-gpl
 --enable-swresample --enable-avfilter --enable-fontconfig --enable-libzmq
 --enable-nvenc --enable-cuda --enable-cuvid --enable-libnpp --enable-
 opencl --enable-libfdk_aac --enable-pthreads --enable-libx264 --enable-
 libfontconfig --enable-libfreetype --enable-cuda-nvcc --enable-openssl
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
 [AVHWDeviceContext @ 0x55c1bd60abc0] 0.0: NVIDIA CUDA / Tesla T4
 [h264 @ 0x55c1bdec1980] Reinit context to 1280x720, pix_fmt: yuv420p
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf59.27.100
   Duration: 00:02:00.07, start: 0.000000, bitrate: 278 kb/s
     Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 /
 0x31637661), yuv420p(left), 1280x720, 142 kb/s, 30 fps, 30 tbr, 15360 tbn,
 60 tbc (default)
     Metadata:
       handler_name    : VideoHandler
       encoder         : Lavc59.37.100 libx264
     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
 stereo, fltp, 128 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
 Stream mapping:
   Stream #0:0 (h264) -> format
   format -> Stream #0:0 (libx264)
 [h264 @ 0x55c1bdf004c0] Reinit context to 1280x720, pix_fmt: yuv420p
 [graph 0 input from stream 0:0 @ 0x55c1be3ea280] w:1280 h:720
 pixfmt:yuv420p tb:1/15360 fr:30/1 sar:0/1
 [Parsed_boxblur_opencl_3 @ 0x55c1be3e75c0] luma_radius:2 luma_power:2
 chroma_radius:2 chroma_power:2 alpha_radius:2 alpha_power:2 w:1280
 chroma_w:1280 h:720 chroma_h:720
 [Parsed_xfade_opencl_4 @ 0x55c1be3e8000] Failed to build program: -11.
 [Parsed_xfade_opencl_4 @ 0x55c1be3e8000] Build log:
 <kernel>:109:27: error: call to 'mix' is ambiguous
     write_imagef(dst, uv, mix(val1, val2, (p.y >= 0) * (h > p.y) * (p.x >=
 0) * (w > p.x)));
                           ^~~
 cl_kernel.h:3925:26: note: candidate function
 float4  __OVERLOADABLE__ mix(float4 x, float4 y, float a)    ;
                          ^
 cl_kernel.h:3942:25: note: candidate function
 float4 __OVERLOADABLE__ mix(float4, float4, float4);
                         ^

 Error while filtering: Input/output error
 Failed to inject frame into filter network: Input/output error
 Error while processing the decoded data for stream #0:0
 [AVIOContext @ 0x55c1bdc7fdc0] Statistics: 0 seeks, 0 writeouts
 [AVIOContext @ 0x55c1bde96c00] Statistics: 178037 bytes read, 2 seeks
 Conversion failed!
 }}}

 `nvidia-smi` output:
 {{{
 +-----------------------------------------------------------------------------+
 | NVIDIA-SMI 440.64       Driver Version: 440.64       CUDA Version: 10.2
 |
 |-------------------------------+----------------------+----------------------+
 | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr.
 ECC |
 | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute
 M. |
 |===============================+======================+======================|
 |   0  Tesla T4            Off  | 00000000:00:04.0 Off |
 0 |
 | N/A   66C    P0    20W /  70W |      0MiB / 15109MiB |      0%
 Default |
 +-------------------------------+----------------------+----------------------+

 +-----------------------------------------------------------------------------+
 | Processes:                                                       GPU
 Memory |
 |  GPU       PID   Type   Process name                             Usage
 |
 |=============================================================================|
 |  No running processes found
 |
 +-----------------------------------------------------------------------------+
 }}}

 The error looks like the opencl compiler/builder failed to build the
 program and that stopped the filtergraph from being constructed.
 Perhaps I'm having a mismatch of opencl version ? Or it has something to
 do with CUDA/nvidia driver ?
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9933>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list