单机双卡Parallel Nsight2.0安装
本人使用的软件系列如下:
vs2008, devdriver_4.0_winvista-win7_32_270.81_general, cudatoolkit_4.0.17_win_32, gpucomputingsdk_4.0.19_win_32, Parallel_Nsight_Win32_2.0.11166.
CUDA的安装这里不再赘述(http://cudabbs.it168.com/thread-2797-1-1.html),这里重点说一下单机双卡parallel nsight的安装:
安装Nsight2.0的时候提示需要vs2008安装vs2008 service pack 1,到微软官网上下载英文的补丁VS90sp1-KB945140-ENU.exe安装好即可(Nsight支持vs2008 sp1及以上的版本,如果是vs2010就简单多了);。
单机双卡安装Nsight2.0:
1、 选择自定义安装,不要选择其它的安装方式,在自定义安装中有cuda3.2和cuda4.0,需要哪个安装哪个的插件,将另外一个取消安装即可。
2、 安装后最好查看一下环境变量CUDA_PATH指向哪里,可以在计算机属性的环境变量中查看,也可以在终端输入 set cuda查看环境变量,会列出所有cuda开头的环境变量的设置,看看是否指向CUDA toolkit4.0即可。
3、 安装完毕后,需要设置一些东西(Monitor即target机类似“服务器端”运行cuda代码;Host即本地机类似“客户端”运行开发环境);
首先,将桌面的背景主题更换为非aero主题(如基本和高对比度主题:windows经典,不一定需要将aero关闭),(否则错误:Local debugging failed. Nsight is incompatible with Aero desktop themes. Please switch your theme to a non-Aero theme, and retry the Nsight CUDA C Debugger.)
其次,对vs菜单栏中的Nsight的设置(即host机):
option->“Enablesecure server” 选FALSE,不使用安全连接。
最后,对Monitor进行设置(即target机):
a. option->“Use this Moitor for CUDA attach”选True
b. option->“WDDM TDR enabled” 选FALSE,(否则错误:The remote system’s TDR delay is set to 2 seconds. This will timeout when setting breakpoints on the target. Please modify the system’s TDR setting.)
c. option->“Enablesecure server” 选FALSE,(否则错误:Connection to the Nsight monitor on ‘zhongliangv-PC’ failed. Please make sure the monitor is running and the security settings match. )
d. 关闭D3D加速:在安装目录下面的Common文件夹中找到
DisableWpfHardwareAcceleration.reg,双击添加到注册表中,(否则报错:Local debugging failed. Nsight is incompatible with WPF acceleration. Please see documentation about WPF acceleration. Run the DisableWpfHardwareAcceleration.reg in your Nsight installation)
(双机的话类似,只要在option中将launch option-> connection names中设置ip地址即可)
设置完重启电脑。
4、调试:
a. 启动Moitor,启动后程序自动最小化任务栏托盘区。
b. 使用VS2008创建一个CUDA项目,和未安装Nsight之前的vs2008不一样了,不是选
择C++ win32了,而是可以选择CUDA cuda4.0,然后创建了一个工程,里面自带了个kernel.cu 的例子文件,这是个向量加法kernel。
c. 在kernel.cu中设置断点和普通的debug一样,设置好断点之后,先点击Nsight菜单中的Enable CUDA Kernel Launch Debugging,然后点击“Start CUDA Debugging” 启动debug,不是点击VS自带的debug按钮。
d. 程序开始执行,会在断点处会停下来,可以观察或跟踪变量,其它的功能如单步调试 F11都和之前的debug一样。想进入某个特定线程可用使用Nsight中的Windows->Debug Focus 设定block和thread的坐标进行线程之间的切换或者使用VS设置条件断点。想要查看某个数组的地址空间中的变量可以Debug->Windows->Memory窗口将变量的地址拖进去,就会以内存地址的形式显示变量的值。
上面只是简单的熟悉了一下,功能还有很多,比如分析性能,内存检测,生成报告等等,你自己慢慢看手册吧:
(http://http.developer.nvidia.com … ight_User_Guide.htm)。