【问题标题】:Discovering my GPU capabilities发现我的 GPU 能力
【发布时间】:2013-10-02 11:57:42
【问题描述】:

我正在尝试了解我的 GPU 的内存组织是如何工作的。

根据下表列出的技术规范,我的 GPU 可以有 8 个活动块/SM 和 768 个线程/SM。基于此,我认为为了利用上述优势,每个块应该有 96 个(=768/8)线程。我认为最近的具有这个线程数的块是 9x9 块,81 个线程。使用 8 个块可以在一个 SM 中同时运行这一事实,我们将拥有 648 个线程。剩下的 120 (= 768-648) 呢?

我知道这些想法有问题。一个简单的例子描述了最大 SM 线程数、每个块的最大线程数和基于我的 GPU 规格的 warp 大小之间的联系,这将非常有帮助。

Device 0: "GeForce 9600 GT"
      CUDA Driver Version / Runtime Version          5.5 / 5.0
      CUDA Capability Major/Minor version number:    1.1
      Total amount of global memory:                 512 MBytes (536870912 bytes)
      ( 8) Multiprocessors x (  8) CUDA Cores/MP:    64 CUDA Cores
      GPU Clock rate:                                1680 MHz (1.68 GHz)
      Memory Clock rate:                             700 Mhz
      Memory Bus Width:                              256-bit
      Max Texture Dimension Size (x,y,z)             1D=(8192), 2D=(65536,32768), 3D=(2048,2048,2048)
      Max Layered Texture Size (dim) x layers        1D=(8192) x 512, 2D=(8192,8192) x 512
      Total amount of constant memory:               65536 bytes
      Total amount of shared memory per block:       16384 bytes
      Total number of registers available per block: 8192
      Warp size:                                     32
      Maximum number of threads per multiprocessor:  768
      Maximum number of threads per block:           512
      Maximum sizes of each dimension of a block:    512 x 512 x 64
      Maximum sizes of each dimension of a grid:     65535 x 65535 x 1
      Maximum memory pitch:                          2147483647 bytes
      Texture alignment:                             256 bytes
      Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
      Run time limit on kernels:                     Yes
      Integrated GPU sharing Host Memory:            No
      Support host page-locked memory mapping:       Yes
      Alignment requirement for Surfaces:            Yes
      Device has ECC support:                        Disabled
      Concurrent kernel execution:                   No
      Device supports Unified Addressing (UVA):      No
      Device PCI Bus ID / PCI location ID:           1 / 0   

【问题讨论】:

  • 你读过这篇文章吗? stackoverflow.com/questions/17816136/…
  • 从我从这篇文章中读到的内容中,我了解到每个 SM 可以处理不同数量的块,这些块更小/等于可以在一个 SM 上运行的最大块数。这是否意味着这8个块都可以有512个线程? Warp 调度程序是否组织这些线程 (512x8) 的执行,即使这个线程数可能超过 GPU 上可以同时运行的最大线程数?

标签: cuda gpu


【解决方案1】:

您可以在以下 cuda 编程指南中找到您设备的技术规格,而不是 cuda 示例程序的输出。

http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#compute-capabilities

从硬件的角度来看,我们通常会尝试最大化每个多处理器 (SM) 的 warp 占用率,以获得最大的性能。最大占用受限于 3 种硬件资源:#warp/SM、#register/SM 和#shared memory/SM。

您可以在您的 cuda 安装目录中尝试以下工具来了解如何进行计算。它将让您更清楚地了解#threads/SM、#threads/block、#warp/SM等之间的联系。

$CUDA_HOME/tools/CUDA_Occupancy_Calculator.xls

【讨论】:

    猜你喜欢
    • 2015-01-07
    • 1970-01-01
    • 2012-06-12
    • 1970-01-01
    • 2017-09-26
    • 2023-02-24
    • 1970-01-01
    • 2020-01-31
    • 2011-09-20
    相关资源
    最近更新 更多