首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用SYCL设置TensorFlow与OpenCL失败

使用SYCL设置TensorFlow与OpenCL失败
EN

Stack Overflow用户
提问于 2017-06-12 02:21:44
回答 1查看 774关注 0票数 0

我使用SYCL在Ubuntu16.04/ AMD RX480上按照https://www.codeplay.com/portal/03-30-17-setting-up-tensorflow-with-opencl-using-sycl设置了https://www.codeplay.com/portal/03-30-17-setting-up-tensorflow-with-opencl-using-sycl,并由于fglrx版本冲突而跳过安装OpenCL报头。

然后,失败时:

  1. 运行:$ bazel test --config=sycl -k --test_timeout 1600 -//tensorflow/.-/tensorflow/cont肋骨/.-//tensorflow/java/.-/tensorflow/编译器/.

返回: /home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/testlogs/tensorflow/go/test/test.log

代码语言:javascript
复制
Executed 1 out of 634 tests: 84 tests pass, 549 fail to build and 1 fails locally.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.

其中test.log显示:

代码语言:javascript
复制
[[ ! -x go ]]
[[ -x /usr/local/go/bin/go ]]
export
PATH=.:/home/opt/anaconda2/envs/sycl/bin:/home/opt/anaconda2/bin:/home/opt/OpenSource/torch/install/bin:/home/opt/OpenSource/torch/install/bin:/home/ai/bin:/home/ai/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/local/go/bin

PATH=.:/home/opt/anaconda2/envs/sycl/bin:/home/opt/anaconda2/bin:/home/opt/OpenSource/torch/install/bin:/home/opt/OpenSource/torch/install/bin:/home/ai/bin:/home/ai/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/local/go/bin
export
GOPATH=/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/_tmp/3e13e1018d21b8204dd1d98027854067/go

GOPATH=/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/_tmp/3e13e1018d21b8204dd1d98027854067/go
mkdir -p
/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/_tmp/3e13e1018d21b8204dd1d98027854067/go/src/github.com/tensorflow
ln -s
/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow
/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/_tmp/3e13e1018d21b8204dd1d98027854067/go/src/github.com/tensorflow/tensorflow
export
LIBRARY_PATH=/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow

LIBRARY_PATH=/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow
++ uname -s
OS=Linux
[[ Linux = \L\i\n\u\x ]]
[[ -z
/usr/local/computecpp/lib:/home/opt/OpenSource/torch/install/lib:/home/opt/OpenSource/torch/install/lib:  
]]
export
LD_LIBRARY_PATH=/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow:/usr/local/computecpp/lib:/home/opt/OpenSource/torch/install/lib:/home/opt/OpenSource/torch/install/lib:

LD_LIBRARY_PATH=/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow:/usr/local/computecpp/lib:/home/opt/OpenSource/torch/install/lib:/home/opt/OpenSource/torch/install/lib:
++ go version
echo 'Go version: go version go1.7.4 linux/amd64'
Go version: go version go1.7.4 linux/amd64
go test github.com/tensorflow/tensorflow/tensorflow/go
github.com/tensorflow/tensorflow/tensorflow/go/op
github.com/tensorflow/tensorflow/tensorflow/go
/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow/libtensorflow.so: undefined reference to cl::sycl::program::create_program_for_kernel_impl(std::string, unsigned char const*, int, char const* const*, std::shared_ptr<cl::sycl::detail::context>)
/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow/libtensorflow.so: undefined reference to cl::sycl::program::get_kernel_impl(std::string)
const
collect2: error: ld returned 1 exit status # github.com/tensorflow/tensorflow/tensorflow/go
/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow/libtensorflow.so: undefined reference to cl::sycl::program::create_program_for_kernel_impl(std::string, unsigned char const*, int, char const* const*, std::shared_ptr<cl::sycl::detail::context>)
/home/ai/.cache/bazel/_bazel_ai/03759b09788dc48db1c2f1f857f3711b/execroot/tensorflow-opencl/bazel-out/local_linux-opt/bin/tensorflow/go/test.runfiles/org_tensorflow/tensorflow/libtensorflow.so: undefined reference to cl::sycl::program::get_kernel_impl(std::string)
const
collect2: error: ld returned 1 exit status
FAIL    github.com/tensorflow/tensorflow/tensorflow/go [build failed]
FAIL    github.com/tensorflow/tensorflow/tensorflow/go/op [build failed]
  1. 或运行:$ bazel build _resources 2048,.5,1.0 -c opt -config=sycl.5,1.0

返回:

代码语言:javascript
复制
/home/opt/OpenSource/TensorFlow/tensorflow-opencl/tensorflow/compiler/xla/service/BUILD:108:1: C++ compilation of rule '//tensorflow/compiler/xla/service:versioned_computation_handle' failed: computecpp failed: error executing command external/local_config_sycl/crosstool/computecpp -Wall -msse3 -g0 -O2 -DNDEBUG '-std=c++11' -MD -MF ... (remaining 103 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from
tensorflow/compiler/xla/service/versioned_computation_handle.cc:16:0:
./tensorflow/compiler/xla/service/versioned_computation_handle.h:33:19: error:  
expected type-specifier before 'int64'
    using Version = int64;

./tensorflow/compiler/xla/service/versioned_computation_handle.h:36:3:  
error: Version does not name a type
    Version version;

./tensorflow/compiler/xla/service/versioned_computation_handle.h:38:3:  
error: string does not name a type
    string ToString() const;

./tensorflow/compiler/xla/service/versioned_computation_handle.h: In member function bool xla::VersionedComputationHandle::operator==(const
xla::VersionedComputationHandle&) const:
./tensorflow/compiler/xla/service/versioned_computation_handle.h:41:13: error:  
version was not declared in this scope
             (version == other.version);

./tensorflow/compiler/xla/service/versioned_computation_handle.h:41:30: error:  
const struct xla::VersionedComputationHandle has no member named version
             (version == other.version);

./tensorflow/compiler/xla/service/versioned_computation_handle.h: In member function bool xla::VersionedComputationHandle::operator<(const
xla::VersionedComputationHandle&) cons':
./tensorflow/compiler/xla/service/versioned_computation_handle.h:46:15: error:  
version was not declared in this scope
               (version < other.version)));

./tensorflow/compiler/xla/service/versioned_computation_handle.h:46:31: error:  
'const struct xla::VersionedComputationHandle' has no member named version
               (version < other.version)));

tensorflow/compiler/xla/service/versioned_computation_handle.cc: At global scope:
tensorflow/compiler/xla/service/versioned_computation_handle.cc:22:1:  
error: string does not name a type
  string VersionedComputationHandle::ToString() const {

tensorflow/compiler/xla/service/versioned_computation_handle.cc: In function std::ostream& xla::operator<<(std::ostream&, const
xla::VersionedComputationHandle&):
tensorflow/compiler/xla/service/versioned_computation_handle.cc:28:27:  
error: const struct xla::VersionedComputationHandle has no member named ToString out << versioned_handle.ToString();

此外,我的CPU和GPU在ComputeCPP看来都是“未经测试”的,根据computecpp_info的说法。

EN

回答 1

Stack Overflow用户

发布于 2017-06-12 10:50:37

为了克服第一个错误,尝试-//tensorflow/go/... -我们还没有尝试go包装器。

XLA错误令人困惑,因为在交叉脚本中,我们显式地避免使用ComputeCpp (party/sycl/crosstool/computecpp.tpl#L46)编译“编译器”文件夹。

确保您在这个分支上:mehdi

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44490557

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档