【问题标题】:Crash with thrust::min_element on thrust::device_vector (CUDA Thrust)在thrust::device_vector (CUDA Thrust) 上的thrust::min_element 崩溃
【发布时间】:2012-02-21 19:33:23
【问题描述】:

以下 CUDA Thrust 程序崩溃:

#include <thrust/device_vector.h>
#include <thrust/extrema.h>

int main(void)
{
  thrust::device_vector<int> vec;
  for (int i(0); i < 1000; ++i) {
    vec.push_back(i);
  }

  thrust::min_element(vec.begin(), vec.end());
}

我得到的例外是:

Unhandled exception at 0x7650b9bc in test_thrust.exe: Microsoft C++
exception:thrust::system::system_error at memory location 0x0017f178..

In `checked_cudaMemcpy()` in `trivial_copy.inl`.

如果我添加#include &lt;thrust/sort.h&gt; 并将min_element 替换为sort,它不会崩溃。

我在 Windows 7 64 位、compute_20、sm_20 (Fermi)、调试版本上使用 CUDA 4.1。在发布版本中,我没有遇到崩溃,并且 min_element 找到了正确的元素。

是我做错了什么,还是 Thrust 中存在错误?

【问题讨论】:

    标签: cuda thrust


    【解决方案1】:

    我可以使用针对 Compute Capability 2.0 的调试模式(即nvcc -G0 -arch=sm_20)重现该错误。该错误不会在发布模式或针对 Compute Capability 1.x 设备时重现,这通常表明代码生成问题而不是库中的错误。无论问题出在哪里,我都鼓励你submit a bug report,这样这个问题就会得到应有的关注。同时,我建议在经过更严格测试的发布模式下编译。

    【讨论】:

    • 我已经提交了一个错误报告。 #72796.
    • @RogerDahl 我在哪里可以找到该错误报告?当我搜索错误时,nvdeveloper 网站(尽管它说所有错误都是公开可见的)没有返回任何结果
    • @flipchart 注册后我也找不到该错误。但我确实收到了一位 NVIDIA 工程师的电子邮件,说他们已经复制了它,并且已经转发给了相应的团队。
    • NVIDIA 已通知我此问题已在 CUDA 4.2 中修复。
    猜你喜欢
    • 1970-01-01
    • 2011-08-21
    • 1970-01-01
    • 2016-03-04
    • 1970-01-01
    • 2014-09-11
    • 2016-01-18
    • 2011-01-24
    • 2013-06-25
    相关资源
    最近更新 更多