CUDA在VC2008中的环境搭建与配置要点
来源:互联网 发布:远程导出oracle数据库 编辑:程序博客网 时间:2024/06/04 18:45
CUDA's enviroment build and configuration in VC2008
This article is a CUDA config and enviroment build in VC2008, VC2005 should also OK.
1,default location and order install this three tool:
devdriver_3.0_winxp_32_197.13_general.exe
cudatoolkit_3.0_win_32.exe
gpucomputingsdk_3.0_win_32.exe
2,Test the cuda tool
C:/Documents and Settings/All Users/Application Data/NVIDIA Corporation/NVIDIA GPU Computing SDK/C/bin/win32/Release/
double click and run the release version's CUDA programs, Such as "deviceQuery.exe"; If CUDA install OK it will show run result,it means that eveything has been installed OK.
3,copy the CUDA default rule file which is configed OK original.
C:/Documents and Settings/All Users/Application Data/NVIDIA Corporation/NVIDIA GPU Computing SDK/C/common/Cuda.rules
to
C:/Program Files/Microsoft Visual Studio 9.0/VC/VCProjectDefaults/
4,copy the path of
C:/Documents and Settings/All Users/Application Data/NVIDIA Corporation/NVIDIA GPU Computing SDK/C/common/
C:/Documents and Settings/All Users/Application Data/NVIDIA Corporation/NVIDIA GPU Computing SDK/shared/
C:/Documents and Settings/All Users/Application Data/NVIDIA Corporation/NVIDIA GPU Computing SDK/OpenCL
C:/CUDA/
the three folders: inc(include)lib(library) src(source)'s location to
VC Tools--Options--Project and Solutions--VC++ Directories
relate config path of the inc(include)lib(library) src(source).then config the path
"C:/CUDA/bin/" to "Executable files"
For Highlight code as cpp file, Please also copy
C:/Documents and Settings/All Users/Application Data/NVIDIA Corporation/NVIDIA GPU Computing SDK/C/doc/syntax_highlighting/visual_studio_8/usertype.dat
to
C:/Program Files/Microsoft Visual Studio 8/VC/VCProjectDefaults/
also in VC++ Project Settings:C/C++ File extensions:add *.cu, in "Text editor-File extension":add cu relate editor to "Microsoft VC++ editor";
5,Restart the VC and then build a null project,such as "CUDAtest" add the "cu" source file into the project and then copy and paste the demo code into it, or you can use the following test code(a little code for OpenGL):
6,The most important item:
save then you need config the "CUDAtest"--"Custom Build Rules"(right click),you can see the CUDA Build Rule showed int the "Availble Rule Files", select and then OK.
config the "CUDAtest" property's "Configuration Properties"--"Linker"--"Input"--"Additional Dependencies"--"cudart.lib cutil32D.lib"(not include ").this step is for the normal link issues that cause by the important lib, it always show the link error just like following show:
1>------ Build started: Project: cudatest, Configuration: Debug Win32 ------
1>Linking...
1>cudatest.cu.obj : error LNK2019: unresolved external symbol ___cudaUnregisterFatBinary@4 referenced in function "void __cdecl __cudaUnregisterBinaryUtil(void)" (?__cudaUnregisterBinaryUtil@@YAXXZ)
...
1>cudatest.cu.obj : error LNK2019: unresolved external symbol _cudaMalloc@8 referenced in function _main
1>C:/HOME/Evel/CUDA/cudatest/Debug/cudatest.exe : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://c:/HOME/Evel/CUDA/cudatest/cudatest/Debug/BuildLog.htm"
1>cudatest - 10 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
if the project need include extra include files, then config the rules: "CUDA Build Rule v3.0"--"Additional Include Directories"--"C:/CUDA/include1; D:/CUDA/include2".
OK! now it's time to test the first CUDA code:
"Build Solution"(F7)--"Strat Without Debugging"(Ctrl+F5)
7,If no other issues, every thing should be OK and then show the run result.
For the code more fast, use Visual Assist to achieve auto finished function as c++ code, Please make sure close the IDE first and then
follow this address step:
http://blog.csdn.net/OpenHero/archive/2008/04/24/2324711.aspx
Notice: if the inc(include) path has been config OK, when you open VC the second time, it will be OK in Visual Assist's include path, so you can ignore the Visual Assist's include file config step.
- CUDA在VC2008中的环境搭建与配置要点
- 【高性能编程】环境配置--cuda 环境搭建 在VS中的配置
- Maven环境搭建与在Eclipse中的配置
- Maven环境搭建与在Eclipse中的配置
- openCV 在vc2008中的配置方法
- Linux环境下CUDA在CodeBlocks中的配置
- Linux环境下CUDA在CodeBlocks中的配置
- Linux环境下CUDA在CodeBlocks中的配置
- Linux环境下CUDA在CodeBlocks中的配置
- VC2008入门-环境配置
- CUDA在windows平台的环境搭建
- 如何在VS 2012开发平台中搭建CUDA开发环境以及opencv的配置方法
- 在vs2010上配置cuda环境
- 在vs2010中配置CUDA环境
- Windows8.1 64bit环境下搭建深度学习平台之CUDA安装与配置
- Windows8.1 64bit环境下搭建深度学习平台之CUDA安装与配置
- Windows8.1 64bit环境下搭建深度学习平台之CUDA安装与配置
- 【CUDA】CUDA开发环境搭建
- 2010年4月28 - 2010年5月28 学习PetShop的框架和三层结构!
- 航空航天各院所大全
- 怎么解决“只进结果集不支持请求的操作”问题
- windows & python & Emacs
- union的应用
- CUDA在VC2008中的环境搭建与配置要点
- 解决MySQL连接超时Communications link failure due to underlying exception
- 开关电源基础知识
- svn修改用户
- 高端人才必看,生意人必读!
- 深入浅出面向对象分析与设计——学习笔记之二
- VC 统计 代码行数
- 顺流逆流 的 log ,很多不错的关于 动态连接的文章
- 奥巴马的悼词