cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

nooploop
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::Platform> platforms; cl::Platform::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::Device> devices = context.getInfo<CL_CONTEXT_DEVICES>(); cl::Program::Sources source(1, std::make_pair(kernel.c_str(), kernel.length())); cl::Program 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; }

0 Likes
8 Replies
bubu
Adept II

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 Likes

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

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

0 Likes

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 Likes

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 Likes

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 Likes

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 Likes

nooploop,

This has been fixed. Thanks for reporting.

0 Likes

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 Likes