PDA

View Full Version : clGetPlatformIDs error -1001 when called in PostgreSQL UDF



kksiazek
12-23-2012, 05:43 AM
I'm trying to write an OpenCL function that would be executed inside PostgreSQL. To do this i create DLL from my OpenCL code and link it to postgres using User-Defined Function mechanism. Everything goes well until clGetPlatformIDs is called. Function returns error -1001, which I read that indicates problem with finding OpenCL drivers.

I've tried to compile the same code(i had to remove some postgres magic) to exe and runed it with success - all platforms were found correctly, so I assume that i have correctly set up SDK and drivers.

I am runing PostgreSQL 9.1 on windows 7 x64. I am also using Nvidia CUDA SDK 4.2 with Visual Studio 2010 and running my code on GeForce GTS 450.

clint3112
01-08-2013, 07:37 AM
have you tried using clew for dll lazy loading?

kksiazek
02-21-2013, 02:58 AM
The problem is Session 0 Isolation in Windows 7, running on Linux solves the issue.
http://stackoverflow.com/questions/1418 ... gresql-udf (http://stackoverflow.com/questions/14180919/clgetplatformids-error-1001-when-called-in-postgresql-udf)