Reputation: 1697
I am using Magick.NET to despeckle an image. It take ~1-2 second for a relatively small image (1000*1500 pixels). I read that ImageMagick uses OpenCL to speed up some operations and despeckle is one of them. So, I wonder why it is so slow with a quite recent graphic card (GTX 960).
Is there a Magick.NET setting to enable OpenCL?
Upvotes: 1
Views: 1699
Reputation: 8143
You can enable or disable OpenCL by setting OpenCL.IsEnabled
. The first time you use an OpenCL operation a benchmark will run to determine if it is better to use the GPU or the CPU. The benchmark is written inside the following file: %LOCALAPPDATA%\ImageMagick\ImagemagickOpenCLDeviceProfile.xml
. An example of this benchmark is:
<devices>
<device name="CPU" score="4.914"/>
<device platform="AMD Accelerated Parallel Processing" score="0.165" vendor="Advanced Micro Devices, Inc." name="Ellesmere" version="2117.14 (VM)" maxClockFrequency="1266" maxComputeUnits="36" />
<device platform="AMD Accelerated Parallel Processing" score="1.326" vendor="Advanced Micro Devices, Inc." name="Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz" version="2117.14 (sse2,avx)" maxClockFrequency="3998" maxComputeUnits="8" />
</devices>
The device with the lowest score wins and will be used when it is possible to use OpenCL inside an algorithm.
It is possible that the benchmark already ran on your machine and decided that the CPU is faster. This means that even though OpenCL is enabled the CPU will be used.
Upvotes: 6