I know that this has been posted many times, but I'm reposting the same question because none of the suggestions in the Internet works for me. I've been stuck here for weeks trying to get a simple OpenCL program running.
Here's what I did:
I got a new video card with CUDA and installed a fresh copy of Ubuntu 14.04:
# lspci | grep VGA
02:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1)
and then installed CUDA in it:
sudo apt-get install nvidia-cuda-toolkit
This installed all the necessary files for OpenCL compilation as far as I could see. I got following files in my computer now:
/usr/lib/x86_64-linux-gnu/libOpenCL.so
/etc/OpenCL/vendors/nvidia.icd
Then I tried the following program:
#include <stdio.h>
#include <CL/cl.h>
int main(void)
{
cl_int err;
cl_uint numPlatforms = 0;
err = clGetPlatformIDs(0, NULL, &numPlatforms);
if (CL_SUCCESS == err)
printf("\nDetected OpenCL platforms: %d", numPlatforms);
else
printf("\nError calling clGetPlatformIDs. Error code: %d", err);
getchar();
return 0;
}
Compiled it successfully as follows:
gcc -o test2 test.c -lOpenCL
And when I run it, I get the following message:
Error calling clGetPlatformIDs. Error code: -1001
I've tried numourous suggestions in the Internet to get this to work but for no avail. I'd appreciate any help you could offer.