Results 1 to 7 of 7

Thread: Help setting up OpenCL

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    3

    Help setting up OpenCL

    Hi,

    I'm starting to develop in OpenCL, and I want to know how to setup and install OpenCL to use with Code::Blocks. I'm using the .h files that are here http://www.khronos.org/registry/cl/, but I think that I need to install something.

    Thanks for the help and sorry for my english :P

  2. #2
    Junior Member
    Join Date
    Jun 2010
    Posts
    3

    Re: Help setting up OpenCL

    New info: after I installed GPU Caps (http://www.geeks3d.com/20091218/gpu-cap ... and-demos/), it said that I have OpenCL in my system. When I tried to use one of the examples on GPU Caps, it said that it didn't found an OpenCL GPU Device, but I have a GeForce 9x.

    How can I setup OpenCL in Windows Vista to use with Code::Blocks?

  3. #3

    Re: Help setting up OpenCL

    Don't know anything about GPU Caps or Code Blocks, but you probably need NVIDIAS GPU Computing SDK. Have a look at this page: http://developer.nvidia.com/object/c...downloads.html.

  4. #4
    Junior Member
    Join Date
    Jun 2010
    Posts
    3

    Re: Help setting up OpenCL

    Thanks for the reply

    Actually, I managed to "install" OpenCL in my system. But I can't configure it to Code::Blocks.
    Can someone help me?

  5. #5
    Junior Member
    Join Date
    Jul 2010
    Posts
    6

    Re: Help setting up OpenCL

    Are you on a Windows-Like (actually Windows) or a Linux-Like plateform?

    For both you need to have CUDA installed (and perhaps CUDA SDK) (download them from here) and make sure you have the latest drivers available for your GPU.

    For a Linux like you just have to add the header and specify the library to link (you can find it in the CUDA directory...) and that's all.

    For Windows, it's not very difficult (and worked for me - 7 x64) if you are using the MingW compiler. Go into the installation directory of C::B. Then, from there, go in MingW/bin. You'll find some exe and, among them, one named reimp.exe. Use it in the cmd prompt like this :
    Code :
    reimp.exe C:\CUDA\lib\OpenCL.lib
    (According to your CUDA installation directory of course...)
    You'll get two files named "OpenCL.def" & "libopencl.a". Copy them back to C:\CUDA\lib\ (or equivalent). Finally, in C::B, you can use
    Code :
    #include <CL/cl.h>
    And link the library via the project options... (I had some trouble if I let the relative path, so you'll probably have to test this too)...

    Hope this can help...

  6. #6
    Junior Member
    Join Date
    Jul 2010
    Posts
    3

    Re: Help setting up OpenCL

    Hi,
    I have the same problem but i am using Microsoft Visual Studio C++ 2008.
    The example of the GPU computing sdk work fine, but when i try to build my own project, i have no errors but the debugger starts!
    Do u have any idea what the problem may be?
    Thank you

    The code I use is here:
    https://www.wiki.ed.ac.uk/display/ecdfw ... uick+start

  7. #7
    Member
    Join Date
    Mar 2010
    Location
    Raleigh, NC
    Posts
    55

    Re: Help setting up OpenCL

    I do C++ with OpenCL on VS 2008 also. I have not had problems running OpenCL, provided everything is set up properly. I have it working on Windows 7 x64 and Windows XP SP2 32-bit.

    How you set it up depends on where your project is located. Did you follow the nVIDIA guide and copy an existing project in the GPU Computing SDK, or did you create a new project in VS2008?

    Here's some notes from my experiences:
    1) Make sure your drivers installed come with the OpenCL driver. Most of nvidia's do; ATI currently requires you to get it through the Stream SDK.
    2) The IDK used by OpenCL looks for the OpenCL drivers in the registry. You can check to make sure this is set up correctly by going to "Run" -> "regedit". Be careful when you're in here. You can seriously screw a computer up. Look for "HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendor s". You should have some .dll files there (notably nvcuda.dll)
    3) Check your project settings within VS2008. Notably, make sure you have the correct include directories to the OpenCL header (under C/C++, General). Also, make sure you have your Additional Library Directoreis set to your OpenCL.lib containing folder (Linker,General). Also, under "Additional Dependencies (Linker, Input) that you have "OpenCL.lib" listed.

    My biggest problem was breaking away from the nVIDIA SDK samples, and figuring out the paths and making more 'independent' setups in my own locations.

    The reason the debugger starts is that your code is error free, but if it doesn't find the OpenCL driver, then there's no chance that it's going to be able to do anything with OpenCL.

Similar Threads

  1. Setting up OpenCL with DirectX 9
    By N0xus in forum OpenCL
    Replies: 0
    Last Post: 02-14-2012, 10:29 AM
  2. Opencl setting up kdevelop + cmake
    By facundo.hpc in forum OpenCL
    Replies: 1
    Last Post: 12-30-2011, 07:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •