OpenCL on 196.21 WHQL

Hi everybody,

I am working on a Windows 7 x64 SO, and the examples of “NVIDIA GPU Computing SDK” do not work with the 196.21 driver

The line

cxGPUContext = clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, &ciErrNum)

does not work.

the ciErrNum code is -32… but i doubt it is relevant.

has someone the same problem?

Thanks to all,


Hi Perry,

Error code -32 means CL_INVALID_PLATFORM, so I think you can run oclDeviceQuery sample to check if you are working on a valid platform.


You’re passing null in for the platform. You now have to pass in a valid platform object to create a context.

oooo yes!

the oclDeviceQuery is the only sample still works!

all other does not work…

I’m tring to do something like:

[codebox]// Get platforms

cl_uint nPlatform = 0;


cl_platform_id* plInfos = (cl_platform_id*)malloc(nPlatform * sizeof(cl_platform_id));


// Get Devices

cl_uint nDev = 0;


cl_device_id* GPUDevices = (cl_device_id*)malloc(nDev * sizeof(cl_device_id));



//Create context

GPUContext = clCreateContext(NULL,nDev,GPUDevices,0,0,0);


and it works…

But i will like to see the nvidia examples work again…

GPUContext = clCreateContext(NULL,nDev,GPUDevices,0,0,0);

This shouldn’t work. It worked before but will not in current and future implementations of OpenCL.

By the way, if you haven’t yet, get the newest SDK. It has updates to the samples’ code. The old SDK has this error everywhere.

Which SDK are you referring to? I started getting this error and changed the way I created contexts.

I’m currently using the CUDA 3.0 beta (

Is there a newer one?

It appears I was wrong, even 3.0 Beta has those errors. This does work on my end tho, even with 196.21.

The release notes say (since 195)

The bold fragment is not true.


  1. Initializing a context this way is a bad idea, it’s relying on vendor specific implementation and the whole idea is broken - not future proof

  2. But it works with 196.21 on my machine

  3. It’s also done this way in the 3.0 Beta SDK, I was wrong in my previous post

If anyone is looking for an example on how to do this, have a look at oclSimpleGL which first establishes cl_context_properties and then uses that in clCreateContextFromType.

You can find more information about this in the Khronos OpenCL 1.0 spec on page 42.

Fingers crossed on NVIDIA, AMD and Khronos getting this right so we can write code compatible on multiple platforms, you know, the whole point of OpenCL. :D

I too have the same problem except I’m on Windows Vista x64 SP1