【问题标题】:How many dimensions for the grid can i use on cuda compute capability 2.0 card?我可以在 cuda 计算能力 2.0 卡上使用多少个网格维度?
【发布时间】:2011-10-15 20:26:49
【问题描述】:

我想使用 3D 网格进行 cuda 计算。此页面 [1] 或此答案 [2] 说我可以为此使用三个维度,但查询我的设备属性会得到以下信息:

   --- General Information for device 0 ---
Name:  Quadro 4000
Compute capability:  2.0
Clock rate:  950000
Device copy overlap:  Enabled
Kernel execution timeout :  Enabled
   --- Memory Information for device 0 ---
Total global mem:  2146631680
Total constant Mem:  65536
Max mem pitch:  2147483647
Texture Alignment:  512
   --- MP Information for device 0 ---
Multiprocessor count:  8
Shared mem per mp:  49152
Registers per mp:  32768
Threads in warp:  32
Max threads per block:  1024
Max thread dimensions:  (1024, 1024, 64)
Max grid dimensions:  (65535, 65535, 1)

如果我尝试在我的代码中使用 3D 网格,则没有任何反应:

__global__ void updateBuffer( ... )
{
  int x = blockIdx.x;
  int y = blockIdx.y;
  int z = threadIdx.x;

  int offset =
      x +
      y * width +
      z * width * height;

  buffer[offset] = ...;
}

__global__ void updateBuffer2( ... )
{
  int x = blockIdx.x;
  int y = blockIdx.y;
  int z = blockIdx.z;

  int offset =
      x +
      y * width +
      z * width * height;

  buffer[offset] = ...;
}

void callKerner() {
  dim3 blocks(extW,extH,1);
  dim3 threads(extD,1,1);

  dim3 blocks2(extW,extH,extD);
  dim3 threads2(1,1,1);


  updateBuffer<<<blocks,threads>>>( ... ); // works fine
  updateBuffer2<<<blocks2,threads2>>>( ... ); // nothing happens
}

那么是不是 3d 网格不适用于某些卡片?

[1]http://en.wikipedia.org/wiki/CUDA#Version_features_and_specifications [2]Maximum blocks per grid:CUDA

【问题讨论】:

  • 如果我提到我使用 cuda v3.0 可能会有所帮助

标签: cuda


【解决方案1】:

我通过安装最新的 nvidia 驱动程序并更新到 cuda 4.0 来修复它

【讨论】:

    【解决方案2】:

    这行有个线索:

    Max grid dimensions:  (65535, 65535, 1)
    

    【讨论】:

    • 是的,但为什么会这样,因为 [1] 和 [2] 说应该不是这样?
    猜你喜欢
    • 1970-01-01
    • 2016-01-04
    • 1970-01-01
    • 2015-05-10
    相关资源
    最近更新 更多