Confused on how to install

The cuda download page says, download a driver, sdk and toolkit. The available mac downloads seem to be only the sdk and toolkit but no driver.

The toolkit seems to be a normal mac installer package. The SDK is a simple folder with the following contents:
Makefile common projects
bin lib tools

The Makefile does not seem to have any “make install” defined so I’m confused about what to do. Do I need to put these files someplace on my system?

In short how do I install cuda?
Is there a “getting started” manual I’m missing somewhere?

After just installing the Toolkit, and downloading the fortran cuda blas example, I get errors when I try to compile the example with the included makefile, so I think I’m missing something. See this link to see the errors I get:
http://forums.nvidia.com/index.php?showtopic=66474

On MacOSX, you don’t need a new driver, the one shipping with 10.5.2 is CUDA-aware.

  1. Install the toolkit and restart.

You may want to add to your .bash_profile file:
export PATH=/usr/local/cuda/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH

  1. In the SDK directory, just type make. It will build all the examples in the subdirectory bin/macosx/release

thanks, I’ll try this now. But I’m wondering how you knew this.

Second, as for the SDK, Okay so I make it. What do I do with it? what’s SD about this SDK?

and how do I execute the examples???

sorry to be a dolt, but this is so frightfully undocumented.

I just tried that and I get the following error message when I try to compile the cudablas example:

cd ~/src/cuda/Fortran_Cuda_Blas
bash-3.2$ gcc -O3 -DCUBLAS_USE_THUNKING -I/usr/local/cuda/include -c fortran.c
fortran.c:64:2: error: #error unsupported platform
fortran.c:208:2: error: #error unsupported Fortran compiler
bash-3.2$

Further update.

the examples in the cuda sdk compile and run from the command line. So that’s good

Apparently the example in the Fortran_cuda_blas will not compile. I’m not sure why.

You will need to modify the fortran.c.

line 61 should be:
#elif defined(__linux) || defined (APPLE)

Aha. yes that’s part of the problem.

Now it has a problem because it can’t find the Intel Math Kernel Libraries (not sure why it should need this).

When I google intel math kernel libraries for mac osx I find pages on intel’s site desctibin how to use it but no pages offering the actual code fro free or for purchase!

So I need this?

AHA!

edit the Makefile to add the following two lines after the Intel and AMD mathlib declarations

NAMEBLAS = “VECLIB”

LIBBLAS = -L/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A -lblas

Note the second line is all one line in case your browser is busting it in two

Use this makefile to use the Accelerate framework.
Makefile.txt (1.79 KB)

Thanks. Was not aware of the “framework” option to the compiler.

When I do this I find the native BLAS libraries are within about 30% in speed of the cudablas when using the NVIDIA Fortran_cuda_blas example for sgemm.

The framework seems to top out at about 12MFLOPS on my 2.4GHZ macbook pro (core duo 2).

The cudablas sgemm (including the transfers) tops out at 16MFLOPS on my 256MB 8600 GT, (mac has PCIe Lane width of x16 and a memory speed of 667MHz DDR2)

THat seems kinda sluggish for the Nvidia. I’m going to start a new thread asking why this is this way.

To compile on Snow Leopard add -arch i386 to the gcc command in the Makefile, in addition to the changes mentioned in this thread.

A performance report for a 2.8 GHz Intel Core Duo macbook pro:

sgemm_speed_cublas ~17.3 GFlops

sgemm_speed_VECLIB ~14.5 GFlops.