CL_INVALID_WORK_GROUP_SIZE with clEnqueueNDRangeKernel
is this a known bug? here is my usage


int dim = 2;
size_t globalWorkSizeData[2] = {16,16};
size_t localWorkSizeData[2] = {8,8};
clEnqueueNDRangeKernel(clQueue, clKernel, dim,
NULL,
(const size_t *) globalWorkSizeData,
(const size_t *) localWorkSizeData,
0, NULL, NULL);

only if localWorkSizeData is NULL does the code work

thanks
is this a known bug? here is my usage





int dim = 2;

size_t globalWorkSizeData[2] = {16,16};

size_t localWorkSizeData[2] = {8,8};

clEnqueueNDRangeKernel(clQueue, clKernel, dim,

NULL,

(const size_t *) globalWorkSizeData,

(const size_t *) localWorkSizeData,

0, NULL, NULL);



only if localWorkSizeData is NULL does the code work



thanks

#1
Posted 10/19/2009 08:53 PM   
I am experiencing exactly the same problem: as long as I put a non-NULL parameter for work-group size, OpenCL will quit with CL_INVALID_WORK_GROUP_SIZE. It is hard to believe this is a bug though, since almost every nvidia opencl programmer should have encountered it.

Any explanations?
I am experiencing exactly the same problem: as long as I put a non-NULL parameter for work-group size, OpenCL will quit with CL_INVALID_WORK_GROUP_SIZE. It is hard to believe this is a bug though, since almost every nvidia opencl programmer should have encountered it.



Any explanations?

#2
Posted 02/23/2010 08:40 PM   
I want to add that the maxWorkGroupSize returned from clGetDeviceInfo() is 512, and kernelWorkGroupSize returned from clGetKernelWorkGroupInfo() is 128. The previous error happened for any workgroup size smaller than 128.
I want to add that the maxWorkGroupSize returned from clGetDeviceInfo() is 512, and kernelWorkGroupSize returned from clGetKernelWorkGroupInfo() is 128. The previous error happened for any workgroup size smaller than 128.

#3
Posted 02/23/2010 09:10 PM   
Having anything but NULL as local work size gives an error -54.

Are there any known solutions? It has been a few months...
Having anything but NULL as local work size gives an error -54.



Are there any known solutions? It has been a few months...

#4
Posted 02/23/2010 09:28 PM   
error -54 is the same as CL_INVALID_WORK_GROUP_SIZE.

