Check out my first novel, midnight's simulacra!

CUDA: Difference between revisions

From dankwiki
Line 31: Line 31:
* Installation Complete</pre>
* Installation Complete</pre>
==Building==
==Building==
* Set the <tt>CUDA_INSTALL_PATH</tt> and <tt>ROOTDIR</tt> (yeargh!) if outside the SDK, for example:
===SDK's common.mk===
** <tt>export ROOTDIR=/home/dank/local/cuda/C/</tt> (the SDK install path)
This assumes use of the SDK's common.mk, as recommended by the documentation.
** <tt>export CUDA_INSTALL_PATH=/home/dank/local/cuda</tt> (the toolkit install path)
* Add the library path to LD_LIBRARY_PATH, assuming CUDA's been installed to a non-standard directory.
* Set the <tt>CUDA_INSTALL_PATH</tt> and <tt>ROOTDIR</tt> (yeargh!) if outside the SDK.
* I keep the following in <tt>bin/cudasetup</tt> of my home directory. Source its output, ala <tt>eval `cudasetup`</tt>:<code>#!/bin/sh
 
CUDA=$HOME/local/cuda
 
[ -d "$CUDA" ] || { echo "$CUDA is not a directory, exiting" >&2 ; exit 1 ; }
 
echo "# run \"eval \`$0\`\" to source these exports"
echo "export CUDA_INSTALL_PATH=$CUDA"
echo "export ROOTDIR=$CUDA/C/common/"
# check for its current presence? FIXME
if [ -n "$LD_LIBRARY_PATH" ] ; then
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA/lib64"
else
echo "export LD_LIBRARY_PATH=$CUDA/lib64"
fi</code>
===Handrolled builds===

Revision as of 04:09, 26 January 2010

Installation on Debian

There exist libcuda-dev packages in the non-free archive area, but they seem incomplete or obsolete (or both). I instead used the NVIDIA upstream files, installing CUDA onto a 64-bit Debian Unstable system 2010-01-25 (hand-rolled 2.6.32.6 kernel, built with gcc-4.4). This machine did not have CUDA-compatible hardware (it uses Intel 965).

  • Download the Ubuntu 9.04 files from NVIDIA's "CUDA Zone".
  • Run the toolkit installer (sh cudatoolkit_2.3_linux_64_ubuntu9.04.run)
    • For a user-mode install, supply $HOME/local or somesuch
* Please make sure your PATH includes /home/dank/local/cuda/bin
* Please make sure your LD_LIBRARY_PATH
*   for 32-bit Linux distributions includes /home/dank/local/cuda/lib
*   for 64-bit Linux distributions includes /home/dank/local/cuda/lib64
* OR
*   for 32-bit Linux distributions add /home/dank/local/cuda/lib
*   for 64-bit Linux distributions add /home/dank/local/cuda/lib64
* to /etc/ld.so.conf and run ldconfig as root

* Please read the release notes in /home/dank/local/cuda/doc/

* To uninstall CUDA, delete /home/dank/local/cuda
* Installation Complete
  • Run the SDK installer (sh cudasdk_2.3_linux.run)
    • I just installed it to the same directory as the toolkit, which seems to work fine.
========================================

Configuring SDK Makefile (/home/dank/local/cuda/shared/common.mk)...

========================================

* Please make sure your PATH includes /home/dank/local/cuda/bin
* Please make sure your LD_LIBRARY_PATH includes /home/dank/local/cuda/lib

* To uninstall the NVIDIA GPU Computing SDK, please delete /home/dank/local/cuda
* Installation Complete

Building

SDK's common.mk

This assumes use of the SDK's common.mk, as recommended by the documentation.

  • Add the library path to LD_LIBRARY_PATH, assuming CUDA's been installed to a non-standard directory.
  • Set the CUDA_INSTALL_PATH and ROOTDIR (yeargh!) if outside the SDK.
  • I keep the following in bin/cudasetup of my home directory. Source its output, ala eval `cudasetup`:#!/bin/sh

CUDA=$HOME/local/cuda

[ -d "$CUDA" ] || { echo "$CUDA is not a directory, exiting" >&2 ; exit 1 ; }

echo "# run \"eval \`$0\`\" to source these exports" echo "export CUDA_INSTALL_PATH=$CUDA" echo "export ROOTDIR=$CUDA/C/common/"

  1. check for its current presence? FIXME

if [ -n "$LD_LIBRARY_PATH" ] ; then echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA/lib64" else echo "export LD_LIBRARY_PATH=$CUDA/lib64" fi

Handrolled builds