Help us understand the problem. What is going on with this article?

MacにCudaをインストールする

More than 3 years have passed since last update.

環境:GeForce搭載のMacbook Pro, OSX10.11

Driver + Toolkitをインストール

ここからダウンロード(downloadとかいてるところ)
https://developer.nvidia.com/cuda-toolkit

自分の場合は選択肢は
Mac OSX, x86_64, 10.11, local
を選んだ

パスを通す

~/.bashrcに以下を記述

~/.bashrc
## cuda
export PATH=/Developer/NVIDIA/CUDA-7.5/bin:$PATH
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-7.5/lib:$DYLD_LIBRARY_PATH

インストールが上手く行ったかのテストは以下を参考
https://hnakamur.github.io/blog/2015/07/25/setup_cuda_on_macbook_pro_with_geforce/

pycudaを入れる

cd ~/Download
git clone http://git.tiker.net/trees/pycuda.git
cd pycuda
python configure.py

pycudaの下にあるsiteconf.pyを以下のように修正

siteconf.py
BOOST_INC_DIR = ['/usr/local/Cellar/boost/1.58.0/include']
BOOST_LIB_DIR = ['usr/local/Cellar/boost/1.58.0/lib']
BOOST_COMPILER = 'gcc49'
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python-mt']
BOOST_THREAD_LIBNAME = ['boost_thread-mt']
CUDA_TRACE = False
CUDA_ROOT = '/usr/local/cuda'
CUDA_ENABLE_GL = False
CUDA_ENABLE_CURAND = True
CUDADRV_LIB_DIR = ['${CUDA_ROOT}/lib']
CUDADRV_LIBNAME = ['cuda']
CUDART_LIB_DIR = ['${CUDA_ROOT}/lib']
CUDART_LIBNAME = ['cudart']
CURAND_LIB_DIR = ['${CUDA_ROOT}/lib']
CURAND_LIBNAME = ['curand']
CXXFLAGS = ['-arch', 'x86_64', '-mmacosx-version-min=10.7', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk']
LDFLAGS = ['-F/Library/Frameworks', '-arch', 'x86_64', '-mmacosx-version-min=10.7', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk']

ここは自分の環境に合わせて変更してください
最初の2行はboostライブラリがある場所を指定してください
最後の2行はXcodeの設定にやバージョンに合わせてください

cd ~/Download/pycuda
git clone git://github.com/inducer/compyte.git

pycudaをインストール

cd ~/Download/pycuda
sudo make
sudo make install

pycudaが入ったかの確認

一度ターミナルを再起動して

python
>>> import pycuda.autoinit
>>>

のようにエラーが出なければうまく行ってる

参考http://sukehirodiary.seesaa.net/article/422737834.html

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away