windows 配置 paddle CUDA 环境
安装CUDA
- 查看支持的CUDA版本
nvidia-smi
这个CUDA 版本是指GUP支持的最高CUDA API版本 并不是当前的CUDA 版本
-
查看飞浆支持的CUDA版本
https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/windows-pip.html
-
下载CUDA工具包
https://developer.nvidia.com/cuda-toolkit-archive
下载对应版本的安装包,并安装
安装 paddle
python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
验证
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
PaddlePaddle works well on 1 GPU.
PaddlePaddle works well on 1 GPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
报错处理
RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_7.dll) that Paddle depends on is not
这是因为没有安装 cudnn
https://developer.nvidia.com/rdp/cudnn-download
把文件夹复制到 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7
Could not locate cudnn_ops_infer64_8.dll. Please make sure it is in your lib
https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-zlib-windows
下载后找到zlibwapi.dll
复制到PATH