GraphicsMagick 的 OpenCL 开发记录(三)

作者描述了在VSCode环境中遇到的clCreateBuffer调用异常问题,怀疑可能是由IntelComputeRuntime升级到IntelOpenCLRuntime引起的。文章详细记录了堆栈跟踪、代码调试过程以及环境配置。

<2022-03-07 Mon>

调用clCreateBuffer()产生异常问题(一)

vscode上的堆栈输出如下:

libc.so.6!__pthread_kill_implementation (Unknown Source:0)
libc.so.6!raise (Unknown Source:0)
libc.so.6!abort (Unknown Source:0)
libigdrcl.so![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libOpenCL.so!clCreateBuffer (Unknown Source:0)
AcquireMagickCLCacheInfo(MagickCLDevice device, Quantum * pixels, const magick_int64_t length) (gm-ocl/magick/opencl.c:569)
GetAuthenticOpenCLBuffer(const Image * image, MagickCLDevice device, ExceptionInfo * exception) (gm-ocl/magick/pixel_cache.c:5252)

因为堆栈显示问题最终是出在__pthread_kill_implementation上,所以我的调查方向一直在线程同步上,代码调试了一遍又一遍却始终没有找到问题。心灰意冷并已经产生从头再开始的想法了。

注意到:

libigdrcl.so![Unknown/Just-In-Time compiled code] (Unknown Source:0)

谷歌了下libigdrcl.so,难道是安装intel驱动的问题?目前使用的是intel-compute-runtime,现改为intel-opencl-runtime,参考自:“GPGPU - ArchWiki”。

$ sudo pacman -Rns intel-compute-runtime
$ yay -S intel-opencl-runtime

我对比了intel-compute-runtimeintel-opencl-runtimeclinfo输出差异发现intel-compute-runtime支持GPUintel-opencl-runtime支持CPU

那代码到底有没有问题?clCreateBuffer()调用失败的原因要不要深究?

vscode环境

// tasks.json
{
   
   
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值