在CUDA 6.0提供的示例中,我运行以下编译命令,并输出错误:
foo@foo:/usr/local/cuda-6.0/samples/0_Simple/cdpSimpleQuicksort$ nvcc --cubin -I../../common/inc cdpSimpleQuicksort.cu
nvcc warning : The 'compute_10' and 'sm_10' architectures are deprecated, and may be removed in a future release.
cdpSimpleQuicksort.cu(105): error: calling a __global__ function("cdp_simple_quicksort") from a __global__ function("cdp_simple_quicksort") is only allowed on the compute_35 architecture or above
cdpSimpleQuicksort.cu(114): error: calling a __global__ function("cdp_simple_quicksort") from a __global__ function("cdp_simple_quicksort") is only allowed on the compute_35 architecture or above
2 errors detected in the compilation of "/tmp/tmpxft_0000241a_00000000-6_cdpSimpleQuicksort.cpp1.ii".然后,我将命令修改为以下内容,出现了新的失败:
foo@foo:/usr/local/cuda-6.0/samples/0_Simple/cdpSimpleQuicksort$ nvcc --cubin -I../../common/inc -gencode arch=compute_35,code=sm_35 cdpSimpleQuicksort.cu
cdpSimpleQuicksort.cu(105): error: kernel launch from __device__ or __global__ functions requires separate compilation mode
cdpSimpleQuicksort.cu(114): error: kernel launch from __device__ or __global__ functions requires separate compilation mode
2 errors detected in the compilation of "/tmp/tmpxft_000024f3_00000000-6_cdpSimpleQuicksort.cpp1.ii".这与我所使用的机器只有Compute2.1功能和构建工具阻塞我这一事实有任何关系吗?决议是什么..。我在文档中找不到任何可以清楚地处理此错误的内容。
我看了这的问题,然后.指向文档的链接根本没有帮助。我需要知道如何修改编译命令。
发布于 2014-04-24 21:38:26
看看这个cdpSimpleQuicksort项目附带的makefile。它显示了编译它所需的一些额外开关,这是由于CUDA的动态并行性(这基本上是您正在看到的第二组错误)。回到过去,研究makefile,看看您是否能够找到如何将一些编译命令与--cubin结合起来。
读者摘要版本是,这应该没有错误地编译:
nvcc --cubin -rdc=true -I../../common/inc -arch=sm_35 cdpSimpleQuicksort.cu尽管如此,您应该能够为任何类型的目标进行编译,但是您将无法在cc2.1架构上运行cdp代码。
cdp文档和这里
https://stackoverflow.com/questions/23280243
复制相似问题