1_TensorFlow1.31.1 GPU版本源码编译【重点备忘】

这篇博客详细记录了在Kali Linux上,针对GPU计算能力为3.0的显卡,如何配置CUDA 10.0和cuDNN v7.4.2,以及源码编译安装TensorFlow 1.13.1 GPU版本的过程。包括NVIDIA GPU驱动安装、CUDA和cuDNN的下载与安装、Python和numpy版本控制、GCC 4.8及G++ 4.8的安装、TensorFlow源码编译以及遇到的错误和解决方案,最终成功编译并安装了tensorflow-gpu==1.13.1。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.youkuaiyun.com/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

(10)★★★★★★★★★★★★★★【 下载时,会经常报错的处理。 】★★★★★★★★★★★★★
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: no such package '@llvm//': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/llvm-mirror/llvm/archive/2ba3294845dedcbb27dc49287bfbcdb49aa1e6b7.tar.gz, https://github.com/llvm-mirror/llvm/archive/2ba3294845dedcbb27dc49287bfbcdb49aa1e6b7.tar.gz] to /root/.cache/bazel/_bazel_root/3f83cabb457beddc67f1cf84eff7f8a3/external/llvm/2ba3294845dedcbb27dc49287bfbcdb49aa1e6b7.tar.gz: Tried to reconnect at offset 165,210 but server didn't support it
INFO: Elapsed time: 40.457s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (356 packages loaded, 16216 targets configured)
    Fetching @grpc; fetching 39s
    Fetching @llvm; fetching 39s

(11)★

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值