Vulkan Compute - shader local size.

#1

Hello,

I have a bug related to the vulkan compute. In the compute shader, if set local size something like:

layout (local_size_x = 32, local_size_y = 32, local_size_z = 1) in;

The compute app works ok. But if set local_size_z greater than 1:

layout (local_size_x = 32, local_size_y = 32, local_size_z = 2) in;

The compute app freezes after the command buffer has been dispached (Linux Debian sid 4.18.10-2).
The situation on Windows is slightly different. If local_size_z greater than 1, the compute app does not freezes, but computational result is incorrect(all output buffer values are zero).

The Validation layer(VK_LAYER_LUNARG_standard_validation) was enabled on both OS (Linux and Windows).

Nvidia Geforce 1070ti
Driver Version: 410.78

This is simple compute app, that copy values from one buffer to another.
https://bitbucket.org/HiT__/compute-shader

Any ideas?

Best Regards.

#2

Answer - https://devtalk.nvidia.com/default/topic/1044337/vulkan/vulkan-compute-shader-local-size-bug-/

#3

For completeness, adding the answer here as well:


the error is on your end. The 1070 TI has, according to vulkan.gpuinfo.org, a physical device limit of 1536 for maxComputeWorkGroupInvocations. Your nonworking compute shader has a working group size of 32322=2048.

The required minimum for this limit is 128, so if you want to use a larger size, you need to check your device limit. If you want to adapt to your hardware, use specialization constants for the local size.