Nvidia OpenCL samples on AMD GPUs

I’m trying to build/compile Nvidia OpenCL samples on AMD GPUs with no luck. I get an error with the clCreateContext…Type function call? Any suggestions?

Actually, the samples build/compile just fine. But then I get a runtime 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.

on the line: context = clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, &errnum);


Try AMD’s OpenCL forum maybe? Good luck! :)

This is the sample codes problem. Before ICD you could even specify null for the properties arg and get away with it. Specifying 0 for a 0 terminated list is almost the same as null. You need a CL_CONTEXT_PLATFORM (4228), the value of your cl_platform, 0.

Does this sample currently run on nVidia? Is it possible your sample code is old?

Thanks, this is the same answer someone gave on the AMD forums. I will check to make sure I’m using the latest samples.

Simon, seems to be a problem with Nvidia samples.

I have a 3.0 toolkit, and checked the source for one of the samples, and it had this 0. (Maybe that is null, I have been using Java so long I forgot what C used for null). My sample code no longer runs for me with nVidia GPU.

I downloaded 3.0 and now can’t get the samples to compile/build like they were before, not sure what’s changed.