In what there can be cause of error Run-Time Check Failure #0 in OpenCL?

Notebook Lenovo with video card Nvidia G240M with 512M memories. Visual C ++ Express. Windows 7. The driver with support OpenCL (a driver file 195.62_notebook_winvista_win7_32bit_international_whql.exe) is established. It is established Nvidia SDK (a file gpucomputingsdk_2.3b_win_64.exe). SDK ATI it is not necessary. I start the program, at performance clGetPlatformIDs I receive an error “Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention”. The Same program works on a desktop with Nvidia GeForce 9500 without problems. Prompt, please, in what there can be a cause of error? (3.82 KB)

I have exactly the same problem. I think the OpenCL.dll in 195.62 has a different calling convention. The new driver probably installs the Khronos dll, but the sdk samples and especially OpenCL.lib are still built for the previous OpenCL.dll. In the platform.h of the sdk there is

#define CL_API_CALL

I think that should now be

#define CL_API_CALL __stdcall

I just replaced an ATI with a NVIDIA card and it turns out that my App, which was originally developed using the ATI sdk runs on the NVIDIA cards as long as I use the OpenCL header files and lib files that came with the ATI sdk. If I use the ones from the Nvidia sdk, then I get the same error.

Just a quick follow up. I just replaced the CL header files and the OpenCL.lib in the NVIDIA sdk with the ones from the ATI sdk and after recompiling the samples they seem to run fine.

I had to do the above to get anything to run with the 2.3a GPU computing SDK. I downloaded the ATI stream SDK v2.0 and used the OpenCL.lib and cl_platform.h. Once I did that and recompiled, a number of examples in the SDK began to work, but others continued crashing. Debugging this I found that I had to edit the oclUtils.cpp file, changing the string comparison

if(strcmp(“NVIDIA”, chBuffer) == 0)


if(strcmp(“NVIDIA CUDA”, chBuffer) == 0)

It appears the driver returns a different platform name now than it once did. All of this was with the 195.62 drivers (the latest I’m aware at the time of writing this).

All I have to say is … wow. Really Nvidia? Do you know what the words ‘quality control’ mean? Ever heard of testing your releases before you ship them out? I only registered on the forum so I could post my fix and publicly marvel that this is what it took to get things working. Many thanks to jstier for his suggestion about using the ATI components.

Thanks for this last bit right here, to change the “NVIDIA CUDA”. Im starting a project with OpenCL and could not even start because of the source inconcistencies, atleast now i can start :P.

nvidia is way too busy with CUDA to care about OpenCL right nou -.-

If I’m right the driver newer the sdk 2.3 doesn’t work with drivers newer than 195… You have to use install the sdk 3.0 and it would work fine.

Yep, I would like to add my voice into this too. We have been working on a school project getting openCL and CUDA to run on multiple platforms and while my partner could easily get openCL to work on his the mac side of this macbook, I could not for the life of me figure out how to get the code working on the windows side of my mac till I found this string of messages. That and knowing info form here:…threadid=126879

Hey NVidia, more support for openCL please (like updating your sdk). Oh, well…

It was bad idea to use 2.3b to develop opencl if you could get 3.0beta. Better was using 3.0beta with more proper opencl support. Opencl support was added recenlty, it is not as mature as cuda.