# Maximum block per grid

**URL:** <https://forums.developer.nvidia.com/t/maximum-block-per-grid/246841>\
**Category:** CUDA Programming and Performance\
**Tags:** cuda\
**Created:** [March 21, 2023, 10:19am UTC](https://forums.developer.nvidia.com/t/maximum-block-per-grid/246841 "2023-03-21T10:19:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bansalgarish](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bansalgarish](https://forums.developer.nvidia.com/u/bansalgarish)\
**Post date:** [March 21, 2023, 10:19am UTC](https://forums.developer.nvidia.com/t/maximum-block-per-grid/246841/1 "2023-03-21T10:19:09Z")

</div>

No of thread blocks  
queried the device properties. Is the maximum number of blocks per grid in the x, y and z:  
Max grid size, dim(0): 2147483647  
Max grid size, dim(1): 65535  
Max grid size, dim(2): 65535  
?

Does this mean in dim[0], could have a maximum of 2147483647 blocks and dim[1] can have 100 and dim[2] can have 100 with 1024 threads per block

Does this mean i have 2147483647×100×100×1024 threads🤨

---

<div class="post-metadata">

**Author:** ![striker159](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@striker159](https://forums.developer.nvidia.com/u/striker159)\
**Post date:** [March 21, 2023, 1:20pm UTC](https://forums.developer.nvidia.com/t/maximum-block-per-grid/246841/2 "2023-03-21T13:20:09Z")

</div>

yes. but those are logical threads. Only up to 2048 \* number\_of\_sm threads will run simultaneously.

---

<div class="post-metadata">

**Author:** ![bansalgarish](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bansalgarish](https://forums.developer.nvidia.com/u/bansalgarish)\
**Post date:** [March 21, 2023, 2:41pm UTC](https://forums.developer.nvidia.com/t/maximum-block-per-grid/246841/3 "2023-03-21T14:41:56Z")

</div>

Ok👍 ,but still preety cool😁

---

<div class="post-metadata">

**Author:** ![2249256431](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@2249256431](https://forums.developer.nvidia.com/u/2249256431)\
**Post date:** [March 23, 2023, 5:10am UTC](https://forums.developer.nvidia.com/t/maximum-block-per-grid/246841/5 "2023-03-23T05:10:27Z")

</div>

![image](https://global.discourse-cdn.com/nvidia/original/3X/d/c/dcc52c8f282fe0f79f8c1b5f0716b5eccf700d4a.png)  
i guess it’s depends on your device properties and the occupied register of your algo;  
3070ti for laptop

---

<div class="post-metadata">

**Author:** ![Greg](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/greg/32/14043_2.png) [@Greg](https://forums.developer.nvidia.com/u/Greg)\
**Post date:** [March 24, 2023, 3:19am UTC](https://forums.developer.nvidia.com/t/maximum-block-per-grid/246841/6 "2023-03-24T03:19:58Z")

</div>

Yes, you can launch an enormous grid. If you launch a grid with max blocks in the X direction with each block having 1024 threads even a null block will likely take minutes. If you apply max Y and Z the GPU will physically stop working before the grid finishes.

MAX\_THREADS\_PER\_BLOCK has been 1024 since CC 3.0.  
MAX\_THREADS\_PER\_MULTIPROCESSOR changes.

- CC3.0 - CC 9.0 2048 except
- CC7.5 1024 Turing TU1xx
- CC8.6/8.7 1536 Ampere GA10x (not GA100)

In an application it is best to query the device attributes. The CUDA C++ Programming Guide Compute Capability section has a table showing the values for all supported GPUs (Maximum number of resident threads per SM).
