Skip to content

bazel compile error: enumeration value ‘CUDNN_POINTWISE_RECIPROCAL’ not handled in switch #60398

Closed

Description

@kentosho
Click to expand!

Issue Type

Build/Install

Have you reproduced the bug with TF nightly?

No

Source

source

Tensorflow Version

v2.12.0

Custom Code

Yes

OS Platform and Distribution

Linux Debian Bullseye

Mobile device

No response

Python version

3.9

Bazel version

5.3.0

GCC/Compiler version

gcc (Debian 10.2.1-6) 10.2.1 20210110

CUDA/cuDNN version

cuda_11.6.r11.6/compiler.31057947_0

GPU model and memory

RTX A4000

Current Behaviour?

bazel build --config=cuda --config=mkl //tensorflow/tools/pip_package:build_pip_package
failed displaying following error messages

ERROR: /mnt/data/kentwork/src/AI/tensorflow/tensorflow/compiler/xla/stream_executor/cuda/BUILD:376:11: Compiling tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.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/cudnn_plugin/cuda_dnn.pic.d ... (remaining 141 arguments skipped)
In file included from bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_Operation.h:37,
from bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_OperationGraph.h:36,
from bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_Heuristics.h:31,
from bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend.h:101,
from tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:55:
bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_PointWiseDesc.h: In member function ‘int64_t cudnn_frontend::PointWiseDesc_v8::getPortCount() const’:
bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_PointWiseDesc.h:69:16: error: enumeration value ‘CUDNN_POINTWISE_RECIPROCAL’ not handled in switch [-Werror=switch]
69 | switch (mode) {
| ^
In file included from bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_OperationGraph.h:36,
from bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_Heuristics.h:31,
from bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend.h:101,
from tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:55:
bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_Operation.h: In member function ‘cudnn_frontend::Operation_v8&& cudnn_frontend::OperationBuilder_v8::build_pointwise_op()’:
bazel-out/k8-opt/bin/external/cudnn_frontend_archive/_virtual_includes/cudnn_frontend/third_party/cudnn_frontend/include/cudnn_frontend_Operation.h:354:16: error: enumeration value ‘CUDNN_POINTWISE_RECIPROCAL’ not handled in switch [-Werror=switch]
354 | switch (m_operation.pointwise_mode) {
| ^
cc1plus: some warnings being treated as errors
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.

Standalone code to reproduce the issue

bazel build --config=cuda --config=mkl //tensorflow/tools/pip_package:build_pip_package

Relevant log output

No response

Activity

  1. saurabhmj11 commented on Apr 22, 2023

    @saurabhmj11

    It looks like you are encountering a compilation error when building TensorFlow with Bazel on your Debian Bullseye system using CUDA and MKL. The error is related to a missing switch case in the cudnn_frontend library.

    One possible solution to this issue is to update the cudnn_frontend library to a newer version that has the missing switch case. You can try updating the cudnn_frontend by running the following command:

    arduino
    Copy code
    bazel build --config=cuda --config=mkl --config=monolithic //tensorflow/tools/pip_package:build_pip_package --incompatible_remove_native_http_archive=false
    This command will build TensorFlow with CUDA, MKL, and the latest version of the cudnn_frontend library.

    If updating the cudnn_frontend library doesn't solve the issue, you can try disabling the --config=mkl option when building TensorFlow with Bazel. You can do this by running the following command:

    arduino
    Copy code
    bazel build --config=cuda //tensorflow/tools/pip_package:build_pip_package
    This command will build TensorFlow with only CUDA and without MKL. This might help you to identify whether the issue is related to the MKL library or not.

    If neither of these solutions works, you might want to provide more information such as the complete build log or the full error message to help us better understand the issue.

  2. kentosho commented on Apr 22, 2023

    @kentosho
    Author

    $ bazel build --config=cuda --config=mkl --config=monolithic //tensorflow/tools/pip_package:build_pip_package --incompatible_remove_native_http_archive=false
    ERROR: --incompatible_remove_native_http_archive=false :: Unrecognized option: --incompatible_remove_native_http_archive=false

    gives Unrecognized option error

    I also tried removing --config mkl, which I can not get any improvement.

  3. Shuolongbj commented on Apr 24, 2023

    @Shuolongbj
    Contributor

    #60362 FYI.

    btw:
    tensorflow V2.12.0 requires 8.6cuDNN and 11.8 CUDA

  4. added
    subtype: ubuntu/linux
    TF 2.12
    on Apr 24, 2023
  5. SuryanarayanaY commented on Apr 25, 2023

    @SuryanarayanaY
    Collaborator

    Hi @kentosho ,

    Please look at the tested configurations here. For Tf2.12 version the tested configurations are GCC-9.3.1 , CUDA-11.8,cuDNN-8.6. Can you please cross check with the tested configurations.

    Also I would like to know the sequence of steps followed for build.Have you installed cuDNN as per instructions ? I am interested to know the sequence of steps followed by you for GPU setup with CUDA,cuDNN toolkit installations etc. Official instructions as per documentation mentioned here.

  6. added
    stat:awaiting response
    on Apr 25, 2023
  7. github-actions commented on May 3, 2023

    @github-actions

    This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

  8. added
    stale
    on May 3, 2023
  9. kentosho commented on May 6, 2023

    @kentosho
    Author

    compile suceeded for gcc-10.2.1 CUDA-11.8 cuDNN-8.9 with following patch
    it might be a wired patch

    diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
    index 1261273bc92..0a9d755af0f 100644
    --- a/tensorflow/workspace2.bzl
    +++ b/tensorflow/workspace2.bzl
    @@ -172,9 +172,9 @@ def _tf_repositories():
             name = "cudnn_frontend_archive",
             build_file = "//third_party:cudnn_frontend.BUILD",
             patch_file = ["//third_party:cudnn_frontend_header_fix.patch"],
    -        sha256 = "3c7b842cd67989810955b220fa1116e7e2ed10660a8cfb632118146a64992c30",
    -        strip_prefix = "cudnn-frontend-0.7.3",
    -        urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.7.3.zip"),
    +        sha256 = "d8dba9e2607a0c256aa8eacb45b39986ab6f3f24a4d431d4397047a3cb0cd4fb",
    +        strip_prefix = "cudnn-frontend-0.9",
    +        urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.9.zip"),
         )
    
    
  10. removed
    stale
    stat:awaiting response
    on May 6, 2023
  11. SuryanarayanaY commented on May 8, 2023

    @SuryanarayanaY
    Collaborator

    Hi @kentosho ,

    This might be due to the fact that TF tested cuDNN version is 8.6 whereas you are trying to use different version 8.9 and hence the change in dependencies might be worked.

    I assume you haven't checked with cuDNN-8.6 which is a tested configuration. If you have tested this but still fails please let us know. have you done the patch suitable for cuDNN-8.9 directly please let us know.

  12. added
    stat:awaiting response
    on May 8, 2023
  13. github-actions commented on May 16, 2023

    @github-actions

    This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

  14. added
    stale
    on May 16, 2023
  15. kentosho commented on May 18, 2023

    @kentosho
    Author

    I try to build with cuDNN 8.6 instead of cuDNN8.9 and sucssess to build with no error. Also, when using CuDNN 8.9, I had experienced an abnormal termination of python when running model.fit on sensorflow 2.12.0, but this phenomenon was fixed by using CuDNN 8.6.

  16. google-ml-butler commented on May 18, 2023

    @google-ml-butler

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

  17. surak commented on Jan 2, 2024

    @surak

    It looks like you are encountering a compilation error when building TensorFlow with Bazel on your Debian Bullseye system using CUDA and MKL. The error is related to a missing switch case in the cudnn_frontend library.

    One possible solution to this issue is to update the cudnn_frontend library to a newer version that has the missing switch case. You can try updating the cudnn_frontend by running the following command:

    arduino Copy code bazel build --config=cuda --config=mkl --config=monolithic //tensorflow/tools/pip_package:build_pip_package --incompatible_remove_native_http_archive=false This command will build TensorFlow with CUDA, MKL, and the latest version of the cudnn_frontend library.

    If updating the cudnn_frontend library doesn't solve the issue, you can try disabling the --config=mkl option when building TensorFlow with Bazel. You can do this by running the following command:

    arduino Copy code bazel build --config=cuda //tensorflow/tools/pip_package:build_pip_package This command will build TensorFlow with only CUDA and without MKL. This might help you to identify whether the issue is related to the MKL library or not.

    If neither of these solutions works, you might want to provide more information such as the complete build log or the full error message to help us better understand the issue.

    Is this a chatgpt reply?

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

Metadata

Metadata

Labels

TF 2.12stalestat:awaiting responsesubtype: ubuntu/linuxtype:build/install

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions