Question

I'm completely new to OpenCL programming and I decided to run some examples from downloaded AMD SDK. My first choice was Reduction sample. Every time I execute program on CPU, I get execution time about 10 times lower than on GPU. Shound't GPU be better than CPU for that calculations?

My hardware:

  • CPU i5-2430M 2.40 Ghz
  • GPU AMD Radeon 6630M

Execution on Platform 0 (GPU):

$ Reduction.exe -x 33554432 -i 5 -q -t -p 0
Platform 0 : Advanced Micro Devices, Inc.
Platform 1 : Intel(R) Corporation

Selected Platform Vendor : Advanced Micro Devices, Inc.
Device 0 :        Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz Device ID is 009E83A0

Executing kernel for 5 iterations
-------------------------------------------
Exec: 1.64225

| Elements | Time(sec) | (DataTransfer + Kernel)Time(sec) |
|----------|-----------|----------------------------------|
| 33554432 | 1.83705   | 1.64225                          |

Execution on Platform 1 (CPU):

$ Reduction.exe -x 33554432 -i 5 -q -t -p 1
Platform 0 : Advanced Micro Devices, Inc.
Platform 1 : Intel(R) Corporation
GPU not found. Falling back to CPU device

Selected Platform Vendor : Intel(R) Corporation
Device 0 :        Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz Device ID is 040BEF1C

Executing kernel for 5 iterations
-------------------------------------------
Exec: 0.198049

| Elements | Time(sec) | (DataTransfer + Kernel)Time(sec) |
|----------|-----------|----------------------------------|
| 33554432 | 0.542269  | 0.198049                         |
Was it helpful?

Solution 2

According to this spec page (gpuzoo.com), the 6630M device should support OpenCL 1.2. Double check your driver version and make sure it is supported. Try an older driver for it too if you are still having trouble. driverscollection.com

Try to run the CLInfo program on your system to see if it all works. That should give you the full details of all devices you support.

OTHER TIPS

Judging from your output, they both seem to be running on your CPU.

The first one is using the AMD platform and the second is using the Intel but your CPU shows up as device 0 on both platforms. Try using the flag -d 1 (to use device 1) or --device gpu.

edit: Looking at the system requirements page, on the AMD website, or the OpenCL conformant products list, it doesn't look like your GPU is supported.

It seems the AMD SDK is choosing Intel as its computing device. No wonder why, as it may be based on Priority of the devices.

How to fix it,

1) Retrieve deviceid's for all GPU/CPU which has OpenCL support for particular platform (In your case ONE AMD GPU + ONE INTEL CPU).
1) After getting all device id's use device info to extract required device (You can use CL_DEVICE_VENDOR flag to extract the required deviceid)
3) and then use this deviceid in all further device id reference.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top