Here's the patch to make it work with OpenCL 1.1 (and therefore Nvidia cards).
Replace function
OpenCL::WriteBufferPattern in file
AppOpenCL.cpp with the following code:
void OpenCL::WriteBufferPattern(uint device_num, string buffername, size_t data_length, void* pattern, size_t pattern_length)
{
_clState& GPUstate = GPUstates[device_num];
if (GPUstate.buffers[buffername] == NULL)
cout << "Buffer " << buffername << " not found on GPU #" << device_num << endl;
#ifdef CL_VERSION_1_2
cl_int status = clEnqueueFillBuffer(GPUstate.commandQueue, GPUstate.buffers[buffername], pattern, pattern_length, 0, data_length, 0, NULL, NULL);
#else
uint8_t buffer[data_length];
for(uint16_t i=0; i<(data_length / pattern_length);i++)
memcpy((&buffer[i*pattern_length]), pattern, pattern_length);
cl_int status = clEnqueueWriteBuffer(GPUstate.commandQueue, GPUstate.buffers[buffername], CL_TRUE, 0, data_length, buffer, 0, NULL, NULL);
#endif
if (globalconfs.coin.config.GetValue("opencldebug"))
cout << "Write buffer pattern " << buffername << ", " << pattern_length << " bytes. Status: " << status << endl;
}
This
runs for me, but I am getting
0 fermats/s, 0 gandalfs/s.
0 TOTAL
most likely because my card it too old and I had to set
worksize 64 in
primecoin.conf.
If you have a newer Nvidia card (with a "compute capability version" >= 2.0 according to
http://en.wikipedia.org/wiki/CUDA#Supported_GPUs ), try to set
worksize 512 and see what this gives you.
Hi, I got it to compile, but I modifided the line
#ifdef CL_VERSION_1_2
to
#ifndef CL_VERSION_1_2
due to compile errors.