Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » [SOLVED] Bizarre OpenCL behavior when launching from within Eclipse(Some OpenCL implementations fail to load when launching from within Eclipse)
[SOLVED] Bizarre OpenCL behavior when launching from within Eclipse [message #659447] Mon, 14 March 2011 03:43 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: March 2011
Junior Member
I have been trying to figure this out for about 12 hours with no luck.
I have been guessing it is an environment/path issue, but the behavior still baffles me.
I do not know enough about the Eclipse CDT app launcher to continue investigating this.

Setup:
+ Windows 7 64-bit
+ Eclipse 3.6.2 + CDT 7.0.2
+ MinGW GCC 4.5.2

OpenCL installations:
+ NVIDIA CUDA Toolkit 3.2
+ Intel OpenCL SDK 1.1
+ ATI Stream 2.3

Target:
+ Compiling a C99 32-bit application that simply queries OpenCL for the available platforms.

Issue:
+ When executing application outside of Eclipse, OpenCL properly reports the 3 platforms registered with the Khronos ICD.
+ When executing application with an Eclipse Debug Configuration (GDB launcher), OpenCL properly reports the 3 platforms registered with the Khronos ICD.
+ When executing application with an Eclipse Run Configuration, OpenCL only reports 1 platform (NVIDIA).

Example code to repro:
#include <stdio.h>
#include <CL/cl.h>

int main()
{
    FILE* file = fopen("icd.txt", "w");
    cl_uint numPlatforms;
    cl_platform_id platforms[10];
    char name[1024];
    cl_uint i;

    clGetPlatformIDs(10, platforms, &numPlatforms);

    fprintf(file, "%d\n", numPlatforms);

    for (i = 0; i < numPlatforms; ++i)
    {
        clGetPlatformInfo(platforms[i], CL_PLATFORM_NAME, 1024, name, NULL);

        fprintf(file, "%s\n", name);
    }

    return 0;
}


Correct Output:
3
NVIDIA CUDA
ATI Stream
Intel OpenCL

Incorrect Output:
1
NVIDIA CUDA

Does anyone know what could be the problem?
If not, the above setup is probably pretty common, so could someone try to reproduce the issue?
You shouldn't need all 3 platforms installed, just Intel or ATI.

[Updated on: Mon, 14 March 2011 04:38]

Report message to a moderator

[SOLVED] Bizarre OpenCL behavior when launching from within Eclipse [message #659451 is a reply to message #659447] Mon, 14 March 2011 04:37 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: March 2011
Junior Member
I kept trying exhaustive environment changes and finally found the culprit:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=236330

I had Eclipse 64-bit installed. Isn't there a way Eclipse 64-bit could warn user when installing CDT that it doesn't work on 64-bit?

I downloaded Eclipse 32-bit, installed CDT, loaded old workspace, recompiled the above test program and ran. The program behaves correctly.

Re: [SOLVED] Bizarre OpenCL behavior when launching from within Eclipse [message #728416 is a reply to message #659451] Fri, 23 September 2011 08:56 Go to previous message
Dr. Ali Kattan is currently offline Dr. Ali KattanFriend
Messages: 1
Registered: September 2011
Junior Member
Hi,

I would be grateful if you can share your experience in setting Eclipse CDT to work with OpenCL. I didn't find much luck googling this issue and I need to know how to setup the paths and be able to build and run a C host application from within Eclipse CDT. I would really appreciate your reply.
Thanks
Previous Topic:debug included library
Next Topic:memory view constrain range
Goto Forum:
  


Current Time: Thu Apr 25 16:12:44 GMT 2024

Powered by FUDForum. Page generated in 0.03946 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top