[未解決]昔のMacBook Pro (Mid 2009) にGPUで演算させるためにCUDAを導入メモ

※未解決で不完全です

3DのレンダリングやAfter Effectなどの映像編集で使われるCUDA(Compute Unified Device Architecture:クーダ)を試そうとした時のメモ。
失敗してますが誰かの何かのお役に立てれば…

きっかけはAIの機械学習のため。
機械学習はめっちゃ時間かかる。余ってる古いMacBook Proにさせようとしたら今のメインのMacBook Airの3倍近くかかってしまう。
しかしこのMacBookProにはグラボ(NVIDIA GeForce 9400Mグラフィックプロセッサ、256MB)が載ってるから、噂のGPUでChainerのCUDA処理ができるんじゃないかと試した次第。

目次

環境

  • MacBook Pro (15-inch, Mid 2009)
  • OS X 10.11.4 (El Capitan)
  • Xcode 7.3
  • python 2.7.11

インストールしたライブラリ

  • CUDA 7.5.26 Driver
  • CUDA 7.5.20 Toolkit
  • cuDNN v5 → v4
  • pycuda
  • chainer 1.8

ほぼこちらのサイトそのままです。非常に参考になりました。
GeForce搭載の旧モデルMacBook ProでCUDAをセットアップする手順のメモ · hnakamur’s blog at github

CUDA 7.5 ドライバのインストール

MAC アーカイブ用CUDA ドライバ | NVIDIA から最新バージョンをダウンロード(この時点では7.5.26 for Mac )

sc2016-04-17 16.10.41 sc2016-04-17 16.10.12

特に問題なく完了。
システム環境設定にアイコンが追加される。

sc2016-04-17 16.12.42 sc2016-04-17 16.12.49

CUDA 7.5 Toolkitのインストール

CUDA Toolkit | NVIDIA DeveloperからMac OSXのLocal Installerをタブで選択しダウンロード。

sc2016-04-17 16.14.45

sc2016-04-17 16.15.19

Download Target Installer for Mac OSX 10.11 x86_64
cuda_7.5.20_mac.dmg (md5sum: 7f8f3af1ecee93d837b80b93e0251228)

Download (1.0 GB)

1.0GBありめっちゃ時間かかった

ダウンロードしたファイルを解凍してインストールするだけ。

 

HDD直下に以下のフォルダができた。

/Developer/NVIDIA/CUDA-7.5/

参考サイトにはREADMEの内容を実行しろとあったけど7.5からしなくていいっぽい

CUDAのPATHを通す

フロントエンドの人間には「パスを通す」というのがいつもわからない。怖くて不安。

参考サイト:Macで.bashrcをいじるとき – Qiita
こちらの通りに2つのファイルに書き込む。

.bash_profileと.bashrcファイルがなければ新規に作成。
自分の環境では ~/.bash_profile は既にあり、 ~/.bashrc は新規作成した。

ちなみに “~/” はユーザーのHOMEフォルダを指します。
ターミナルを起動したら一番最初の位置。
FinderだとユーザーのHOMEフォルダ直下。
.から始まる不可視ファイル、フォルダを表示させるようにしていればわかりやすいです。
途中すっ飛ばしてますが、最終的に ~/.bash_profile はこう書きました。

~/.bash_profile

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="/usr/local/cuda/bin:/Developer/NVIDIA/CUDA-7.5/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/lib/:/Developer/NVIDIA/CUDA-7.5/lib:$LD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="/usr/local/cud/lib:/Developer/NVIDIA/CUDA-7.5/lib:$LD_LIBRARY_PATH"
export HDF5_DIR="/usr/local/hdf5"
export CUDA_PATH="/usr/local/cuda"
eval "$(pyenv init -)"

if [ -f ‾/.bashrc ] ; then
. ‾/.bashrc
fi

CUDAのサンプル生成(この作業は不要)

