CL_INVALID_COMMAND_QUEUE on OpenCL branch of Bullet @Windows

Please don't post Bullet support questions here, use the above forums instead.
phoad
Posts: 1
Joined: Sun Nov 28, 2010 11:28 pm

CL_INVALID_COMMAND_QUEUE on OpenCL branch of Bullet @Windows

Post by phoad »

Hello,
I have just tried to compile the OpenCL branch of the Bullet and I coincided some difficulties. I am just a beginner user of Bullet, so please forgive me for my mistakes. I just want to make this branch active :)

I have successfully compiled the OpenCL branch of Bullet at Windows 7 @32bit. I think the 64 bit adaptation and Linux port is not available yet?

- Instead of testing for MiniCL, I tried to test the NV ports, so I removed -DMiniCL like flags from the CMakeFiles as I see them. You may not need this, but as I get errors at runtime I just tried to cancel these for the first action..

== At the ParticlesOpenCL demo I got CL_INVALID_COMMAND_QUEUE errors..

I removed the kernel implementations at first but then I released the kernel implementations may not / is not the reason of the error. Then I changed the local, and global work sizes to 512 and 1024 respectively for just testing, and reverting back,, and the error is not produced. So I changed the code a bit, and viola, the code worked with no CL_INVALID_COMMAND_QUEUE error. So I think in my computer the code should be updated to match the workgroup size constraints. In fact it seem that maximum workgroup size is 1024 and the code uses it, but it somehow fails and I just divided the localworkgroup size to be equal to 512 and adapted the global workgroup size as *2..

In this function I just changed one line, colored!..

void btParticlesDynamicsWorld::runKernelWithWorkgroupSize(int kernelId, int globalSize)
{
...
else
{
size_t localWorkSize[2], globalWorkSize[2];
workgroupSize = btMin(workgroupSize, globalSize) / 2;
int num_t = globalSize / workgroupSize;
int num_g = num_t * workgroupSize;
if(num_g < globalSize)
{
num_t++;
}
localWorkSize[0] = workgroupSize;
globalWorkSize[0] = num_t * workgroupSize;
localWorkSize[1] = 1;
globalWorkSize[1] = 1;
ciErrNum = clEnqueueNDRangeKernel(m_cqCommandQue, kernelFunc, 1, NULL, globalWorkSize, localWorkSize, 0,0,0 );
}
oclCHECKERROR(ciErrNum, CL_SUCCESS);
}

---
And another 1 line is updated as cancelling *2

void btParticlesDynamicsWorld::bitonicSortNv(cl_mem pKey, unsigned int batch, unsigned int arrayLength, unsigned int dir)
{
unsigned int localSizeLimit = m_kernels[PARTICLES_KERNEL_BITONIC_SORT_CELL_ID_LOCAL].m_workgroupSize; //FUAT CANCELLED * 2;
if(arrayLength < 2)
return;
//Only power-of-two array lengths are supported so far
dir = (dir != 0);
cl_int ciErrNum;
size_t localWorkSize, globalWorkSize;
if(arrayLength <= localSizeLimit)

.........


== At SpheresOpenCL demo I got such an error:

OpenCL compiles C:/development/bullet_all/branches/OpenCL/Demos/SpheresOpenCL/Shared/SpheresGrid.cl ...OK
OCL Error : -30
ERROR OCCURED:
CL_INVALID_VALUE error executing CL_COMMAND_READ_BUFFER on GeForce GTX 460 (Device 0).

Assertion failed: (ciErrNum) == (0), file ..\..\..\..\Demos\SpheresOpenCL\Shared\btSpheresGridDemoDynamicsWorld.cpp, lin
e 1268

-- I have not looked for the error yet..


So any updates at the OpenCL branch of the Bullet will be appreciated by me, please :)

It will be glad to help if I can in any way at this branch,

Thanks,
Fuat Geleri