您的位置:首页 > 其它

cuda8.0使用nvcc编译程序出现warning:The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated的解决办法

2016-12-30 15:46 615 查看
初学CUDA,使用的NVIDIA显卡是Tesla K80, 安装的是cuda8.0

写了一个简单的测试程序,使用nvcc编译,指令如下: nvcc cudaPrintDeviceInfo.cu -o cudaPrintDeviceInfo

本以为会很顺利地生成执行文件。但还是出现了warning:

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

查阅了一些资料,发现这只是提示build target 2.0, 2.1被弃用了。

如果不想让这些提示出现,只需要在编译时加上一个参数,表示基于自己显卡的计算能力选择build target即可。

Tesla K80支持CUDA compute ability 3.7, 因此在编译时使用如下命令:

nvcc -arch=sm_35 cudaPrintDeviceInfo.cu -o cudaPrintDeviceInfo

即可解决问题。

可参考: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#warp-examples-broadcast

其中Application Compatibility部分有如下解释:



YES!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