rocm-arch / tensorflow-rocm

tensorflow-rocm AUR package
17 stars 12 forks source link

a bazel problem #48

Closed Arniiiii closed 1 year ago

Arniiiii commented 1 year ago

os: manjaro spec: a notebook with amd ryzen 4700 U (it has AVX2 and FMA if believe lscpu) with Renoir radeon graphics pkg: python-tensorflow-amd python-tensorflow-opt-amd

is it me doing something wrong or this is an issue?

Building tensorflow-amd...
==> Making package: tensorflow-amd 2.9.2-2 (Fri 03 Feb 2023 01:11:47 AM EET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found tensorflow-amd-2.9.2.tar.gz
  -> Found fix-c++17-compat.patch
  -> Found fix-rocblas-include.patch
==> Validating source files with sha512sums...
    tensorflow-amd-2.9.2.tar.gz ... Passed
    fix-c++17-compat.patch ... Passed
    fix-rocblas-include.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting tensorflow-amd-2.9.2.tar.gz with bsdtar
==> Starting prepare()...
patching file tensorflow/core/util/gpu_solvers.h
patching file tensorflow/stream_executor/rocm/rocblas_wrapper.h
patching file tensorflow/stream_executor/rocm/rocm_blas.h
Package nccl was not found in the pkg-config search path.
Perhaps you should add the directory containing `nccl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'nccl', required by 'virtual:world', not found
/var/tmp/pamac-build-john/tensorflow-amd/PKGBUILD: line 129: /opt/cuda/bin/nvcc: No such file or directory
sed: can't read /usr/include/cudnn_version.h: No such file or directory
==> Removing existing $pkgdir/ directory...
==> Starting build()...
Building with rocm and without non-x86-64 optimizations
You have bazel 6.0.0 installed.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
    --config=mkl            # Build with MKL support.
    --config=mkl_aarch64    # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
    --config=monolithic     # Config for mostly static monolithic build.
    --config=numa           # Build with NUMA support.
    --config=dynamic_kernels    # (Experimental) Build kernels into separate shared objects.
    --config=v1             # Build with TensorFlow 1 API instead of TF 2 API.
Preconfigured Bazel build configs to DISABLE default on features:
    --config=nogcp          # Disable GCP support.
    --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'build' from /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc:
  'build' options: --define framework_shared_object=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library
INFO: Reading rc options for 'build' from /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python --action_env PYTHON_LIB_PATH=/usr/lib/python3.10/site-packages --python_path=/usr/bin/python --define=with_xla_support=true --config=rocm --action_env TF_SYSTEM_LIBS=boringssl,curl,cython,gif,icu,libjpeg_turbo,lmdb,nasm,png,pybind11,zlib
INFO: Reading rc options for 'build' from /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:rocm in file /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc: --crosstool_top=@local_config_rocm//crosstool:toolchain --define=using_rocm_hipcc=true --define=tensorflow_mkldnn_contraction_kernel=0 --repo_env TF_NEED_ROCM=1
INFO: Found applicable config definition build:mkl in file /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc: --define=build_with_mkl=true --define=enable_mkl=true --define=tensorflow_mkldnn_contraction_kernel=0 --define=build_with_openmp=true -c opt
INFO: Found applicable config definition build:linux in file /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc: --copt=-w --host_copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --config=dynamic_kernels --distinct_host_configuration=false --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
Loading: 
Loading: 0 packages loaded
Analyzing: 4 targets (2 packages loaded, 0 targets configured)
ERROR: /home/john/.cache/bazel/_bazel_john/05230ec5b44981fd336ba7f532110697/external/bazel_tools/platforms/BUILD:84:6: in alias rule @bazel_tools//platforms:linux: Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on https://github.com/bazelbuild/platforms. See https://github.com/bazelbuild/bazel/issues/8622 for details.
ERROR: /home/john/.cache/bazel/_bazel_john/05230ec5b44981fd336ba7f532110697/external/bazel_tools/platforms/BUILD:84:6: Analysis of target '@bazel_tools//platforms:linux' failed
ERROR: /var/tmp/pamac-build-john/tensorflow-amd/src/tensorflow-2.9.2-amd/tensorflow/BUILD:1177:8: While resolving toolchains for target //tensorflow:install_headers: Target @local_execution_config_platform//:platform was referenced as a platform, but does not provide PlatformInfo
ERROR: Analysis of target '//tensorflow:install_headers' failed; build aborted: 
INFO: Elapsed time: 8.046s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (7 packages loaded, 8 targets configured)
==> ERROR: A failure occurred in build().
vrbouza commented 1 year ago

I see the same errors (btw I had to manually install roctracer, from main repos, maybe it should be added as dependency?) using Arch with a 6800XT:

ERROR: /home/X/.cache/bazel/_bazel_X/d53f54156b3cedbf472e29fb0ea2ec80/external/bazel_tools/platforms/BUILD:19:6: in alias rule @bazel_tools//platforms:x86_64: Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on https://github.com/bazelbuild/platforms. See https://github.com/bazelbuild/bazel/issues/8622 for details.

ERROR: /home/X/.cache/bazel/_bazel_X/d53f54156b3cedbf472e29fb0ea2ec80/external/bazel_tools/platforms/BUILD:19:6: Analysis of target '@bazel_tools//platforms:x86_64' failed

ERROR: /home/X/.cache/yay/tensorflow-rocm/src/tensorflow-2.10.0-rocm/tensorflow/tools/pip_package/BUILD:278:10: While resolving toolchains for target //tensorflow/tools/pip_package:build_pip_package: Target @local_execution_config_platform//:platform was referenced as a platform, but does not provide PlatformInfo

ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted:

vrbouza commented 1 year ago

At least in for me, with the last update of the tensorflow-rocm package this issue no longer appears (though others yes).

acxz commented 1 year ago

Thanks for your testing @vrbouza I'll go ahead and close this issue.