機械学習用の環境構築を行っています。
- MacOSX10.11.6 El Capitan
- Python 3.8.2
前段は下記
https://teratail.com/questions/251286
pip install pynvxを実施した結果、下記のエラーが出ました。
$ pip install pynvx Collecting pynvx Using cached pynvx-1.0.0.tar.gz (150 kB) Installing collected packages: pynvx Running setup.py install for pynvx ... error ERROR: Command errored out with exit status 1: command: /Users/<ユーザ名>/.pyenv/versions/3.8.2/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/setup.py'"'"'; __file__='"'"'/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-record-n9acp2vu/install-record.txt --single-version-externally-managed --compile --install-headers /Users/<ユーザ名>/.pyenv/versions/3.8.2/include/python3.8/pynvx cwd: /private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/ Complete output (72 lines): running install running build running build_py creating build creating build/lib.macosx-10.11-x86_64-3.8 creating build/lib.macosx-10.11-x86_64-3.8/pynvx copying pynvx/__init__.py -> build/lib.macosx-10.11-x86_64-3.8/pynvx copying pynvx/pynvml.py -> build/lib.macosx-10.11-x86_64-3.8/pynvx running build_ext -- The C compiler identification is AppleClang 8.0.0.8000042 -- The CXX compiler identification is AppleClang 8.0.0.8000042 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: /Users/<ユーザ名>/.pyenv/versions/3.8.2/bin/python3.8 (found version "3.8.2") -- Found PythonLibs: /Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/libpython3.8.a -- Performing Test HAS_CPP14_FLAG -- Performing Test HAS_CPP14_FLAG - Success -- pybind11 v2.3.dev0 -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- LTO enabled CMake Error at /Applications/CMake.app/Contents/share/cmake-3.17/Modules/FindCUDA.cmake:715 (message): Specify CUDA_TOOLKIT_ROOT_DIR Call Stack (most recent call first): CMakeLists.txt:8 (find_package) -- Configuring incomplete, errors occurred! See also "/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/build/temp.macosx-10.11-x86_64-3.8/CMakeFiles/CMakeOutput.log". Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/setup.py", line 68, in <module> setup( File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/command/install.py", line 545, in run self.run_command('build') File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/setup.py", line 32, in run self.build_extension(ext) File "/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/setup.py", line 56, in build_extension subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env) File "/Users/<ユーザ名>/.pyenv/versions/3.8.2/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/build/lib.macosx-10.11-x86_64-3.8', '-DPYTHON_EXECUTABLE=/Users/<ユーザ名>/.pyenv/versions/3.8.2/bin/python3.8', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1. ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/<ユーザ名>/.pyenv/versions/3.8.2/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/setup.py'"'"'; __file__='"'"'/private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-install-3hv7hf9l/pynvx/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kb/136jgc252tvbq6x86lgfx3mc0000gn/T/pip-record-n9acp2vu/install-record.txt --single-version-externally-managed --compile --install-headers /Users/<ユーザ名>/.pyenv/versions/3.8.2/include/python3.8/pynvx Check the logs for full command output.
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.17/Modules/FindCUDA.cmake:715 (message): Specify CUDA_TOOLKIT_ROOT_DIR Call Stack (most recent call first): CMakeLists.txt:8 (find_package)
上記内容からCMakeのCUDAのパスが不正と考え、下記リンクの内容を参考にいくつかの対応を施しました。
https://stackoverflow.com/questions/19980412/how-to-let-cmake-find-cuda
①
cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/CUDA-8.0
②~/.bash_profileに下記を追記
export CUDA_TOOLKIT_ROOT_DIR="/Developer/CUDA-8.0"
export CUDA_BIN_PATH="/Developer/CUDA-8.0"
export PATH=$PATH:/usr/local/cuda/CUDA-8.0
追記後
$ source ~/.bash_profile
を実施。
ただしどちらも現象は変わらずでした。
何か他に対応方法もしくは調査の手がかりになりそうなことをご存知の方おりましたら、ご教授願います。
あなたの回答
tips
プレビュー