john pinkerton
john pinkerton

Reputation: 13

how do i get opencl to run on my gpu

i am using this tutorial http://www.obellianne.fr/alexandre/tutorials/OpenCL/tuto_opencl_codeblocks.php my gpu is radeon hd 6970 and my amd app and drivers are up to date my os is windows 8 when i run the code in the tutorial it only recognizes my cpu

Upvotes: 1

Views: 210

Answers (2)

Johns Paul
Johns Paul

Reputation: 673

Are you sure the GPU driver in your system is installed properly? I had this issue in ubuntu where the driver was installed but due to some issues the system wasnt able to detect the GPU. Can you try looking at the output of "clinfo" to make sure that the system is able to detect your GPU as an opencl device

Upvotes: 0

Xirema
Xirema

Reputation: 20386

Looking through the source code of that project, I see the following lines:

cl_int result = clGetPlatformIDs(num_entries, platforms, &available);

err = clGetDeviceIDs(platforms[0], CL_DEVICE_TYPE_ALL, maxDevices, deviceIDs, &numDevices);

The code is only querying one platform in your system for devices. I don't know which platform it is, but GPU devices are usually in a different platform than CPU devices, and platforms will also vary depending on which manufacturer is responsible (Intel, AMD, NVidia, etc.).

You'll need to modify this code to query devices for each platform id returned, not just the first platform.

Upvotes: 1

Related Questions