Beta 4: huge bug with compute kernel (radar 21931401)

All my compute kernels, that work with beta 3, are now blocked at runtime with this error :


failed assertion `total used threadgroupMemoryLength(34816) must be <= 32768.


None of them exceed this limit ! In fact, every time I try to set a threadgroup buffer with setThreadgroupMemoryLength, even with a very small threadgroup buffer, this error occurs. Thus, compute kernels are totally unusable !


Does anybody else have the same issue ?


By the way, the buffer size are now restricted to 256 MB... This is not the case with OpenCL...


---- Edit -----


The compute kernels are totally blocked by this assertion... Something like :


assert(length + limit <= limit)


That, in my opinion, can not be solved on earth...

The problem seems to be in the drivers, as Xcode beta 3 (and the previous framework) doesn't solve it.


Do we have to wait 2 weeks for beta 5 ?!!

---- Edit 2 -----


We have tested on a last 2013 21" iMac with Nvidia GeForce GT 750M, and there is no problem !


---- Workaround -----


You can (temporarily) disable the "Metal API validation" into the Edit Scheme / Options panel.

I tried to reduce the size of a threadgroup buffer of a simple kernel to the minimum... With a length < 32 bytes, I've got:


threadgroupMemoryLength(16) must be >= 32 at threadgroupMemory binding at index 0 for localBBox[0].'


So, I set this size to 32 bytes, and I've got :


failed assertion `total used threadgroupMemoryLength(32800) must be <= 32768.'


As a conclusion, no way to use the threadgroup buffers !

Ho... Just a guess, but it seems that the wrong report of the memory size of the threadgroup in the assertion message is exactly the effective size of the threadgroup buffer + 32768, that is, here... the limit of available threadgroup memory ! 😝

Are you declaring any threadgroup buffers inside your compute shader code? Those count as a memory allocation too.

For example:


threadgroup struct point points[512];

There was a bug, and it was solved by a previous beta...

Beta 4: huge bug with compute kernel (radar 21931401)
 
 
Q