使用Nvidia Nsight生成可重定位设备代码 [英] Generating Relocatable Device Code using Nvidia Nsight
问题描述
我正在尝试在CUDA上编译一个动态并行性示例,当我尝试对其进行编译时,会给出错误提示,
I'm trying to compile a dynamic parallelism example on CUDA and when i try to compile it gives and error saying,
内核需要单独的编译模式
后来发现我必须将-relocabletable-device-code
标志设置为 true
.但是,在Nsight Eclipse中是否要设置一个标志,以使将 relocabletable-device-code
设置为 true
?
Later found that I have to set the --relocatable-device-code
flag to true
. But, is there a flag to set in order to make the set relocatable-device-code
to true
in Nsight Eclipse?
推荐答案
如果您不使用makefile项目,您可以从菜单开始,在以下位置更改传递给Nsight项目的 nvcc
的选项.
If you are not using makefile project,
you could change the options passed to nvcc
of a Nsight project at the following position, starting from the menu.
项目-属性-生成-设置-工具设置-NVCC编译器
Project - Properties - Build - Settings - Tool Settings - NVCC Compiler
由于Nsight不提供rdc选项供您检查,因此您可以直接将"Commnad"更改为
As Nsight does not provide a rdc option for you to check, you could directly change 'Commnad' from
nvcc
到
nvcc -rdc=true
或从以下位置更改命令行模式"
or change 'Command line pattern' from
${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX} ${OUTPUT} ${INPUTS}
到
${COMMAND} ${FLAGS} -rdc=true ${OUTPUT_FLAG} ${OUTPUT_PREFIX} ${OUTPUT} ${INPUTS}
第二个更好.
您可能还希望仅针对所有配置"而不是调试"或发布"进行更改.
You may also want to change this for 'All configurations' rather than 'Debug' or 'Release' only.
您应该按照评论中@RobertCrovella的说明进行操作.这是官方的方式.
You should follow @RobertCrovella's instructions in the comment. It is the official way.
这篇关于使用Nvidia Nsight生成可重定位设备代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!