[SOLVED] Bizarre OpenCL behavior when launching from within Eclipse [message #659447] |
Mon, 14 March 2011 03:43 |
No real name 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03946 seconds