I keep getting this error now when I issue the "make" command:
Linking [bin/gpuPlotGenerator.exe]
/usr/bin/ld: cannot find -lopencl
collect2: error: ld returned 1 exit status
make: *** [bin/gpuPlotGenerator.exe] Error 1
I've tried Googling the error and see that a bunch of posts on the issue, but can't seem to correct this "/usr/bin/ld: cannot find -lopencl" error. Any suggestions?
The correction for that particular error is to use "-lOpenCL" instead (assuming you've installed opencl with "sudo apt-get install ocl-icd-libopencl1" first.)
However, I found the makefile is incompatible with linux. It may work better if you change the "CC"s to "C++", but I haven't tried. I did get it to compile with the single command
g++ -ansi -pedantic -W -Wall -std=c++0x gpuPlotGenerator.cpp -lOpenCL
I also had to do "( cd kernel && ln -s ../nonce.cl )", since it seems to expect to find the file there (In my version, it's in the root dir.) Then the command "./gpuPlotGenerator ./plots/ 0 10 10 10 10" ran without errors (on an NVIDIA GTX Black.)
Edit: However, when I try something more substantial, like a stagger size of 64 and a thread num of 64, I get ">>> [-5] Error in synchronous read". -5 is
out of resources.
Edit 2: Following the advice
here, I added
error = clFinish(commandQueue);
if (error != CL_SUCCESS) {
throw opencl_error(error, "Error after running kernel");
}
in between the clEnqueueNDRangeKernel and clEnqueueReadBuffer calls. I get error -36, "invalid command queue", which
apparently can still mean insufficient resources. A titan black is pretty beefy, though.