$ sudo sh /Developer/NVIDIA/CUDA-7.5/bin/cuda-install-samples-7.5.sh
Error: target directory missing
Usage: cuda-install-samples-7.5.sh
Will append NVIDIA_CUDA-7.5_Samples to

エラーが出た。参考サイトにあるように後ろに引数(.)指定が必要だったのでやり直し。

$ sudo sh /Developer/NVIDIA/CUDA-7.5/bin/cuda-install-samples-7.5.sh .
Copying samples to ./NVIDIA_CUDA-7.5_Samples now...
Finished copying samples.

成功した模様!

と思ったけどこの作業は不要だったみたい。
/Developer/NVIDIA/CUDA-7.5/samples がインストールした時から既にあった。
上記のサンプル生成は不要です。

インストールテストの実行

参考サイトの /samples/0_Simple/asyncAPI を試してみます

$ cd /Developer/NVIDIA/CUDA-7.5/samples/0_Simple/asyncAPI/
$ sudo make
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -ccbin clang++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o asyncAPI.o -c asyncAPI.cu
nvcc fatal : The version ('70300') of the host compiler ('Apple clang') is not supported
make: *** [asyncAPI.o] Error 1

うーん、エラー…
ググってみるとどんぴしゃのページが。ありがたや

nvcc fatal : The version (‘70300’) of the host compiler (‘Apple clang’) is not supported – Qiita

原因はXcodeのバージョン(7.3)が対応してないので以前のバージョン(7.2)を入れることに。

ちなみに参考サイトのダウンロード先はなくなってたので、ここからXcode 7.2をダウンロードしました。
https://developer.apple.com/downloads/
直接リンク(できるか不明)

参考)http://adcdownload.apple.com/Developer_Tools/Xcode_7.2/Xcode_7.2.dmg

上記参考サイトと同じようにアプリケーションの名前を変更して、2つのバージョンを共存
(ダウンロードとインストールで2時間ぐらいかかりました)

ターミナル上でXcode7.2の方を優先させる
Xcode7.2を起動→検証が動いてここでも20分ぐらい

Xcodeの環境設定で タブ[Locations]-> Command Line Tools を Xcode 7.2(7C68)に

参考)ios – Revert Apple Clang Version For NVCC – Stack Overflow

再びコマンド実行

$ cd /Developer/NVIDIA/CUDA-7.5/samples/0_Simple/asyncAPI/
$ sudo make
$ sudo make install

無事成功!

Boost のインストール

なんでもC++の凄いライブラリとか(全くわかりません)

参考)
Mac OSX 10.10 (Yosemite)にpycudaをインストール: すけひろ日記
【C++】Mac に Boost を インストールした | ちょまど帳

https://sourceforge.net/projects/boost/files/boost/1.60.0/
から
boost_1_60_0.tar.gz (90.4MB)
を~/Downloads にダウンロード

$ cd ~/Downloads
$ tar zxf boost_1_60_0.tar.gz
$ cd~/Downloads/boost_1_60_0

$ ./bootstrap.sh --prefix=/opt/local\
$  --with-pyton=python \
$  --libdir=/opt/local/lib \ 
$  --includedir=/opt/local/include$ ./bjam install
$ sudo ./bootstrap.sh --prefix=/opt/local --with-python=PYTHON --libdir=/opt/local/lib --includedir=/opt/local/include$ ./bjam install

error: unrecognized option: –with-pyton=python
もしこのエラーが出たら –with-python=PYTHON と大文字にすればOKだった

$ sudo ./bootstrap.sh --prefix=/opt/local --with-python=PYTHON --libdir=/opt/local/lib --includedir=/opt/local/include$ ./bjam install Building Boost.Build engine with toolset darwin... tools/build/src/engine/bin.macosxx86_64/b2 Detecting Python version... 2.7 Detecting Python root... /Users/kanauchitooru2/.pyenv/versions/2.7.11 Unicode/ICU support for Boost.Regex?... not found. Generating Boost.Build configuration in project-config.jam... Bootstrapping is done. To build, run: ./b2 To adjust configuration, edit 'project-config.jam'. Further information: - Command line help: ./b2 --help - Getting started guide: http://www.boost.org/more/getting_started/unix-variants.html - Boost.Build documentation: http://www.boost.org/build/doc/html/index.html

