问题描述
在 VS 社区中创建 CUDA 项目时运行默认生成的内核时出现以下错误:
I am getting the following error when running the default generated kernel when creating a CUDA project in VS Community:
addKernel launch failed: invalid device function
addWithCuda failed!
我搜索了如何解决它,发现必须更改Project->Properties->CUDA C/C++->Device->Code Generation
(默认值[architecture, code] 是 compute_20,sm_20
),但我找不到我的显卡 (GeForce 8400 GS) 所需的值
I searched for how to solve it, and found out that have to change the Project->Properties->CUDA C/C++->Device->Code Generation
(default values for [architecture, code] are compute_20,sm_20
), but I couldn't find the values needed for my graphic card (GeForce 8400 GS)
网上是否有[架构,代码]的列表,或者是否可以通过任何命令获取它们?
Is there any list on the net for the [architecture, code] or is it possible to get them by any command?
推荐答案
compute_XX
和 sm_XX
中的数值是 CUDA 设备的计算能力 (CC).
The numeric value in compute_XX
and sm_XX
are the Compute Capability (CC) for your CUDA device.
您可以查找此链接 http://en.wikipedia.org/wiki/CUDA#Supported_GPUs 获取(可能不完整)GPU 列表和相应的 CC.
You can lookup this link http://en.wikipedia.org/wiki/CUDA#Supported_GPUs for a (maybe not complete) list of GPUs and there corresponding CC.
您相当旧的 8400 GS(当我没记错的时候)拥有支持 CC 1.1 的 G86 芯片.
Your quite old 8400 GS (when I remember correctly) hosts a G86 chip which supports CC 1.1.
所以你要改成compute_11,sm_11
`
这篇关于CUDA - 无效的设备功能,如何知道[架构,代码]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!