Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread group count is above the maximum allowed limit. Maximum allowed thread group count is 65535. #3

Open
SlimeQ opened this issue Jul 28, 2023 · 1 comment

Comments

@SlimeQ
Copy link

SlimeQ commented Jul 28, 2023

I'm trying to run this thing in Unity 2022.2.3 and getting this error out of the box with no changes:

Thread group count is above the maximum allowed limit. Maximum allowed thread group count is 65535.

From what I can tell, this is happening because m_threadGroupsPerGridCell is 125000 when clearing the grid:

m_commandBuffer.BeginSample("ClearGrid");
m_commandBuffer.DispatchCompute(m_computeShader, m_kernel_clearGrid, m_threadGroupsPerGridCell, 1, 1);
m_commandBuffer.EndSample("ClearGrid");

and that value is calculated based on values from the inspector

m_threadGroupsPerGridCell = Mathf.CeilToInt((gridX * gridY * gridZ) / 8f);

the grid appears to be set to 100x100x100, which pushes this value to 125000.

What I can't figure out is why the project is in this state; was there a change at some point that made the max thread count lower? Or was this some sort of typo or something?

@SlimeQ
Copy link
Author

SlimeQ commented Jul 28, 2023

If I had to guess what happened, I'd say someone was playing with the grid size and forgot to save the scene or something. If I drop it down to 64x64x64 then the thread count is like 30k and the sim works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant