# Block and thread configuration

**URL:** <https://forums.developer.nvidia.com/t/block-and-thread-configuration/2602>\
**Category:** CUDA Programming and Performance\
**Created:** [February 11, 2008, 3:40pm UTC](https://forums.developer.nvidia.com/t/block-and-thread-configuration/2602 "2008-02-11T15:40:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philprattszeliga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@philprattszeliga](https://forums.developer.nvidia.com/u/philprattszeliga)\
**Post date:** [February 11, 2008, 3:40pm UTC](https://forums.developer.nvidia.com/t/block-and-thread-configuration/2602/1 "2008-02-11T15:40:35Z")

</div>

Hello,

I have tried to do the following and I get an invalid configuration error.

dim3 grid( 5, 1, 1);  
dim3 threads( 10, 128, 1);

while this works fine

dim3 grid( 5, 1, 1);  
dim3 threads( 10, 1, 1);

Why does the top not work? Is the answer dependant on the size of the kernel I run? The GPU docs say I need to try and make as many threads as I can to get the best perfomance, but this is not launching!

---

<div class="post-metadata">

**Author:** ![mfatica](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mfatica](https://forums.developer.nvidia.com/u/mfatica)\
**Post date:** [February 11, 2008, 3:47pm UTC](https://forums.developer.nvidia.com/t/block-and-thread-configuration/2602/2 "2008-02-11T15:47:58Z")

</div>

The maximum number of threads in a block (as written in the manual…) is 512.  
You are using 1280 in the first case when you get the configuration error.

---

<div class="post-metadata">

**Author:** ![philprattszeliga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@philprattszeliga](https://forums.developer.nvidia.com/u/philprattszeliga)\
**Post date:** [February 11, 2008, 3:54pm UTC](https://forums.developer.nvidia.com/t/block-and-thread-configuration/2602/3 "2008-02-11T15:54:22Z")

</div>

Oh okay, thank you.
