OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

IGP of Ivy bridge can't be found by OpenCL SDK

chunhong_zhang08
Beginner
224 Views
Hi,
Now I have set up a IvyBridge platform for coding OpenCL program. My system is win7 64-bit, VS2010 as developement tools. There is one i7-3770k with a nVidia GTX560 on my PC. When I queried the devices of my system, I cann't find HD4000. I have checked my system driver for HD4000 by using thiswebpage: http://www.intel.com/p/en_US/support/detect/graphics. The report said "Current Driver Installed 8.15.10.2696". The following is my code and the output.

I also noticed that the device name of CPU is very strange. By the way, I have connected the HD4000 device toa monitor since I found someone met the issue thatfailed tocreate a CL context. Andnow I canfind HD4000 can be detectedbyGPU-Ztool after we connected a monitor to HD4000. So anyone can help mesolve this problem?

Thanks in advanced.


#include "stdafx.h"

#include

#include

#include

#include

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, CL_PLATFORM_NAME, sizeof(plt_name),&plt_name,NULL);

clGetPlatformInfo(platforms, CL_PLATFORM_VENDOR, sizeof(plt_vendor),&plt_vendor,NULL);

clGetPlatformInfo(platforms, CL_PLATFORM_VERSION, sizeof(plt_version),&plt_version,NULL);

clGetPlatformInfo(platforms, 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,CL_DEVICE_TYPE_CPU, 1, NULL, &num_devices);

devices_cpu = (cl_device_id *)malloc(sizeof(cl_device_id) * num_devices);

clGetDeviceIDs(platforms, CL_DEVICE_TYPE_CPU, num_devices, devices_cpu, NULL);

for(int j = 0 ; j < num_devices; j++)

{

clGetDeviceInfo(devices_cpu, CL_DEVICE_NAME, sizeof(dev_name), &dev_name, NULL);

clGetDeviceInfo(devices_cpu, CL_DEVICE_VENDOR, sizeof(dev_vendor), &dev_vendor, NULL);

clGetDeviceInfo(devices_cpu, CL_DEVICE_VERSION, sizeof(dev_version), &dev_version, NULL);

clGetDeviceInfo(devices_cpu, 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,CL_DEVICE_TYPE_GPU, 1, NULL, &num_devices);

devices_gpu = (cl_device_id *)malloc(sizeof(cl_device_id) * num_devices);

clGetDeviceIDs(platforms,CL_DEVICE_TYPE_GPU, num_devices, devices_gpu, NULL);

for(int j = 0; j < num_devices; j++)

{

clGetDeviceInfo(devices_gpu, CL_DEVICE_NAME, sizeof(dev_name), &dev_name, NULL);

clGetDeviceInfo(devices_gpu, CL_DEVICE_VENDOR, sizeof(dev_vendor), &dev_vendor, NULL);

clGetDeviceInfo(devices_gpu, CL_DEVICE_VERSION, sizeof(dev_version), &dev_version, NULL);

clGetDeviceInfo(devices_gpu, 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;

}

output:

Platform #1 Info:

Platform: Intel OpenCL

Vendor: Intel Corporation

Version: OpenCL 1.1

Profile: FULL_PROFILE

CPU Device Info:

Name: Intel Corporation

Vendor: Intel Corporation

Version: OpenCL 1.1 (Build 31360.31441)

Profile: FULL_PROFILE

Platform #0 Info:

Platform: NVIDIA CUDA

Vendor: NVIDIA Corporation

Version: OpenCL 1.1 CUDA 4.2.1

Profile: FULL_PROFILE

GPU Device Info:

Platform: GeForce GTX 560 Ti

Vendor: NVIDIA Corporation

Version: OpenCL 1.1 CUDA

Profile: FULL_PROFILE

0 Kudos
6 Replies
Raghupathi_M_Intel
224 Views
Thanks for providing the code. I will investigate and get back to you. As you already noted you need to connect the monitor to HD 4000 to see the device. I will find out if its supposed to be that way.

Thanks,
Raghu
Raghupathi_M_Intel
224 Views
I took a quick look and your char array is not large enough to hold information you get from clGetPlatformInfo() call. The param_value_size argument of this call should specify the size in bytes greater than or equal to return type expected. In this case the CL_DEVICE_NAME string doesnt fit in 40 bytes. Try increasing it to, say 128 (char dev_name[128]).

Thanks,
Raghu
chunhong_zhang08
Beginner
224 Views
Thank you for your quick helps.

Yes, I revised the code to increase the length of the char arraydev_name. It works well. But I still cann't find the HD4000. Do I need to uninstall the discrete GPU?

Thanks again.
chunhong_zhang08
Beginner
224 Views
I tried to unplug the discrete nVidia GPU. And then my code can find the Intel HD4000. Does this mean that HD4000 cann't work with the discrete GPU? Is that right?

Actually, I want to use HD4000 to accelerate the application by using OpenCL since it can share the memory with CPU to elimate the data transfer through the PCIE buy. But I still need a discrete GPU to render a very complicated GUI. Is that possible to make itby using IvyBridge + OpenCL?

Thank you.
ARNON_P_Intel
Employee
224 Views
This is known issue.
OpenCL on HD Graphics is working only when the device is connected to the display. It still can work with discrete GPU and with OpenCL on the CPU as long as it is the main display.
Regards,
Arnon
Mikhail_Smirnov
Beginner
224 Views
So, it is no chance to activate IGP without display connected to it's output? And the display should be the main display of the system?
Reply