SoftCreatR / imei

IMEI - ImageMagick Easy Install
ISC License
309 stars 36 forks source link

doxigen and opencl dependencies? #69

Closed rubenjmunoz closed 2 years ago

rubenjmunoz commented 2 years ago

Great tool to have a nice clean full install of ImageMagick . During the install there where 2 errors that maybe stopped me from having a successful install.

  1. (indicated in the log) regarding doxigen that was seamingly solved with (an apology i didn't write down the error)

sudo apt install doxygen

  1. it was looking for :

./MagickWand/studio.h:133:12: fatal error: CL/cl.h: No such file or directory and it finally went away after doing the following

sudo apt install opencl-headers

now I got the happy message: image the leftover errors seem to be of no impact to the software usage. image eddit: now I see those are not "errors"... lol

No biggy, it might be a faulty messy set up of mine, just letting you guys know.

sidenote: I came back looking for an updated version of your script from 2019 to install ImageMagick!

SoftCreatR commented 2 years ago

Welcome back ;)

For the missing doxygen lib: I have to find out, what uses it, because I disable docs by default to speed up the process a little bit.

And for OpenCL: I prefer not to compile IM with OpenCL support. However, it seems, that I have to explicitly disable it (via --disable-opencl or --enable-opencl=no).

SoftCreatR commented 2 years ago

Apparently, Doxygen is required by libaom, although -DENABLE_DOCS=0 is set*. Could/must** be reported directly to the respective developer. But since this isn't an actual problem that negatively affects the compilation, you can safely ignore the hint.

* = The exact message is:

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) --- Cannot find doxygen(version 1.8.10 or newer), ENABLE_DOCS turned off.

** = https://bugs.chromium.org/p/aomedia/issues/detail?id=3324


Regarding the message about OpenCL: OpenCL is explicitly disabled in IMEI (v6.6.3+).

jackyhallyday commented 1 year ago

Welcome back ;)

For the missing doxygen lib: I have to find out, what uses it, because I disable docs by default to speed up the process a little bit.

And for OpenCL: I prefer not to compile IM with OpenCL support. However, it seems, that I have to explicitly disable it (via --disable-opencl or --enable-opencl=no).

Hello, I've just started to rent a server with a GPU. Image processing is the only field where it could be useful for now, so I was wondering: why do you prefer not to compile IM with OpenCL support? Is the rendering different or something?

SoftCreatR commented 1 year ago

Imagemagick, when utilizing OpenCL, demonstrates noticeably inferior performance compared to OpenMP.

To delve into the technical details, Imagemagick is a widely used software suite for image manipulation and processing tasks. It offers support for various programming frameworks, including OpenCL and OpenMP, which allow for parallel computing on different hardware architectures.

OpenCL (Open Computing Language) is a framework that enables developers to harness the power of heterogeneous computing devices, such as GPUs (Graphics Processing Units), to accelerate computations. It provides a programming model that allows for task parallelism, where multiple tasks can be executed simultaneously on different processing units.

On the other hand, OpenMP (Open Multi-Processing) is a programming interface primarily designed for shared memory systems, such as multi-core CPUs. It facilitates parallel processing by dividing the workload among multiple threads, where each thread operates on a separate portion of the data.

In the context of Imagemagick, the choice between OpenCL and OpenMP depends on the specific hardware configuration and the nature of the image processing tasks. While OpenCL can leverage the computational power of GPUs, which are highly parallel devices, it may not always outperform OpenMP on certain systems.

The performance discrepancy between OpenCL and OpenMP in Imagemagick can be attributed to several factors. One of the key considerations is the workload characteristics. OpenCL excels at handling tasks that can be efficiently parallelized and benefit from the massive parallelism offered by GPUs. However, certain image processing algorithms or operations may not be amenable to parallel execution or may exhibit limited parallelism. In such cases, the overhead associated with task scheduling and data transfers between the CPU and GPU in OpenCL can degrade performance compared to the more straightforward thread-based parallelism of OpenMP.

Additionally, the efficiency of the underlying hardware implementation can also play a role. While GPUs are highly capable parallel processors, their performance can be influenced by factors such as memory bandwidth, data dependencies, and algorithmic optimizations. If the GPU architecture or the specific GPU device being utilized is not well-suited for the image processing workload or lacks proper optimization, it can contribute to the slower performance observed when using OpenCL.

To summarize, the assertion that Imagemagick with OpenCL is significantly slower than OpenMP highlights the need for careful consideration of the workload characteristics and hardware configuration. While OpenCL can provide substantial performance gains for certain image processing tasks, it may not always surpass the efficiency of OpenMP, especially when confronted with workloads that have limited parallelism or encounter overhead due to data transfers or suboptimal GPU utilization. Therefore, choosing the most suitable parallel computing framework in Imagemagick depends on a thorough analysis of the specific requirements and constraints of the image processing tasks at hand, as well as the available hardware resources.

It is possible to include an option for compiling ImageMagick with OpenCL, but this won't be part of the default compilation process.

jackyhallyday commented 1 year ago

Thanks for the explanation. Apparently, ImageMagick does some benchmark to evaluate which hardware is the best to use : https://imagemagick.org/script/opencl.php Not sure it's able to stick to the CPU if the GPU is less efficient, though.

SoftCreatR commented 1 year ago

@jackyhallyday https://github.com/SoftCreatR/imei#opencl-support