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

Rendering Device Vulkan Error : Dispatch amount of Y compute groups (536870913) is larger than device limit (65535) #85094

Closed
Sheppowed opened this issue Nov 19, 2023 · 9 comments

Comments

@Sheppowed
Copy link

Godot version

4.2.beta

System information

Windows 10 64 bits, Godot 4.2 Beta, Vulkan (Forward +), Nvidia RTX 3060 , Ryzen 5 3600

Issue description

I'm still trying to figure out what's triggering this problem, it's a bit random I think.

When it happens, as soon as I collide with an object, the screen turns gray and this error is dropped in the output:

E 0:01:44:0119 RenderingDeviceVulkan::compute_list_dispatch: Dispatch amount of Y compute groups (536870913) is larger than device limit (65535)
  <C++ Error> Condition "p_y_groups > limits.maxComputeWorkGroupCount[1]" is true.
  <Source C++> drivers\vulkan\rendering_device_vulkan.cpp:8140 @ RenderingDeviceVulkan::compute_list_dispatch()

unfortunately, I have no idea what it is , I have the impression that it happens when my head movement script is turned on, but I just can't understand why it happens and what the error itself means. I have the impression that it's more to do with the engine than with my script (which is just a s eries of position and rotation interpolations).

Here's a video of the problem : In this video, it seems that the problem is sometimes triggered when i uncrouch and my capsule collider slides sideways (because it's taller than the upper floor).

issue.mp4

Steps to reproduce

Can't really tell , sometimes the issue never appears

Minimal reproduction project

N/A

@Sheppowed
Copy link
Author

I'll try to make a project that could try to reproduce the bug and I'm going to put it here

@AThousandShips
Copy link
Member

Suspect this might be from:

int x_groups = (p_size - 1) / 8 + 1;
int y_groups = (p_size - 1) / 8 + 1;
RD::get_singleton()->compute_list_dispatch(compute_list, x_groups, y_groups, p_face_id > 9 ? 6 : 1);

If p_size - 1 overflows (i.e. if p_size == 0) the expression (p_size - 1) / 8 + 1, when clamped to 32 bits, is equal to 536870913

Could be from somewhere else but this one does stick out

@Sheppowed
Copy link
Author

while making the small project to reproduce the issue, i noticed the error (Dispatch amount of Y compute groups (536870913) is larger than device limit (65535) is only shown if a volumetric fog node is present inside the scene, but the issue (image disappears) still happens

@Sheppowed
Copy link
Author

okay , here is the project , let me explain a bit :

i re-used the code for my player movement , i succesfully reproduced the issue

I've put up a video where you can see how I proceed. Basically, I crouch under the edge (CTRL key on any key to crouch) and move with the ZSQD/WASD keys.

once under the ledge, I release crouch and as the collision box of the standing player is higher than the height of the ledge, my character is shifted to the side

by doing this several times in a row, after a while the problem appears, and it's when I'm up against a wall that it happens

I'm not going to lie, it's a bit of a weird test, but it's the only solution I've found to reproduce this bug.
my player's code is also available, it might give you an hint

Project.zip

Sans.titre.mp4

@Sheppowed
Copy link
Author

as far as i know it seems that the interpolations on the Y axis (for my head movement) can cause this issue, i'm not sure tho

@Sheppowed
Copy link
Author

i found the issue :

it is related to my player camera code, a value was returning a NaN value for some weird reasons , i fixed this issue and the problem doesn't happen again

I'm sorry I wasted your time on something that wasn't engine-related

@akien-mga
Copy link
Member

Well this still looks like something that may need to be handled in the renderer. We shouldn't let these ints wrap around like that.

@akien-mga akien-mga reopened this Nov 19, 2023
@clayjohn
Copy link
Member

I think this issue will be fixed by #80390

@akien-mga
Copy link
Member

Indeed, closing as duplicate of #80358 which seems to include this one too.

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

No branches or pull requests

4 participants