上記の結果が出たら、次は下のコマンドでインストール実行

$ sudo ./b2 install -j4 --prefix=/opt/local

Performing configuration checks

- 32-bit : no
- 64-bit : yes
- arm : no
- mips1 : no
- power : no
- sparc : no
- x86 : yes
- symlinks supported : yes
- lockfree boost::atomic_flag : yes
- has_icu builds : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
- zlib : yes

ものすごくターミナルが動き出す。

523 warnings generated.
darwin.archive bin.v2/libs/test/build/darwin-4.2.1/release/link-static/threading-multi/libboost_test_exec_monitor.a
common.copy /opt/local/lib/libboost_test_exec_monitor.a
darwin.compile.c++ bin.v2/libs/wave/build/darwin-4.2.1/release/threading-multi/cpplexer/re2clex/cpp_re.o
darwin.link.dll bin.v2/libs/wave/build/darwin-4.2.1/release/threading-multi/libboost_wave.dylib
common.copy /opt/local/lib/libboost_wave.dylib
...updated 13046 targets...

1時間半ぐらいかかりました。

Bootが正常にインストールされたか動作テスト
こちらの boost_sort_vector.cpp の中身を test.cpp としてテキストエディタで保存(場所は任意)

$ g++ -I/opt/local/include test.cpp -o test.out
ld: can't write output file: test for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

sudo じゃないとダメみたいでやり直し

$ sudo g++ -I/opt/local/include test.cpp -o test.out

実行するとディレクトリに test.out というファイルが生成される
(なにげC++コンパイル人生初体験)

コンパイルされたファイルを実行する
./ が必ず必要!

$ ./test.out
Before sort
3
4
1
2
After sort
1
2
3

動いた!これでBootは大丈夫。

この時点でこのコマンドを試してみる。

$ kextstat | grep -i cuda
146 0 0xffffff7f82cce000 0x2000 0x2000 com.nvidia.CUDA (1.1.0) 5AFE550D-6361-3897-912D-897C13FF6983

CUDAの文字が出てるので大丈夫っぽい

ここまででCUDAとBootはインストールできてるっぽい

CUDA動作確認

NVIDIAの中のサンプルファイルを動かしてみる

$ g++ -I/usr/local/cuda/include -I/Developer/NVIDIA/CUDA-7.5/samples/common/inc /Developer/NVIDIA/CUDA-7.5/samples/1_Utilities/deviceQuery/deviceQuery.cpp

-IでCUDAのライブラリを指定する。ここは適時変更してください。
面倒なんだけどサンプル用のライブラリのパス samples/common/inc も指定しないといけない。

Undefined symbols for architecture x86_64:
"_cudaDeviceCanAccessPeer", referenced from:
_main in deviceQuery-52061f.o
"_cudaDeviceReset", referenced from:
_main in deviceQuery-52061f.o
void check(cudaError, char const*, char const*, int) in deviceQuery-52061f.o
"_cudaDriverGetVersion", referenced from:
_main in deviceQuery-52061f.o
"_cudaGetDeviceCount", referenced from:
_main in deviceQuery-52061f.o
"_cudaGetDeviceProperties", referenced from:
_main in deviceQuery-52061f.o
"_cudaGetErrorString", referenced from:
_main in deviceQuery-52061f.o
"_cudaRuntimeGetVersion", referenced from:
_main in deviceQuery-52061f.o
"_cudaSetDevice", referenced from:
_main in deviceQuery-52061f.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

うーん、architecture x86_64 が見つからないとエラー
Google先生にエラーメッセージでぐぐってみたけどよくわからなかった。
フォルダの中身を見るとMakefileがあるのでMakeを試してみる。

