clGetPlatformIDs returning null


I am having Nvidia Geforce 9500 GT card, i have updated the drivers and installed NVidia cuda tool kit along with opencl available on the website.
when i run the code below in my visual studio 2010. The function clGetPlatformIDs is returning -1001 and the value of the second argument of the function is “test” is returned as NULL. I guess this means the device is not detected. Can some one please help in making my device getting detected.

#include <CL/opencl.h>

int main(int argc, char **argv)

cl_platform_id test;
cl_uint num;
cl_uint ok = 1;
cl_int result;
result = clGetPlatformIDs(ok, &test, &num);

return 0;



Can some one reply this??

Can you run any of the examples that NVIDIA ships?

I found where my issue is, i have been using remote desktop to connect to my windows 2008 server, and i found out that gpu cannot be accessed withe RDP. I ran the code directly on the server terminal and it works fine. Now all other nvidia sdk examples are working.