Skip to content

Tensorflow 2.12 bazel failed!Cuda11.2+cuDNN8.1+Tensorrt7.2 under Ubuntu2004 #60362

Closed

Description

@Shuolongbj
Click to expand!

Issue Type

Build/Install

Have you reproduced the bug with TF nightly?

No

Source

source

Tensorflow Version

tf2.12

Custom Code

Yes

OS Platform and Distribution

Ubuntu2004

Mobile device

No response

Python version

3.8

Bazel version

5.3

GCC/Compiler version

9.4

CUDA/cuDNN version

CUDA11.2/cuDNN8.1

GPU model and memory

No response

##Current Behaviour?

TensorRT Version: 7.2.3.4 CUDA Version: 11.2 CUDNN Version: 8.1.1.33-1 Operating System: Ubuntu-20.04

https://github.com/tensorflow/tensorflow/blob/master/.bazelrc

Bazel build latest 2.12 source code failed:

##Standalone code to reproduce the issue

# Configuration: 605fee2c8aa1b68d8dcb7abeac1c0e77048ffd56710c9ebb1fee2729853263d3
# Execution platform: @local_execution_config_platform//:platform
tensorflow/compiler/xla/stream_executor/cuda/cuda_graph.cc: In function ‘tsl::StatusOr<stream_executor::gpu::OwnedCudaGraph> stream_executor::gpu::CaptureCudaGraph(stream_executor::Stream*, absl::lts_20220623::AnyInvocable<tsl::Status()>, cudaStreamCaptureMode)’:
tensorflow/compiler/xla/stream_executor/cuda/cuda_graph.cc:135:21: **error**: ‘cudaGraphDebugDotFlagsVerbose’ was not declared in this scope
  135 |         int flags = cudaGraphDebugDotFlagsVerbose;
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tensorflow/compiler/xla/stream_executor/cuda/cuda_graph.cc:136:24: **error**: ‘cudaGraphDebugDotPrint’ was not declared in this scope
  136 |         if (auto err = cudaGraphDebugDotPrint(graph, file.c_str(), flags);
      |                        ^~~~~~~~~~~~~~~~~~~~~~
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 11358.490s, Critical Path: 270.65s
INFO: 26270 processes: 9762 internal, 16508 local.
FAILED: Build did NOT complete successfully

Relevant log output

No response

Activity

  1. added
    subtype:bazel
    TF 2.12
    subtype: ubuntu/linux
    on Apr 19, 2023
  2. SweetVishnya commented on Apr 20, 2023

    @SweetVishnya
    Contributor

    @mihaimaruseac, same here. I am trying to build TensorFlow 2.12 in docker:

    sudo docker run --gpus all -it -w /tensorflow -v /home/vishnya/tensorflow:/tensorflow -v $PWD:/mnt -e HOST_PERMS="\\((id -u):\\)(id -g)" tensorflow/tensorflow:devel-gpu bash
    bazel build --config=cuda //tensorflow/tools/pip_package:build_pip_package
    
  3. mihaimaruseac commented on Apr 20, 2023

    @mihaimaruseac
    Contributor

    When building from master, please always give the commit, given TF moves fast forward.

    Does it reproduce if you switch to a newer commit?

  4. mihaimaruseac commented on Apr 20, 2023

    @mihaimaruseac
    Contributor

    Sorry, I misread the link to the .bazelrc in master branch.

    Can you try a bazel clean --expunge and then build again?

    Adding @angerson and @MichaelHudgins for the Docker stuff too.

  5. SweetVishnya commented on Apr 20, 2023

    @SweetVishnya
    Contributor

    When building from master, please always give the commit, given TF moves fast forward.

    Does it reproduce if you switch to a newer commit?

    @mihaimaruseac, TensorFlow fails to build from r2.12 branch. I haven't tried master, because I try to locally rebuild 2.12 release.

    Can you try a bazel clean --expunge and then build again?

    I'll try it.

  6. SweetVishnya commented on Apr 20, 2023

    @SweetVishnya
    Contributor

    Can you try a bazel clean --expunge and then build again?

    @mihaimaruseac, it didn't help. The same error:

    ERROR: /tensorflow/tensorflow/compiler/xla/stream_executor/cuda/BUILD:519:11: Compiling tensorflow/compiler/xla/stream_executor/cuda/cuda_graph.cc failed: (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/k8-opt/bin/tensorflow/compiler/xla/stream_executor/cuda/_objs/cuda_graph/cuda_graph.pic.d ... (remaining 108 arguments skipped)
    tensorflow/compiler/xla/stream_executor/cuda/cuda_graph.cc: In function ‘tsl::StatusOr<stream_executor::gpu::OwnedCudaGraph> stream_executor::gpu::CaptureCudaGraph(stream_executor::Stream*, absl::lts_20220623::AnyInvocable<tsl::Status()>, cudaStreamCaptureMode)’:
    tensorflow/compiler/xla/stream_executor/cuda/cuda_graph.cc:135:21: error: ‘cudaGraphDebugDotFlagsVerbose’ was not declared in this scope
      135 |         int flags = cudaGraphDebugDotFlagsVerbose;
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    tensorflow/compiler/xla/stream_executor/cuda/cuda_graph.cc:136:24: error: ‘cudaGraphDebugDotPrint’ was not declared in this scope
      136 |         if (auto err = cudaGraphDebugDotPrint(graph, file.c_str(), flags);
          |                        ^~~~~~~~~~~~~~~~~~~~~~
    Target //tensorflow/tools/pip_package:build_pip_package failed to build
    
  7. mihaimaruseac commented on Apr 20, 2023

    @mihaimaruseac
    Contributor

    Could it be because 2.12 uses cuDNN 8.6, Cuda 11.8?

  8. SweetVishnya commented on Apr 20, 2023

    @SweetVishnya
    Contributor

    Could it be because 2.12 uses cuDNN 8.6, Cuda 11.8?

    nvcc --version
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2021 NVIDIA Corporation
    Built on Sun_Feb_14_21:12:58_PST_2021
    Cuda compilation tools, release 11.2, V11.2.152
    Build cuda_11.2.r11.2/compiler.29618528_0
    

    Hmm, maybe I am using the wrong docker container. What's the right docker container with fresh cuda to build 2.12?

  9. mihaimaruseac commented on Apr 20, 2023

    @mihaimaruseac
    Contributor

    Tagging @angerson

  10. SweetVishnya commented on Apr 20, 2023

    @SweetVishnya
    Contributor

    Now I am trying the following docker (at least it has correct CUDA version):

    sudo docker run --rm --gpus all -it -w /tensorflow -v /home/vishnya/tensorflow:/tensorflow -v $PWD:/mnt -e HOST_PERMS="\\((id -u):\\)(id -g)" tensorflow/build:2.12-python3.8 bash
    bazel build --config=cuda //tensorflow/tools/pip_package:build_pip_package
    
  11. MichaelHudgins commented on Apr 20, 2023

    @MichaelHudgins
    Collaborator

    As for docker containers using the tensorflow/build ones would be the correct ones. See: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/tf_sig_build_dockerfiles.

    I agree that it likely is the mismatch on the original issue as well. The root level .bazelrc should get an update in the next few days as clang is migrated. Until then https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/tf_sig_build_dockerfiles/devel.usertools/gpu_gcc.bazelrc has the bazelrc values being used in TF's CI.

  12. angerson commented on Apr 20, 2023

    @angerson
    Contributor

    Thanks Michael & Mihai. Those instructions Michael linked should work.

    I'll have to look into updating the https://www.tensorflow.org/install/source#docker_linux_builds docs. I guess they never got changed, as the SIG Build containers were not initially planned to be official.

  13. SweetVishnya commented on Apr 21, 2023

    @SweetVishnya
    Contributor

    I succeeded building TensorFlow 2.12 in tensorflow/build:2.12-python3.8 docker.

  14. Shuolongbj commented on Apr 21, 2023

    @Shuolongbj
    ContributorAuthor

    Thank you all. @SweetVishnya @angerson @MichaelHudgins @mihaimaruseac
    The relevant documents build from source have been updated to the latest version.well done!
    image

    BTW:
    bazel.rc TensorRT 7 for CUDA 11.1 is compatible with CUDA 11.2
    CUDA 11.2 must be 11.2 update 1,not 11.2 update 2, refer to here tensorrt-723/support-matrix

    nvrtc is deliver inside the CUDA toolkit, you can also install it separate, I find the links in:

    ubuntu1804
    https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-nvrtc-11-1_11.1.105-1_amd64.deb
    https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-nvrtc-dev-11-1_11.1.105-1_amd64.deb

    ubuntu2004
    https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/cuda-nvrtc-11-1_11.1.105-1_amd64.deb
    https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/cuda-nvrtc-dev-11-1_11.1.105-1_amd64.deb

    ubuntu2204
    https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2204/x86_64/cuda-nvrtc-11-1_11.1.105-1_amd64.deb https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2204/x86_64/cuda-nvrtc-dev-11-1_11.1.105-1_amd64.deb

  15. mihaimaruseac commented on Apr 21, 2023

    @mihaimaruseac
    Contributor

    In this case, we can close this?

  16. google-ml-butler commented on Apr 21, 2023

    @google-ml-butler

    Are you satisfied with the resolution of your issue?
    Yes
    No

  17. Shuolongbj commented on Apr 22, 2023

    @Shuolongbj
    ContributorAuthor

    And,I sucessed to build the latest 2.12 version with Cuda11.8+cuDNN8.6+Tensorrt8.5.2.2+JAX+Flax under Ubuntu2004 at last.

    you will continue to meet new "DataType kFP8" error as shown in the following information if you use the tensorrt version between 8.5.3 and 8.6.0 of TensorRT. (API Reference: 8.5.3, 8.6.0)

    Execution platform: @local_execution_config_platform//:platform
    tensorflow/compiler/tf2tensorrt/convert/weights.cc: In member function ‘size_t tensorflow::tensorrt::convert::TRT_ShapedWeights::size_bytes() const’:
    tensorflow/compiler/tf2tensorrt/convert/weights.cc:61:10: error: enumeration value ‘kFP8’ not handled in switch [-Werror=switch]
    61 | switch (type_) {
    | ^
    cc1plus: some warnings being treated as errors
    Target //tensorflow/tools/pip_package:build_pip_package failed to build
    INFO: Elapsed time: 1276.053s, Critical Path: 83.16s
    INFO: 8084 processes: 3883 internal, 4201 local.
    FAILED: Build did NOT complete successfully

  18. google-ml-butler commented on Apr 23, 2023

    @google-ml-butler

    Are you satisfied with the resolution of your issue?
    Yes
    No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

TF 2.12subtype: ubuntu/linuxsubtype:bazeltype:build/install

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions