Skip to content

Commit 5b96ef6

Browse files
haifeng-jincopybara-github
authored andcommitted
Update the install guide to support TensorFlow 2.11 for linux (Ubuntu 22.04).
PiperOrigin-RevId: 508168844
1 parent 414e8c9 commit 5b96ef6

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

site/en/install/pip.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ step-by-step instructions.
2626
for more information about this collaboration.
2727

2828
```bash
29-
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
29+
conda install -c conda-forge cudatoolkit=11.2.2 cudnn=8.1.0
3030
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/
3131
python3 -m pip install tensorflow
3232
# Verify install:
@@ -236,7 +236,7 @@ The following NVIDIA® software are only required for GPU support.
236236
Then install CUDA and cuDNN with conda.
237237

238238
```bash
239-
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
239+
conda install -c conda-forge cudatoolkit=11.2.2 cudnn=8.1.0
240240
```
241241

242242
Configure the system paths. You can do it with the following command every time
@@ -271,7 +271,7 @@ The following NVIDIA® software are only required for GPU support.
271271
PyPI.
272272
273273
```bash
274-
pip install tensorflow
274+
pip install tensorflow==2.11.*
275275
```
276276
277277
### 6. Verify install
@@ -293,6 +293,31 @@ The following NVIDIA® software are only required for GPU support.
293293
If a list of GPU devices is returned, you've installed TensorFlow
294294
successfully.
295295
296+
### Ubuntu 22.04
297+
298+
In Ubuntu 22.04, you may encounter the following error:
299+
300+
```
301+
Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice.
302+
...
303+
Couldn't invoke ptxas --version
304+
...
305+
InternalError: libdevice not found at ./libdevice.10.bc [Op:__some_op]
306+
```
307+
308+
To fix this error, you will need to run the following commands.
309+
310+
```bash
311+
# Install NVCC
312+
conda install -c nvidia cuda-nvcc=11.3.58
313+
# Configure the XLA cuda directory
314+
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
315+
printf 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/\nexport XLA_FLAGS=--xla_gpu_cuda_data_dir=$CONDA_PREFIX/lib/\n' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
316+
source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
317+
# Copy libdevice file to the required path
318+
mkdir -p $CONDA_PREFIX/lib/nvvm/libdevice
319+
cp $CONDA_PREFIX/lib/libdevice.10.bc $CONDA_PREFIX/lib/nvvm/libdevice/
320+
```
296321
297322
* {MacOS}
298323

0 commit comments

Comments
 (0)