Windows 10下安装CUDA、cuDNN以及 paddlepaddle

(1)下载CUDA并安装

https://developer.nvidia.com/cuda-downloads

选择windows安装包,一步一步安装即可。

验证cuda的安装成功,可以执行,cuda的extras\demo_suite目录下的deviceQuery和bandwidthTest,能正常获取到设备、带宽的,表示cuda安装成功。

(2)下载cuDNN

下载地址:https://developer.nvidia.com/downloads

下载cuDNN Library For Windows[x86]

解压以后,将目录下文件复制到cuda得安装目录下,默认为:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1

(3)设置环境变量

添加cuda环境变量,控制面板,在控制面板中搜索环境变量,点击 编辑账户的环境变量,添加cuda的安装目录下bin到path中,如果是默认路径,为:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin

注意如果不设置环境变量会报错:
PreconditionNotMetError: The third-party dynamic library (libcublas.so) that Paddle depends on is not configured correctly. (error code is libcublas.so: cannot open shared object file: No such file or directory)
  Suggestions:
  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
  - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`
  - Windows: set PATH by `set PATH=XXX; at (/paddle/paddle/fluid/platform/dynload/dynamic_loader.cc:194)

 

(4)安装python 3.8 (目前paddlepaddle还不支持python 3.9,如果安装python3.9安装paddlepaddle时会报依赖不满足之类的错误)

安装时,要选择添加python到环境变量,否则需要自己添加环境变量。

(5)安装paddlepaddle(具体地安装方法需要根据自己的cuda等因素确定,网址为https://www.paddlepaddle.org.cn/),根据实际情况,使用windows下pip安装:

 

python -m pip install paddlepaddle-gpu==2.0.0.post110 -f https://paddlepaddle.org.cn/whl/stable.html

 

下一步就可以开始愉快地玩耍paddlepaddle了

 

 

 

 

你可能感兴趣的:(AI,深度学习,机器学习)