一、显卡驱动安装
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
# 查看可选驱动
ubuntu-drivers devices
# 选择合适驱动安装
sudo apt install nvidia-driver-xxx
# 重启
sudo reboot
# 验证是否安装成功
nvidia-smi
二、Cuda安装(以Cuda10.1为例)
# 官网下载Cuda(建议下载.run(local))
https://developer.nvidia.com/cuda-10.1-download-archive-base
## 安装
sudo sh cuda_10.1.105_418.39_linux.run
## 后处理
vim ~/.bashrc # 添加以下三行内容
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.1/lib64
export PATH=$PATH:/usr/local/cuda-10.1/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-10.1
source ~/.bashrc
## 查看是否安装成功
nvcc -V