2014-12-05 156 views
-1

我在Windows 7 Pro 32上安装了NVIDIA GeForce 8500 GT,并且在CUDAC中我的项目出现问题。我已经安装了所有软件包和VS2012 Pro。我从Cuda 6.5的模板创建新的项目...编译它和..“无效的设备功能”。 从歌厅Windows启动PDF我已阅读,我可以deviceQuery.exe chceck CUDA ..所以我做到了这一点:Cuda编译示例

deviceQuery.exe Starting... 

CUDA Device Query (Runtime API) version (CUDART static linking) 

Detected 1 CUDA Capable device(s) 

Device 0: "GeForce 8500 GT" 
    CUDA Driver Version/Runtime Version   6.5/6.5 
    CUDA Capability Major/Minor version number: 1.1 
    Total amount of global memory:     512 MBytes (536870912 bytes) 
    (2) Multiprocessors, ( 8) CUDA Cores/MP:  16 CUDA Cores 
    GPU Clock rate:        1570 MHz (1.57 GHz) 
    Memory Clock rate:        400 Mhz 
    Memory Bus Width:        128-bit 
    Maximum Texture Dimension Size (x,y,z)   1D=(8192), 2D=(65536, 32768), 3D=(2048, 2048, 2048) 
    Maximum Layered 1D Texture Size, (num) layers 1D=(8192), 512 layers 
    Maximum Layered 2D Texture Size, (num) layers 2D=(8192, 8192), 512 layers 
    Total amount of constant memory:    65536 bytes 
    Total amount of shared memory per block:  16384 bytes 
    Total number of registers available per block: 8192 
    Warp size:          32 
    Maximum number of threads per multiprocessor: 768 
    Maximum number of threads per block:   512 
    Max dimension size of a thread block (x,y,z): (512, 512, 64) 
    Max dimension size of a grid size (x,y,z): (65535, 65535, 1) 
    Maximum memory pitch:       2147483647 bytes 
    Texture alignment:        256 bytes 
    Concurrent copy and kernel execution:   Yes with 1 copy engine(s) 
    Run time limit on kernels:      Yes 
    Integrated GPU sharing Host Memory:   No 
    Support host page-locked memory mapping:  Yes 
    Alignment requirement for Surfaces:   Yes 
    Device has ECC support:      Disabled 
    CUDA Device Driver Mode (TCC or WDDM):   WDDM (Windows Display Driver Model) 
    Device supports Unified Addressing (UVA):  No 
    Device PCI Bus ID/PCI location ID:   1/0 
    Compute Mode: 
    < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > 

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.5, CUDA Runtime Version = 6.5, NumDevs = 1, Device0 = GeForce 8500 GT 
Result = PASS 

所以PASS!那么什么错误..?接下来我做了bandwidthTest

[CUDA Bandwidth Test] - Starting... 
Running on... 

Device 0: GeForce 8500 GT 
Quick Mode 

Host to Device Bandwidth, 1 Device(s) 
PINNED Memory Transfers 
    Transfer Size (Bytes) Bandwidth(MB/s) 
    33554432   1346.5 

Device to Host Bandwidth, 1 Device(s) 
PINNED Memory Transfers 
    Transfer Size (Bytes) Bandwidth(MB/s) 
    33554432   1556.9 

Device to Device Bandwidth, 1 Device(s) 
PINNED Memory Transfers 
    Transfer Size (Bytes) Bandwidth(MB/s) 
    33554432   5857.4 

Result = PASS 

那么可以用enybode帮我吗?

+1

CUDA 6.5的默认编译目标是CC 2.0(sm_20),但您的GPU是CC 1.1(sm_11)。尝试在'nvcc'命令行中指定正确的目标体系结构:'-arch = sm_11'。 – njuffa 2014-12-05 16:43:17

回答

2

无效的设备函数通常意味着代码编译时的体系结构高于您尝试运行它的GPU。

的GPU架构包含在打印输出:

CUDA Capability Major/Minor version number: 1.1 

CUDA 6.5编译为默认情况下,CC2.0架构。如果您想编译cc 1.1体系结构,则需要将特定开关传递给您的编译命令nvcc来执行此操作。

这通常意味着在项目属性的Visual Studio设备配置选项卡中添加诸如compute_11,sm_11之类的内容。

当您这样做时,您将会收到警告(在CUDA 6.5下)设备架构1.1已弃用。但是,您仍然可以编译并定位此架构。

即使这个问题涉及到Windows,Linux上也存在同样的必要性。如果您在Linux上使用CUDA 6.5,则默认编译目标是cc2.0。为了编译早期的设备,有必要在编译命令行中添加一些东西,如-arch=sm_11

+0

非常感谢你;)))作品;) – user3490530 2014-12-05 16:46:17

+1

@ user3490530如果答案让你满意,请点击问题左边的复选标记接受它。 – njuffa 2014-12-05 16:49:43