Mac OS X v10.6 Snow LeopardでCUDA開発環境を構築
使用しているMacは
MB403J/A(MacBook 2.4GHz Core 2 Duo/13.3/2G/160G/8xSuperDrive DL/Gigabit/BT/DVI)
にメモリを4Gに拡張したものです。
結論から言うとこちらの記事で紹介されていた方法であっさり構築できました。
が、リンク先の記事のdeviceQueryの実行結果を見ると使用されているMacはどうやらMacBookProのようで、、、、
私のMacは1世代前でオンボードグラフィックのみになっています、、、
Device 0: "Device Emulation (CPU)" CUDA Driver Version: 2.30 CUDA Runtime Version: 2.30 CUDA Capability Major revision number: 9999 CUDA Capability Minor revision number: 9999 Total amount of global memory: 4294967295 bytes Number of multiprocessors: 16 Number of cores: 128 Total amount of constant memory: 65536 bytes Total amount of shared memory per block: 16384 bytes Total number of registers available per block: 8192 Warp size: 1 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.35 GHz Concurrent copy and execution: No Run time limit on kernels: No Integrated: Yes Support host page-locked memory mapping: Yes Compute mode: Default (multiple host threads can use this device simultaneously)
上記の通りdeviceQueryを実行するとやはりGPUエミュレーションモードになっています。
この場合、リンク先の記事に書かれている方法でmakeをして出力されたサンプルプログラムは実行できません。
./particles [CUDA Particles Simulation] grid: 64 x 64 x 64 = 262144 cells particles: 32768 cudaSafeCall() Runtime API error in file, line 90 : initialization error.
のようにエラーになります。
こちらの記事のようにmakeのパラメータとしてemu=1を指定してあげます。
make i386=1 x86_64=0 emu=1
すると
/Developer/GPU Computing/C/bin/darwin/emurelease
というディレクトリにエミュレーション用のサンプルプログラムが出力されます。
これで問題なく実行はできるようになります。
が、重くて話にならない、、、、
やっぱりグラボ載せられるサーバ買うしかないか、、、、、