2019년 1월 24일 목요일

Install log of tensorflow-gpu on Debian (buster)

1. Install nvidia driver
# apt install nvidia-driver

1.1. Driver check
# nvidia-smi
Thu Jan 24 15:06:13 2019 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 390.87 Driver Version: 390.87 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 105... Off | 00000000:01:00.0 On | N/A | | 45% 30C P8 N/A / 75W | 220MiB / 4038MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 872 G /usr/lib/xorg/Xorg 135MiB | | 0 13044 G /usr/lib/firefox-esr/firefox-esr 1MiB | | 0 13275 G /usr/lib/firefox-esr/firefox-esr 79MiB | | 0 14283 G /usr/lib/firefox-esr/firefox-esr 1MiB | +-----------------------------------------------------------------------------+

1.2. Install cuda toolkit
# apt install nvidia-cuda-toolkit
# cudafe++ -v
cudafe: NVIDIA (R) Cuda Language Front End Portions Copyright (c) 2005-2018 NVIDIA Corporation Portions Copyright (c) 1988-2016 Edison Design Group Inc. Based on Edison Design Group C/C++ Front End, version 4.14 (Jun 12 2018 23:07:12) Cuda compilation tools, release 9.2, V9.2.148
# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2018 NVIDIA Corporation Built on Tue_Jun_12_23:07:04_CDT_2018 Cuda compilation tools, release 9.2, V9.2.148

2. Install Python3.6
2.1. Check default python in Debian 10(buster)
# apt policy python3
python3: Installed: 3.7.1-3 Candidate: 3.7.1-3 Version table: *** 3.7.1-3 500 500 http://debian-archive.trafficmanager.net/debian testing/main amd64 Packages 100 /var/lib/dpkg/status

2.2. Install packages of python3.6 and virtualenv
 # apt install python3.6 virtualenv

3. build the private console with python3.6
$ virtualenv --system-site-packages -p python3.6 ./venv
$ source ./venv/bin/activate
(venv) $ pip install --upgrade pip
(venv) $ pip install tensorflow-gpu

4. (TODO) Check tensorflow-gpu

(venv) $ python
Python 3.6.8 (default, Jan 3 2019, 03:42:36) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/home/user/Workspace/deep_neural_network/venv/lib/python3.6/imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "/home/user/Workspace/deep_neural_network/venv/lib/python3.6/imp.py", line 343, in load_dynamic return _load(spec) ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.6/dist-packages/tensorflow/__init__.py", line 22, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/__init__.py", line 49, in from tensorflow.python import pywrap_tensorflow File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/home/user/Workspace/deep_neural_network/venv/lib/python3.6/imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "/home/user/Workspace/deep_neural_network/venv/lib/python3.6/imp.py", line 343, in load_dynamic return _load(spec) ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

4.1. Fix the absence of libcublas.so.9.0

Have to do lots of works to install dependencies related to libcublas.so.9.0.
Please see my next post about installation of nvidia-cuda-toolkit.

P.S.
# prompt : root privilage
$ prompt : user prifilage

댓글 없음:

댓글 쓰기