nvidia-smi
或者
cat /proc/driver/nvidia/version
sudo sh cuda_10.2_linux.run
继续
在接受许可之后,不选择驱动,然后选择安装
3. 查看cuda版本
cat /usr/local/cuda/version.txt
cd /usr/local/cuda-10.2/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
# 测试通过会显示PASS
# 在多个cud版本切换时
sudo rm -rf /usr/local/cuda #删除之前生成的软链接
sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda #生成新的软链接
cat /usr/local/cuda/version.txt#查看当前cuda的版本
sudo gedit /etc/profile
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64$LD_LIBRARY_PATH
export PATH=/usr/local/cuda/bin:$PATH
sudo gedit ~/.bashrc
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda
sudo /usr/local/cuda-10.0/bin/uninstall_cuda-10.0.pl
cudnn下载地址
# 下载并解压cudnn
# 将库文件复制到对应的cuda目录
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
# 查看cudnn版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
bash Anacondaxxx.sh
按回车继续
输入yes
接受许可
输入yes
使conda在打开终端时自启动
也可以打开.bashrc
文件
sudo gedit ~/.bashrc
添加命令取消conda初始化
conda deactivate
conda info --env
conda info -e
conda create -n your_env_name python=X.X
conda create -n pytorch1.5 python=3.7
conda activate pytorch1.5
#离线安装pytorch
conda install pytorch-1.5.0-py3.7_cuda10.1.243_cudnn7.6.3_0.tar.bz2
#离线安装补充的pytorch库文件
conda install numpy pyyaml mkl cmake cffi
#在线安装指定版本的pytorch
conda install pytorch=1.5.0 cudatoolkit=10.1 torchvision=0.6.0 -c pytorch
import torch
torch.__version__
torch.cuda.is_available()
torch.cuda.current_device() # 查看显卡数
torch.cuda.get_device_name() # 查看显卡名
#下载paddlepaddle-gpu-2.1.1-py39_gpu_cuda10.1_windows.tar.bz2
conda install paddlepaddle-gpu-2.1.1-py39_gpu_cuda10.1_windows.tar.bz2
pip install astor decorator==4.4.2 gast==0.3.3 Pillow protobuf requests six numpy==1.19.2
进入python解释器
python
import paddle
paddle.utils.run_check()
出现PaddlePaddle is installed successfully!
清华镜像下载地址
源版本
CPU版本
GPU版本
aarch64版本
pip install tensorflow_xxx.whl