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,
Perry
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.
Ngoc
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;
clGetPlatformIDs(0,NULL,&nPlatform);
cl_platform_id* plInfos = (cl_platform_id*)malloc(nPlatform * sizeof(cl_platform_id));
clGetPlatformIDs(nPlatform,plInfos,NULL);
// Get Devices
cl_uint nDev = 0;
clGetDeviceIDs(plInfos[i],CL_DEVICE_TYPE_ALL,0,0,&nDev);
cl_device_id* GPUDevices = (cl_device_id*)malloc(nDev * sizeof(cl_device_id));
clGetDeviceIDs(plInfos[i],CL_DEVICE_TYPE_ALL,nDev,GPUDevices
,0);
//Create context
GPUContext = clCreateContext(NULL,nDev,GPUDevices,0,0,0);
[/codebox]
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.
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 (The Official NVIDIA Forums | NVIDIA ).
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)
Previous NVIDIA OpenCL drivers permitted developers to assume that the NULL or default platform,
as passed to clCreateContext and related calls, was NVIDIA’s platform. This approach is incompatible
with supporting multiple vendors on a single platform (it would be unclear which vendor is the default).
To prepare for compatibility with future multi-vendor OpenCL installations, NVIDIA’s drivers will no longer
honor NULL as a platform. This requires OpenCL programs to be changed explicitly enumerate the
available platforms and choose the appropriate vendors. [b]This change is reflected in the sample code
in this SDK release.[/b]
The bold fragment is not true.
So:
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
But it works with 196.21 on my machine
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
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,
Perry
I too have the same problem except I’m on Windows Vista x64 SP1
output
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\OpenCL\bin\Win32\Release\oclPostprocessGL.exe Starting…
!!! Error # -32 at line 592 , in file .\oclPostprocessGL.cpp !!!
Starting Cleanup…
TEST FAILED !!!..
oclPostProcessGL.exe Exiting…
Press to Quit