Paddlepaddle installation issues and fixation

Posted by Jingbiao on July 14, 2021, Reading time: 1 minute.

Issues

Conda do not have the correct version for installing paddlepaddle gpu. In order to get the correct version you need to use pip. While using pip, cudnn is not installed, and environmental variable needs to be set to be the right path.

Working setup

OS version: Ubuntu 20.04

Python version: 3.8.10

Pip version: 21.1.3

conda version: 4.10.1

GPU: RTX 3090

cuda version: 11.2

cudnn version: 8.2.1

Installation

  • Install paddlepaddle: python -m pip install paddlepaddle-gpu==2.1.1.post112 -f https://paddlepaddle.org.cn/whl/mkl/stable.html

  • Install cudnn via conda: conda install -c conda-forge cudnn

  • Setup environmental variable path: export LD_LIBRARY_PATH=/home/.../anaconda3/envs/your_env/lib:$LD_LIBRARY_PATH

where your_env is the name of your environment in anaconda - you may need to do this everytime you reboot your device

  • test by: paddle.utils.run_check()

  • Success message would be:

>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
W0714 11:02:47.031818  3157 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.2, Runtime API Version: 11.2
W0714 11:02:47.046116  3157 device_context.cc:422] device: 0, cuDNN Version: 8.2.
PaddlePaddle works well on 1 GPU.
PaddlePaddle works well on 1 GPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.