Tensorflow Custom Compile on Windows

796 views Asked by At

So, I've installed Bazel via Chocolatey, installed Python 3.5 and 2.7, installed CUDA v8, and cuDNN v6, and installed JDK 8.0, I'm now trying to custom-build TensorFlow on my Windows 10 device, with AVX, AVX 2 and CUDA. TensorFlow-GPU, the pre-built version, does work, I've already tested and run that successfully.

I've followed the instructions of other articles, both on TensorFlows' actual site (trying to adapt some sections from the Linux/Mac installs), and on here. The furthest I've made it is; cloning the Github repository via Msys2, running configure.py, then attempting to build via bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package I receive an error, the header of which is:

Error reading java.io.IOException: CreateProcess(): The system cannot find the file specified. : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/cudnn.h

I've double checked, that file does exist, so I'm not sure why I'm getting this error.

EDIT: Also attempted to run via Powershell, reached the same point.

Any help would be much appreciated.

2

There are 2 answers

3
Andrew Wasielewski On

I had the exact same error while trying to build Tensorflow on Windows (using cuDNN 5.1). I fixed it by launching bazel from the msys2 terminal (instead of from the windows command prompt) and manually setting the BAZEL_SH environment variable before attempting to build.

export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
bazel build -c opt --config=win-cuda tensorflow/cc:cc_ops
0
Dmitry On

The following steps helped me to compile Tensorflow on Windows 10.

pacman -Syuu patch
ln -s "c:\python27\python.exe" /usr/bin/python

export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
"C:\Documents and Settings\All Users\chocolatey\bin\bazel.exe" build --config=opt --config=win-cuda //tensorflow/tools/pip_package:build_pip_package

But after 1 hour of compilation I got another error:

C:\tools\msys64\tmp_bazel_dmitry\x1e5egqw\execroot\org_tensorflow\external\protobuf_archive\python\google\protobuf\internal\api_implementation.cc : fatal error C1083: Cannot open compiler generated file: '': Invalid argument Target //tensorflow/tools/pip_package:build_pip_package failed to build