8 Replies Latest reply on Feb 15, 2011 4:14 AM by genaganna

    Cannot run a simple program

    nooploop

      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; }