cl_platform_id* platforms = (cl_platform_id *)malloc(numPlatforms*sizeof(cl_platform_id));
numPlatforms=1;
status = clGetPlatformIDs(numPlatforms, platforms, NULL);
if(status != CL_SUCCESS)
{
printf("Error: Getting Platform Ids. (clGetPlatformsIDs)\n");
return 1;
}
printf("platforms ID::%d\n",platforms[0]);
I am getting weired value:numofp
platforms ID: :-1210489720
What type of ID values are expected here.I am getting -ve number.
I working on AMD CPU , Radeon HD4350 GPU ,Ubuntu 9.04 32 bit ,SDK v2.01.
You are trying to print pointer address as int. You have to use %p to print pointer address.
Thanks Omkar,
I got platforms ID: 0xb7d1b488 ..is it right? bythe way where is %p defined..I didn't see it in C-lang.Why is this ID values gets changed every time of execution ...is thats becaz of some random iD generator internally.
Also how abt "cl_device_type" print specifier?
Just adding one more clarifications:
cl_uint num_devices;
status=clGetDeviceIDs(platform,CL_DEVICE_TYPE_ALL,0,NULL,&num_devices);
printf(" num of devices=%d",num_devices);
I am getting num_of_devices as 1 .but my config is having AMD CPU And Radeon GPU.It should give 2 right?
Thanks in Advance.
Pavan
clGetPlatformID return pointer to platform. and pointers are runtime dependent.
and yes you should get 2 devices. try run FindNumDevices from CAL samples directory in which is in SDK. if get zero then you need reinstall catalyst driver.
Thanks nou,
I ran FindNumDevices from cal/bin/x86 and got the Device Count = 1.
what does it mean...is it saying only AMD CPU available?
then why is my OpenCL not recognizing the GPU
-ALSO Please confirm whether the above platform ID value is right in general?I assumed it should be 1,2,3...and so on.
CAL samples detect the GPU only.
Could you post the output of CLInfo Sample?
what CPU do you have? CPU must support SSE 3
I have AMD Phenom(tm) II X4 810 Processor and I guess this supports SSE.But still OpenCL is unable to detect ATI HD radeon 4350 GPU plugged in my PCI slot
Hi Omkar,Please find the output og CLinfo
root@work:/home/work/gpu/ati-stream-sdk-v2.01-lnx32/samples/opencl/bin/x86# ./CLInfo
*** CAL version mismatch:
This OpenCL build requires version 1.4.467, version 1.4.255 installed.
Aborting.
Number of platforms: 1
Plaform Profile: FULL_PROFILE
Plaform Version: OpenCL 1.0 ATI-Stream-v2.0.1
Plaform Name: ATI Stream
Plaform Vendor: Advanced Micro Devices, Inc.
Plaform Extensions: cl_khr_icd
Plaform Name: ATI Stream
Number of devices: 1
Device Type: CL_DEVICE_TYPE_CPU
Device ID: 4098
Max compute units: 4
Max work items dimensions: 3
Max work items[0]: 1024
Max work items[1]: 1024
Max work items[2]: 1024
Max work group size: 1024
Preferred vector width char: 16
Preferred vector width short: 8
Preferred vector width int: 4
Preferred vector width long: 2
Preferred vector width float: 4
Preferred vector width double: 0
Max clock frequency: 800Mhz
Address bits: 32
Max memeory allocation: 536870912
Image support: No
Max size of kernel argument: 4096
Alignment (bits) of base address: 32768
Minimum alignment (bytes) for any datatype: 128
Single precision floating point capability
Denorms: Yes
Quiet NaNs: Yes
Round to nearest even: Yes
Round to zero: No
Round to +ve and infinity: No
IEEE754-2008 fused multiply-add: No
Cache type: Read/Write
Cache line size: 64
Cache size: 65536
Global memory size: 1073741824
Constant buffer size: 65536
Max number of constant args: 8
Local memory type: Global
Local memory size: 32768
Profiling timer resolution: 1
Device endianess: Little
Available: Yes
Compiler available: Yes
Execution capabilities:
Execute OpenCL kernels: Yes
Execute native function: No
Queue properties:
Out-of-Order: No
Profiling : Yes
Platform ID: 0xb7cc9488
Name: AMD Phenom(tm) II X4 810 Processor
Vendor: AuthenticAMD
Driver version: 1.0
Profile: FULL_PROFILE
Version: OpenCL 1.0 ATI-Stream-v2.0.1
Extensions: cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store
even in OpenCl samples ,Number of devices: 1.
pavandsp,
Seems you are having old drivers. You need to install Catalyst 10.2 drivers to get SDK2.01 working.
Hi Omkar & Nou ,
Thanks for the help .
I installed Catalyst 10.2 drivers and I could see my OpenCL detecting the GPU.