ubutun 安装1050ti nvidia驱动
https://developer.nvidia.com/downloads
安驱动前
(一)错误信息:
You appear to be running an X server; please exit X before...
原来,更新驱动需要关闭图形桌面。赶紧查看一下,是不是真的有X:
ps aux | grep X
看到
$ ps aux | grep X
root 2242 1.6 0.0 154212 35820 tty7 Ss+ 04:10 0:01 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
cc 4677 0.0 0.0 11284 1016 pts/8 S+ 04:11 0:00 grep --color=auto X
(二)关闭X的方式有两种:
(1)gdm类型的桌面系统
sudo /etc/init.d/gdm stop
sudo /etc/init.d/gdm status
(2)light类型的桌面系统
sudo /etc/init.d/lightdm stop
sudo /etc/init.d/lightdm status
关闭后,ps看下,的确看不到X了,但是,又有个新的Error:
An NVIDIA kernel module 'nvidia-uvm' appears to already be loaded in your ke...
(三)卸载旧的驱动
#关键的命令:
sudo apt-get purge nvidia-cuda*
sudo apt-get purge nvidia-*
(四)再次安装新驱动,终于OK了!
安装cuda10
chmod u+x cuda_10.0.130_410.48_linux.run
./cuda_10.0.130_410.48_linux.run
按空格若干次,一直到--more--(100%)
当提示:
Do you accept the previously read EULA?
accept/decline/quit:
输入 accept
提示 "Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 410.48?
(y)es/(n)o/(q)uit:
选no,不安装,因为我们已经 安了新的440.82的驱动,
这之后的要选yes ,可输入y
1) 打开bashrc文件: sudo gedit ~/.bashrc
(2)添加三条路径:export CUDA_HOME=/usr/local/cuda
export PATH=$PATH:$CUDA_HOME/bin
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
(3)让配置生效:source ~/.bashrc
安装libcudnn
下载
https://developer.nvidia.com/rdp/cudnn-archive
dpkg -i libcudnn7-dev_7.6.5.32-1+cuda10.0_amd64.deb
当运行程序时,感觉GPU没加速上,如果应用报错 Could not load dynamic library ‘libcudnn.so.7‘; dlerror: /usr/local/cuda-10.1/lib64/libcudnn.so.7:
错的原因是因为没有为cudnn中的文件创建软链接,只需要分别输入一下命令:
cd /usr/local/cuda-10.0/lib64
sudo chmod +r libcudnn.so.7.6.5
sudo ln -sf libcudnn.so.7.6.5 libcudnn.so.7
sudo ln -sf libcudnn.so.7 libcudnn.so
sudo ldconfig