简体   繁体   English

在Ubuntu 18.04上使用Cuda 10构建Tensorflow r1.12

[英]Building Tensorflow r1.12 with Cuda 10 on Ubuntu 18.04

I really have tried getting built. 我确实尝试过建造。 I have followed the instructions here and here and here . 我已按照此处此处此处的指示进行操作。 Clean system: 清洁系统:

  • Ubuntu 18.04 server Ubuntu 18.04服务器
  • Ubuntu Gnome Ubuntu Gnome
  • Cuda 10.0 CUDA 10.0
  • cuDNN 7.4.1 cuDNN 7.4.1
  • NCCL 2.3.7 NCCL 2.3.7
  • TensorRT 5.0.2.1 TensorRT 5.0.2.1
  • Tensorflow r1.12 Tensorflow R1.12
  • Python 3.6 Python 3.6
  • GCC 7.3.0 using the command line: 使用命令行的GCC 7.3.0:

    bazel build --config=cuda --config=mkl //tensorflow/tools/pip_package:build_pip_package bazel build --config = cuda --config = mkl // tensorflow /工具/ pip_package:build_pip_package

This is the error: 这是错误:

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/devel/software/tensorflow/tools/bazel.rc
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=171
ERROR: Config value cuda is not defined in any .rc file

Anybody know which parts of bazel.rc the need to be imported? 有人知道需要导入bazel.rc的哪些部分?

Why is cuda not defined? 为什么未定义cuda?

If I try: 如果我尝试:

bazel test -c opt -- //tensorflow/... -//tensorflow/compiler/... -//tensorflow/contrib/lite/... bazel测试-c opt-// tensorflow / ...-// tensorflow / compiler / ...-// tensorflow / contrib / lite / ...

It fails with this error: 失败并显示以下错误:

ERROR: /devel/software/tensorflow/tensorflow/python/BUILD:3768:1: Linking of rule '//tensorflow/python:_pywrap_tensorflow_internal.so' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -shared -o bazel-out/k8-opt/bin/tensorflow/python/_pywrap_tensorflow_internal.so -Wl,--version-script bazel-out/k8-opt/bin/tensorflow/python/pywrap_tensorflow_internal_versionscript.lds ... (remaining 65 argument(s) skipped) 错误:/ devel / software / tensorflow / tensorflow / python / BUILD:3768:1:链接规则'//tensorflow/python:_pywrap_tensorflow_internal.so'失败(出口1)gcc失败:执行命令/ usr / bin / gcc时出错-shared -o bazel-out / k8-opt / bin / tensorflow / python / _pywrap_tensorflow_internal.so -Wl,-version-script bazel-out / k8-opt / bin / tensorflow / python / pywrap_tensorflow_internal_versionscript.lds ...(剩下的65个参数已跳过)

Anyone had success? 有人成功吗? (Obviously at least 2 people have) Maybe someone could tell me what I am doing wrong? (显然至少有两个人)也许有人可以告诉我我做错了什么? Or how to get this built? 还是如何构建它?

Do as what is said in the warning and it will work. 按照警告中的内容进行操作,它将起作用。

"WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/devel/software/tensorflow/tools/bazel.rc"

You should have a file .bazelrc at /devel/software/tensorflow/.bazelrc. 您应该在/devel/software/tensorflow/.bazelrc中有一个文件.bazelrc。 At the top of this file add the following code snippet. 在此文件的顶部添加以下代码段。

import /devel/software/tensorflow/tools/bazel.rc

Enjoy! 请享用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM