Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow Building from Source Code #66238

Open
Nicky9319 opened this issue Apr 23, 2024 · 2 comments
Open

Tensorflow Building from Source Code #66238

Nicky9319 opened this issue Apr 23, 2024 · 2 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:windows Windows Build/Installation Issues TF 2.9 Issues found in the TF 2.9 release (or RCs) type:build/install Build and install issues type:support Support issues

Comments

@Nicky9319
Copy link

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

2.9

Custom code

No

OS platform and distribution

Windows 11

Mobile device

No response

Python version

3.10.0

Bazel version

5.0.0

GCC/compiler version

9.2.0

CUDA/cuDNN version

11.2 , 8.1

GPU model and memory

No response

Current behavior?

I am trying to build Tensorflow from source because i want to run tensorflow using c++ and i am trying to download the GPU version
So I ran ./Configure command, and choose the option to enable GPU Support
I ran the bazel command given on the tensorflow Build From source on windows
https://www.tensorflow.org/install/source_windows

and ran into the following error, What does it imply and how can i Solve it

Standalone code to reproduce the issue

ERROR: An error occurred during the fetch of repository 'local_config_cuda':
Traceback (most recent call last):
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl
_create_local_cuda_repository(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1179, column 17, in _create_local_cuda_repository
cc = find_cc(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 216, column 34, in find_cc
return _get_msvc_compiler(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 133, column 26, in _get_msvc_compiler
return find_msvc_tool(repository_ctx, vc_path, "cl.exe").replace("\", "/")
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 447, column 27, in find_msvc_tool
if _is_vs_2017_or_2019(repository_ctx, vc_path) or _is_msbuildtools(vc_path):
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 265, column 72, in _is_vs_2017_or_2019
vc_path_contents = [d.basename.lower() for d in repository_ctx.path(vc_path).readdir()]
Error in path: in call to path(), parameter 'path' got value of type 'NoneType', want 'string, Label, or path'
ERROR: D:/tensorflow/tensorflow-2.9.0/WORKSPACE:15:14: fetching cuda_configure rule //external:local_config_cuda: Traceback (most recent call last):
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl
_create_local_cuda_repository(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1179, column 17, in _create_local_cuda_repository
cc = find_cc(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 216, column 34, in find_cc
return _get_msvc_compiler(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 133, column 26, in _get_msvc_compiler
return find_msvc_tool(repository_ctx, vc_path, "cl.exe").replace("\", "/")
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 447, column 27, in find_msvc_tool
if _is_vs_2017_or_2019(repository_ctx, vc_path) or _is_msbuildtools(vc_path):
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 265, column 72, in _is_vs_2017_or_2019
vc_path_contents = [d.basename.lower() for d in repository_ctx.path(vc_path).readdir()]
Error in path: in call to path(), parameter 'path' got value of type 'NoneType', want 'string, Label, or path'
INFO: Found applicable config definition build:cuda in file d:\tensorflow\tensorflow-2.9.0.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: in call to path(), parameter 'path' got value of type 'NoneType', want 'string, Label, or path'

Relevant log output

No response

@google-ml-butler google-ml-butler bot added type:build/install Build and install issues type:support Support issues labels Apr 23, 2024
@Venkat6871 Venkat6871 added TF 2.9 Issues found in the TF 2.9 release (or RCs) subtype:windows Windows Build/Installation Issues labels Apr 24, 2024
@Venkat6871
Copy link

Hi @Nicky9319 ,

  • Ensure that you have visual studio installed on your system with the necessary components for building tensorflow. This typically includes the desktop development with C++ workload and the MSVC v142 - VS 2019 C++ x64/x86 build tools component.
  • Make sure that the visual studio environment variables are set correctly. You can do this by opening a developer command prompt for visual studio and running the vcvarsall.bat script for your target architecture (x64 or x86) and platform (Debug or Release).
  • Try to clean the Bazel cache by running this command.
bazel clean --expunge

Thank you!

@Venkat6871 Venkat6871 added the stat:awaiting response Status - Awaiting response from author label Apr 24, 2024
Copy link

github-actions bot commented May 2, 2024

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.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:windows Windows Build/Installation Issues TF 2.9 Issues found in the TF 2.9 release (or RCs) type:build/install Build and install issues type:support Support issues
Projects
None yet
Development

No branches or pull requests

2 participants