OpenCL SDK找不到Ivy Bridge的IGP

问题描述 投票:0回答:1

我已经建立了一个IvyBridge平台来编码OpenCL程序。我的系统是win7 64位,开发工具是VS2010。我的电脑上有一台 i7-3770k 和 nVidia GTX560。当我查询系统的设备时,我找不到HD4000。我已使用此网页检查了 HD4000 的系统驱动程序:http://www.intel.com/p/en_US/support/detect/graphics。报告显示“当前安装的驱动程序为 8.15.10.2696”。 OpenCL SDK 是最新的适用于 OpenCL 应用程序 2012 Windows 64 位的英特尔 SDK,可从 http://software.intel.com/en-us/articles/vcsource-tools-opencl-sdk/ 下载。以下是我的代码和输出。

我还注意到CPU的设备名称很奇怪。顺便说一句,自从我发现有人遇到无法创建 CL 上下文的问题后,我已将 HD4000 设备连接到显示器。现在我可以发现当我们将显示器连接到HD4000后,GPU-Z工具可以检测到HD4000。那么任何人都可以帮我解决这个问题吗?

#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <CL/cl.h>

int _tmain(int argc, _TCHAR* argv[])
{
    cl_platform_id *platforms;
    cl_uint num_platforms;
    cl_device_id *devices_cpu, *devices_gpu;
    cl_uint num_devices;

    char dev_name[40], dev_vendor[40], dev_version[40], dev_profile[40];
    char plt_name[40], plt_vendor[40], plt_version[40], plt_profile[40];

    clGetPlatformIDs(1, NULL, &num_platforms);
    platforms = (cl_platform_id*) malloc(sizeof(cl_platform_id) * num_platforms);
    clGetPlatformIDs(num_platforms, platforms, NULL);
    for(int i = num_platforms - 1; i >= 0; i--)
    {
        clGetPlatformInfo(platforms[i], CL_PLATFORM_NAME, sizeof(plt_name),&plt_name,NULL);
        clGetPlatformInfo(platforms[i], CL_PLATFORM_VENDOR, sizeof(plt_vendor),&plt_vendor,NULL);
        clGetPlatformInfo(platforms[i], CL_PLATFORM_VERSION, sizeof(plt_version),&plt_version,NULL);
        clGetPlatformInfo(platforms[i], CL_PLATFORM_PROFILE, sizeof(plt_profile),&plt_profile,NULL);
        printf("\n\n\nPlatform #%d Info: \n\n", i);
        printf("Platform: %s \n", plt_name);
        printf("Vendor: %s \n", plt_vendor);
        printf("Version: %s \n", plt_version);
        printf("Profile: %s \n", plt_profile);

        clGetDeviceIDs(platforms[i],CL_DEVICE_TYPE_CPU, 1, NULL, &num_devices);
        devices_cpu = (cl_device_id *)malloc(sizeof(cl_device_id) * num_devices);
        clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_CPU, num_devices, devices_cpu, NULL);
       for(int j = 0 ; j < num_devices; j++)
       {
           clGetDeviceInfo(devices_cpu[j], CL_DEVICE_NAME, sizeof(dev_name), &dev_name, NULL);
           clGetDeviceInfo(devices_cpu[j], CL_DEVICE_VENDOR, sizeof(dev_vendor), &dev_vendor, NULL);
           clGetDeviceInfo(devices_cpu[j], CL_DEVICE_VERSION, sizeof(dev_version), &dev_version, NULL);
           clGetDeviceInfo(devices_cpu[j], CL_DEVICE_PROFILE, sizeof(dev_profile), &dev_profile, NULL);
           printf("\n\n\nCPU Device Info: \n\n");
           printf("Name: %s \n", dev_name);
           printf("Vendor: %s \n", dev_vendor);
           printf("Version: %s \n", dev_version);
           printf("Profile: %s \n", dev_profile);
       }
       clGetDeviceIDs(platforms[i],CL_DEVICE_TYPE_GPU, 1, NULL, &num_devices);
       devices_gpu = (cl_device_id *)malloc(sizeof(cl_device_id) * num_devices);
       clGetDeviceIDs(platforms[i],CL_DEVICE_TYPE_GPU, num_devices, devices_gpu, NULL);
       for(int j = 0; j < num_devices; j++)
       {
           clGetDeviceInfo(devices_gpu[j], CL_DEVICE_NAME, sizeof(dev_name), &dev_name, NULL);
           clGetDeviceInfo(devices_gpu[j], CL_DEVICE_VENDOR, sizeof(dev_vendor), &dev_vendor, NULL);
           clGetDeviceInfo(devices_gpu[j], CL_DEVICE_VERSION, sizeof(dev_version), &dev_version, NULL);
           clGetDeviceInfo(devices_gpu[j], CL_DEVICE_PROFILE, sizeof(dev_profile), &dev_profile, NULL);
           printf("\n\n\nGPU Device Info: \n\n");
           printf("Platform: %s \n", dev_name);
           printf("Vendor: %s \n", dev_vendor);
           printf("Version: %s \n", dev_version);
           printf("Profile: %s \n", dev_profile);
       }
       free((void*)devices_cpu);
       free((void*)devices_gpu);
    }
    return 0;
}

输出:

平台#1信息:
平台:英特尔(R) OpenCL
供应商: 英特尔(R) 公司
版本:OpenCL 1.1
个人资料:FULL_PROFILE
CPU设备信息:
姓名: ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ ÌÌÌÌÌ英特尔(R) 公司
供应商: 英特尔(R) 公司
版本:OpenCL 1.1(内部版本 31360.31441)
个人资料:FULL_PROFILE
平台 #0 信息:
平台:NVIDIA CUDA
供应商: NVIDIA 公司
版本:OpenCL 1.1 CUDA 4.2.1
个人资料:FULL_PROFILE
GPU设备信息:
平台:GeForce GTX 560 Ti
供应商: NVIDIA 公司
版本:OpenCL 1.1 CUDA
个人资料:FULL_PROFILE
opencl gpu intel
1个回答
2
投票

首先说明我不是律师,但我反对培训人工智能或统计 未经我手写的个人同意,模仿我的书面文字。 删除此反对意见将损害我贡献的文本 并应附有详细的法律解释,以解决 这个特定的文本以及为什么它的污损是合法的。

如果卡上没有连接显示器,则 OpenCL 无法在 HD4000 上运行。 这是我自己在英特尔论坛上的测试和回答。

请参阅英特尔论坛上的这些主题:1 2 3

© www.soinside.com 2019 - 2024. All rights reserved.