1_TensorFlow1.31.1 GPU版本源码编译【重点备忘】
GPU计算能力为3.0的显卡,Kali Linux系统上面配置安装CUDA:
(1)#################### 【 各个软件的版本适配说明 】 ###############
https://tensorflow.google.cn/install/source
(2)#################### 【 Linux上面安装 NVIDIA GPU 显卡驱动 】 ####################
https://www.kali.org/docs/general-use/install-nvidia-drivers-on-kali-linux/
(3)#################### 【 CUDA 10.0 】 ####################
https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal
★使用 --override 参数进行安装:
.//cuda_10.0.130_410.48_linux.run --override
(4)#################### 【 cuDNN v7.4.2 (Dec 14, 2018), for CUDA 10.0 】 ##########
https://developer.nvidia.com/rdp/cudnn-archive#a-collapse742-10
Compatible Driver >= 410.48
(5)#################### 【 tensorflow-gpu==1.13.1 】 ####################
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.13.1
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting tensorflow-gpu==1.13.1
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7b/b1/0ad4ae02e17ddd62109cd54c291e311c4b5fd09b4d0678d3d6ce4159b0f0/tensorflow_gpu-1.13.1-cp36-cp36m-manylinux1_x86_64.whl (345.2MB)
(6)####################【 Python 3.3-3.6 下载源码进行编译安装 】##############
https://www.python.org/ftp/python/3.6.8/
【源码编译参考:】
https://blog.csdn.net/l497626363/article/details/104903454
(7)####################【 必须将 numpy 降低版本为 1.14 】 ####################
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.14
(8)★★★★★★★★★★★★★★【 安装 GCC4.8 G++4.8 】 ★★★★★★★★★★★★★★★
aptitude install gcc-4.8 gcc-4.8-multilib
aptitude install g++-4.8 g++-4.8-multilib
(9)★★★★★★★★★★★★★★【 先清理,而后(源码编译安装 tensorflow1.13.1) 】 ★★★★★★★
清理:
bazel clean --expunge
root@longhk:/tensorflow-1.13.1# bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --verbose_failures
??最开始进行清理: bazel clean; 【 rm -rf ~/.cache 不要用,会清除下载的 第三方包!】
root@longhk:/tensorflow-1.13.1# bazel clean --expunge
WARNING: ignoring _JAVA_OPTIONS in environment.
Starting local Bazel server and connecting to it...
INFO: Invocation ID: e2deaab8-0473-499c-a030-829a517b86ee
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
root@longhk:/tensorflow-1.13.1# bazel build 【这个要去掉,否则编译报错: --cxxopt=-std=c++11 】 --copt=-march=native --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --verbose_failures