Convert and OpenCL

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
EvilDev
Posts: 1
Joined: 2011-12-12T01:54:23-07:00
Authentication code: 8675308

Convert and OpenCL

Post by EvilDev »

Hi!
I have task. Need install imagemagick on server and resize images on GPU.
First time = 12s rotate and resize image, before compile with opencl.
I install cuda, cuda drivers from nvidia and compiled imagick:

Code: Select all

export LD_LIBRARY_PATH=/usr/local/cuda/lib64
export C_INCLUDE_PATH=/usr/local/cuda/include
./configure \
--prefix=/usr \
--enable-shared \
--enable-openmp \
--enable-opencl \
--without-dps \
--without-djvu \
--without-fftw \
--without-fpx \
--without-gslib \
--without-gvc \
--without-jbig \
--without-lcms \
--without-lcms2 \
--without-lzma \
--without-openexr \
--without-pango \
--without-rsvg \
--without-tiff \
--without-webp \
--without-wmf  \
--without-xml | grep -e cl.h -e OpenCL

Code: Select all

checking CL/cl.h usability... yes
checking CL/cl.h presence... yes
checking for CL/cl.h... yes
checking OpenCL/cl.h usability... no
checking OpenCL/cl.h presence... no
checking for OpenCL/cl.h... no
checking for OpenCL library... -lOpenCL
Next do make and make install.
After try rotate and resize image. Wihtout OpenCL time = 12sec and with opencl time = 12s. OpenCL not work! :(
Please. Help me solve this problem!

Code: Select all

time convert -rotate 45 -resize 800x600 -quality 80 ~/2.jpg ~/1.jpg
Thank you!

P.S. SORRY MY ENGLISH :-[
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert and OpenCL

Post by magick »

Only convolution is OpenCL-enabled currently, see http://www.imagemagick.org/script/archi ... istributed. We have a contributor that has OpenCL-enabled about 15 additional image processing algorithms but we do not have an ETA yet on when it will be available in the released version of ImageMagick.
Phantom7
Posts: 5
Joined: 2014-02-10T15:31:48-07:00
Authentication code: 6789

Re: Convert and OpenCL

Post by Phantom7 »

You tried thisone:

Code: Select all

time convert -rotate 45 -resize 800x600 -quality 80 ~/2.jpg ~/1.jpg
Try this:

Code: Select all

time convert -resize 800x600 -rotate 45 -quality 80 ~/2.jpg ~/1.jpg
Same effect:

Code: Select all

time convert -rotate 45 -scale 800x600 -quality 80 ~/2.jpg ~/1.jpg
Should faster:

Code: Select all

time convert -scale 800x600 -rotate 45 -quality 80 ~/2.jpg ~/1.jpg
Maybe, if you read these lines, you will see, that i changed the positions of action. Sure, if you think about, there is many power, that you give to hell. I´ll understand, that you try to compensate lame parts. But please, take care and respect, that the cuda-technology is not present in any devices. When you like to use OpenCL, you should understood the ways of this technology first. Nice to read about your phantasies around the compiling orgy. Without a great work, the jobs never will run faster.

In analoge way there is the reason the following:

Your line rotates a full and great image first, then resizes to final.
My line will first do rescale, then rotates (a smaller image).

What you think, that will be the fastest one? ;)

Sometimes a combination decides around the fun-factor.

On my server i have an i7 CPU and a Radeon Cedar GPU. OS is Linux, stupids like php or mysql not installed. For what against?! ;)
On my homeserver i have an Phenom II X4 CPU and 4 GTX-295 GPU´s in 2 Cards on SLi. OS will differ, sometimes Windows.

So you see, that the hardware differs extremly. A replicatable setup will not make more happy.

Now you can stay bored or think about alternatives. On booth (Linux & Windows) a chance is in Perl-Language. If there are ressources, you can detect and assimilate. The central process is a perl instance, which out you can call the console. So in the consoles will only run that required and after work, returns also the memorials (ressources). I do use this, to delegate specific parts of a great job. Not everyone is the pure use von Magick the fastest way. Inner Magick thats okay, but for the ill things i do, often too lame. Through PerlMagick you have an gimmick, that your work will make much more easy. Accessing Layers, work in Arrays and also the CUDA-Port. But the price will be, that you begin to lern programming...

http://blogs.perl.org/users/david_merte ... eased.html

The main part of Magick are the ways of manipulation algorithms. For the project the streaming-processor technology will be a chance. But first there must be created standards. Without - landing here, to get orientation...

If i only have 1 pic to convert, the minds are not required. But if i have thousands of pics to convert, i´ll think about every detail for a liquid workflow. :D
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert and OpenCL

Post by fmw42 »

see changelog at http://www.imagemagick.org/script/changelog.php


2013-10-26 6.8.7-4 Siu Chi Chan <...@amd.com>
Major improvements to the OpenCL infrastructure.
New OpenCL accelerated algorithms (function image, blur, radial blur, unsharp mask, resize, contrast, equalize, despeckle).
Added a new checkbox to enable OpenCL in the configure program.
Post Reply