Number of total threads, blocks, and grids on my GPU.

点点圈 提交于 2019-12-23 16:34:32

问题


For the NVIDIA GEFORCE 940mx GPU, Device Query shows it has 3 Multiprocessor and 128 cores for each MP.

Number of threads per multiprocessor=2048

So, 3*2048=6144.ie. total 6144 threads in GPU.

6144/1024=6 ,ie. total 6 blocks. And warp size is 32.

But from this video https://www.youtube.com/watch?v=kzXjRFL-gjo i found that each GPU has limit on threads, but no limit on Number of blocks.

So i got confused with this. I would like to know

  1. How many total threads are in my GPU? Can we use all threads for execute a program?
  2. How many blocks and Grids are there?

回答1:


It appears the main source of your confusion is mixing up two completely different sets of limits:

  1. The maximum number of threads and blocks which can run concurrently on the GPU.
  2. The maximum number of threads and blocks which can be launched for a given kernel.

The numbers you quote (2048 threads per multiprocessor, three multiprocessors in total = 6144 threads represent the first set of limits. The numbers you show in your screenshot of the deviceQuery output:

  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)

define the limits of a given kernel launch. While they overlap somewhat, you can treat them as more or less separate. For a more thorough discussion of the practicalities of kernel launch parameters and block dimensions, see here.



来源:https://stackoverflow.com/questions/51035225/number-of-total-threads-blocks-and-grids-on-my-gpu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!