Skip to content

Commit 06798ba

Browse files
authored
Move the GPU debugging step to after the "Test the installation" step.
1 parent 64e7c50 commit 06798ba

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

site/en/install/pip.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,29 @@ The following NVIDIA® software are only required for GPU support.
231231
232232
**Note:** Do not install TensorFlow with `conda`. It may not have the latest stable version. `pip` is recommended since TensorFlow is only officially released to PyPI.
233233
234-
### 5. Virtual environment configuration
234+
### 6. Verify the installation
235235
236-
You can skip this section if you only run TensorFlow on the CPU.
237-
238-
Note: Symbolic links are only necessary in case the intended way doesn't work, i.e. the components aren't being
239-
detected, and/or conflict with the existing system CUDA installation.
236+
Verify the CPU setup:
237+
238+
```bash
239+
python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
240+
```
241+
242+
If a tensor is returned, you've installed TensorFlow successfully.
243+
244+
Verify the GPU setup:
245+
246+
```bash
247+
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
248+
```
249+
250+
If a list of GPU devices is returned, you've installed TensorFlow
251+
successfully. **If not continue to the next step**.
252+
253+
### 6. [GPU only] Virtual environment configuration
254+
255+
If the GPU test in the last section was unsuccessful, the most likely cause is that components aren't being detected,
256+
and/or conflict with the existing system CUDA installation. So you need to add some symbolic links to fix this.
240257

241258
* Create symbolic links to NVIDIA shared libraries:
242259

@@ -252,25 +269,15 @@ The following NVIDIA® software are only required for GPU support.
252269
ln -sf $(find $(dirname $(dirname $(python -c "import nvidia.cuda_nvcc;
253270
print(nvidia.cuda_nvcc.__file__)"))/*/bin/) -name ptxas -print -quit) $VIRTUAL_ENV/bin/ptxas
254271
```
255-
256-
### 6. Verify the installation
257-
258-
Verify the CPU setup:
259-
260-
```bash
261-
python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
262-
```
263-
264-
If a tensor is returned, you've installed TensorFlow successfully.
265272

266273
Verify the GPU setup:
267274

268275
```bash
269276
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
270277
```
271278

272-
If a list of GPU devices is returned, you've installed TensorFlow
273-
successfully.
279+
280+
274281

275282
* {MacOS}
276283

0 commit comments

Comments
 (0)