Skip to content

Commit

Permalink
Move the GPU debugging step to after the "Test the installation" step.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDaoust authored Sep 4, 2024
1 parent 64e7c50 commit 06798ba
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions site/en/install/pip.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,29 @@ The following NVIDIA® software are only required for GPU support.
**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.
### 5. Virtual environment configuration
### 6. Verify the installation
You can skip this section if you only run TensorFlow on the CPU.
Note: Symbolic links are only necessary in case the intended way doesn't work, i.e. the components aren't being
detected, and/or conflict with the existing system CUDA installation.
Verify the CPU setup:
```bash
python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
```
If a tensor is returned, you've installed TensorFlow successfully.

Verify the GPU setup:

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

If a list of GPU devices is returned, you've installed TensorFlow
successfully. **If not continue to the next step**.
### 6. [GPU only] Virtual environment configuration
If the GPU test in the last section was unsuccessful, the most likely cause is that components aren't being detected,
and/or conflict with the existing system CUDA installation. So you need to add some symbolic links to fix this.

* Create symbolic links to NVIDIA shared libraries:

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

Verify the GPU setup:

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

If a list of GPU devices is returned, you've installed TensorFlow
successfully.



* {MacOS}

Expand Down

0 comments on commit 06798ba

Please sign in to comment.