# Scheduling Thread Blocks

**URL:** <https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830>\
**Category:** CUDA Programming and Performance\
**Created:** [July 27, 2021, 9:16am UTC](https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830 "2021-07-27T09:16:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ho126jin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ho126jin](https://forums.developer.nvidia.com/u/ho126jin)\
**Post date:** [July 27, 2021, 9:16am UTC](https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830/1 "2021-07-27T09:16:17Z")

</div>

![image](https://global.discourse-cdn.com/nvidia/original/3X/9/a/9a1ca2fb29b847164e13413fbb0a5f131440a827.png)

> **[Turing Tuning Guide :: CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/turing-tuning-guide/index.html#sm-occupancy)**
>
> The programming guide to tuning CUDA Applications for GPUs based on the NVIDIA Turing Architecture.

I’m using Quadro RTX 6000 (Turing).

In the picture above, the maximum number of concurrent warps per SM is 32 means maximum threads per SM is 1024 right?

And

If the maximum number of thread blocks per SM is 16 , sum of 16 blocks’s threads on one SM should be 1024 or just need to have less than 1,024 threads on the only block currently running?

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [July 27, 2021, 2:33pm UTC](https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830/2 "2021-07-27T14:33:03Z")

</div>

> [@ho126jin](#):
>
> In the picture above, the maximum number of concurrent warps per SM is 32 means maximum threads per SM is 1024 right?

Yes, and this information is available to you already in the programming guide, in table 15.

> [@ho126jin](#):
>
> If the maximum number of thread blocks per SM is 16 , sum of 16 blocks’s threads on one SM should be 1024 or just need to have less than 1,024 threads on the only block currently running?

It means that you can have a maximum of 16 threadblocks currently executing in an SM. It does not abrogate other hardware limits. You are also limited (on that device) to a maximum of 1024 threads. Therefore, if you actually wanted to witness 16 threadblocks deposited on a single SM, those threadblocks could have no more than 64 threads. If you launched a kernel with 128 threads per block, you could witness at most 8 blocks on a single SM, even though the hardware limit for that value is 16.

This is the nature of occupancy. All relevant hardware limits must be satisfied.

---

<div class="post-metadata">

**Author:** ![ho126jin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ho126jin](https://forums.developer.nvidia.com/u/ho126jin)\
**Post date:** [July 28, 2021, 8:56am UTC](https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830/3 "2021-07-28T08:56:33Z")

</div>

Can blocks assigned by one SM be from different kernels?

Or only have blocks of the same kernel?

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [July 28, 2021, 10:39am UTC](https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830/4 "2021-07-28T10:39:03Z")

</div>

They can be from different kernels.

---

<div class="post-metadata">

**Author:** ![ho126jin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ho126jin](https://forums.developer.nvidia.com/u/ho126jin)\
**Post date:** [July 29, 2021, 6:19am UTC](https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830/5 "2021-07-29T06:19:55Z")

</div>

Then, the blocks execute in warp units.

Can warp of different blocks (different kernel) run on one SM at the same time?

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [July 29, 2021, 2:08pm UTC](https://forums.developer.nvidia.com/t/scheduling-thread-blocks/184830/6 "2021-07-29T14:08:47Z")

</div>

Yes. This is all assuming those kernels are issued from the same application/process, or that MPS is being used.
