3.0 build samples problem

Hi everybody! I’m using Mac OS X Snow Leopard 10.6.3, i’ve just installed version 3.0 driver + toolkit + sdk, and found that i can’t build OpenCL samples, here are the symptoms:

Last login: Mon Apr  5 03:23:54 on ttys000

Lu4-2:~ Lu4$ cd /Developer/GPU\ Computing/OpenCL/

Lu4-2:OpenCL Lu4$ make

src/oclUtils.cpp: In function ‘void oclPrintDevInfo(int, _cl_device_id*)’:

src/oclUtils.cpp:282: error: ‘CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV’ was not declared in this scope

src/oclUtils.cpp:283: error: ‘CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV’ was not declared in this scope

src/oclUtils.cpp:290: error: ‘CL_DEVICE_REGISTERS_PER_BLOCK_NV’ was not declared in this scope

src/oclUtils.cpp:294: error: ‘CL_DEVICE_WARP_SIZE_NV’ was not declared in this scope

src/oclUtils.cpp:298: error: ‘CL_DEVICE_GPU_OVERLAP_NV’ was not declared in this scope

src/oclUtils.cpp:302: error: ‘CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV’ was not declared in this scope

src/oclUtils.cpp:306: error: ‘CL_DEVICE_INTEGRATED_MEMORY_NV’ was not declared in this scope

make[1]: *** [obj/release/oclUtils.cpp.o] Error 1

make: *** [common/liboclUtil.so] Error 2

Lu4-2:OpenCL Lu4$

any thoughts?

Are you installed xcode ? what is the version ?
Actually, i download the version 3.2.2 and the iphone sdk 3.2 .
The link for xcode : Mac Dev Center - Apple Developer.

Same problem here. Probably not the best solution but I pasted the define statements in the oclUtils.cpp file (at the top) and it compiled fine…




#define CL_DEVICE_WARP_SIZE_NV 0x4003




This is not the best solution but it is one.
Where to find the values for different variables?
I use the integrated 9400 and the 9600. How to avoid having to change the value each time I change cards?
Deeply real solution made by Nvidia as well as integration with Xcode.

Well, I think I found a solution.

The OpenCL example has messy headers re OpenCL, e.g.:

amadeus[2075]:/Developer/GPU Computing/OpenCL/common% grep -r “OpenCL/cl” *
inc/CL/cl.h:#include <OpenCL/cl_platform.h>
inc/CL/cl_gl.h:#include <OpenCL/cl.h>
inc/CL/opencl.h:#include <OpenCL/cl.h>
inc/CL/opencl.h:#include <OpenCL/cl_gl.h>
inc/CL/opencl.h:#include <OpenCL/cl_gl_ext.h>
inc/CL/opencl.h:#include <OpenCL/cl_ext.h>

looking at /Developer/GPU Computing/OpenCL/common/inc/oclUtils.h:

// All OpenCL headers
#if defined (APPLE) || defined(MACOSX)
#include <OpenCL/opencl.h>
#include <CL/opencl.h>

and at “/Developer/GPU Computing/OpenCL/common/inc” we have only “CL” folder and not “OpenCL”

So, we will never have “obj/release/oclUtils.cpp.o” because make will never find the right header.

Well, the solution I found was:

/Developer/GPU Computing/OpenCL/common% cp -a inc/CL inc/OpenCL
/Developer/GPU Computing/OpenCL/common% make
/Developer/GPU Computing/OpenCL/common% mv common/inc/OpenCL common/inc/OpenCL_ #or delete

then go to /Developer/GPU Computing/OpenCL/ and do:

This works but I had to boot OS X in 32bit mode by holding down 3 and 2 until the Apple screen shows during startup. (I also followed the release instructions explicitly.)