GraphicsMagick 的 OpenCL 开发记录(二)

文章讲述了在ArchLinux上使用IntelGPU时,启用OpenCL遇到的链接问题,以及在调试RunOpenCLBenchmark时的崩溃情况,怀疑是由于同步问题导致的。开发者尝试了清理缓存并检查了资源释放的代码段。
摘要由CSDN通过智能技术生成

<2022-02-25 Fri>

关于AccelerateResizeImage()的链接问题

因为增加了两个新文件accelerate-private.haccelerate.cAccelerateResizeImage()就位于其中,因为magick/Makefile.am中没有增加这两个文件,所以在autoreconf时生成的Makefile.in就不知道新增了两个文件,因此在configure时生成的Makefile中就不会编译AccelerateResizeImage()函数,因此出现的链接问题。

$ rm configure
$ autoreconf
configure.ac:119: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:119: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

<2022-03-02 Wed>

archlinux上为Intel启用OpenCL

% lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G1 (Ice Lake) (rev 07)
% clinfo
Number of platforms                               0
% sudo pacman -S intel-compute-runtime

调试RunOpenCLBenchmark()时的崩溃问题

发现直接运行gm display没有崩溃问题,调试时却经常发生,有时SIGABRT,有时SIGSEGV,猜测可能是同步问题:

/*
  We need this to get a proper performance benchmark, the operations
  are executed asynchronous.
*/
if (is_cpu == MagickFalse)
  {
    CacheInfo
      *cache_info;

    MagickCLCacheInfo
      cl_info;

    cache_info=(CacheInfo *) resizedImage->cache;
    cl_info=GetCacheInfoOpenCL(cache_info);
    if (cl_info != (MagickCLCacheInfo) NULL)
      openCL_library->clWaitForEvents(cl_info->event_count,
        cl_info->events);
  }

if (i > 0)
  StopAccelerateTimer(&timer);

if (bluredImage != (Image *) NULL)
  DestroyImage(bluredImage);
if (unsharpedImage != (Image *) NULL)
  DestroyImage(unsharpedImage);
if (resizedImage != (Image *) NULL)
  DestroyImage(resizedImage);

经常遇到的是:resizedImage0SIGSEGV),DestroyImage(resizedImage);SIGABRT)。

commitreplace MagickCoreSignature with MagickSignature

  • 6
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值