wgpu
wgpu copied to clipboard
Work Group Size Error is Confusing
I am working on a project involving a compute shader on MacOS and have set the local work group size in the shader like so:
@workgroup_size(8, 8, 8)
However, this results in an error that reads:
shader entry point current workgroup size [8, 8, 8] must be less or equal to [256, 256, 64] of total 256
After talking to some folks on Matrix, it seems that what the error is trying to say is: the total number of invocations in a work group cannot exceed 256. In my case, the total # of invocations is 8x8x8 = 512, which is greater than 256, so it fails to compile. I'm not sure how to best word the error message, but I think it's a little confusing as-is, since [8, 8, 8] is clearly less than [256, 256, 64] across all dimensions.
Idea for improvement: add "of total 512" to the first half — show the value derived from the input — so that it is immediately obvious what is too big because it parallels the second half specifying the limits.
"Total" doesn't seem like a great description but I don't have any suggestions I like very much. "Product" would specify how the number was gotten better? What if the dimensions were printed with "×"es between?
I would like to fix this.
Building on top of the idea by @kpreid. Would a message like shader entry point current workgroup size [8, 8, 8] of total 512 must be less or equal to [256, 256, 64] and of total 256
be an improvement? @mwalczyk
By the way, I would be motivated to work on a few PRs for the Hacktoberfest challenge. @cwfitzgerald would you be open to adding the “hacktoberfest” topic to the repo? https://hacktoberfest.com/participation/#maintainers
I've went ahead and proposed #3139.
The idea from @kpreid is definitely an improvement to the current message. If anybody shares new ideas, we can improve further easily....
This issue can be closed because #3139 was merged to master. @cwfitzgerald