相关疑难解决方法(0)

CUDA与我的gcc版本不兼容

我在编译CUDA SDK附带的一些示例时遇到了麻烦.我已经安装了开发人员驱动程序(版本270.41.19)和CUDA工具包,最后是SDK(两者都是4.0.17版本).

最初它根本没有编译:

error -- unsupported GNU version! gcc 4.5 and up are not supported!
Run Code Online (Sandbox Code Playgroud)

我发现81行负责:/usr/local/cuda/include/host_config.h并将其更改为:

//#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
Run Code Online (Sandbox Code Playgroud)

从那时起,我只得到了一些编译的例子,它停止了:

In file included from /usr/include/c++/4.6/x86_64-linux-gnu/bits/gthr.h:162:0,
             from /usr/include/c++/4.6/ext/atomicity.h:34,
             from /usr/include/c++/4.6/bits/ios_base.h:41,
             from /usr/include/c++/4.6/ios:43,
             from /usr/include/c++/4.6/ostream:40,
             from /usr/include/c++/4.6/iterator:64,
             from /usr/local/cuda/include/thrust/iterator/iterator_categories.h:38,
             from /usr/local/cuda/include/thrust/device_ptr.h:26,
             from /usr/local/cuda/include/thrust/device_malloc_allocator.h:27,
             from /usr/local/cuda/include/thrust/device_vector.h:26,
             from lineOfSight.cu:37:
/usr/include/c++/4.6/x86_64-linux-gnu/bits/gthr-default.h:251:1: error: pasting         "__gthrw_" and "/* Android's C library does not provide pthread_cancel, check …
Run Code Online (Sandbox Code Playgroud)

debian gcc cuda

86
推荐指数
8
解决办法
11万
查看次数

指定 NVCC 用于编译主机代码的编译器

运行 nvcc 时,它始终使用 Visual C++ 编译器 ( cl.exe)。我怎样才能让它使用GCC编译器?

CC环境变量设置为 并gcc没有修复它。我在可执行文件帮助输出中也找不到任何选项。

windows compiler-construction cuda nvcc

5
推荐指数
1
解决办法
2306
查看次数

标签 统计

cuda ×2

compiler-construction ×1

debian ×1

gcc ×1

nvcc ×1

windows ×1