使用SYCL支持安装Tensorflow

时间:2017-10-04 14:56:17

标签: python ubuntu tensorflow opencl nvidia

我想使用gdb跟踪Eens SYCL支持的Tensorflow操作内核实现。 但是,当我尝试安装.whl包时,会弹出一些关于fglrx的错误消息。

错误消息

Compiling /tmp/pip-1vfYDJ-build/tensorflow-1.0.1.data/purelib/tensorflow/contrib/cudnn_rnn/ops/gen_cudnn_rnn_ops.py ...
  File "/tmp/pip-1vfYDJ-build/tensorflow-1.0.1.data/purelib/tensorflow/contrib/cudnn_rnn/ops/gen_cudnn_rnn_ops.py", line 1
    Error: Fail to load fglrx kernel module!
             ^
SyntaxError: invalid syntax ....

配置

命令

以下是我根据教程使用的命令。

https://www.codeplay.com/portal/03-30-17-setting-up-tensorflow-with-opencl-using-sycl

  • 构造

    Please specify the location of python. [Default is /usr/local/bin/python]: 
    Please specify optimization flags to use during compilation [Default is -march=native]: 
    Do you wish to use jemalloc as the malloc implementation? (Linux only) [Y/n] 
    jemalloc enabled on Linux
    Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] 
    No Google Cloud Platform support will be enabled for TensorFlow
    Do you wish to build TensorFlow with Hadoop File System support? [y/N] 
    No Hadoop File System support will be enabled for TensorFlow
    Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] 
    No XLA support will be enabled for TensorFlow
    Found possible Python library paths: /usr/local/lib/python2.7/dist-packages
    /usr/lib/python2.7/dist-packages
    Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-packages]
    Using python library path: /usr/local/lib/python2.7/dist-packages
    Do you wish to build TensorFlow with OpenCL support? [y/N] y
    OpenCL support will be enabled for TensorFlow
    Do you wish to build TensorFlow with CUDA support? [y/N] 
    No CUDA support will be enabled for TensorFlow
    Please specify which C++ compiler should be used as the host C++ compiler. [Default is /usr/bin/clang++-3.6]: 
    Please specify which C compiler should be used as the host C compiler. [Default is /usr/bin/clang-3.6]: 
    
  • bazel build:

  

bazel build -c dbg --config = sycl       // tensorflow /工具/ pip_package:build_pip_package

  • build pip package:
  

巴泽勒滨/ tensorflow /工具/ pip_package / build_pip_package

  • 安装pip包
  

sudo pip install:   /tmp/tensorflow_pkg/tensorflow-1.0.1-cp27-none-linux_x86_64.whl

请帮我解决问题。

2 个答案:

答案 0 :(得分:1)

SYCL变体目前需要一个支持SPIR或SPIRV的平台,如Intel或AMD。 NVIDIA平台目前不支持。

答案 1 :(得分:1)

您不能(目前)在英特尔GPU上使用带有TensorFlow的SYCL。但是,它即将到来。您需要一些修复,然后它才能正常工作。您将需要等待新的Intel OpenCL GPU驱动程序,然后在TensorFlow上进行一些兼容性提交,然后才能在Intel GPU上运行。您可能还需要等待一段时间才能获得一些性能改进,因为我们一直更注重正确性,首先,性能会稍晚一些。