Sign in to follow this  

Compute Threads

Recommended Posts

Just started reading up on compute shaders but the author of this book as well as an nvidia slide seemed to brush off how these Thread Group and Num Threads works.

 

They stated that 32 threads will usually run concurrently. Not groups, but threads.

 

If I have a 1920x1080 image, and I simply want to add 1 to each pixel.

I could have (1,1,1) thread groups, and (1920,1080,1) number of threads? Why is this good/bad.

I could have (32,32,1) thread groups, what would my # of threads be?  Wouldnt it have to be (1920/32, 1080/32, 1) to make sure it hits all pixels?

What about the case of a texture that is 33x33? How would you have to lay out threads and thread groups in that case? Or does it have more to do with the algorithm itself on grouping things based on the algorithm?

Edited by dpadam450

Share this post


Link to post
Share on other sites

On the hardware side:
AMD compute units always run 64 threads at once.
NVidia compute units run 32 threads at once.
Intel compute units run 8 threads at once.
So - for good performance across all hardware, you should try to make your shader's thread-group sizes a multiple of 64.

 

That's only true for one (or a few) specific hardware generation. You have to check the execution units count per compute unit per gpu type. There is a high amount of variance across different generations.

 

For example, when NVidia rolled out Kepler, they suddenly increased the simd count of the execution unit to 192, increasing the effectiveness of typical game shaders, but severely crippling the generic, compute workloads. That's why you had lots of people sticking to 580s when doing computing, even if the 680 series were out.

Share this post


Link to post
Share on other sites

That's only true for one (or a few) specific hardware generation. You have to check the execution units count per compute unit per gpu type. There is a high amount of variance across different generations.

Actually IIRC it's been like that since unified shaders were introduced. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this