I use opencl to write a multi-gpu application.
A strange problem has trapped me for a few days.
in single gpu case, both codes work well.
but in multi-gpu case, h_Test1 in code one gets right data, while h_Test1 in code two gets error data. It happens in all devices except device 0.
i really don't know why this happen. I guess it may be a bug.
does anybody know about the reason?
thank you for your kindness!
// g_Context is the global context for all gpu devices // g_Devices is the device list. //code one cl_command_queue commandQueue = clCreateCommandQueue(g_Context,g_Devices[iDeviceID],0,&iStatus); cl_uint h_Test0[16] = {1}; cl_mem d_Test = clCreateBuffer(g_Context,CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR,16*sizeof(cl_uint),h_Test0,&iStatus); cl_uint h_Test1[16]={0}; iStatus = clEnqueueReadBuffer(commandQueue,d_Test,CL_TRUE,0,16*sizeof(cl_uint),h_Test1,0,NULL,NULL); iStatus = clReleaseMemObject(d_Test); //code two cl_command_queue commandQueue = clCreateCommandQueue(g_Context,g_Devices[iDeviceID],0,&iStatus); cl_uint h_Test0[16] = {1}; cl_mem d_Test = clCreateBuffer(g_Context,CL_MEM_READ_ONLY,16*sizeof(cl_uint),NULL,&iStatus); iStatus=clEnqueueWriteBuffer(commandQueue,d_Test,CL_TRUE,0,16*sizeof(cl_uint),h_Test0,0,NULL,NULL); cl_uint h_Test1[16]={0}; iStatus = clEnqueueReadBuffer(commandQueue,d_Test,CL_TRUE,0,16*sizeof(cl_uint),h_Test1,0,NULL,NULL); iStatus = clReleaseMemObject(d_Test);
please provide your
system configuration
GPUs
Driver version
SDK installation details
system configuration : win7,32bits
GPUs : HD5970, 2 cards with crossfire enabled
Driver version : 10-4_vista32_win7_32_dd
SDK installation details : sdk v2.1, opencl v1.1
Best wishes!
xmuben
hi xmuben,
As of now,in crossfired gpus you cannot use all the devices available.Try running by disabling the crossfire.
for the same reason you cannot run openCL kernel on the two internally crossfired devices.Only device[0] is supported in this case.
Hi Himanshu:
This trouble bothered me for a long time. I disabled the crossfire, but when I run the simpleMuitidevice, I can only find GPU[0],GPU[1], the GPU[2] and GPU[3] were missing. What can I do?
Thanks,
ThomasUCF
ThomasUCF,
Your problem appears different.Can you please move this post to a fresh topic.
Also mention your system info:
SDK and Driver version
GPU And CPU
Hi Himanshu:
I posted a new one named "Multiple GPU problem" in the "OpenCL", thanks a lot.
ThomasUCF