Imagemagick只使用一个核心

Hor*_*ren 8 imagemagick openmp

我正在运行一个8核的Ubuntu服务器.但是imagemagick总是只使用1个单核.
运行identify -version回报:

Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
Run Code Online (Sandbox Code Playgroud)

因此OpenMP,启用了多线程显然需要的功能.

使用此处描述的-bench选项(例如convert logo: -resize 500% -bench 10 logo.png)运行基准返回

Performance: 10i 1.17647ips 14.390u 0.14166666666833332977:08.500
Run Code Online (Sandbox Code Playgroud)

它不返回Performance[1]经过Performance[8]所描述的说明书中,这使得我不知道.

任何想法如何让imagemagick使用所有8核?

更新:这是来自imagemagick调用的strace输出:http://pastebin.com/Q0gC3k09

emc*_*lle 12

我能够在Ubuntu 10.04上重现这种行为.来自apt-get的ImageMagick似乎具有 OpenMP功能,并配置了-fopenmp标志,但似乎没有启用该功能.这可以通过运行以下行并将" FEATURES "列表(如果存在)与各种配置标志进行比较来验证.

identify -list Configure | less
Run Code Online (Sandbox Code Playgroud)

我可以按照文章" 在Ubuntu 8.04上从Source安装ImageMagick "来解决这个问题,详细介绍了以下过程.

  • 删除ImageMagick
  • 通过apt-get安装所有需要的图像/图形依赖库
  • 下载
    • wget http://www.imagemagick.org/download/ImageMagick-6.8.6-6.tar.gz
  • 按照基本的./configure,make,和sudo make install步骤
  • 将库路径导出到 /usr/local/lib

这似乎有效,因为OpenMP现在出现在" FEATURES "列表下,当我执行时convert logo: -resize 500% -bench 10 logo.png.我看到以下内容

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
Run Code Online (Sandbox Code Playgroud)

这些结果符合我的预期.