接到了一个需求,需要验证一下在深度操作系统中是否适配以下软件:
- python2.7
- python3.5
- gnuradio 最新版
- tensorflow 1.7以上版本
- cuda 9.1版本适配
- cndnn 7.1版本适配
- QT 5.0版本适配
首先,操作系统已经默认装了python2.7和python3.5 。通过命令行就可以查看:
deepin@deepin-PC:~$ apt-cache policy python2.7 python3.5
python2.7:
已安装:2.7.13-2
候选: 2.7.13-2
版本列表:
*** 2.7.13-2 500
500 http://pools.corp.deepin.com/professional elephant/main amd64 Packages
100 /var/lib/dpkg/status
python3.5:
已安装:3.5.3-1
候选: 3.5.3-1
版本列表:
*** 3.5.3-1 500
500 http://pools.corp.deepin.com/professional elephant/main amd64 Packages
100 /var/lib/dpkg/status
验证gnuradio的最新版
安装依赖:
sudo apt-get install git cmake libboost-all-dev swig3.0 libasound2-dev pyqt4-dev-tools libqwt-dev libzmq3-dev libusb-1.0-0-dev doxygen python-mako bison flex libevent-dev libssl-dev python-twisted autoconf -y
下载最新源码
git clone https://github.com/gnuradio/gnuradio.git
编译安装
cd gnuradio
mkdir build
cd build
cmake -DENABLE_INTERNAL_VOLK=OFF ../
make
make test
sudo make install
验证 tensorflow 1.7以上版本:
多次执行sudo pip install tensorflow ,因为执行的时候,会下载好几个包,但是下载会失败多次,所以多执行几遍。
安装完成之后,执行命令验证tensorflow 是否能够正确运行:
deepin@deepin-PC:~/cudnn_samples_v7/mnistCUDNN$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import tensorflow as tf
hello = tf.constant('Hello,TensorFlow!')
sess = tf.Session()
2018-10-23 10:49:04.013088: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
print sess.run(hello)
Hello,TensorFlow!
使用命令pip3 show tensorflow,查看tensorflow版本
deepin@deepin-PC:~/Downloads$ pip show tensorflow
Name: tensorflow
Version: 1.11.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: protobuf, grpcio, termcolor, numpy, six, mock, tensorboard, backports.weakref, absl-py, wheel, keras-applications, keras-preprocessing, gast, enum34, astor, setuptools
cuda 9.1版本适配
在连接中下载修改repo的deb包:
https://developer.nvidia.com/cuda-91-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1704&target_type=debnetwork
安装步骤:
sudo dpkg -i cuda-repo-ubuntu1704_9.1.85-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1704/x86_64/7fa2af80.pub`
sudo apt-get update
sudo apt-get install cuda
cudnn7.1安装步骤:
官网下载包cudnn-9.1-linux-x64-v7.1.tgz ,libcudnn7_7.1.3.16-1+cuda9.1_amd64.deb ,libcudnn7-dev_7.1.3.16-1+cuda9.1_amd64.deb ,libcudnn7-doc_7.1.3.16-1+cuda9.1_amd64.deb :
https://developer.nvidia.com/rdp/cudnn-archive
执行命令:
tar -xzvf cudnn-9.1-linux-x64-v7.1.tgz
cd cudnn
sudo cp lib64/* /usr/local/cuda/lib64/
sudo cp include/cudnn.h /usr/local/cuda/include/
安装deb包:
sudo dpkg -i libcudnn7_7.1.3.16-1+cuda9.1_amd64.deb
sudo dpkg -i libcudnn7-dev_7.1.3.16-1+cuda9.1_amd64.deb
sudo dpkg -i libcudnn7-doc_7.1.3.16-1+cuda9.1_amd64.deb
QT5.0安装:
下载地址
http://download.qt.io/archive/qt/5.0/5.0.0/
chmod +x qt-linux-opensource-5.0.0-x86_64-offline.run
./qt-linux-opensource-5.0.0-x86_64-offline.run
执行安装成功。