フォルダに移動

$ cd /Developer/NVIDIA/CUDA-7.5/samples/1_Utilities/deviceQuery
$ sudo make
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -ccbin clang++ -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o deviceQuery.o -c deviceQuery.cpp
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -ccbin clang++ -m64 -Xcompiler -arch -Xcompiler x86_64 -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-7.5/lib -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o deviceQuery deviceQuery.o
mkdir -p ../../bin/x86_64/darwin/release
cp deviceQuery ../../bin/x86_64/darwin/release

おお、何か動いた!
最後の行に ../../bin/x86_64/darwin/release にコピーしたとあるのでFinderで確認
/Developer/NVIDIA/CUDA-7.5/samples/bin/x86_64/darwin/release/deviceQuery
sc2016-04-18 1.23.05

上記のフォルダにファイルができていたのでダブルクリックで実行
sc2016-04-18 1.22.43

これでいいっぽい。

pycudaのインストール

下記参考サイトの通りに実行

参考サイト)Mac OSX 10.10 (Yosemite)にpycudaをインストール: すけひろ日記

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

~/Downloads/pycuda/siteconf.py をテキストエディタで編集

BOOST_INC_DIR = ['/opt/local/include']
BOOST_LIB_DIR = ['/opt/local/lib']
BOOST_COMPILER = 'gcc43'
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python-py27']
BOOST_THREAD_LIBNAME = ['boost_thread']
CUDA_TRACE = False
CUDA_ROOT = '/usr/local/cuda'
CUDA_ENABLE_GL = False
CUDA_ENABLE_CURAND = True
CUDADRV_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib64', '${CUDA_ROOT}/lib/stubs', '${CUDA_ROOT}/lib64/stubs']
CUDADRV_LIBNAME = ['cuda']
CUDART_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib64', '${CUDA_ROOT}/lib/stubs', '${CUDA_ROOT}/lib64/stubs']
CUDART_LIBNAME = ['cudart']
CURAND_LIB_DIR = ['${CUDA_ROOT}/lib', '${CUDA_ROOT}/lib64', '${CUDA_ROOT}/lib/stubs', '${CUDA_ROOT}/lib64/stubs']
CURAND_LIBNAME = ['curand']
CXXFLAGS = ["-arch", "x86_64", "-arch", "i386",'-mmacosx-version-min=10.11', '-isysroot', '/Applications/Xcode7.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk']
LDFLAGS = ["-F/Library/Frameworks", "-arch", "x86_64", "-arch", "i386",'-mmacosx-version-min=10.11', '-isysroot', '/Applications/Xcode7.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk']

参考サイトを見ながら適宜パスを変更しています。

$ cd ~/Downloads/pycuda
$ git clone git://github.com/inducer/compyte.git
$ cd ~/Downloads/pycuda
$ sudo make
Password:
ctags -R src || true
/Applications/Xcode7.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
/Users/kanauchitooru2/.pyenv/versions/2.7.11/bin/python setup.py build
***************************************************************
*** WARNING: nvcc not in path.
*** May need to set CUDA_INC_DIR for installation to succeed.
***************************************************************
running build
running build_py
running egg_info
writing requirements to pycuda.egg-info/requires.txt
writing pycuda.egg-info/PKG-INFO
writing top-level names to pycuda.egg-info/top_level.txt
writing dependency_links to pycuda.egg-info/dependency_links.txt
reading manifest file 'pycuda.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.cpp' under directory 'bpl-subset/bpl_subset/boost'
warning: no files found matching '*.html' under directory 'bpl-subset/bpl_subset/boost'
warning: no files found matching '*.inl' under directory 'bpl-subset/bpl_subset/boost'
warning: no files found matching '*.txt' under directory 'bpl-subset/bpl_subset/boost'
warning: no files found matching '*.h' under directory 'bpl-subset/bpl_subset/libs'
warning: no files found matching '*.ipp' under directory 'bpl-subset/bpl_subset/libs'
warning: no files found matching '*.pl' under directory 'bpl-subset/bpl_subset/libs'
writing manifest file 'pycuda.egg-info/SOURCES.txt'
running build_ext

