Skip to content

Commit abfbe6e

Browse files
Merge pull request #2220 from Intel-tensorflow:mraunak/tf_win_docs
PiperOrigin-RevId: 527748822
2 parents 3ad57a2 + 7be6338 commit abfbe6e

File tree

2 files changed

+67
-36
lines changed

2 files changed

+67
-36
lines changed

site/en/install/pip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ step-by-step instructions.
5151
supported GPU on native-Windows.
5252
Starting with TensorFlow `2.11`, you will need to install
5353
[TensorFlow in WSL2](https://tensorflow.org/install/pip#windows-wsl2),
54-
or install `tensorflow-cpu` and, optionally, try the
54+
or install `tensorflow` or `tensorflow-cpu` and, optionally, try the
5555
[TensorFlow-DirectML-Plugin](https://github.com/microsoft/tensorflow-directml-plugin#tensorflow-directml-plugin-)
5656

5757
```bash

site/en/install/source_windows.md

Lines changed: 66 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ environment.
1313
### Install Python and the TensorFlow package dependencies
1414

1515
Install a
16-
[Python 3.8+ 64-bit release for Windows](https://www.python.org/downloads/windows/){:.external}.
16+
[Python 3.9+ 64-bit release for Windows](https://www.python.org/downloads/windows/){:.external}.
1717
Select *pip* as an optional feature and add it to your `%PATH%` environmental
1818
variable.
1919

@@ -69,6 +69,8 @@ Note: TensorFlow is tested against the *Visual Studio 2019*.
6969
See the Windows [GPU support](./gpu.md) guide to install the drivers and
7070
additional software required to run TensorFlow on a GPU.
7171

72+
Note: GPU support on native-Windows is only available for 2.10 or earlier versions, starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin
73+
7274
### Download the TensorFlow source code
7375

7476
Use [Git](https://git-scm.com/){:.external} to clone the
@@ -91,6 +93,28 @@ git checkout <em>branch_name</em> # r1.9, r1.10, etc.
9193
Key Point: If you're having build problems on the latest development branch, try
9294
a release branch that is known to work.
9395

96+
## Optional: Environmental Variable Set Up
97+
Run following commands before running build command to avoid issue with package creation:
98+
(If the below commands were set up while installing the packages, please ignore them). Run `set` check if all the paths were set correctly, run `echo %Environmental Variable%` e.g. `echo %BAZEL_VC%` to check path set up for a specific Environmental Variable
99+
100+
Python path set up issue [tensorflow:issue#59943](https://github.com/tensorflow/tensorflow/issues/59943),[tensorflow:issue#9436](https://github.com/tensorflow/tensorflow/issues/9436),[tensorflow:issue#60083](https://github.com/tensorflow/tensorflow/issues/60083)
101+
102+
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">
103+
set PATH=path/to/python # [e.g. (C:/Python310)]
104+
set PATH=path/to/python/Scripts # [e.g. (C:/Python310/Scripts)]
105+
set PYTHON_BIN_PATH=path/to/python_virtualenv/Scripts/python.exe
106+
set PYTHON_LIB_PATH=path/to/python virtualenv/lib/site-packages
107+
set PYTHON_DIRECTORY=path/to/python_virtualenv/Scripts
108+
</pre>
109+
110+
Bazel/MSVC path set up issue [tensorflow:issue#54578](https://github.com/tensorflow/tensorflow/issues/54578)
111+
112+
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">
113+
set BAZEL_SH=C:/msys64/usr/bin/bash.exe
114+
set BAZEL_VS=C:/Program Files(x86)/Microsoft Visual Studio/2019/BuildTools
115+
set BAZEL_VC=C:/Program Files(x86)/Microsoft Visual Studio/2019/BuildTools/VC
116+
</pre>
117+
94118

95119
## Optional: Configure the build
96120

@@ -114,49 +138,41 @@ differ):
114138
<h4 class="showalways">View sample configuration session</h4>
115139
<pre class="devsite-terminal tfo-terminal-windows">
116140
python ./configure.py
117-
Starting local Bazel server and connecting to it...
118-
................
119-
You have bazel 0.15.0 installed.
120-
Please specify the location of python. [Default is C:\python36\python.exe]:
121-
141+
You have bazel 5.3.0 installed.
142+
Please specify the location of python. [Default is C:\Python310\python.exe]:
122143
Found possible Python library paths:
123-
C:\python36\lib\site-packages
124-
Please input the desired Python library path to use. Default is [C:\python36\lib\site-packages]
125-
126-
Do you wish to build TensorFlow with CUDA support? [y/N]: <b>Y</b>
127-
CUDA support will be enabled for TensorFlow.
128-
129-
Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 9.0]:
130-
131-
Please specify the location where CUDA 9.0 toolkit is installed. Refer to README.md for more details. [Default is C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0]:
144+
C:\Python310\lib\site-packages
145+
Please input the desired Python library path to use. Default is [C:\Python310\lib\site-packages]
132146

133-
Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7.0]: <b>7.0</b>
147+
Do you wish to build TensorFlow with ROCm support? [y/N]:
148+
No ROCm support will be enabled for TensorFlow.
134149

135-
Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0]: <b>C:\tools\cuda</b>
136150

137-
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
138-
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
139-
Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 3.5,7.0]: <b>3.7</b>
151+
WARNING: Cannot build with CUDA support on Windows.
152+
Starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2.
140153

141154
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is /arch:AVX]:
142155

156+
143157
Would you like to override eigen strong inline for some C++ compilation to reduce the compilation time? [Y/n]:
144158
Eigen strong inline overridden.
145159

146-
Configuration finished
147-
</pre>
148-
</section>
149-
150-
### Configuration options
160+
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]:
161+
Not configuring the WORKSPACE for Android builds.
151162

152-
For [GPU support](./gpu.md), specify the versions of CUDA and cuDNN. If your
153-
system has multiple versions of CUDA or cuDNN installed, explicitly set the
154-
version instead of relying on the default. `./configure.py` creates symbolic
155-
links to your system's CUDA libraries—so if you update your CUDA library paths,
156-
this configuration step must be run again before building.
163+
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
164+
--config=mkl # Build with MKL support.
165+
--config=mkl_aarch64 # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
166+
--config=monolithic # Config for mostly static monolithic build.
167+
--config=numa # Build with NUMA support.
168+
--config=dynamic_kernels # (Experimental) Build kernels into separate shared objects.
169+
--config=v1 # Build with TensorFlow 1 API instead of TF 2 API.
170+
Preconfigured Bazel build configs to DISABLE default on features:
171+
--config=nogcp # Disable GCP support.
172+
--config=nonccl # Disable NVIDIA NCCL support.
157173

158-
Warning: TF-TRT Windows support is provided experimentally. No guarantee is made
159-
regarding functionality or engineering support. Use at your own risk.
174+
</pre>
175+
</section>
160176

161177
## Build and install the pip package
162178

@@ -184,12 +200,21 @@ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
184200

185201
#### GPU support
186202

203+
Note: GPU support on native-Windows is only available for 2.10 or earlier versions, starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin
204+
187205
To make the TensorFlow package builder with GPU support:
188206

189207
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">
190208
bazel build --config=opt --config=cuda --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package
191209
</pre>
192210

211+
Commands to clean the bazel cache to resolve errors due to invalid or outdated cached data, bazel clean with --expunge flag removes files permanently
212+
213+
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">
214+
bazel clean
215+
bazel clean --expunge
216+
</pre>
217+
193218
#### Bazel build options
194219

195220
Use this option when building to avoid issue with package creation:
@@ -223,13 +248,16 @@ Although it is possible to build both CUDA and non-CUDA configs under the
223248
same source tree, we recommend running `bazel clean` when switching between
224249
these two configurations in the same source tree.
225250

251+
226252
### Install the package
227253

228254
The filename of the generated `.whl` file depends on the TensorFlow version and
229255
your platform. Use `pip3 install` to install the package, for example:
230256

231257
<pre class="devsite-terminal tfo-terminal-windows prettyprint lang-bsh">
232-
pip3 install C:/tmp/tensorflow_pkg/tensorflow-<var>version</var>-cp36-cp36m-win_amd64.whl
258+
pip3 install C:/tmp/tensorflow_pkg/tensorflow-<var>version</var>-<var>tags</var>.whl
259+
260+
e.g. pip3 install C:/tmp/tensorflow_pkg/tensorflow-2.12.0-cp310-cp310-win_amd64.whl
233261
</pre>
234262

235263
Success: TensorFlow is now installed.
@@ -256,12 +284,12 @@ considered a Unix absolute path since it starts with a slash.)
256284

257285
Add the Bazel and Python installation directories to your `$PATH` environmental
258286
variable. If Bazel is installed to `C:\tools\bazel.exe`, and Python to
259-
`C:\Python36\python.exe`, set your `PATH` with:
287+
`C:\Python\python.exe`, set your `PATH` with:
260288

261289
<pre class="prettyprint lang-bsh">
262290
# Use Unix-style with ':' as separator
263291
<code class="devsite-terminal">export PATH="/c/tools:$PATH"</code>
264-
<code class="devsite-terminal">export PATH="/c/Python36:$PATH"</code>
292+
<code class="devsite-terminal">export PATH="/c/path/to/Python:$PATH"</code>
265293
</pre>
266294

267295
For GPU support, add the CUDA and cuDNN bin directories to your `$PATH`:
@@ -272,6 +300,8 @@ For GPU support, add the CUDA and cuDNN bin directories to your `$PATH`:
272300
<code class="devsite-terminal">export PATH="/c/tools/cuda/bin:$PATH"</code>
273301
</pre>
274302

303+
Note: Starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin
304+
275305
<a name="tested_build_configurations"></a>
276306
## Tested build configurations
277307

@@ -311,6 +341,7 @@ For GPU support, add the CUDA and cuDNN bin directories to your `$PATH`:
311341
</table>
312342

313343
### GPU
344+
Note: GPU support on native-Windows is only available for 2.10 or earlier versions, starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin
314345

315346
<table>
316347
<tr><th>Version</th><th>Python version</th><th>Compiler</th><th>Build tools</th><th>cuDNN</th><th>CUDA</th></tr>

0 commit comments

Comments
 (0)