Imagemagick只使用一个核心 [英] Imagemagick only uses one core

查看:176
本文介绍了Imagemagick只使用一个核心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个8核的Ubuntu服务器。但是imagemagick总是只使用1个单核。

运行识别-version 返回:

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

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

所以 OpenMP 哪个显然需要启用多线程。

So OpenMP which is apparently needed for multi threading is enabled.

使用 -bench 选项运行基准测试(例如转换徽标:-resize 500%-bench 10 logo.png )如这里返回

Running a benchmark with -bench option (e.g. convert logo: -resize 500% -bench 10 logo.png) as described here returns

Performance: 10i 1.17647ips 14.390u 0.14166666666833332977:08.500

它不会返回 Performance [1] 通过 Performance [ 8] 手册中所述这让我很奇怪。

It does not return Performance[1] through Performance[8] as described in the manual which makes me wonder.

我有什么想法可以让imagemagick使用所有8个内核?

更新:以下是imagemagick调用的strace输出: http:// pastebin.com/Q0gC3k09

Update: Here is the strace output from an imagemagick call: http://pastebin.com/Q0gC3k09

推荐答案

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

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

我可以通过以下文章在Ubuntu 8.04上从Source安装ImageMagick 详细介绍了以下过程。

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


  • 删除ImageMagick

  • 通过apt-get安装所有需要的图像/图形依赖库

  • 下载


    • wget http://www.imagemagick.org/download/ImageMagick-6.8。 6-6.tar.gz

    • 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

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

      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.

      这篇关于Imagemagick只使用一个核心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