Imagemagick only uses one core

前端 未结 2 1494
灰色年华
灰色年华 2020-12-31 18:59

I am running an Ubuntu server with 8 cores. However imagemagick always only uses 1 single core.
Running identify -version returns:

Version         


        
2条回答
  •  旧时难觅i
    2020-12-31 19:52

    I was able to reproduce this behavior on Ubuntu 10.04. ImageMagick from apt-get seems to have the OpenMP feature, and configure with the -fopenmp flag, but the feature doesn't seem to be enabled. This can be verified by running the following line, and comparing the "FEATURES" list (if present) to the various configuration flags.

    identify -list Configure | less
    

    I was able to resolve this by following the article "Installing ImageMagick from Source on Ubuntu 8.04" which detailed the following process.

    • Remove ImageMagick
    • Install all the needed image/graphic dependency libraries through apt-get
    • Download
      • wget http://www.imagemagick.org/download/ImageMagick-6.8.6-6.tar.gz
    • Follow basic ./configure, make, & sudo make install steps
    • Export library path to /usr/local/lib

    This seems to work as OpenMP is now present under "FEATURES" list, and when I execute convert logo: -resize 500% -bench 10 logo.png. I see the following

    Performance[1]: 10i 0.750ips 1.000e 18.750u 0:13.330
    Performance[2]: 10i 0.751ips 0.500e 18.660u 0:13.320
    Performance[3]: 10i 0.738ips 0.496e 18.840u 0:13.550
    Performance[4]: 10i 0.469ips 0.385e 19.560u 0:21.320
    

    And these results match what I would expect.

提交回复
热议问题