gpt4 book ai didi

ubuntu - 在 Ubuntu 18.04 上构建具有 OpenCL 支持的 TensorFlow 失败

转载 作者:行者123 更新时间:2023-12-04 18:44:53 30 4
gpt4 key购买 nike

在尝试使用此 configuration 在 Ubuntu 18.04 上编译 Tensorflow 时我遇到了这个错误:

ERROR: /home/joao/Documents/playground/tensorflow/tensorflow/contrib/tensor_forest/hybrid/BUILD:72:1: C++ compilation of rule '//tensorflow/contrib/tensor_forest/hybrid:utils' failed (Exit 1)
In file included from tensorflow/contrib/tensor_forest/hybrid/core/ops/utils.cc:15:
In file included from ./tensorflow/contrib/tensor_forest/hybrid/core/ops/utils.h:20:
In file included from ./tensorflow/core/framework/tensor.h:19:
In file included from ./third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:
In file included from external/eigen_archive/unsupported/Eigen/CXX11/Tensor:99:
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:163:19: error: no matching member function for call to 'get_access'
auto ptr =buf.get_access<cl::sycl::access::mode::discard_write, cl::sycl::access::target::host_buffer>().get_pointer();
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/local_config_sycl/crosstool/../sycl/include/SYCL/buffer.h:532:3: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'accessMode'
get_access() {
^
external/local_config_sycl/crosstool/../sycl/include/SYCL/buffer.h:550:53: note: candidate function template not viable: requires single argument 'cgh', but no arguments were provided
accessor<T, dimensions, accessMode, accessTarget> get_access(
^
external/local_config_sycl/crosstool/../sycl/include/SYCL/buffer.h:572:53: note: candidate function template not viable: requires 3 arguments, but 0 were provided
accessor<T, dimensions, accessMode, accessTarget> get_access(
^
external/local_config_sycl/crosstool/../sycl/include/SYCL/buffer.h:592:53: note: candidate function template not viable: requires at least 2 arguments, but 0 were provided
accessor<T, dimensions, accessMode, accessTarget> get_access(
^
external/local_config_sycl/crosstool/../sycl/include/SYCL/buffer.h:609:68: note: candidate function template not viable: requires 2 arguments, but 0 were provided
accessor<T, dimensions, accessMode, access::target::host_buffer> get_access(
^
external/local_config_sycl/crosstool/../sycl/include/SYCL/buffer.h:623:68: note: candidate function template not viable: requires at least argument 'range', but no arguments were provided
accessor<T, dimensions, accessMode, access::target::host_buffer> get_access(
^
In file included from tensorflow/contrib/tensor_forest/hybrid/core/ops/utils.cc:15:
In file included from ./tensorflow/contrib/tensor_forest/hybrid/core/ops/utils.h:20:
In file included from ./tensorflow/core/framework/tensor.h:19:
In file included from ./third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:
In file included from external/eigen_archive/unsupported/Eigen/CXX11/Tensor:99:
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:195:61: error: no member named 'map_allocator' in namespace 'cl::sycl'
auto src_buf = cl::sycl::buffer<uint8_t, 1, cl::sycl::map_allocator<uint8_t> >(static_cast<uint8_t*>(static_cast<void*>(const_cast<Index*>(src))), cl::sycl::range<1>(n));
~~~~~~~~~~^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:195:75: error: unexpected type name 'uint8_t': expected expression
auto src_buf = cl::sycl::buffer<uint8_t, 1, cl::sycl::map_allocator<uint8_t> >(static_cast<uint8_t*>(static_cast<void*>(const_cast<Index*>(src))), cl::sycl::range<1>(n));
^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:195:86: warning: expression result unused [-Wunused-value]
auto src_buf = cl::sycl::buffer<uint8_t, 1, cl::sycl::map_allocator<uint8_t> >(static_cast<uint8_t*>(static_cast<void*>(const_cast<Index*>(src))), cl::sycl::range<1>(n));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:198:31: error: expected unqualified-id
auto src_acc =src_buf.template get_access<cl::sycl::access::mode::read, cl::sycl::access::target::global_buffer>(cgh);
^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:198:107: error: nested name specifier 'cl::sycl::access::target::' for declaration does not refer into a class, class template or class template partial specialization
auto src_acc =src_buf.template get_access<cl::sycl::access::mode::read, cl::sycl::access::target::global_buffer>(cgh);
~~~~~~~~~~~~~~~~~~~~~~~~~~^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:198:120: error: expected ';' at end of declaration
auto src_acc =src_buf.template get_access<cl::sycl::access::mode::read, cl::sycl::access::target::global_buffer>(cgh);
^
;
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:217:62: error: no member named 'map_allocator' in namespace 'cl::sycl'
auto dest_buf = cl::sycl::buffer<uint8_t, 1, cl::sycl::map_allocator<uint8_t> >(static_cast<uint8_t*>(dst), cl::sycl::range<1>(n));
~~~~~~~~~~^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:217:76: error: unexpected type name 'uint8_t': expected expression
auto dest_buf = cl::sycl::buffer<uint8_t, 1, cl::sycl::map_allocator<uint8_t> >(static_cast<uint8_t*>(dst), cl::sycl::range<1>(n));
^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:217:87: warning: expression result unused [-Wunused-value]
auto dest_buf = cl::sycl::buffer<uint8_t, 1, cl::sycl::map_allocator<uint8_t> >(static_cast<uint8_t*>(dst), cl::sycl::range<1>(n));
^~~~~~~~~~~~~~~~~~~~~~~~~~
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:220:32: error: expected unqualified-id
auto dst_acc =dest_buf.template get_access<cl::sycl::access::mode::discard_write, cl::sycl::access::target::global_buffer>(cgh);
^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:220:117: error: nested name specifier 'cl::sycl::access::target::' for declaration does not refer into a class, class template or class template partial specialization
auto dst_acc =dest_buf.template get_access<cl::sycl::access::mode::discard_write, cl::sycl::access::target::global_buffer>(cgh);
~~~~~~~~~~~~~~~~~~~~~~~~~~^
external/eigen_archive/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h:220:130: error: expected ';' at end of declaration
auto dst_acc =dest_buf.template get_access<cl::sycl::access::mode::discard_write, cl::sycl::access::target::global_buffer>(cgh);
^
;
2 warnings and 11 errors generated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 170.920s, Critical Path: 39.24s
INFO: 2976 processes: 2976 local.
FAILED: Build did NOT complete successfully

如果有人可以帮助我,我将不胜感激,我已经尝试解决这个问题一段时间了,但似乎没有任何效果。我也尝试过用 triSYCL 编译它,但问题仍然存在,我还确认在没有 OpenCL 支持的情况下编译可以按预期工作,没有任何错误。

最佳答案

最近 SYCL 规范中的接口(interface)发生了变化,因此您需要确保您的 TensorFlow 源代码与 ComputeCpp 版本匹配。

跟随指南here并确保您已下载最新版本的 ComputeCpp 并从 GitHub 获得最新版本的源代码。请注意,您需要使用 Codeplay 分支 here因为更改需要一些时间才能传播到主 TensorFlow 存储库,所以指南中对此进行了概述。

关于ubuntu - 在 Ubuntu 18.04 上构建具有 OpenCL 支持的 TensorFlow 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51688885/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com