Editing a post in OpenCL sdk who does compile but does not work

Hi everybody!

so i have a strange problem: I have a system with a geforce gtx280 and 195.62 drivers.

I downloaded and installed the OpenCL sdk, and from the sdk browser all the examples work properly.

So i started to code my own stuff in opencl but my program crashes in the very beginning after getting the opencl context.

So i was dubious, and tried to compile myself the examples from Nvidia, and actually it happens the same when i run the examples
compiled by myself. Is it a driver compatibility problem?

oh, the SDK browser i have is version 2.30.1006.1500

thanks in advance…

(sorry for the topic, i wrongly posted it before to another nvidia forum)

Crashing how? Do you get some form of error message or error code?

In genera I get the windows report “this program has stopped working”.

Now i was looking at the logs and i also get something else:

On the bandwidth test example i get:

“WARNING: NVIDIA OpenCL platform not found - defaulting to first platform!”

(which usually does not happen. for example the boxfilter example correctly recognize the platform, looking at the log file, before crashing)

on the oclBlackScholes.exe:

!!! Error # 4436155 at line 103 , in file .\src\main.cpp !!!

on the convolutionseparable.exe:

!!! Error # 4356160 at line 59 , in file .\src\main.cpp !!!

on the dct:

!!! Error # 4340332 at line 61 , in file .\src\main.cpp !!!

the device query example says also:

WARNING: NVIDIA OpenCL platform not found - defaulting to first platform!

CL_PLATFORM_NAME: ¸?¼

CL_PLATFORM_VERSION: 1

OpenCL SDK Version: 4788711

the DotProduct outputs (before crashing) :

C:\Users\Dev\Desktop\OpenCL\bin\Win32\Release\oclDotProduct.exe Starting…

of float elements per Array = 5111777

Global Work Size = 5111808

Local Work Size = 256

of Work Groups = 19968

Allocate and Init Host Mem…

clCreateContextFromType…

clGetContextInfo

…clCreateCommandQueue…

clCreateBuffer (SrcA, SrcB and Dst in Device GMEM)…

oclLoadProgSource (DotProduct.cl)…

clCreateProgramWithSource…

clBuildProgram…

clCreateKernel (DotProduct)…

clSetKernelArg 0 - 3…

the DXTcompression.exe:

!!! Error # 205680 at line 84 , in file .\oclDXTCompression.cpp !!!

the oclFDTD3d.exe

Set-up, based upon target device GMEM size…

getTargetDeviceGlobalMemSize

clCreateContextFromType

clGetContextInfo

clGetDeviceInfo

the oclHiddenMarkovModel.exe

Create context

Get device info…

clCreateCommandQueue

!!! Error # 16692683 at line 74 , in file .\oclHiddenMarkovModel.cpp !!!

the oclVectorAdd.exe

of float elements per Array = 11444777

Global Work Size = 11444992

Local Work Size = 256

of Work Groups = 44707

Allocate and Init Host Mem…

clCreateContextFromType…

clGetContextInfo…

clCreateCommandQueue…

clCreateBuffer…

oclLoadProgSource (VectorAdd.cl)…

clCreateProgramWithSource…

clBuildProgram…

if you need more log, i can post the remaining results!

While I don’t understand what is happening here, it sounds like there is something wrong with the use of platforms. I had a look at some of the lines where your messages indicates that something went wrong, but found either empty lines or unrelated statements. Which version of the NVIDIA SDK are you using?

From rather recently it has become mandatory to specify a platform when creating context, as done in oclVectorAdd. Take a look at that example and compare with the others that are failing and your own code to see if there is a difference. Platform handling is described in Section 4 of the OpenCL specification, in particular 4.1->4.3.

I think the version of the sdk i am using is the 2.3. I am not sure if it’s the correct version, that’s what i found in the release notes.

but it looks to me it is also the latest version. or is there a newer one? also should i upgrade to the latest drivers, or should i use the

190.89 linked in the opencl download page?

http://developer.download.nvidia.com/compu…89_general.exe

http://developer.download.nvidia.com/compu…89_general.exe

thanks

Try downloading 3.0 Beta SDK instead of reverting to an older driver. Some changes were introduced to how OpenCL is handled by the driver since 195 and SDK 2.3 (which was released with driver 190) may not be compatible anymore. Particularly, the calling conventions have changed from 190 (__cdecl ) to 195 (__stdcall).

thank you very much! so i installed the drivers cudadriver_3.0-beta1_winvista_64_195.39-beta_general.exe (do they differ from the regular 195.x? and if not, could i in principle use also the latest regular 196.x?)

and the 3.0beta sdk , and now all works properly on the examples!

i’ll check the code out now, and try to begin with opencl :)

thanks again

You should just get the newest drivers from nvidia’s site (196.21 at the moment of writing afaik).