rocm-arch / tensorflow-rocm

tensorflow-rocm AUR package
17 stars 12 forks source link

Fix build with ROCm 5.6.0 #58

Closed lubosz closed 10 months ago

lubosz commented 1 year ago

Patch rocm_configure.bzl to drop hip subdirectory in hipcc path.

This fixes /opt/rocm/hip/bin/hipcc: No such file or directory. https://github.com/rocm-arch/tensorflow-rocm/issues/57

Furthermore it adds LLVM 16 headers to the include path and fixes:

ERROR: tensorflow-rocm/src/tensorflow-2.13.0-opt-rocm/tensorflow/core/kernels/rnn/BUILD:55:18: Compiling tensorflow/core/kernels/rnn/gru_ops_gpu.cu.cc failed: undeclared inclusion(s) in rule '//tensorflow/core/kernels/rnn:gru_ops_gpu':
this rule is missing dependency declarations for the following files included by 'tensorflow/core/kernels/rnn/gru_ops_gpu.cu.cc':
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__clang_hip_runtime_wrapper.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/cuda_wrappers/cmath'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/stddef.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__clang_hip_libdevice_declares.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__clang_hip_math.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/cuda_wrappers/algorithm'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/cuda_wrappers/new'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/limits.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/stdint.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__clang_hip_stdlib.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__clang_cuda_math_forward_declares.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__clang_hip_cmath.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__clang_cuda_complex_builtins.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/cuda_wrappers/complex'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/__stddef_max_align_t.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/stdarg.h'
  '/opt/rocm/llvm/lib/clang/16.0.0/include/sanitizer/tsan_interface.h'
acxz commented 10 months ago

This is great, @lubosz! I have a small request though. Is it possible for you to submit these patches upstream to the https://github.com/tensorflow/tensorflow repo? This ensures that the work we do here is contributed back upstream. Once you do that, you can modify the sources to point to the upstream PR. For an example, see the following: https://github.com/rocm-arch/rocm-arch/blob/fb6969fcc3619b8ee63495da8c194d1f9285056f/migraphx/PKGBUILD#L14

Edit: done see corresponding issue