bazel compile error: enumeration value ‘CUDNN_POINTWISE_RECIPROCAL’ not handled in switch
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. $ 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. https://github.com/tensorflow/tensorflow/issues/60362 FYI.

btw:
tensorflow V2.12.0 requires 8.6cuDNN and 11.8 CUDA Hi @kentosho ,

Please look at the tested configurations [here](https://www.tensorflow.org/install/source#gpu). 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](https://www.tensorflow.org/install/pip#step-by-step_instructions). 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. 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"),
     )

```

 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. 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. 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. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60398">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60398">No</a>
 > 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?
<details><summary>Click to expand!</summary> 
 
 ### 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

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


### Relevant log output

_No response_</details>