C1060 GPU 的奇怪设备属性

Strange Device Properties of C1060 GPU

我是运行一段代码,可以简单地获取有关GPU的信息并将其打印出来。但是,我得到了非常奇怪(并且不断变化)的数字。代码只是一堆 cudaDeviceProperties 打印。

输出:

Global memory:   0mb
Shared memory:   136723055446kb
Constant memory: 136723055540kb
Block registers: 1359818672
Warp size:         32597
Threads per block: 1359826784
Max block dimensions: [ 32597, 1357152712, 32597 ]
Max grid dimensions:  [ 1359925824, 32597, -1220823104 ]

None 这些数字是有道理的,这使我认为 card/drivers/OS.

可能有问题

Nvidia-SMI:340.93。 OS: Ubuntu 14.04.

对于此处可能发生的事情,我们将不胜感激。

cudaDeviceProp props;
cudaGetDeviceProperties(&props, i);
cout << i << ": " << props.name << ": " << props.major << "." << props.minor << endl;
cout << "  Global memory:   " << props.totalGlobalMem / mb << "mb" << endl;
cout << "  Shared memory:   " << props.sharedMemPerBlock / kb << "kb" << endl;
cout << "  Constant memory: " << props.totalConstMem / kb << "kb" << endl;
cout << "  Block registers: " << props.regsPerBlock << endl << endl;

cout << "  Warp size:         " << props.warpSize << endl;
cout << "  Threads per block: " << props.maxThreadsPerBlock << endl;
cout << "  Max block dimensions: [ " << props.maxThreadsDim[0] << ", " << props.maxThreadsDim[1]  << ", " << props.maxThreadsDim[2] << " ]" << endl;
cout << "  Max grid dimensions:  [ " << props.maxGridSize[0] << ", " << props.maxGridSize[1]  << ", " << props.maxGridSize[2] << " ]" << endl;
cout << endl;

在这种特殊情况下,问题恰好出在代码生成上。 C1060 是具有计算能力的旧 gpu。 1.3. CUDA 6.5 默认(可能)为更新的架构生成代码,但通过在使用 nvcc 编译时显式声明 --gpu-arch=compute_13 解决了这个问题。希望这对遇到此问题的任何人有所帮助。