简体   繁体   English

Cuda不支持的GPU架构Eclipse Nsight

[英]Cuda Unsupported gpu architecture Eclipse Nsight

I try to create a new project with Eclipse Nsight but when I build the project I get: 我尝试使用Eclipse Nsight创建一个新项目,但是在构建该项目时,我得到了:

nvcc fatal   : Unsupported gpu architecture 'compute_21'. 
In build setting i use Generate GPU code 2.1. The command build that Eclipse launches is:

Building file: ../src/prova.cu
Invoking: NVCC Compiler
/usr/local/cuda-5.5/bin/nvcc -G -g -O0 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=sm_21 -odir "src" -M -o "src/prova.d" "../src/prova.cu"
/usr/local/cuda-5.5/bin/nvcc --compile -G -O0 -g -gencode arch=compute_20,code=compute_20 -gencode arch=compute_20,code=compute_21 -gencode arch=compute_20,code=sm_20  -x cu -o  "src/prova.o" "../src/prova.cu"

If i change code=compute_21 with code=compute_20 I don't have any errors. 如果我改变code=compute_21code=compute_20我没有任何错误。 How can I change this in Eclipse Nsight? 如何在Eclipse Nsight中更改此设置?

The arch command specifies a virtual architecture that will be used to generate the intermediate ptx. arch命令指定将用于生成中间ptx的虚拟体系结构。

The code command specifies the real architecture for which the code will be generated, either real executable code or PTX real-architecture-specific code. code命令指定将为其生成代码的实际体系结构,可以是实际可执行代码,也可以是PTX实际体系结构特定的代码。

compute_21 doesn't exist as a virtual architecture in both of them. compute_21 不存在作为在他们两人的虚拟架构。 If you want code for the real 21 architecture use arch=compute_20,code=sm_21 如果要使用真正的21架构的代码,请使用arch=compute_20,code=sm_21


So it's a configuration problem; 因此,这是一个配置问题; try with the Nsight import wizard for CUDA samples (source: https://devtalk.nvidia.com/default/topic/490324/issue-with-gencode-and-compute_21-results-in-unsupported-gpu-architecture/ ) and see if the problem persists. 尝试使用Nsight导入向导获取CUDA示例 (源: https : //devtalk.nvidia.com/default/topic/490324/issue-with-gencode-and-compute_21-results-in-unsupported-gpu-architecture/ )查看问题是否仍然存在。

I installed the latest CUDA toolkit available for Fedora 19 (cuda_5.5.22_linux_64.run) and experienced the same issue. 我安装了适用于Fedora 19的最新CUDA工具包(cuda_5.5.22_linux_64.run),并遇到了相同的问题。

I think the problem was that I had changed the default install location. 我认为问题是我已更改了默认安装位置。 After reinstalling the CUDA toolkit in the default location (/usr/local/cuda-5.5) and deleting the cuda-workspace directory to let Eclipse Nsight recreate it, the problem has gone. 在默认位置(/usr/local/cuda-5.5)上重新安装了CUDA工具包并删除了cuda-workspace目录以使Eclipse Nsight重新创建它之后,问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM