title: Bazel build error with Cuda on Windows 10, how resolve it?
body: <p>I'm trying to compile a  Tensorflow core, with CUDA support (I need cc 8.6 for GeForce3090) on Windows 10 64bit via Bazel by this instruction: <a href="https://www.tensorflow.org/install/source_windows" rel="nofollow noreferrer">https://www.tensorflow.org/install/source_windows</a></p>
  <p>I use this build string:
  bazel build --config=opt --config=cuda --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package</p>
  <p>I get error, like bellow:</p>
  <p>How I can resolve this?</p>
  <p>Thanx.</p>
  <pre><code>  &gt; D:\Python\tensorflow&gt;bazel build --config=opt --config=cuda
      &gt; --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package Extracting Bazel
      &gt; installation... WARNING: Ignoring JAVA_HOME, because it must point to
      &gt; a JDK, not a JRE. Starting local Bazel server and connecting to it...
      &gt; WARNING: The following configs were expanded more than once: [cuda,
      &gt; using_cuda]. For repeatable flags, repeats are counted twice and may
      &gt; lead to unexpected behavior. INFO: Options provided by the client:  
      &gt; Inherited 'common' options: --isatty=1 --terminal_columns=237 INFO:
      &gt; Reading rc options for 'build' from d:\python\tensorflow\.bazelrc:  
      &gt; Inherited 'common' options: --experimental_repo_remote_exec INFO:
      &gt; Options provided by the client:   'build' options:
      &gt; --python_path=C:/Program Files/Python37/python.exe INFO: Reading rc options for 'build' from d:\python\tensorflow\.bazelrc:   'build'
      &gt; options: --apple_platform_type=macos --define
      &gt; framework_shared_object=true --define open_source_build=true
      &gt; --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=tensorflow_enable_mlir_generated_gpu_kernels=0 --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 --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=short_logs --config=v2 INFO: Reading rc options for 'build' from d:\python\tensorflow\.tf_configure.bazelrc:   'build' options:
      &gt; --action_env PYTHON_BIN_PATH=C:/Program Files/Python37/python.exe --action_env PYTHON_LIB_PATH=C:/Program Files/Python37/lib/site-packages --python_path=C:/Program
      &gt; Files/Python37/python.exe --config=xla --action_env
      &gt; CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing
      &gt; Toolkit/CUDA/v11.1 --action_env TF_CUDA_COMPUTE_CAPABILITIES=5.2,8.6
      &gt; --config=cuda --action_env TF_CONFIGURE_IOS=0 INFO: Found applicable config definition build:short_logs in file
      &gt; d:\python\tensorflow\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
      &gt; INFO: Found applicable config definition build:v2 in file
      &gt; d:\python\tensorflow\.bazelrc: --define=tf_api_version=2
      &gt; --action_env=TF2_BEHAVIOR=1 INFO: Found applicable config definition build:xla in file d:\python\tensorflow\.bazelrc:
      &gt; --define=with_xla_support=true INFO: Found applicable config definition build:cuda in file d:\python\tensorflow\.bazelrc:
      &gt; --config=using_cuda --define=using_cuda_nvcc=true INFO: Found applicable config definition build:using_cuda in file
      &gt; d:\python\tensorflow\.bazelrc: --define=using_cuda=true --action_env
      &gt; TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain
      &gt; --define=tensorflow_enable_mlir_generated_gpu_kernels=1 INFO: Found applicable config definition build:opt in file
      &gt; d:\python\tensorflow\.tf_configure.bazelrc: --copt=/arch:SSE4.2
      &gt; --define with_default_optimizations=true INFO: Found applicable config definition build:cuda in file d:\python\tensorflow\.bazelrc:
      &gt; --config=using_cuda --define=using_cuda_nvcc=true INFO: Found applicable config definition build:using_cuda in file
      &gt; d:\python\tensorflow\.bazelrc: --define=using_cuda=true --action_env
      &gt; TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain
      &gt; --define=tensorflow_enable_mlir_generated_gpu_kernels=1 INFO: Found applicable config definition build:windows in file
      &gt; d:\python\tensorflow\.bazelrc: --copt=/W0 --copt=/D_USE_MATH_DEFINES
      &gt; --host_copt=/D_USE_MATH_DEFINES --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/experimental:preprocessor --host_copt=/experimental:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --experimental_strict_action_env=true --verbose_failures --distinct_host_configuration=false INFO: Found applicable config definition build:monolithic in file d:\python\tensorflow\.bazelrc:
      &gt; --define framework_shared_object=false DEBUG: Rule 'io_bazel_rules_go' indicated that a canonical reproducible form can be obtained by
      &gt; modifying arguments shallow_since = &quot;1557349968 -0400&quot; DEBUG:
      &gt; Repository io_bazel_rules_go instantiated at:   no stack
      &gt; (--record_rule_instantiation_callstack not enabled) Repository rule
      &gt; git_repository defined at:  
      &gt; C:/users/vladimir/_bazel_vladimir/sd7zocps/external/bazel_tools/tools/build_defs/repo/git.bzl:195:33:
      &gt; in &lt;toplevel&gt; INFO: Repository local_config_cuda instantiated at:   no
      &gt; stack (--record_rule_instantiation_callstack not enabled) Repository
      &gt; rule cuda_configure defined at:  
      &gt; D:/python/tensorflow/third_party/gpus/cuda_configure.bzl:1418:33: in
      &gt; &lt;toplevel&gt; 
  
  ------------------------------------------------------------------------
  **ERROR: An error occurred during the fetch of repository
      &gt; 'local_config_cuda':**    Traceback (most recent call last):
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 1388
      &gt;                 _create_local_cuda_repository(&lt;1 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 1064,
      &gt; in _create_local_cuda_repository
      &gt;                 _find_libs(repository_ctx, &lt;2 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 599,
      &gt; in _find_libs
      &gt;                 _check_cuda_libs(repository_ctx, &lt;2 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 501,
      &gt; in _check_cuda_libs
      &gt;                 execute(repository_ctx, &lt;1 more arguments&gt;)***
      &gt;         File &quot;D:/python/tensorflow/third_party/remote_config/common.bzl&quot;, line 217,
      &gt; in execute
      &gt;                 fail(&lt;1 more arguments&gt;) Repository command failed &quot;C:/Program&quot; is not an internal or external command, executable
      &gt; program, or batch file. 
  
  ---------------------------------------------------------------------------
  
  ERROR: Skipping
      &gt; '//tensorflow/tools/pip_package:build_pip_package': no such package
      &gt; '@local_config_cuda//cuda': Traceback (most recent call last):
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 1388
      &gt;                 _create_local_cuda_repository(&lt;1 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 1064,
      &gt; in _create_local_cuda_repository
      &gt;                 _find_libs(repository_ctx, &lt;2 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 599,
      &gt; in _find_libs
      &gt;                 _check_cuda_libs(repository_ctx, &lt;2 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 501,
      &gt; in _check_cuda_libs
      &gt;                 execute(repository_ctx, &lt;1 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/remote_config/common.bzl&quot;, line 217,
      &gt; in execute
      &gt;                 fail(&lt;1 more arguments&gt;) Repository command failed &quot;C:/Program&quot; is not an internal or external command, executable
      &gt; program, or batch file. WARNING: Target pattern parsing failed. ERROR:
      &gt; no such package '@local_config_cuda//cuda': Traceback (most recent
      &gt; call last):
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 1388
      &gt;                 _create_local_cuda_repository(&lt;1 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 1064,
      &gt; in _create_local_cuda_repository
      &gt;                 _find_libs(repository_ctx, &lt;2 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 599,
      &gt; in _find_libs
      &gt;                 _check_cuda_libs(repository_ctx, &lt;2 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/gpus/cuda_configure.bzl&quot;, line 501,
      &gt; in _check_cuda_libs
      &gt;                 execute(repository_ctx, &lt;1 more arguments&gt;)
      &gt;         File &quot;D:/python/tensorflow/third_party/remote_config/common.bzl&quot;, line 217,
      &gt; in execute
      &gt;                 fail(&lt;1 more arguments&gt;) Repository command failed &quot;C:/Program&quot; is not an internal or external command, executable
      &gt; program, or batch file. INFO: Elapsed time: 47.934s INFO: 0 processes.
      &gt; FAILED: Build did NOT complete successfully (0 packages loaded)
      &gt;     currently loading: tensorflow/tools/pip_package
  </code></pre>