windows下安装gpu版paddlepaddle
一.window下gpu版安装
- 安装显卡驱动和cuda和cudnn
安装显卡驱动
cuda下载地址:https://developer.nvidia.com/cuda-toolkit-archive (查看显卡支持的最高版本cuda)
cudnn下载地址:https://developer.nvidia.com/rdp/cudnn-archive (下载对应版本的cudnn)
安装cuda(如 11.6) (默认应该安装在 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6)
解压 cudnn-windows-x86_64-8.7.0.84_cuda11-archive.zip 把 bin lib include 下的文件 复制到 到上一步安装目录的对应的目录下
如果要求登录,可以右键复制链接地址,用迅雷下载
- 创建虚拟环境(以paddlenlp为例):
conda create -n paddle_nlp python=3.10
activate paddle_nlp
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- 安装gpu版paddlepaddle (cuda版本11.6) 参考:https://www.paddlepaddle.org.cn/
python -m pip install paddlepaddle-gpu==2.6.0.post116 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
- 验证: 编写python脚本,paddle_check.py:
import paddle
paddle.utils.run_check()
执行: python paddle_check.py 提示如下:
Running verify PaddlePaddle program ...
I0314 12:34:35.963681 10008 program_interpreter.cc:212] New Executor is Running.
W0314 12:34:35.963681 10008 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.6, Runtime API Version: 11.6
W0314 12:34:35.994819 10008 gpu_resources.cc:164] device: 0, cuDNN Version: 8.6.
I0314 12:34:38.557274 10008 interpreter_util.cc:624] Standalone Executor is Used.
PaddlePaddle works well on 1 GPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.