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

bazel build branch r1.10 on windows #32

Open
guihigashi opened this issue Aug 16, 2018 · 10 comments
Open

bazel build branch r1.10 on windows #32

guihigashi opened this issue Aug 16, 2018 · 10 comments

Comments

@guihigashi
Copy link

guihigashi commented Aug 16, 2018

I've been using this repo for some time and I wanted to share that I was able to build tf on windows 10 with bazel. This is based on the build log from the Official Builds.

Versions:
VS2017 with VS2015 workload
CUDA 9.2.148 and cuDNN 7.1.4
Python 3.6.6
Bazel 0.15.2

Clone the repo and checkout branch r1.10

git clone https://github.com/tensorflow/tensorflow
cd tensorflow
git checkout r1.0

VS prompt

"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

Activate your python env

conda activate py36

for CUPTI

set PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v9.2\extras\CUPTI\libx64;%PATH%

for grep, bash and perl

set PATH=%ProgramFiles%\Git\usr\bin;%PATH%

bazel envs

set BAZEL_SH=%ProgramFiles%\Git\usr\bin\bash.exe
set BAZEL_VC=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC

this will create .tf_configure.bazelrc file with options you choose... cpu or gpu, cuda version, cudnn version, /arch:AVX2 or whatever...

python configure.py

build command. (--jobs 2 --local_resources 3000,2,1.0 is optional, I wanted to use the PC while building)

bazel build --jobs 2 --local_resources 3000,2,1.0 --config=opt //tensorflow/tools/pip_package:build_pip_package

Create wheel package

bazel-bin\tensorflow\tools\pip_package\build_pip_package tmp/tensorflow_pkg
@fo40225
Copy link
Owner

fo40225 commented Aug 17, 2018

@guihigashi Do you execute those command in cmd.exe?

I have tried bazel a long time ago and must be executed in bash (MSYS2 or git bash).

Anyway, thank you very much, this protocol should be updated to the official documentation.

@fo40225
Copy link
Owner

fo40225 commented Aug 17, 2018

@guihigashi
Copy link
Author

I used cmd.exe. My guess is that bazel uses bash for some commands (git bash).

@leduclinh7141
Copy link

Hello, I am looking forward to version 1.10 wheel. When will you release it? Thank you!

@trias702
Copy link

I tried for two days to replicate guihigashi's method, which is nearly identical to the TensorFlow documentation, but it does not seem to work for me. The Bazel build completes fine, but it seems to get some things very wrong. For example, it compiles all the libraries as .so files even on Windows, when they should be dlls.

Also, the bazel-bin\tensorflow\tools\pip_package\build_pip_package tmp/tensorflow_pkg command does not work because the simple_console_for_windows.zip created in bazel-bin\tensorflow\tools\pip_package after the build finishes is zero size, so the items required by the manifest (runfiles) are not being zipped up at all.

Is anyone else able to replicate guihigashi's results and generate a working 1.10 wheel?

@guihigashi
Copy link
Author

I got a bunch of .so files too. I remember I tried newer bazel (0.16), that didn't work. The simple_console_for_windows.zip finished with 1.2GB. It was a bit of trial and error.

I compile my wheel with CUDA capability 5.0, if you're interested I can share

@whb0219
Copy link

whb0219 commented Aug 31, 2018

@guihigashi Can you share your 1.10?(windows gpu)I did not build successfully.

@guihigashi
Copy link
Author

@whb0219 https://github.com/guihigashi/tf-windows-wheel

@fo40225 I apologize for sharing my repo here. If you want I can collaborate with this repo, but actually I plan to build future versions with the described config... Anyway, don't wanna be rude.

@fo40225
Copy link
Owner

fo40225 commented Sep 1, 2018

@guihigashi Nevermind, Tensorflow is not my own library.

@whb0219
Copy link

whb0219 commented Sep 2, 2018

@guihigashi Thank you for your help.
@fo40225 Thanks also for your GIT help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants