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.
I ran what you suggested:
sudo apt-get install ocl-icd-libopencl1
But I think what got me past the error was the changing of "-lopencl" to "-l
Open
CL" (Dang Linux and being case sensitive!). After this, I finally got "make" to work!
I'm not linux-y, so I don't know what running this command does:
cd kernel && ln -s ../nonce.cl
It appears to change directory into the kernel folder (assuming you are already in the root of the gpu plotter folder). The second part of the command... this creates a link somewhere?? I run that command and I get this:
ln: failed to create symbolic link ‘./nonce.cl’: File exists
I tried running the gpu plot generator anyways, and I get this:
GPU plot generator v1.1.0
Author: Cryo
Bitcoin: 138gMBhCrNkbaiTCmUhP9HLU9xwn5QKZgD
Burst: BURST-YA29-QCEW-QXC3-BKXDL
--------------
Path: ./plots
Nonces: 0 to 5000 (1 GB)
Process memory: 250MB
Threads number: 64
--------------
Retrieving OpenCL platform
Retrieving OpenCL GPU device
Creating OpenCL context
Creating OpenCL command queue
Creating CPU buffer
Creating OpenCL GPU generation buffer
Creating OpenCL GPU scoops buffer
Creating OpenCL program
An error occured in the generation process, aborting...
>>> Unable to open the source file
... not sure where to go from here.