clCreateContext成功,但clCreateCommandQueue失败,返回-33

clCreateContext succeeds, but clCreateCommandQueue fails with -33

本文关键字:返回 失败 成功 clCreateContext clCreateCommandQueue      更新时间:2023-10-16

我在一台装有集成Intel卡的机器上遇到了一个有趣的问题。

clCreateContext()使用要在其上创建上下文的设备返回有效上下文。返回的错误为CL_SUCCESS。但是,将上下文传递给clCreateCommandQueueWithProperties()会导致错误代码-33或CL_INVALID_DEVICE。我做了两次检查,确保我正确检查了错误。为什么我可以在设备上创建上下文,而不能创建命令队列?

尝试执行clCreateCommandQueue()(OpenCL 1.0)而不是clCreateCommandQueueWithProperties()(OpenCL 2.0)。

后者在英特尔(专有)和NVIDIA运行时都失败了。但不知道为什么。