1)安装CUDA
1.下载cuda10.0.13 deb包
2.安装cuda
sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
3.创建环境变量
sudo gedit ~/.bashrc
export CUDA_HOME=/usr/local/cuda-10.0
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.0/bin:$PATH
source ~/.bashrc
4.测试是否安装成功
1)nvcc -V 后可以看到cuda的版本号
2)
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
输入命令后可以看到Result = PASS
表示cuda安装成功