<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VIDWAV.com &#187; IDE</title>
	<atom:link href="http://www.vidwav.com/tag/ide/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vidwav.com</link>
	<description>关注于视频技术领域的相关资讯，研发和产品</description>
	<lastBuildDate>Thu, 20 May 2010 13:51:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mac OS X Leopard Xcode环境下的NVIDIA CUDA设置</title>
		<link>http://www.vidwav.com/2009/06/mac-os-x-leopard-xcode-nvidia-cuda.htm</link>
		<comments>http://www.vidwav.com/2009/06/mac-os-x-leopard-xcode-nvidia-cuda.htm#comments</comments>
		<pubDate>Sun, 14 Jun 2009 03:30:22 +0000</pubDate>
		<dc:creator>Yu Liu</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.vidwav.com/2009/06/mac-os-x-leopard-xcode%e7%8e%af%e5%a2%83%e4%b8%8b%e7%9a%84nvidia-cuda%e7%bc%96%e7%a8%8b.htm</guid>
		<description><![CDATA[在前面的文章中，曾介绍过<a href="http://www.vidwav.com/2009/06/integrate-cuda-into-ide.htm">Xcode IDE环境下的CUDA设置</a>。之前提过我的CUDA Plugin for Xcode一直设置不成功，经过一番折腾，总算是把Xcode IDE的CUDA配置给搞定了。下面介绍一下如何设置CUDA Plugin for Xcode IDE。
<ol>
<li>
首先安装NVIDIA最新的显卡驱动,以及 CUDA Toolkit 和 CUDA SDK. 下载地址 <a href="http://www.nvidia.com/object/cuda_get.html">here</a>.
</li>
<li>
安装CUDA之后，你可以测试一下你的机器是否CUDA配置正确。方法如下：进入CUDA安装目录，我将CUDA安装在/Developer目录下。在/Developer/CUDA下有一个Makefile，在该目录[......]</li></ol><p class='read-more'><a href='http://www.vidwav.com/2009/06/mac-os-x-leopard-xcode-nvidia-cuda.htm'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p align="justify">在前面的文章中，曾介绍过<a href="http://www.vidwav.com/2009/06/integrate-cuda-into-ide.htm">Xcode IDE环境下的CUDA设置</a>。之前提过我的CUDA Plugin for Xcode一直设置不成功，经过一番折腾，总算是把Xcode IDE的CUDA配置给搞定了。下面介绍一下如何设置CUDA Plugin for Xcode IDE。</p>
<ol>
<li>
<div>首先安装NVIDIA最新的显卡驱动,以及 CUDA Toolkit 和 CUDA SDK. 下载地址 <a href="http://www.nvidia.com/object/cuda_get.html">here</a>.</div>
</li>
<li>
<div>安装CUDA之后，你可以测试一下你的机器是否CUDA配置正确。方法如下：进入CUDA安装目录，我将CUDA安装在/Developer目录下。在/Developer/CUDA下有一个Makefile，在该目录下运行make，编译projects目录下的所有demo程序，其中就包括一个deviceQuery程序。编译完成后，你可以在/Developer/CUDA/bin/darwin/release/目录下运行deviceQuery程序，其应该输出以下信息; 否则，你的机器并没有CUDA capable的GPU，或者GPU设备驱动并没有正确安装。</div>
<div><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="devicequery" src="http://ftp.vidwav.com/image/MacOSXLeopardXcodeNVIDIACUDA_99CA/devicequery_thumb.png" border="0" alt="devicequery" width="511" height="394" /></div>
</li>
<li>下载NVCuda Plugin for Xcode，下载地址<a href="http://ftp.vidwav.com/cuda/nvcuda_plugin.zip">here</a>.</li>
<li>
<div>解压缩nvcuda_plugin.zip包，将里面的NVCuda.pbplugin文件拷贝到<br />
&#8220;/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/“ 目录下， 如果你没有这个目录，那么在这个路径上创建相应的目录结构。重新启动你的Xcode后，在你的工程Target的Build Tab下应该有一个叫<strong>NVIDA Cuda – Code Generation</strong>的Section了。</div>
</li>
<li>
<div>打开Xcode，创建一个Command Line Utility下的C++ Tool的工程，将你的源代码拷贝到该工程的目录下并加入工程。</div>
</li>
<li>
<div>在菜单Project -&gt; Edit Active Target下的Build tab进行以下设置<br />
在Section: <strong>Linking</strong>中的Other Linker Flags添加-lcuda, -lcudart, 并选中Prebinding<br />
<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="linking" src="http://ftp.vidwav.com/image/MacOSXLeopardXcodeNVIDIACUDA_99CA/linking_thumb.png" border="0" alt="linking" width="604" height="113" />以及Section: <strong>Search Paths<span style="font-weight: normal;">中:</span><br />
在<span style="font-weight: normal;">Header Search Paths中添加CUDA的系统目录/usr/local/cuda/include/**,如果你用到了CUDA SDK里面的函数,则需要加上/Developer/CUDA/common/inc.<br />
在Library Search Paths中添加CUDA的系统目录/usr/local/cuda/lib,如果你用到了CUDA SDK里面的函数,则需要加上/Developer/CUDA/lib 和/Developer/CUDA/common/lib<br />
<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="searchpaths" src="http://ftp.vidwav.com/image/MacOSXLeopardXcodeNVIDIACUDA_99CA/searchpaths_thumb.png" border="0" alt="searchpaths" width="604" height="137" />以及Section: </span>NVIDA Cuda – Code Generation</strong>中,Host Compilation设置为c++.</div>
<p style="text-align: center;"><img class="aligncenter" style="display: inline; border-width: 0px;" title="cudaplugin" src="http://ftp.vidwav.com/image/MacOSXLeopardXcodeNVIDIACUDA_99CA/cudaplugin_thumb.png" border="0" alt="cudaplugin" width="604" height="193" /></p>
</li>
<li>点击Build and Go 按钮，你的程序应该不会再有&#8221;no rule to process file test.cu … for architecture i386″的错误了。</li>
<li>如果你用到了CUDA SDK的函数,有可能会出现Link时找不到相应函数,这时你需要将CUDA SDK的库加入你的工程中,如libcutil.a库文件.</li>
<li>Have Fun！</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.vidwav.com/2009/06/mac-os-x-leopard-xcode-nvidia-cuda.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>常用集成开发环境(IDE)的CUDA配置</title>
		<link>http://www.vidwav.com/2009/06/integrate-cuda-into-ide.htm</link>
		<comments>http://www.vidwav.com/2009/06/integrate-cuda-into-ide.htm#comments</comments>
		<pubDate>Sat, 06 Jun 2009 07:16:52 +0000</pubDate>
		<dc:creator>Yu Liu</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.vidwav.com/?p=131</guid>
		<description><![CDATA[前面简单介绍了CUDA通用并行架构的情况,如何在常用的集成开发环境(IDE)下CUDA的配置好坏往往影响到CUDA程序开发的难易程度.
我这里介绍的常用的IDE包括Windows平台下的Visual Studio (VS)系列和Mac OS X平台下的Xcode. 至于Linux平台的开发,印象中的linux guy都是用make,gcc和gdb来进行项目管理和程序开发调试,我想应该很少linux guy会用IDE吧? 并且CUDA安装程序已经包含了相应的环境设置以及makefile文件的设置,只要依葫芦画瓢,很容易生成自己项目的makefile文件,这里我就不再赘述了.
回到正题,如何对CU[......]<p class='read-more'><a href='http://www.vidwav.com/2009/06/integrate-cuda-into-ide.htm'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">前面简单介绍了CUDA通用并行架构的情况,如何在常用的集成开发环境(IDE)下CUDA的配置好坏往往影响到CUDA程序开发的难易程度.</p>
<p style="text-align: justify;">我这里介绍的常用的IDE包括Windows平台下的Visual Studio (VS)系列和Mac OS X平台下的Xcode. 至于Linux平台的开发,印象中的linux guy都是用make,gcc和gdb来进行项目管理和程序开发调试,我想应该很少linux guy会用IDE吧? 并且CUDA安装程序已经包含了相应的环境设置以及makefile文件的设置,只要依葫芦画瓢,很容易生成自己项目的makefile文件,这里我就不再赘述了.</p>
<p style="text-align: justify;">回到正题,如何对CUDA在VS和Xcode下的IDE设置呢? 最快捷的方式就是利用相应的CUDA插件来进行配置.这里不得不提两个比较好的插件,一个是Windows平台下的VS插件CUDA VS Wizard, 下载地址 <a href="http://sourceforge.net/projects/cudavswizard">here</a>; 另一个是Mac平台下的Xcode插件NVCuda Plug-in, 下载地址 <a href="http://ftp.vidwav.com/cuda/nvcuda_plugin.zip">here</a>.</p>
<p style="text-align: justify;">由于我对Xcode的开发环境不是很熟悉,因此NVCuda这个插件我总是安装不成功,或者根本就不work. 用这个插件之后,Xcode仍然报什么&#8221;no rule to process file test.cu &#8230; for architecture i386&#8243;的错误.但google一下,好像有人可以成功的利用这个插件在Xcode下编译成功,但没有给出细节,:(. 如果有人知道如何解决这个问题的话,麻烦告诉我一声. <span style="color: #000080;"> <span style="color: #666699;">(后记：问题已解决，参见《</span></span><a title="到 Mac OS X Leopard Xcode环境下的NVIDIA CUDA设置 的永久链接" rel="bookmark" href="http://www.vidwav.com/2009/06/mac-os-x-leopard-xcode-nvidia-cuda.htm">Mac OS X Leopard Xcode环境下的NVIDIA CUDA设置</a><span style="color: #666699;">》一文.）</span></p>
<p style="text-align: justify;">相对Xcode而言,在Windows平台下就显得容易很多了,CUDA VS Wizard插件安装很方便,安装完后,其使用就和VS其他project template一样简单易用. 详细的视频教程可以参看CUDA VS Wizard作者制作的视频, <a href="http://ftp.vidwav.com/cuda/CUDA_easy_start_up.wmv" target="_blank">CUDA_easy_start_up.wmv</a>.</p>
<p style="text-align: justify;">但有个问题就是 CUDA VS Wizard 这个插件没有实现 CUDA 源文件 .cu 的语法高亮设置,解决的方法可以利用 CUDA SDK 自带的usertype.dat 文件来设置 VS 的语法高亮,方法如下:</p>
<ol>
<li style="text-align: justify;">首先安装NVIDIA最新的显卡驱动,以及 CUDA Toolkit 和 CUDA SDK. 下载地址 <a href="http://www.nvidia.com/object/cuda_get.html">here</a>.</li>
<li style="text-align: justify;">然后拷贝%NVIDIA CUDA SDK%\doc\syntax_highlighting\visual_studio_8目录下的usertype.dat文件到%Program Files%\Microsoft Visual Studio 8\Common7\IDE目录下.</li>
<li style="text-align: justify;">在Visual Studio下打开Tools -&gt; Options</li>
<li style="text-align: justify;">在Text Editor -&gt; File Extension tab下,指定新的扩展名extension “.cu”, 关联到Microsoft Visual C++.</li>
<li style="text-align: justify;">重启Visual Studio.</li>
<li>Enjoy it!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.vidwav.com/2009/06/integrate-cuda-into-ide.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://ftp.vidwav.com/cuda/CUDA_easy_start_up.wmv" length="10827444" type="video/x-ms-wmv" />
		</item>
	</channel>
</rss>
