tensorflow / tensorflow

An Open Source Machine Learning Framework for Everyone
https://tensorflow.org
Apache License 2.0
186.13k stars 74.27k forks source link

Error loading option @local_config_cuda//:enable_cuda: Argument 0 of execute is neither a path, label, nor string. #53614

Closed DublikuntMux closed 2 years ago

DublikuntMux commented 2 years ago

System information

Describe the problem Problem when build from source.

Provide the exact sequence of commands / steps that you executed before running into the problem bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package INFO: Options provided by the client: Inherited 'common' options: --isatty=1 --terminal_columns=156 INFO: Reading rc options for 'build' from c:\users\dubli\downloads\tensorflow.bazelrc: Inherited 'common' options: --experimental_repo_remote_exec INFO: Options provided by the client: 'build' options: --python_path=E:/Python3/python.exe INFO: Reading rc options for 'build' from c:\users\dubli\downloads\tensorflow.bazelrc: 'build' options: --define framework_shared_object=true --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --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 --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library INFO: Reading rc options for 'build' from c:\users\dubli\downloads\tensorflow.tf_configure.bazelrc: 'build' options: --action_env PYTHON_BIN_PATH=E:/Python3/python.exe --action_env PYTHON_LIB_PATH=E:/Python3/lib/site-packages --python_path=E:/Python3/python.exe --action_env CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.5 --action_env TF_CUDA_COMPUTE_CAPABILITIES=7.5 --config=cuda --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --define=override_eigen_strong_inline=true INFO: Reading rc options for 'build' from c:\users\dubli\downloads\tensorflow.bazelrc: 'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/fallback,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils INFO: Found applicable config definition build:short_logs in file c:\users\dubli\downloads\tensorflow.bazelrc: --output_filter=DONT_MATCH_ANYTHING INFO: Found applicable config definition build:v2 in file c:\users\dubli\downloads\tensorflow.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1 INFO: Found applicable config definition build:cuda in file c:\users\dubli\downloads\tensorflow.bazelrc: --repo_env TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain --@local_config_cuda//:enable_cuda INFO: Found applicable config definition build:opt in file c:\users\dubli\downloads\tensorflow.tf_configure.bazelrc: --copt=/arch:FMA3 --host_copt=/arch:FMA3 INFO: Found applicable config definition build:windows in file c:\users\dubli\downloads\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 --verbose_failures --features=compiler_param_file --distinct_host_configuration=false INFO: Found applicable config definition build:monolithic in file c:\users\dubli\downloads\tensorflow.bazelrc: --define framework_shared_object=false INFO: Repository local_config_cuda instantiated at: C:/users/dubli/downloads/tensorflow/WORKSPACE:15:14: in C:/users/dubli/downloads/tensorflow/tensorflow/workspace2.bzl:878:19: in workspace C:/users/dubli/downloads/tensorflow/tensorflow/workspace2.bzl:96:19: in _tf_toolchains Repository rule cuda_configure defined at: C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl:1448:33: in ERROR: An error occurred during the fetch of repository 'local_config_cuda': Traceback (most recent call last): File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl _create_local_cuda_repository(repository_ctx) File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1182, column 53, in _create_local_cuda_repository host_compiler_includes = get_cxx_inc_directories( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 306, column 49, in get_cxx_inc_directories includes_cpp = _get_cxx_inc_directories_impl( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 277, column 22, in _get_cxx_inc_directories_impl result = raw_exec(repository_ctx, [cc, "-E", "-x" + lang, "-", "-v"] + File "C:/users/dubli/downloads/tensorflow/third_party/remote_config/common.bzl", line 252, column 34, in raw_exec return repository_ctx.execute(cmdline) Error in execute: Argument 0 of execute is neither a path, label, nor string. ERROR: Error fetching repository: Traceback (most recent call last): File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl _create_local_cuda_repository(repository_ctx) File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1182, column 53, in _create_local_cuda_repository host_compiler_includes = get_cxx_inc_directories( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 306, column 49, in get_cxx_inc_directories includes_cpp = _get_cxx_inc_directories_impl( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 277, column 22, in _get_cxx_inc_directories_impl result = raw_exec(repository_ctx, [cc, "-E", "-x" + lang, "-", "-v"] + File "C:/users/dubli/downloads/tensorflow/third_party/remote_config/common.bzl", line 252, column 34, in raw_exec return repository_ctx.execute(cmdline) Error in execute: Argument 0 of execute is neither a path, label, nor string. INFO: Found applicable config definition build:cuda in file c:\users\dubli\downloads\tensorflow.bazelrc: --repo_env TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain --@local_config_cuda//:enable_cuda ERROR: @local_config_cuda//:enable_cuda :: Error loading option @local_config_cuda//:enable_cuda: Argument 0 of execute is neither a path, label, nor string.

Any other info / logs ERROR: @local_config_cuda//:enable_cuda :: Error loading option @local_config_cuda//:enable_cuda: Argument 0 of execute is neither a path, label, nor string.

mohantym commented 2 years ago

Hi @DublikuntMux ! Could you try again with TF 2.7 and Python 3.8/3.9 ? You can use below command to build Tensorflow with GPU support. bazel build --config=opt --config=cuda --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package
Thanks!

DublikuntMux commented 2 years ago

Repository rule cuda_configure defined at: C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl:1448:33: in ERROR: An error occurred during the fetch of repository 'local_config_cuda': Traceback (most recent call last): File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl _create_local_cuda_repository(repository_ctx) File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1182, column 53, in _create_local_cuda_repository host_compiler_includes = get_cxx_inc_directories( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 306, column 49, in get_cxx_inc_directories includes_cpp = _get_cxx_inc_directories_impl( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 277, column 22, in _get_cxx_inc_directories_impl result = raw_exec(repository_ctx, [cc, "-E", "-x" + lang, "-", "-v"] + File "C:/users/dubli/downloads/tensorflow/third_party/remote_config/common.bzl", line 252, column 34, in raw_exec return repository_ctx.execute(cmdline) Error in execute: Argument 0 of execute is neither a path, label, nor string. ERROR: Error fetching repository: Traceback (most recent call last): File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl _create_local_cuda_repository(repository_ctx) File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 1182, column 53, in _create_local_cuda_repository host_compiler_includes = get_cxx_inc_directories( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 306, column 49, in get_cxx_inc_directories includes_cpp = _get_cxx_inc_directories_impl( File "C:/users/dubli/downloads/tensorflow/third_party/gpus/cuda_configure.bzl", line 277, column 22, in _get_cxx_inc_directories_impl result = raw_exec(repository_ctx, [cc, "-E", "-x" + lang, "-", "-v"] + File "C:/users/dubli/downloads/tensorflow/third_party/remote_config/common.bzl", line 252, column 34, in raw_exec return repository_ctx.execute(cmdline) Error in execute: Argument 0 of execute is neither a path, label, nor string. INFO: Found applicable config definition build:cuda in file c:\users\dubli\downloads\tensorflow.bazelrc: --repo_env TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain --@local_config_cuda//:enable_cuda ERROR: @local_config_cuda//:enable_cuda :: Error loading option @local_config_cuda//:enable_cuda: Argument 0 of execute is neither a path, label, nor string.

DublikuntMux commented 2 years ago

Reinstall MSVC and tensorflow repo fix problem.

google-ml-butler[bot] commented 2 years ago

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