OpenCL找到平台,但无法打开它

时间:2017-07-14 20:36:53

标签: c++ visual-studio parallel-processing opencl

我目前正在使用联想Yoga 510,它使用AMD Radon R5显卡。 OpenCL可以使用它,但是,当我运行我的代码来查询并获取平台详细信息时,会返回可用平台的总数,但是如果给出错误,则无法打开此平台。请参阅下面的错误消息。

错误:无法打开平台密钥SOFTWARE \ Intel \ OpenCL \ Boards以在运行时加载板库。 在编译主机代码时链接到电路板库,或者参考电路板供应商关于如何安装电路板库的文档,以便在运行时加载它。

无法关闭平台键(null),忽略 警告:找不到任何英特尔(R)FPGA板库。 不会加载英特尔(R)FPGA器件。 请联系您的电路板供应商或参见"将您的主机应用程序链接到Khronos ICD装载程序库"手动设置FCD的编程指南。

2个平台发现

见下面的代码

[INCLUDE STATEMENTS] 

int main() {

    cl_int returned;
    cl_int zero = (cl_int)0;

    //SET-UP DEVICE EXECUTION ENVIRONMENT
    cl_uint no_of_platforms;
    //cl_uint no_of_entries;
    cl_platform_id* platforms;
    size_t device_info_val_size;
    char* detail;

    //1. Query and select the vendor specific platform
    returned = clGetPlatformIDs(zero, NULL, &no_of_platforms);
    if (returned == CL_SUCCESS) {
        printf("%d PLATFORM(s) FOUND \n", no_of_platforms);
    }
    else {
        printf("No Platform Found\n");
        return EXIT_FAILURE; //Terminante programme
    }

    platforms = (cl_platform_id*)malloc(sizeof(cl_platform_id) * no_of_platforms); //create enough space to put platofrm IDs into
    clGetPlatformIDs(no_of_platforms, platforms, NULL); //Fill in platform with their ID


    free(platforms);
    return 0;
}

任何想法我可能在做什么错误或设置错误?我想知道为什么它在我的Radon显卡上寻找英特尔FPGA

1 个答案:

答案 0 :(得分:2)

根据您提供的内容,听起来好像OpenCL ICD(可安装客户端驱动程序)配置不正确。这可能是由许多因素造成的(独立):

  • 旧/过时的图形驱动程序
  • 系统更新/注册表编辑导致的损坏

最可靠的建议是更新(或作为最后的手段,重新安装)您的图形驱动程序。除非您的GPU / iGPU太旧而无法使用OpenCL驱动程序,否则应该正确设置所有内容。

由于您使用的是MSVC,我还建议您下载英特尔提供的OpenCL SDK(如果这是AMD CPU,则为AMD),这样做不仅可以确保您拥有最高性能与OpenCL相关的日期标题和实用程序,它还为OpenCL安装了一个CPU ICD,为您提供了一个额外的测试平台。

相关问题