2019년 1월 24일 목요일

Install nvidia-cuda-toolkit 9.0.176-2 on Debian (buster).

At first, need to download all the dependencies from http://ftp.riken.jp/Linux/debian/debian/pool/non-free/n/nvidia-cuda-toolkit/, and install these.

# dpkg -i libaccinj64-9.0_9.0.176-2_amd64.deb libnppig9.0_9.0.176-2_amd64.deb libcublas9.0_9.0.176-2_amd64.deb libnppim9.0_9.0.176-2_amd64.deb libcudart9.0_9.0.176-2_amd64.deb libnppist9.0_9.0.176-2_amd64.deb libcuinj64-9.0_9.0.176-2_amd64.deb libnppisu9.0_9.0.176-2_amd64.deb libcurand9.0_9.0.176-2_amd64.deb libnppitc9.0_9.0.176-2_amd64.deb libcusolver9.0_9.0.176-2_amd64.deb libnpps9.0_9.0.176-2_amd64.deb libcusparse9.0_9.0.176-2_amd64.deb libnvgraph9.0_9.0.176-2_amd64.deb libnppc9.0_9.0.176-2_amd64.deb libnvrtc9.0_9.0.176-2_amd64.deb libnppial9.0_9.0.176-2_amd64.deb libnvtoolsext1_9.0.176-2_amd64.deb libnppicc9.0_9.0.176-2_amd64.deb libnvvm3_9.0.176-2_amd64.deb libnppicom9.0_9.0.176-2_amd64.deb  libnppidei9.0_9.0.176-2_amd64.deb libnppif9.0_9.0.176-2_amd64.deb  

In order to prevent automatic upgrade, mark some packages as hold.

# apt-mark hold libnvtoolsext1 libnvvm3 nvidia-cuda-dev nvidia-cuda-toolkit nvidia-profiler

Indeed, minor dependencies should be downloaded and installed.
# apt install gcc-6 g++-6 clang-4.9

And, finalize the install of nvidia-cuda-toolkit.

# dpkg -i nvidia-profiler_9.0.176-2_amd64.deb
# dpkg -i nvidia-cuda-dev_9.0.176-2_amd64.deb
# dpkg -i nvidia-cuda-toolkit_9.0.176-2_amd64.deb 

Next, download and install remaining dependencies from https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/

# dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
# dpkg -i libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
# dpkg -i libcudnn7-doc_7.0.5.15-1+cuda9.0_amd64.deb

(venv) $ python3.6
>>> pip install tensorflow-gpu

In terms of virtualenv, please see the other post about it.

Install wxPython 4.0.4 in raspberry pi

1. preparation
1.2. sdhc >= 16GB installed raspbian
1.3. Install dependencies
# sudo apt install libjpeg-dev libtiff5-dev libnotify-dev libgtk2.0-dev libgtk-3-dev libsdl1.2-dev libgstreamer-plugins-base0.10-dev libwebkitgtk-dev freeglut3 freeglut3-dev

1.4. Turn off the GUI boot chaning to CLI
Preferences -> Raspberry Pi Configuration -> At Boot, select To CLI


2. Install wxpython 4.0.4
# sudo pip3 install wxpython

3. Wait and do not see .....

4. return to GUI
#sudo raspi-config
 -> 3. BootOptions -> B1 Desktop / CLI -> B4 Desktop Autologin -> double 'TAB' -> Finish

# reboot

5. Check the installation
$ python3

>>> import wx
>>> wx.__version__
'4.0.4'



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