Cuda compilation of examples

前端 未结 1 1683
梦谈多话
梦谈多话 2020-12-22 14:46

I have NVIDIA GeForce 8500 GT on Windows 7 Pro 32, and I have problem with my project in CUDAC. I have installed all packages and VS2012 Pro. I\'m creating new Project from

相关标签:
1条回答
  • 2020-12-22 15:00

    Invalid device function usually means that the code was compiled with an architecture that is higher than the GPU you are trying to run it on.

    The GPU architecture is contained in your printout:

      CUDA Capability Major/Minor version number:    1.1
    

    CUDA 6.5 compiles for a cc2.0 architecture by default. If you want to compile for a cc 1.1 architecture, you will need to pass specific switches to your nvcc compile command to do so.

    This usually means adding something like compute_11,sm_11 in the Visual Studio device configuration tab on your project properties.

    When you do so, you will then get warnings (under CUDA 6.5) that device architecture 1.1 is deprecated. However you can still compile for and target this architecture.

    And even though this question pertains to windows, the same necessity exists on Linux. If you use CUDA 6.5 on linux, the default compile target is cc2.0. To compile for an earlier device, it's necessary to add something to the compile command line like -arch=sm_11.

    0 讨论(0)
提交回复
热议问题