[Cin] opencl on Radeons

Andrew Randrianasulu randrianasulu at gmail.com
Wed Nov 9 20:49:53 CET 2022


Because I tend to track this issue

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232

see latest notes there (you need llvm 15.0.4 -  yeah, in this case 0.0.1
version matters) and mesa git + some merge requests manually merged, but
results relatively promising - darktable starts and enjoy some 2x speedup
(on Power CPU, no less!), Lux render also starts and works.


Ffmpeg I guess not tested yet :)

for me ffmpeg -filters | grep opencl shows

... avgblur_opencl    V->V       Apply average blur filter      ...
boxblur_opencl    V->V       Apply boxblur filter to input video
... colorkey_opencl   V->V       Turns a certain color into transparency.
Operates on RGB colors.                            ... convolution_opencl
V->V       Apply convolution mask to input video
 ... deshake_opencl    V->V       Feature-point based video stabilization
filter                                                        ...
dilation_opencl   V->V       Apply dilation effect          ...
erosion_opencl    V->V       Apply erosion effect            ...
nlmeans_opencl    V->V       Non-local means denoiser through OpenCL
                                            ... overlay_opencl    VV->V
  Overlay one video on top of another
... pad_opencl        V->V       Pad the input video.             ...
prewitt_opencl    V->V       Apply prewitt operator         ...
program_opencl    |->V       Filter video using an OpenCL program
 ... roberts_opencl    V->V       Apply roberts operator       ...
sobel_opencl      V->V       Apply sobel operator          ...
tonemap_opencl    V->V       Perform HDR to SDR conversion with tonemapping.
  ... transpose_opencl  V->V       Transpose input video
 ... unsharp_opencl    V->V       Apply unsharp mask to input video
... xfade_opencl      VV->V      Cross fade one video with another video.
                                                                     ...
openclsrc         |->V       Generate video using an OpenCL program



for tonemapping on OpenCL this line was suggested (on Nvidia) - see below.

https://superuser.com/questions/1549479/ffmpeg-4k-hdr-to-1080p-sdr-hardware-tonemap-conversion-opencl

so I guess we can use it as example for trying on Radeons (comment about
OpenCL 1.2 needed still apply, but rusticl exposes 3.0 :-) )

there is also AUR package, but not sure if it tracks right branch from
Karol Herbst (developer) repo ..

https://aur.archlinux.org/packages/mesa-rusticl-git

I personally look at
https://gitlab.freedesktop.org/karolherbst/mesa/-/commits/rusticl/wip_nv/


note enabling this also require some environment flags to be set.

ffmpeg -vsync 0 -hwaccel cuda \

 -init_hw_device opencl=ocl \

-filter_hw_device ocl -extra_hw_frames 3 \

-threads 16 -c:v hevc_cuvid \

-resize 1920x1080 -i INPUT \

-vf "format=p010,hwupload,tonemap_opencl=tonemap=mobius:param=0.01:desat=0:r=tv:p=bt709:t=bt709:m=bt709:format=nv12,hwdownload,format=nv12"
\

 -c:a copy -c:s copy \

-c:v libx264 -max_muxing_queue_size 9999 OUTPUT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20221109/f5baefa8/attachment.htm>


More information about the Cin mailing list