You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/en/install/pip.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,7 +195,7 @@ The following NVIDIA® software are only required for GPU support.
195
195
196
196
### 3. Install Miniconda
197
197
198
-
You can skip this section if you prefer to use Python’s builtin venv module instead of Miniconda.
198
+
You can skip this section if you have already installed `Miniconda` (referred as *option #1* in the next steps) or you prefer to use Python’s built-in `venv` module (referred as *option #2* in the next steps) instead.
is the recommended approach for installing TensorFlow with GPU support.
@@ -208,7 +208,7 @@ The following NVIDIA® software are only required for GPU support.
208
208
209
209
### 4. Create a virtual environment
210
210
211
-
#### First option: Miniconda
211
+
****Option #1: Miniconda***
212
212
213
213
Create a new conda environment named `tf` with the following command.
214
214
@@ -222,9 +222,11 @@ The following NVIDIA® software are only required for GPU support.
222
222
conda deactivate
223
223
```
224
224
225
-
#### Second option: [venv](https://docs.python.org/3/library/venv.html){:.external}
226
-
227
-
Navigate to your desired virtual environments' directory and create a new venv environment named `tf` with the following command.
225
+
****Option #2: venv***
226
+
227
+
The [venv](https://docs.python.org/3/library/venv.html){:.external} module supports creating lightweight “virtual environments”, each with their own independent set of Python packages installed in their site directories.
228
+
229
+
Navigate to your desired virtual environments directory and create a new venv environment named `tf` with the following command.
228
230
229
231
```bash
230
232
python3 -m venv tf
@@ -261,7 +263,7 @@ The following NVIDIA® software are only required for GPU support.
261
263
262
264
You can skip this section if you only run TensorFlow on the CPU.
263
265
264
-
#### First option: Miniconda
266
+
* ***Option #1: Miniconda***
265
267
266
268
Locate the directory for the conda environment in your terminal window by running in the terminal:
267
269
`echo $CONDA_PREFIX`
@@ -289,11 +291,11 @@ The following NVIDIA® software are only required for GPU support.
289
291
# Set LD_LIBRARY_PATH to include CUDNN directory
290
292
export LD_LIBRARY_PATH=$(find ${CUDNN_DIR}/*/lib/ -type d -printf "%p:")${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# Set PATH to include all directories containing NVCC binaries
331
-
export PATH=$(find ${NVCC_DIR}/*/bin/ -type d -printf "%p:")${PATH:+:${PATH}}
332
+
# Set PATH to include the directory containing ptxas
333
+
export PATH=$(find ${PTXAS_DIR}/*/bin/ -type d -printf "%p:")${PATH:+:${PATH}}
332
334
```
333
335
334
336
Add the following lines at the end of `deactivate` block in the activate script to ensure that the necessary NVIDIA environment variables are set only while the virtual environment is active:
335
337
336
338
```bash
337
339
deactivate () {
338
340
# ...
339
-
# Unset the added path to PATH if within a virtual environment
341
+
# Unset the added path to PATH if within the virtual environment
340
342
if [ -n "$VIRTUAL_ENV" ]; then
341
343
# Remove the path from PATH
342
-
PATH=$(echo $PATH| sed -e "s|${NVCC_DIR}/*/bin/:||g")
344
+
PATH=$(echo $PATH | sed -e "s|${PTXAS_DIR}/*/bin/:||g")
343
345
fi
344
346
345
347
# Restore original LD_LIBRARY_PATH
@@ -350,7 +352,7 @@ The following NVIDIA® software are only required for GPU support.
0 commit comments