首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何强制生成cubin文件以获得更高的计算版本

如何强制生成cubin文件以获得更高的计算版本
EN

Stack Overflow用户
提问于 2014-04-24 21:29:48
回答 1查看 399关注 0票数 0

在CUDA 6.0提供的示例中,我运行以下编译命令,并输出错误:

代码语言:javascript
复制
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".

然后,我将命令修改为以下内容,出现了新的失败:

代码语言:javascript
复制
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功能和构建工具阻塞我这一事实有任何关系吗?决议是什么..。我在文档中找不到任何可以清楚地处理此错误的内容。

我看了的问题,然后.指向文档的链接根本没有帮助。我需要知道如何修改编译命令。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-24 21:38:26

看看这个cdpSimpleQuicksort项目附带的makefile。它显示了编译它所需的一些额外开关,这是由于CUDA的动态并行性(这基本上是您正在看到的第二组错误)。回到过去,研究makefile,看看您是否能够找到如何将一些编译命令与--cubin结合起来。

读者摘要版本是,这应该没有错误地编译:

代码语言:javascript
复制
nvcc --cubin -rdc=true -I../../common/inc -arch=sm_35 cdpSimpleQuicksort.cu

尽管如此,您应该能够为任何类型的目标进行编译,但是您将无法在cc2.1架构上运行cdp代码。

cdp文档这里

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23280243

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档