If I set the work-group size to NULL, I got (-5)CL_OUT_OF_RESOURCES error :(
from the best practices guide, shouldn't a "NULL" work-group make opencl to automatically determine a work-group?
error -54 is the same as CL_INVALID_WORK_GROUP_SIZE.



If I set the work-group size to NULL, I got (-5)CL_OUT_OF_RESOURCES error :(

from the best practices guide, shouldn't a "NULL" work-group make opencl to automatically determine a work-group?

#5
Posted 02/23/2010 09:35 PM   
[quote name='FangQ' post='1006894' date='Feb 23 2010, 09:35 PM']error -54 is the same as CL_INVALID_WORK_GROUP_SIZE.

If I set the work-group size to NULL, I got (-5)CL_OUT_OF_RESOURCES error :(
from the best practices guide, shouldn't a "NULL" work-group make opencl to automatically determine a work-group?[/quote]

Which version are you using. I am using 3.0_beta on Windows 64-bit. And if I set the size to anything but NULL I get CL_INVALID_WORK_GROUP_SIZE error
[quote name='FangQ' post='1006894' date='Feb 23 2010, 09:35 PM']error -54 is the same as CL_INVALID_WORK_GROUP_SIZE.



If I set the work-group size to NULL, I got (-5)CL_OUT_OF_RESOURCES error :(

from the best practices guide, shouldn't a "NULL" work-group make opencl to automatically determine a work-group?



Which version are you using. I am using 3.0_beta on Windows 64-bit. And if I set the size to anything but NULL I get CL_INVALID_WORK_GROUP_SIZE error

#6
Posted 02/23/2010 10:10 PM   
[quote name='adakkak' post='1006910' date='Feb 23 2010, 05:10 PM']Which version are you using. I am using 3.0_beta on Windows 64-bit. And if I set the size to anything but NULL I get CL_INVALID_WORK_GROUP_SIZE error[/quote]

mine is driver 190.29 on Ubuntu 9.10, cuda 2.3
[quote name='adakkak' post='1006910' date='Feb 23 2010, 05:10 PM']Which version are you using. I am using 3.0_beta on Windows 64-bit. And if I set the size to anything but NULL I get CL_INVALID_WORK_GROUP_SIZE error



mine is driver 190.29 on Ubuntu 9.10, cuda 2.3

#7
Posted 02/23/2010 11:27 PM   
[quote name='adakkak' post='602834' date='Oct 19 2009, 03:53 PM']only if localWorkSizeData is NULL does the code work[/quote]

using the profiler, I realized that setting NULL for worksize gave me a 1x1x1 block, which completely ruined my kernel's occupancy :(
[quote name='adakkak' post='602834' date='Oct 19 2009, 03:53 PM']only if localWorkSizeData is NULL does the code work



using the profiler, I realized that setting NULL for worksize gave me a 1x1x1 block, which completely ruined my kernel's occupancy :(

#8
Posted 02/25/2010 01:07 AM   
finally, I figured out why I am getting the CL_INVALID_WORK_GROUP_SIZE error. My nvidia card was installed in a 64bit Ubuntu, while, for 64bit systems, sizeof(size_t) is actually 8 [1], and it is different from sizeof(int), which is 4. When I passed my global/block sizes, I used (size_t *)(&an_int), which results in unpredicted values for the kernel dimensions. The reason why the code worked for ATI hardware is because it was installed in a 32bit system.

So, check your code and see if you have the same issue.

[1] [url="http://www.toymaker.info/Games/html/64_bit.html"]http://www.toymaker.info/Games/html/64_bit.html[/url]
finally, I figured out why I am getting the CL_INVALID_WORK_GROUP_SIZE error. My nvidia card was installed in a 64bit Ubuntu, while, for 64bit systems, sizeof(size_t) is actually 8 [1], and it is different from sizeof(int), which is 4. When I passed my global/block sizes, I used (size_t *)(&an_int), which results in unpredicted values for the kernel dimensions. The reason why the code worked for ATI hardware is because it was installed in a 32bit system.



So, check your code and see if you have the same issue.



[1] http://www.toymaker.info/Games/html/64_bit.html

#9
Posted 02/25/2010 06:20 PM   
Same error for me but frome a different reason: the globalWorkSize wasn't divisable by the localWorkSize whereas i naively thought the driver would adjuste the size properly from the input ...
Same error for me but frome a different reason: the globalWorkSize wasn't divisable by the localWorkSize whereas i naively thought the driver would adjuste the size properly from the input ...

#10
Posted 04/09/2010 10:03 AM   
[quote name='FangQ' post='1007953' date='Feb 25 2010, 08:20 PM']finally, I figured out why I am getting the CL_INVALID_WORK_GROUP_SIZE error. My nvidia card was installed in a 64bit Ubuntu, while, for 64bit systems, sizeof(size_t) is actually 8 [1], and it is different from sizeof(int), which is 4. When I passed my global/block sizes, I used (size_t *)(&an_int), which results in unpredicted values for the kernel dimensions. The reason why the code worked for ATI hardware is because it was installed in a 32bit system.

So, check your code and see if you have the same issue.

[1] [url="http://www.toymaker.info/Games/html/64_bit.html"]http://www.toymaker.info/Games/html/64_bit.html[/url][/quote]

What is the solution? I'm confused...

should I use

size_t localWorkSize[2];
(unsigned int*)localWorkSize ?

That does not compile.
[quote name='FangQ' post='1007953' date='Feb 25 2010, 08:20 PM']finally, I figured out why I am getting the CL_INVALID_WORK_GROUP_SIZE error. My nvidia card was installed in a 64bit Ubuntu, while, for 64bit systems, sizeof(size_t) is actually 8 [1], and it is different from sizeof(int), which is 4. When I passed my global/block sizes, I used (size_t *)(&an_int), which results in unpredicted values for the kernel dimensions. The reason why the code worked for ATI hardware is because it was installed in a 32bit system.



So, check your code and see if you have the same issue.



[1] http://www.toymaker.info/Games/html/64_bit.html



What is the solution? I'm confused...



should I use



size_t localWorkSize[2];

(unsigned int*)localWorkSize ?



That does not compile.

#11
Posted 09/08/2010 03:20 PM   
[quote name='FangQ' post='1007953' date='Feb 25 2010, 08:20 PM']finally, I figured out why I am getting the CL_INVALID_WORK_GROUP_SIZE error. My nvidia card was installed in a 64bit Ubuntu, while, for 64bit systems, sizeof(size_t) is actually 8 [1], and it is different from sizeof(int), which is 4. When I passed my global/block sizes, I used (size_t *)(&an_int), which results in unpredicted values for the kernel dimensions. The reason why the code worked for ATI hardware is because it was installed in a 32bit system.

So, check your code and see if you have the same issue.

[1] [url="http://www.toymaker.info/Games/html/64_bit.html"]http://www.toymaker.info/Games/html/64_bit.html[/url][/quote]

What is the solution? I'm confused...

should I use

size_t localWorkSize[2];
(unsigned int*)localWorkSize ?

That does not compile.
[quote name='FangQ' post='1007953' date='Feb 25 2010, 08:20 PM']finally, I figured out why I am getting the CL_INVALID_WORK_GROUP_SIZE error. My nvidia card was installed in a 64bit Ubuntu, while, for 64bit systems, sizeof(size_t) is actually 8 [1], and it is different from sizeof(int), which is 4. When I passed my global/block sizes, I used (size_t *)(&an_int), which results in unpredicted values for the kernel dimensions. The reason why the code worked for ATI hardware is because it was installed in a 32bit system.



So, check your code and see if you have the same issue.



[1] http://www.toymaker.info/Games/html/64_bit.html



What is the solution? I'm confused...



should I use



size_t localWorkSize[2];

(unsigned int*)localWorkSize ?



That does not compile.

#12
Posted 09/08/2010 03:20 PM   
I also encounter this problem,, but finally I found the source is the wrong memory size. So don't focus on the group size, It probably result from the memory transfer between CPU and GPU, and the problem for memory transfer is the wrong size, just a tip. hopefully it helps
I also encounter this problem,, but finally I found the source is the wrong memory size. So don't focus on the group size, It probably result from the memory transfer between CPU and GPU, and the problem for memory transfer is the wrong size, just a tip. hopefully it helps

#13
Posted 04/03/2012 03:58 PM   
Scroll To Top