如何解决Windows 10上的Cuda Bazel构建错误,如何解决?
我正在尝试通过Bazel在Windows 10 64bit上编译具有CUDA支持的Tensorflow内核(我需要GeForce3090 cc 8.6),方法是:https://www.tensorflow.org/install/source_windows
我使用以下构建字符串: bazel build --config = opt --config = cuda --define = no_tensorflow_py_deps = true // tensorflow / tools / pip_package:build_pip_package
我收到错误,就像下面这样:
我该如何解决?
感谢。
> D:\Python\tensorflow>bazel build --config=opt --config=cuda
> --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package Extracting Bazel
> installation... WARNING: Ignoring JAVA_HOME,because it must point to
> a JDK,not a JRE. Starting local Bazel server and connecting to it...
> WARNING: The following configs were expanded more than once: [cuda,> using_cuda]. For repeatable flags,repeats are counted twice and may
> lead to unexpected behavior. INFO: Options provided by the client:
> Inherited 'common' options: --isatty=1 --terminal_columns=237 INFO:
> Reading rc options for 'build' from d:\python\tensorflow\.bazelrc:
> Inherited 'common' options: --experimental_repo_remote_exec INFO:
> Options provided by the client: 'build' options:
> --python_path=C:/Program Files/Python37/python.exe INFO: Reading rc options for 'build' from d:\python\tensorflow\.bazelrc: 'build'
> options: --apple_platform_type=macos --define
> framework_shared_object=true --define open_source_build=true
> --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:
> --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
> Files/Python37/python.exe --config=xla --action_env
> CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing
> Toolkit/CUDA/v11.1 --action_env TF_CUDA_COMPUTE_CAPABILITIES=5.2,8.6
> --config=cuda --action_env TF_CONFIGURE_IOS=0 INFO: Found applicable config definition build:short_logs in file
> d:\python\tensorflow\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
> INFO: Found applicable config definition build:v2 in file
> d:\python\tensorflow\.bazelrc: --define=tf_api_version=2
> --action_env=TF2_BEHAVIOR=1 INFO: Found applicable config definition build:xla in file d:\python\tensorflow\.bazelrc:
> --define=with_xla_support=true INFO: Found applicable config definition build:cuda in file d:\python\tensorflow\.bazelrc:
> --config=using_cuda --define=using_cuda_nvcc=true INFO: Found applicable config definition build:using_cuda in file
> d:\python\tensorflow\.bazelrc: --define=using_cuda=true --action_env
> TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain
> --define=tensorflow_enable_mlir_generated_gpu_kernels=1 INFO: Found applicable config definition build:opt in file
> d:\python\tensorflow\.tf_configure.bazelrc: --copt=/arch:SSE4.2
> --define with_default_optimizations=true INFO: Found applicable config definition build:cuda in file d:\python\tensorflow\.bazelrc:
> --config=using_cuda --define=using_cuda_nvcc=true INFO: Found applicable config definition build:using_cuda in file
> d:\python\tensorflow\.bazelrc: --define=using_cuda=true --action_env
> TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain
> --define=tensorflow_enable_mlir_generated_gpu_kernels=1 INFO: Found applicable config definition build:windows in file
> d:\python\tensorflow\.bazelrc: --copt=/W0 --copt=/D_USE_MATH_DEFINES
> --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:
> --define framework_shared_object=false DEBUG: Rule 'io_bazel_rules_go' indicated that a canonical reproducible form can be obtained by
> modifying arguments shallow_since = "1557349968 -0400" DEBUG:
> Repository io_bazel_rules_go instantiated at: no stack
> (--record_rule_instantiation_callstack not enabled) Repository rule
> git_repository defined at:
> C:/users/vladimir/_bazel_vladimir/sd7zocps/external/bazel_tools/tools/build_defs/repo/git.bzl:195:33:
> in <toplevel> INFO: Repository local_config_cuda instantiated at: no
> stack (--record_rule_instantiation_callstack not enabled) Repository
> rule cuda_configure defined at:
> D:/python/tensorflow/third_party/gpus/cuda_configure.bzl:1418:33: in
> <toplevel>
------------------------------------------------------------------------
**ERROR: An error occurred during the fetch of repository
> 'local_config_cuda':** Traceback (most recent call last):
> File "D:/python/tensorflow/third_party/gpus/cuda_configure.bzl",line 1388
> _create_local_cuda_repository(<1 more arguments>)
> File "D:/python/tensorflow/third_party/gpus/cuda_configure.bzl",line 1064,> in _create_local_cuda_repository
> _find_libs(repository_ctx,<2 more arguments>)
> File "D:/python/tensorflow/third_party/gpus/cuda_configure.bzl",line 599,> in _find_libs
> _check_cuda_libs(repository_ctx,line 501,> in _check_cuda_libs
> execute(repository_ctx,<1 more arguments>)***
> File "D:/python/tensorflow/third_party/remote_config/common.bzl",line 217,> in execute
> fail(<1 more arguments>) Repository command failed "C:/Program" is not an internal or external command,executable
> program,or batch file.
---------------------------------------------------------------------------
ERROR: Skipping
> '//tensorflow/tools/pip_package:build_pip_package': no such package
> '@local_config_cuda//cuda': Traceback (most recent call last):
> File "D:/python/tensorflow/third_party/gpus/cuda_configure.bzl",<1 more arguments>)
> File "D:/python/tensorflow/third_party/remote_config/common.bzl",or batch file. WARNING: Target pattern parsing failed. ERROR:
> no such package '@local_config_cuda//cuda': Traceback (most recent
> call last):
> File "D:/python/tensorflow/third_party/gpus/cuda_configure.bzl",or batch file. INFO: Elapsed time: 47.934s INFO: 0 processes.
> FAILED: Build did NOT complete successfully (0 packages loaded)
> currently loading: tensorflow/tools/pip_package
解决方法
摘要: 通过以下步骤解决了这个问题:
- 将Python从C:\ Program Files \ Python ...移至C:\ Python ... 然后我们需要在PATH变量中更改对应字符串 2)检查并删除另一个bash安装,例如msys64,检查:PATH变量中是否存在passway C:\ msys64 \ usr \ bin mast
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。