Opencl clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL, &num_devices) 返回 -1
我正在使用英特尔 OpenCL SDK。上个月,当我尝试通过 clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL, &num_devices) 在系统中的 CPU 上运行 opencl 代码时,它起作用了..并且 CL_DEVICE_TYPE_CPU, 0, NULL, &num_devices >检测到的总平台为 2。一个是 Intel GPU,另一个是 Intel CPU。只需更改宏,我就能够在 Intel GPU 和 CPU 上运行代码CL_DEVICE_TYPE_CPU。 但现在,当我尝试检测同一系统上的平台和设备时,它没有检测到 CPU。它显示可用平台为 1,即 Intel GPU。 因此,当调用 clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL,&num_devices); 时,它返回 -1 (CL_DEVICE_NOT_FOUND) 并且程序正在退出。
任何人都可以帮助我解决这个问题,为什么在同一系统上,当我们有可用的 Intel CPU 时,CPU 没有被检测到。 但是使用宏 CL_DEVICE_TYPE_GPU 可以正确检测到 GPU。 谢谢。
I'm using Intel OpenCL SDK. Last month, when I tried to run my opencl code on CPU present in my system , by clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL, &num_devices), it worked..and number of total platforms its detected is 2.One is Intel GPU and another is Intel CPU.I was able to run the code both on Intel GPU and CPU just by changing the macro CL_DEVICE_TYPE_CPU.
But now when I try to detect the platform and devices on the same system, its not detecting CPU. Its showing available platforms as 1 that is Intel GPU.
So, when clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL,&num_devices); is called it returns -1 (CL_DEVICE_NOT_FOUND) and program is exiting.
Can anyone please help me on resolving the issue , why on the same system CPU is not getting detected, when we have Intel CPU available on it.
But GPU is getting detected correctly with macro CL_DEVICE_TYPE_GPU.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GPU 的英特尔 OpenCL 运行时是英特尔 GPU 驱动程序的一部分。因此,安装 Intel GPU 驱动程序就足够了,您将能够获得适用于 Intel GPU 的 OpenCL 设备。但 CPU 的 Intel OpenCL 运行时应单独安装: 适用于英特尔处理器的 OpenCL 运行时。如果安装了适用于 CPU 的 Intel OpenCL 运行时但 OpenCL CPU 设备不可用,则有必要检查 ICD 是否了解已安装的运行时并可以找到它。请参阅2.5-2.7 在 关于 ICD 加载程序如何查找运行时库的 OpenCL 扩展规范。
Intel OpenCL runtime for GPU is a part of Intel GPU driver. So, it is enough to install the GPU driver from Intel and you will be able to get OpenCL device for Intel GPU. But Intel OpenCL runtime for CPU should be installed separately: OpenCL Runtimes for Intel Processors. If Intel OpenCL runtime for CPU is installed but OpenCL CPU device is not available, it is necessary to check that ICD knows about the installed runtime and can find it. Please see sections 2.5-2.7 in The OpenCL Extension Specification on how the ICD loader looks for the runtime libraries.