<?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>Stealthcopter.com &#187; Nvidia</title>
	<atom:link href="http://www.stealthcopter.com/blog/tag/nvidia/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stealthcopter.com/blog</link>
	<description>Android, Linux, Python and stealthcopters</description>
	<lastBuildDate>Fri, 13 Jan 2012 16:29:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Compiling and running CUDA 2.3 SDK and toolkit on ubuntu 9.10 x64 (64-bit)</title>
		<link>http://www.stealthcopter.com/blog/2010/02/compiling-and-running-cuda-2-3-sdk-and-toolkit-on-ubuntu-9-10-x64-64-bit/</link>
		<comments>http://www.stealthcopter.com/blog/2010/02/compiling-and-running-cuda-2-3-sdk-and-toolkit-on-ubuntu-9-10-x64-64-bit/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 10:30:17 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[computational]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.stealthcopter.com/blog/?p=728</guid>
		<description><![CDATA[I&#8217;ve heard a lot about CUDA, such as how it is 10,000% faster at cracking wireless passwords over a conventional program/hardware, but never really got around to testing it out before now. This post details the steps required to compile and setup CUDA 2.3 SDK and toolkit on ubuntu 9.10. Downloads You are required to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve heard a lot about CUDA, such as how it is <a href="http://www.crunchgear.com/2008/10/10/crack-wpa-ten-thousand-percent-faster-with-cuda/">10,000% faster at cracking wireless passwords</a> over a conventional program/hardware, but never really got around to testing it out before now. This post details the steps required to compile and setup CUDA 2.3 SDK and toolkit on ubuntu 9.10.</p>
<p><strong>Downloads</strong><br />
You are required to have an Nvidia graphics driver (relatively new version) already installed. First download the CUDA toolkit and CUDA sdk from the <a href="http://developer.nvidia.com/object/cuda_2_3_downloads.html">Nvidia CUDA 2.3 download page</a>.</p>
<p><strong>Install the toolkit</strong></p>
<pre name="code" class="bash"># Make file executable
chmod +x cudatoolkit_2.3_linux_64_ubuntu9.04.run
# Run it as superuser
sudo ./cudatoolkit_2.3_linux_64_ubuntu9.04.run
</pre>
<p>You now need to edit your .bashrc file in your home directory to include the paths (so your CUDA binaries can be found by the system)</p>
<pre class="bash">export PATH=${PATH}:/usr/local/cuda/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64</pre>
<p>Note if you are using 32bit then &#8220;lib64&#8243; should be replaced with just &#8220;lib&#8221;</p>
<p><strong>Install the SDK</strong></p>
<pre name="code" class="bash">
# Make file executable
chmod +x cudasdk_2.3_linux.run
# Run it as normal user
./cudasdk_2.3_linux.run
</pre>
<p>You should now have a NVIDIA_GPU_Computing_SDK folder in your home directory. Change directory into the C folder inside this one.</p>
<pre name="code" class="bash">
cd NVIDIA_GPU_Computing_SDK/C
</pre>
<p>In this folder is a make file which will compile all the Nvidia SDK and all the demos, in order for this to work in ubuntu 9.10 (x64) you will need to install several dependencies. By installing these before attempting to make will save you a lot of time, if you are getting errors please scroll down to the problems section to see if they are already covered.</p>
<pre name="code" class="bash">
# Install the necessary libraries
sudo apt-get install freeglut3 freeglut3-dev libx11-dev mesa-common-dev libxmu6
</pre>
<p><strong>Making and running demos</strong></p>
<p>You can then run the make command, once this is ran all of the executables will be placed in  NVIDIA_GPU_Computing_SDK/C/bin/linux/released . We can check that our computer has an useable CUDA device install by running the deviceQuery program:</p>
<pre name="code" class="bash">
cd ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/released
./deviceQuery
</pre>
<p>This should output something similar to the following:</p>
<pre name="code" class="bash">
# ./deviceQuery
CUDA Device Query (Runtime API) version (CUDART static linking)
There is 1 device supporting CUDA

Device 0: "GeForce GTX 260"
  CUDA Driver Version:                           2.30
  CUDA Runtime Version:                          2.30
  CUDA Capability Major revision number:         1
  CUDA Capability Minor revision number:         3
  Total amount of global memory:                 938803200 bytes
  Number of multiprocessors:                     27
  Number of cores:                               216
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       16384 bytes
  Total number of registers available per block: 16384
  Warp size:                                     32
  Maximum number of threads per block:           512
  Maximum sizes of each dimension of a block:    512 x 512 x 64
  Maximum sizes of each dimension of a grid:     65535 x 65535 x 1
  Maximum memory pitch:                          262144 bytes
  Texture alignment:                             256 bytes
  Clock rate:                                    1.47 GHz
  Concurrent copy and execution:                 Yes
  Run time limit on kernels:                     Yes
  Integrated:                                    No
  Support host page-locked memory mapping:       Yes
  Compute mode:                                  Default (multiple host threads can use this device simultaneously)

Test PASSED
</pre>
<p>Now that we can see CUDA is successfully installed and a suitable device is found we can run some of nvidia&#8217;s more ascetically pleasing demos:</p>
<pre name="code" class="bash">
./fluidsGL
</pre>
<p><div id="attachment_739" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.stealthcopter.com/blog/2010/02/compiling-and-running-cuda-2-3-sdk-and-toolkit-on-ubuntu-9-10-x64-64-bit/cudafluids/" rel="attachment wp-att-739"><img src="http://www.stealthcopter.com/blog/wp-content/uploads/2010/02/cudafluids-600x570.png" alt="CUDA SDK example fluidsGL on ubuntu 9.10 x64" title="CUDA SDK example fluidsGL on ubuntu 9.10 x64" width="600" height="570" class="size-medium wp-image-739" /></a><p class="wp-caption-text">CUDA SDK example fluidsGL on ubuntu 9.10 x64</p></div></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ITpgGT65PJY&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ITpgGT65PJY&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<pre name="code" class="bash">
./smokeParticles
</pre>
<p><div id="attachment_744" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.stealthcopter.com/blog/2010/02/compiling-and-running-cuda-2-3-sdk-and-toolkit-on-ubuntu-9-10-x64-64-bit/cudasmokeparticles/" rel="attachment wp-att-744"><img src="http://www.stealthcopter.com/blog/wp-content/uploads/2010/02/cudasmokeparticles-600x474.png" alt="CUDA SDK example smokeparticles on ubuntu 9.10 x64" title="CUDA SDK example smokeparticles on ubuntu 9.10 x64" width="600" height="474" class="size-medium wp-image-744" /></a><p class="wp-caption-text">CUDA SDK example smokeparticles on ubuntu 9.10 x64</p></div></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/IrKITmwU3jE&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/IrKITmwU3jE&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<pre name="code" class="bash">
./particles
</pre>
<p><div id="attachment_765" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.stealthcopter.com/blog/2010/02/compiling-and-running-cuda-2-3-sdk-and-toolkit-on-ubuntu-9-10-x64-64-bit/cuda_particles/" rel="attachment wp-att-765"><img src="http://www.stealthcopter.com/blog/wp-content/uploads/2010/02/cuda_particles-600x473.png" alt="CUDA SDK example particles on ubuntu 9.10 x64" title="CUDA SDK example particles on ubuntu 9.10 x64" width="600" height="473" class="size-medium wp-image-765" /></a><p class="wp-caption-text">CUDA SDK example particles on ubuntu 9.10 x64</p></div></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/wKSy8_GeHFY&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wKSy8_GeHFY&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<pre name="code" class="bash">
./postProcessGL
</pre>
<p><div id="attachment_767" class="wp-caption aligncenter" style="width: 530px"><a href="http://www.stealthcopter.com/blog/2010/02/compiling-and-running-cuda-2-3-sdk-and-toolkit-on-ubuntu-9-10-x64-64-bit/cuda_teapot/" rel="attachment wp-att-767"><img src="http://www.stealthcopter.com/blog/wp-content/uploads/2010/02/cuda_teapot.png" alt="CUDA SDK example postProcessGL on ubuntu 9.10 x64 (teapot)" title="CUDA SDK example postProcessGL on ubuntu 9.10 x64 (teapot)" width="520" height="543" class="size-full wp-image-767" /></a><p class="wp-caption-text">CUDA SDK example postProcessGL on ubuntu 9.10 x64 (teapot)</p></div></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/0Fd7pVQ8OP0&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/0Fd7pVQ8OP0&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><strong>Problems</strong></p>
<pre name="code" class="bash">

libxi (<a href="http://forums.nvidia.com/lofiversion/index.php?t30464.html">Nvidia forum link</a>)

make[1]: Leaving directory `/home/mat/NVIDIA_GPU_Computing_SDK/C/common'
make[1]: Entering directory `/home/mat/NVIDIA_GPU_Computing_SDK/C/common'
In file included from ./../common/inc/paramgl.h:24,
                 from src/paramgl.cpp:19:
./../common/inc/GL/glut.h:60:20: error: GL/glu.h: No such file or directory
make[1]: *** [obj/release/paramgl.cpp.o] Error 1
make[1]: Leaving directory `/home/mat/NVIDIA_GPU_Computing_SDK/C/common'
make: *** [lib/libparamgl.so] Error 2
</pre>
<pre>
sudo apt-get install freeglut3 freeglut3-dev libx11-dev mesa-common-dev
</pre>
<pre name="code" class="bash">
/usr/include/bits/mathcalls.h:350: error: inline function ‘int __signbitf(float)’ cannot be declared weak
/usr/include/bits/mathcalls.h:350: error: inline function ‘int __signbitl(long double)’ cannot be declared weak
/usr/include/bits/mathinline.h:36: error: inline function ‘int __signbitf(float)’ cannot be declared weak
/usr/include/bits/mathinline.h:42: error: inline function ‘int __signbit(double)’ cannot be declared weak
/usr/include/bits/mathinline.h:48: error: inline function ‘int __signbitl(long double)’ cannot be declared weak
/usr/local/cuda/bin/../include/math_functions.h:442: error: inline function ‘int __signbitl(long double)’ cannot be declared weak
make[1]: *** [obj/release/particleSystem.cu.o] Error 255
make[1]: Leaving directory `/home/mat/NVIDIA_GPU_Computing_SDK/C/src/particles'
make: *** [src/particles/Makefile.ph_build] Error 2
</pre>
<p>The problem is due to having gcc 4.4 installed rather than 4.3, it is possible to install the older version of this compiler but it is simpler to modify common/common.mk and add the following extra flag (<a href="http://forums.nvidia.com/index.php?showtopic=104525">Nvidia forum link</a>):</p>
<pre class="bash">
# Change:
NVCCFLAGS += --compiler-options -fno-strict-aliasing
# To:
NVCCFLAGS += --compiler-options -fno-strict-aliasing --compiler-options -fno-inline</pre>
<p>and change the -O2</p>
<pre class="bash">
# Change:
COMMONFLAGS += -O2
# To:
COMMONFLAGS += -O0
</pre>
<p>The two remaining errors you may encounter are very similar and arrise from missing libraries:</p>
<p>libxi (<a href="http://forums.nvidia.com/index.php?showtopic=83217">Nvidia forum link</a>)</p>
<pre class="bash">
/usr/bin/ld: cannot find -lXi
collect2: ld returned 1 exit status
make[1]: *** [../../bin/linux/release/particles] Error 1
</pre>
<pre name="code" class="bash">
sudo apt-get install libxi-dev
</pre>
<p>libxmu (<a href="http://forums.nvidia.com/index.php?showtopic=87692">Nvidia forum link</a>)</p>
<pre class="bash">/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
make[1]: *** [../../bin/linux/release/particles] Error 1</pre>
<pre name="code" class="bash">
sudo apt-get install libxmu-dev libxmu6
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.stealthcopter.com/blog/2010/02/compiling-and-running-cuda-2-3-sdk-and-toolkit-on-ubuntu-9-10-x64-64-bit/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