すごいwarning出てたけどmake install実行

$ sudo make install
…
Finished processing dependencies for pycuda==2016.1

おお、成功した!

pycudaの動作確認

$ python
Python 2.7.11 (default, Apr 17 2016, 02:28:36)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycuda.autoinit
Traceback (most recent call last):
File "", line 1, in
File "pycuda/autoinit.py", line 2, in
import pycuda.driver as cuda
File "pycuda/driver.py", line 5, in
from pycuda._driver import * # noqa
ImportError: No module named _driver

あれーエラーが出る…
参考サイトをよく見ると、インストール直後はPATHが繋がってないらしい。
ターミナルを再起動してみる。(Mac本体は再起動してない)

$ python
Python 2.7.11 (default, Apr 17 2016, 02:28:36)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycuda.autoinit

Segmentation fault: 11

エラーが消えた!
Segmentation fault: 11 はメモリ関係のエラーらしいから気にしない。

NVIDIA cuDNNのインストール

NIVIDAのデベロッパーに登録して申請する必要がある。
sc2016-04-18 2.37.26

登録してログインしたらどこから探していいかわからなかったけど、cuDNNのページにアクセスすると普通に「DOWNLOAD」の項目あった。

cuDNN Download Surveyページは特に何もチェックしなくてもOK。
cuDNN v5 Library for OSX (80MB弱, cudnn-7.5-osx-x64-v5.0-rc.tgz )をダウンロード。

適当な所に保存して展開

$ tar -xzvf cudnn-7.5-osx-x64-v5.0-rc.tgz

以下のファイルが展開される

├ include
└ cudnn.h
└lib
├ libcudnn_static.a
├ libcudnn.5.dylib
└ libcudnn.dylib

上記ファイルを /Developer/NVIDIA/CUDA-7.5/ の libフォルダとinlcludeフォルダにそれぞれコピー。

一度ターミナルを再起動。

puython上で以下の2行を実行して問題なければOKらしい

from chainer import cuda
cuda.init()

ターミナル上でパスを指定して pythonを実行

$ LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH python
Python 2.7.11 (default, Apr 17 2016, 02:28:36)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from chainer import cuda
>>> cuda.init()
/Users/kanauchitooru2/.pyenv/versions/2.7.11/lib/python2.7/site-packages/chainer/cuda.py:85: UserWarning: cuDNN is not enabled.
Please reinstall chainer after you install cudnn
(see https://github.com/pfnet/chainer#installation).
'cuDNN is not enabled.\n'
>>> exit()

うーん、パスが通ってない?
Macを一度終了し試すも同じエラー。

http://qiita.com/sigmalogneko/items/2b6921c1068bb26582da
を見ると、Chainerをインストールしなおせばいいらしい

$ pip uninstall chainer
Proceed (y/n)? y
Successfully uninstalled chainer-1.8.0
$ CUDA_PATH=/usr/local/cuda pip install chainer --no-cache-dir
Running setup.py install for chainer ... done
Successfully installed chainer-1.8.0

念のためMAC再起動。

cudaを再度試すも同じエラーメッセージ。

参考サイト Chainer 1.6 GPU 対応に関するメモ|毎日の向こうに
を見ると、CuDNNのコピー後にシンボリックリンクを作らないといけなかった

$ cd /Developer/NVIDIA/CUDA-7.5/lib/
$ sudo ln -s libcudnn.4.dylib libcudnn.dylib
ln: libcudnn.dylib: File exists

コピーした時に解凍ファイルにシンボリックリンクも混ざってた。
libcudnn.dylibを削除して作成しなおした。

$ sudo rm -r libcudnn.dylib
$ sudo ln -s libcudnn.4.dylib libcudnn.dylib

もう一度 chainerを再インストール

$ sudo pip uninstall chainer
$ sudo -H CUDA_PATH=/usr/local/cuda pip install chainer --no-cache-dir

セーフモード起動

Command + R 押しながら起動して、ターミナルを起動してコマンド実行

$ csrutil disable

これでGPUのグラフィックボードにアクセスできるようになる??

HDF5のインストール

$ sudo -H HDF5_DIR=/usr/local pip install h5py
Command "/Users/kanauchitooru2/.pyenv/versions/2.7.11/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-OeJYnd/h5py/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bmSDuO-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-OeJYnd/h5py/

でエラー。

参考  Chainerを1.5にアップグレードするのにやったこと – Qiita の通りに、ソースからインストールしたらほぼ大丈夫だった。

ダウンロードしたのはここから
HDF5 Source Code → hdf5-1.8.16.tar.gzただ参考サイトのコマンド、コピペだとエラー出た(本当にによくわかってない)

$ sudo ./configure --prefix=/usr/local/hdf5 --enable-fortran --enable-cxx
> onfigure: error: Fortran could not compile .f90 files

オプションを削ったらOKだった。
僕の環境では以下のコマンドでOKでした。

$ sudo ./configure --prefix=/usr/local/hdf5
$ sudo make
$ sudo make check
$ sudo make install

makeとmake checkはかなり時間かかった。

~/.bash_profile をメモ帳で開いて環境変数(パス)を1行追加

export HDF5_DIR=/usr/local/hdf5

そして chainer を再インストール (何回目だよ…)

$ sudo -H pip uninstall chainer
$ sudo -H CUDA_PATH=/usr/local/cuda pip install chainer --no-cache-dir

特に問題なく終わった!

それでもCUDAは動かない

ここまでやってRuby上で cudaが動くかテスト

$ python
Python 2.7.11 (default, Apr 17 2016, 02:28:36)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from chainer import cuda
>>> cuda.zeros(5)

/Users/kanauchitooru2/.pyenv/versions/2.7.11/lib/python2.7/site-packages/chainer/cuda.py:85: UserWarning: cuDNN is not enabled.
Please reinstall chainer after you install cudnn
(see https://github.com/pfnet/chainer#installation).
'cuDNN is not enabled.\n'

うーん、エラー。
パスは通ってるはずだけど念のためパス指定してやってみる

$ LD_LIBRARY_PATH=/usr/local/cuda/lib python
>>> from chainer import cuda
>>> cuda.zeros(5)

/Users/kanauchitooru2/.pyenv/versions/2.7.11/lib/python2.7/site-packages/chainer/cuda.py:85: UserWarning: cuDNN is not enabled.
Please reinstall chainer after you install cudnn
(see https://github.com/pfnet/chainer#installation).
'cuDNN is not enabled.\n'

同じエラー…

 

cudaとcuDNNのバージョンが合ってないかな…
組み合わせを試すことも考えましたが、もう心折れました。

ここまでで週末全部潰れた。
なれない作業にGoogle先生に聞いてばかりなのもあったけど、
ダウンロードとインストールでもかなり時間かかりました。
(古いMacBook Proだったのもある)

とりあえずここまで。
素直にAWSのGPUで試すことにしました。

このメモがいつか誰かの役に立ちますように。

  • URLをコピーしました!

この記事を書いた人

どうでもいいことばかりです

コメント

コメント一覧 (2件)

  • 初めして。
    私も昔のMac mini (Late 2009)(Geforce 9400M搭載)でCUDAの設定を行っていましたが、CUDA6以降はサポートしていないみたいです。
    そのために、上手くいかなったのではないでしょうか?
    CUDA5.5なら動くかもしれません。

    ソース:https://devtalk.nvidia.com/default/topic/803949/cuda-7-gpu-requirements-geforce-9400m-/

コメントする

目次