我的电脑安装了vs2010配置cuda7.5和vs2013怎么安装cuda

CUDA5.5-VS2010 手把手教你 如何在 配置,还有例子 MPI 并行计算 238万源代码下载-
&文件名称: CUDA5.5-VS2010
& & & & &&]
&&所属分类:
&&开发工具: WORD
&&文件大小: 1475 KB
&&上传时间:
&&下载次数: 3
&&提 供 者:
&详细说明:手把手教你CUDA5.5如何在VS2010配置,还有例子-CUDA5.5 taught you how to configure the VS2010, as well as examples of so
文件列表(点击判断是否您需要的文件,如果是垃圾请在下面评价投诉):
&&CUDA5.5 taught you how to configure VS2010.docx
&输入关键字,在本站238万海量源码库中尽情搜索:
&[] - 能够对大量的数据基于CUDA平台从小到大进行排序
&[] - NVIDIA CUDA 的编译指南,NVIDIA CUDA技术文档(全译文)
&[] - CUDA_超大规模并行程序设计(赵开勇)
&[] - cuda 编程详解,高性能的gpu编程技巧,此书介绍了利用gpu做高性能的并发运算win7+&VS2010安装CUDA7.0图文说明
win7+ VS2010安装CUDA7.0图文说明
查看本机配置,查看显卡类型是否支持NVIDIA GPU,选中计算机--&
右键属性 --&
设备管理器 --&
显示适配器:NVIDIA GeForce GT 610,从/cuda-gpus可以查到相应显卡的compute
capability;
从/Download/index.aspx?lang=cn下载合适驱动347.88-desktop-win8-win7-winvista-64bit-international-whql.exe
从/cuda-toolkit&&
根据本机类型下载相应的最新版本CUDA7.0安装;
4.按照/cuda/cuda-getting-started-guide-for-microsoft-windows/index.html#axzz3W8BU10Ol&
步骤,验证是否安装正确:
(1)、打开C:\ProgramData\NVIDIACorporation\CUDA
Samples\v7.0目录下的Samples_vs2010.sln工程,分别在Debug、Release
x64下编译整个工程;
(2)、编译过程中,会提示找不到”d3dx9.h”、”d3dx10.h”、”d3dx11.h”头文件,可以从/en-us/download/details.aspx?id=6812下载DXSDK_Jun10.exe,然后安装到默认目录下;再编译工程即可;
如果安装DXSDK_Jun10.exe出错,如下图
解决办法:
打开“控制面板”的“程序和功能”,果然计算机里之前有安装“Microsoft Visual C++ 2010
x86 Redistributable - 19”,而DXSDK_Jun安装的是“Microsoft
Visual C++ 2010 x86 Redistributable -
19”,版本低于本机已安装的版本,所以安装出现s1023错误。
卸载更高的版本“Microsoft Visual C++ 2010 x86 Redistributable
- 19”和“Microsoft
Visual C++ 2010 x64 Redistributable -
19”,再重新安装即可。
重新启动vs2010,即可编译通过。
(3)、打开C:\Program
Files\NVIDIA
Corporation\Installer2\CUDASamples_7.0.{658B19AF-1B62-4FD6-A2B7-9E653E4F2B7A}\bin\win64\Release目录,打开cmd命令行,将deviceQuery.exe直接拖到cmd中,回车,会显示GPU显卡、CUDA版本等相关信息,最后一行显示:Result
(4)、将bandwidthTest.exe拖到cmd中,回车,会显示Device0:
GeForce GT 610等相关信息,后面也会有一行显示:Result
= PASS;&&&&&&
配置VS2010
(1)、打开VS2010,新建工程,选win32,记得勾选”空项目“。
(2)、右键源文件-&添加新建项-&选择CUDA
C/C++File,名字任意了。
(3)、右键工程-&生成自定义-&勾选CUDA
(4)、右键main.cu-&属性-&项类型&
选择"CUDA C/C++"
(5)、右键工程-&属性-&链接器-&常规-&附加库目录-&添加目录$(CUDA_PATH_V7_0)\lib\$(Platform);
(6)、链接器-&输入-&附加依赖项
添加cudart.lib
(7)、在main.cu中加入代码,示例代码如下:
#include& stdio.h&&
#include "cuda_runtime.h"&
#include "device_launch_parameters.h"&
bool InitCUDA()&
cudaGetDeviceCount(&count);&
if(count == 0)&
&&&&&&&&&&&
fprintf(stderr, "There is no device.\n");&
&&&&&&&&&&&
for(i = 0; i & i++)&
&&&&&&&&&&&
cudaDeviceP&
&&&&&&&&&&&
if(cudaGetDeviceProperties(&prop, i) ==
cudaSuccess)&
&&&&&&&&&&&
&&&&&&&&&&&&&&&
if(prop.major &= 1)&
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
&&&&&&&&&&&
if(i == count)&
&&&&&&&&&&&
fprintf(stderr, "There is no device supporting CUDA
1.x.\n");&
&&&&&&&&&&&
cudaSetDevice(i);&
int main()&
if(!InitCUDA())&
&&&&&&&&&&&
return 0;&
printf("HelloWorld, CUDA has been initialized.\n");&
return 0;&
运行结果:
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。15:18 提问
在VS2010中调试CUDA程序时总是出现以下问题
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cublasDestroy_v2,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cudaFree,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cublasGetVector,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cublasSgemm_v2,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cudaThreadSynchronize,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cublasSetVector,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cudaMalloc,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cublasCreate_v2,该符号在函数 main 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cudaRegisterFatBinary,该符号在函数 "void __cdecl __sti__cudaRegisterAll_36_tmpxft__cpp1_ii_main(void)" (?__sti____cudaRegisterAll_36_tmpxft__cpp1_ii_main@@YAXXZ) 中被引用
1&1.cu.obj : error LNK2019: 无法解析的外部符号 cudaUnregisterFatBinary,该符号在函数 "void __cdecl __cudaUnregisterBinaryUtil(void)" (?cudaUnregisterBinaryUtil@@YAXXZ) 中被引用
1&E:\Program exercise\1\x64\Debug\1.exe : fatal error LNK1120: 10 个无法解析的外部命令
1&生成失败。
请各位版主指导一下!
按赞数排序
检查下cuda sdk有没有装好,cuda编译器,头文件和库文件的路径设置是否正确。对照网上教程或者书上的步骤仔细检查下
工程中要配置好cuda的lib库文件目录
其他相似问题
相关参考资料Running CUDA program in Visual Studio 2010 (ERROR due to 32 vs 64 bit compile) - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
This is a question which is a spin-off from another posted question which can be found at the following link:
In the above link and in several other posts about the same topic they state that if you compile 32 bit cuda this will solve your Build/Compile problems ...
Can anyone please help direct me to an article which would show how to link to 32 bit CUDA. This does not make sense. when you download CUDA toolkit, you have choice of downloading 64 or 32 bit. Both don't download. So are these people just downloading the 32 bit version of CUDA? This seems ridiculous and I know this cannot be what they mean. Any helpl would be greatly appreciated.
Any help as to what they are talking about when they say 'link to 32 bit CUDA' would be greatly appreciated.
ERROR MESSAGES (same as in previous posts)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts wi use /NODEFAULTLIB:library
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol _cudaSetupArgument@12 referenced in function "void __cdecl __device_stub__Z10kernelTestPi(int *)" (?__device_stub__Z10kernelTestPi@@YAXPAH@Z)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterFunction@40 referenced in function "void __cdecl __sti____cudaRegisterAll_46_tmpxft_000022ac__TestForCuda_cpp1_ii_da17b9e9(void)" (?__sti____cudaRegisterAll_46_tmpxft_000022ac__TestForCuda_cpp1_ii_da17b9e9@@YAXXZ)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterFatBinary@4 referenced in function "void __cdecl __sti____cudaRegisterAll_46_tmpxft_000022ac__TestForCuda_cpp1_ii_da17b9e9(void)" (?__sti____cudaRegisterAll_46_tmpxft_000022ac__TestForCuda_cpp1_ii_da17b9e9@@YAXXZ)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol ___cudaUnregisterFatBinary@4 referenced in function "void __cdecl __cudaUnregisterBinaryUtil(void)" (?__cudaUnregisterBinaryUtil@@YAXXZ)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol _cudaLaunch@4 referenced in function "enum cudaError __cdecl cudaLaunch(char *)" (??$cudaLaunch@D@@YA?AW4cudaError@@PAD@Z)
1>C:\Users\misc\Documents\Visual Studio 2010\Projects\TestForCuda\Test_Configuration\TestForCuda.exe : fatal error LNK1120: 5 unresolved externals
1>Build FAILED.
17.5k53667
The project I was attempting to compile was a VS2010 project I had created from scratch.
The code was test code I downloaded from the internet.
I actually had two problems …
1st problem:
Under ‘build customization’ you need to select the CUDA version to build with.
I had selected the highest version shown which was ‘CUDA 4.2(.targets,.props)’.
The problem was that I linked to CUDA version 5.0.
When I say ‘linked’ I am referring to the linked option which you can find in the VS2010 menu bar at “Project => Properties =>Configuration properties => Linker”.
When you get to this menu you have the option to add ‘Additional Library Directories’.
I had linked to CUDA version 5.0.
I have not figured out yet why I do not have a CUDA v5.0 under ‘build customization’ … but that is another question for another day.
Lesson: whatever version of cude you link to (in Linker menu), is the version you should select in the 'build customation' menu.
2nd problem:
I am running on Windows 7 (64 bit), Processor is 64 bit (Intel quad core), the CUDA sdk/toolkit I downloaded was 64 bit, but I was attempting to debug with a Win32 platform.
Yes, I knew I needed to compile/build using the proper bit platform, but ignorantly, I could not figure out how to change the ‘Platform’ (located in the 'configuration manager' menu for your VS project) to x64.
The how-tos on the web showed the x64 option as already being available in the ‘Platform’ dropdown.
I read later articles that stated that VS can only debug in Win32 but can compile in Win32 or x64 (not true) which freaked me out even more.
In Reality, If it is your first time to use x64 Platform, the x64 option will NOT be in the Platform dropdown.
You must create a ‘new’ platform.
When you do this, you need to select x64 for the ‘Copy settings from:’ dropdown.
I want to say I tried this before and there was not x64 option in the ‘Copy settings form:’ dropdown.
I either overlooked the x64 ‘Copy setting from:’ option previously … or this option was added after I conducted the custom install suggested by Roger (I wish I could remember/ was more observant about this).
Lesson: may need to 'create new' platform in the 'configuration manager' menu if it is your first time to use x64 option (believe VS debug may default to Win32 ... but is easily changed to x64 if needed).
Anyway, after fixing both of these things (not just one … but both), the CUDA code did successfully compile.
I just wanted to thank everyone again for all the help!
Got me moving in the correct direction!
PS: Nice tutorial (not mine but I used to help me) to help you compile your first CUDA code
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled&&国之画&&&& &&&&&&
&& &&&&&&&&&&&&&&&&&&
鲁ICP备号-4
打开技术之扣,分享程序人生!

我要回帖

更多关于 cuda 7.5 vs2010 的文章

 

随机推荐