Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@Geek1986

Install cuda to macOS

More than 3 years have passed since last update.

Environment

macOS Sierra 10.12.2
2.9GHz, 8GB, NVIDIA Geforce

Install Driver + Toolkit

Download link:

Setting the bashrc file

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

Install pycuda from source

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

modify the siteconf.py under the pycuda folder
(if boost is not installed brew install boost)

BOOST_INC_DIR = ['/usr/local/Cellar/boost/1.60.0_1/include']
BOOST_LIB_DIR = ['usr/local/Cellar/boost/1.60.0_1/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.12.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.12.sdk']
cd ~/Download/pycuda
sudo make
sudo make install

※Note
You must import any of pycuda files while you are in the different directory that you extracted the pycuda tar.gz file

Check whether pycuda was installed or not yet

python
>>> import pycuda.autoinit
>>>
0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  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
Geek1986

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?