In my case, i have two Nvidia graphics cards loaded on my MBP 10.5.6 and when you first installed CUDA 2.0, you will not be able to run the examples or any of your code in the GPU itself because the CUDA driver was never installed !!! Nividia's website doesn't tell you straight that you need to install CUDA 1.1 Toolkit prior to installing CUDA 2.0 Toolkit so go ahead and do it.
Make sure the CUDA driver is installed and the way to check it is to go to /System/Library/Extensions/ and look for the file "CUDA.kext". Should be there by now and updated to CUDA 2.0 driver. Yay!
Once you are done with that, build the example code(s) given like this:
- Go to /Developer/CUDA
- Build the example codes using "make" or "make dbg=1, "make emu=1" and "make emu=1 dbg=1" which will create the directories of "release", "debug", "emu" etc.
- Run the example code "deviceQuery" either in the directory "release" or "debug" etc but that's beside the point because they should all give the same result once the CUDA driver is installed properly
ray:release ray$ ./deviceQuery
There are 2 devices supporting CUDA
Device 0: "GeForce 9600M GT"
Major revision number: 1
Minor revision number: 337500
Total amount of global memory: 536543232 bytes
Number of multiprocessors: 1
Number of cores: 8
Total amount of constant memory: 1 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 8192
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: 0.07 GHz
Concurrent copy and execution: No
Device 1: "GeForce 9400M"
Major revision number: 3
Minor revision number: 250000
Total amount of global memory: 266010624 bytes
Number of multiprocessors: 1
Number of cores: 8
Total amount of constant memory: 1 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 8192
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: 0.07 GHz
Concurrent copy and execution: No
Test PASSED
Press ENTER to exit...
If the driver was not present, then all you'll get is an message "There is no device supporting CUDA"
Also make sure that the shell variables PATH and DYLD_LIBRARY_PATH are populated properly to something of the effect
- export PATH=/usr/local/cuda/bin:$PATH
- export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH
If you don't do the above, you're NOT going to be able to run any of the example codes with a error message like "dyld: Library not loaded: @rpath/libcudart.dylib" which refers to the runtime library of CUDA.
After all that is done, i ran the "oceanFFT" and if everything runs ay-ok on your machine, you would see something like what i have below:

If you check the output of the terminal screen, you will notice that CUDA is using my slightly more powerful graphics card i.e. GeForce 9600M GT instead of the GeForce 9400M and the reason is because i've configured my MBP's to do that via the System Preferences -> Energy Saver and select "Higher Performance->Power Adapter" and set "Computer Sleep" and "Display Sleep" to "Never" so that Mac will automatically pick out your more powerful graphics card :) neat trick i learnt from my colleagues at work! Go Mac!
3 comments:
Hi nice tut would you kindly take me through the process of altering the bash shell it's really doing me in, thanks
Thanks for posting this. I installed CUDA 2.2 on my Mac Pro and was able to build the binaries, but I kept getting a "There are no devices supporting CUDA" error. I went back, installed the 1.1 toolkit, rebooted, installed the 2.2 toolkit, rebooted, and now it works (my 8800 GT is detected). Thanks for helping me solve a frustrating error (and phooey to nVidia for making this harder than it needed to be).
Rick
Hmm, can't get this to work.
I set the environment variables, but it doesn't seem to find some libraries:
macbook-pro:oceanFFT minnerhobbs$ make
ld: library not found for -lrendercheckgl_i386
collect2: ld returned 1 exit status
make: *** [../../bin/darwin/release/oceanFFT] Error 1
minner-hobbss-macbook-pro:oceanFFT minnerhobbs$
This is the latest CUDA on a macbook pro running leopard.
thanks,
G
Post a Comment