cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

Highlighted
Journeyman III
Journeyman III

Cannot run a simple program

Hi,

i cant get a simple program running on my gpu (HD4670). (Code should be attached.) It runs on the cpu. On the gpu i get an exception from clWaitForEvents with error code -14. I installed the newest driver, here is fglrxinfo output:

OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Radeon HD 4600 Series
OpenGL version string: 3.3.10362 Compatibility Profile Context

I tried it with different sdk's. It runs on 2.1 and 2.2 (both cpu and gpu). On 2.3 it runs only on cpu.

 

 

#define __CL_ENABLE_EXCEPTIONS #include <CL/cl.hpp> #include <iostream> #include <vector> #include <string> std::string kernel = "__kernel void test() { }"; int main(int argc, char* argv[]) { std::vector<cl:Smiley Tonguelatform> platforms; cl:Smiley Tonguelatform::get(&platforms); cl_context_properties cps[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[0](), 0 }; cl::Context context(CL_DEVICE_TYPE_GPU, cps); std::vector<cl:Smiley Very Happyevice> devices = context.getInfo<CL_CONTEXT_DEVICES>(); cl:Smiley Tonguerogram:Smiley Frustratedources source(1, std::make_pair(kernel.c_str(), kernel.length())); cl:Smiley Tonguerogram program(context, source); program.build(devices); cl::Kernel kernel(program, "test"); cl::CommandQueue queue(context, devices[0]); cl::KernelFunctor func = kernel.bind(queue, cl::NDRange(32), cl::NDRange(1)); try { func().wait(); } catch (const cl::Error& err) { std::cerr << err.what() << ' ' << err.err() << std::endl; } return 0; }

Tags (1)
0 Kudos
Reply
8 Replies
Highlighted
Adept II
Adept II

Cannot run a simple program

The Radeon 4XXXs have very limited OpenCL support ( for instance, they can manage one one buffer, no image support, etc... )

If you paste your kernel in SKA and you see N/A for the Radeon 4XXXs then you might have problems.

 

What's your kernel source, pls? Are you using images or more than one global buffer???

0 Kudos
Reply
Highlighted
Journeyman III
Journeyman III

Cannot run a simple program

Well the kernel is in the source, it's the most simple kernel

std::string kernel = "__kernel void test() { }";

0 Kudos
Reply
Highlighted
Adept II
Adept II

Cannot run a simple program

Try adding a single __global float* foo parameter and set it to NULL when launching the kernel. I've seen problems in the past when running kernels that have no arguments, but I can't remember if that was Brook+ or whathaveyou.

0 Kudos
Reply
Highlighted
Journeyman III
Journeyman III

Cannot run a simple program

I tried it on windows with 2.3 sdk and get the same error. Adding a dummy parameter solves the problem, but it's not really a solution. I have other kernels which are more complicated and they have parameters and everything and i get the same error.

 

0 Kudos
Reply
Highlighted
Journeyman III
Journeyman III

Cannot run a simple program

I think that you might be right that version 2.3 breaks compatibility with 4XXXs somehow. I also encounter some problems with that version (and not with older versions) - not related to yours but I can post which, if interested. But I cannot surely say if there isn't any error on my side. Anyway, I think that there can be some compatibility issue.
0 Kudos
Reply
Highlighted
Journeyman III
Journeyman III

Cannot run a simple program

I got my hands on a HD5670 and the code works fine with it. So it must be some compatibility issue, like pulec noted. I hope someone will look into this.

0 Kudos
Reply
Highlighted
Grandmaster
Grandmaster

Cannot run a simple program

nooploop,

This has been fixed. Thanks for reporting.

0 Kudos
Reply
Highlighted
Journeyman III
Journeyman III

Cannot run a simple program

Originally posted by: nooploop I tried it on windows with 2.3 sdk and get the same error. Adding a dummy parameter solves the problem, but it's not really a solution. I have other kernels which are more complicated and they have parameters and everything and i get the same error.

 

 



Could you please give the test case for this issue?

0 Kudos
Reply