我的环境是
我无法弄清楚为什么我的GPU因遇到"无法纠正的ECC错误"而崩溃.仅当我使用512个或更多线程时才会发生此错误.我不能发布内核,但我会尝试描述它的作用.
通常,内核负责多个参数,并产生由所述螺纹的尺寸,M和其他数定义2个复杂matricies,N.,返回的矩阵将是大小为M×N的.典型配置为512x512,但每个数字都是独立的,可以向上或向下变化.当数字为256x256时,内核可以工作.
每个线程(内核)基于线程id(即大小为999xM)从2D阵列中提取999大小的向量,然后循环通过输出矩阵的行(0 ... N-1)进行计算.计算许多中间参数,仅使用+ - * /
运算符中的pow,sin和cos .要计算其中一个输出矩阵,需要执行一个额外的循环来总结先前提取的999向量的贡献.此循环执行一些中间计算以确定允许贡献的值的范围.然后通过由计算的分数值的cos和正弦值确定的因子来缩放贡献.这是它崩溃的地方.如果我坚持使用常量值或1.0或任何其他值,内核执行没有问题.但是,当只包含一个调用(cos或sine)时,内核崩溃.
一些伪代码如下:
kernel()
{
/* Extract 999 vector from 2D array 999xM - one 999 vector for each thread. */
for (int i = 0; i < 999; i++)
{
.....
}
/* Cycle through the 2nd dimension of the output matricies */
for (int j = 0; j < N; j++)
{
/* Calculate some intermediate variables */
/* Calculate the real and imaginary components of the first output matrix */
/* real = cos(value), imaginary = sin(value) */
/* Construct the first output matrix from some intermediate variables and the real and imaginary components */
/* Calculate some more intermediate variables */
/* cycle through the extracted vector (0 .. 998) */
for (int k = 0; k < 999; k++)
{
/* Calculate some more intermediate variables */
/* Determine the range of allowed values to contribute to the second output matrix. */
/* Calculate the real and imaginary components of the second output matrix */
/* real = cos(value), imaginary = sin(value) */
/* This is were it crashes, unless real and imaginary are constant values (1.0) */
/* Sum up the contributions of the extracted vector to the second output matrix */
}
/* Construct the Second output matrix from some intermediate variables and the real and imaginary components */
}
}
Run Code Online (Sandbox Code Playgroud)
我认为这可能是由于寄存器限制,但占用计算器表明情况并非如此,我使用的是少于32,768个寄存器和512个线程.任何人都可以提出任何关于这可能是什么原因的建议吗?
这是ptasx信息:
ptxas info : Compiling entry function '_Z40KerneliidddddPKdS0_S0_S0_iiiiiiiiiPdS1_S1_S1_S1_S1_S1_S1_S1_S1_' for 'sm_20'
ptxas info : Function properties for _Z40KerneliidddddPKdS0_S0_S0_iiiiiiiiiPdS1_S1_S1_S1_S1_S1_S1_S1_S1_
8056 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Function properties for __internal_trig_reduction_slowpathd
40 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 53 registers, 232 bytes cmem[0], 144 bytes cmem[2], 28 bytes cmem[16]
tmpxft_00001d70_00000000-3_MexFunciton.cudafe1.cpp
Run Code Online (Sandbox Code Playgroud)
"无法纠正的ECC错误"通常是指硬件故障.ECC是纠错码,一种检测和纠正存储在RAM中的位错误的方法.一只流浪宇宙射线可以破坏存储在RAM中每一次的伟大而一位,但"ECC不能纠正的错误"表明,几位正走出RAM存储"错误"的 - 太多的ECC恢复原始位值.
这可能意味着您的GPU设备内存中有一个坏的或边缘的RAM单元.
任何类型的边缘电路都不会100%失效,但在大量使用的压力下 - 以及相关的温度升高 - 更容易失效.
有诊断工具四处传播到压力测试的所有RAM银行个人电脑的确认或查明该芯片是失败的,但我不知道一个模拟的测试GPU的设备RAM银行.
如果您可以访问具有类似功能的GPU的另一台计算机,请尝试在该计算机上运行您的应用程序以查看其行为方式.如果您没有在第二台机器上收到ECC错误,这确认问题几乎肯定在第一台机器的硬件中.如果您在第二台计算机上遇到相同的ECC错误,请忽略我在此处写的所有内容并继续查找您的软件错误.除非您的代码实际上导致硬件损坏,否则两台机器具有相同硬件故障的可能性非常小.
归档时间: |
|
查看次数: |
6139 次 |
最近记录: |