大概是这么个流程,命令文本可以复制下面的
卸载重装吧
执行卸载:
sudo apt-get --purge remove nvidia*
sudo apt autoremove
禁用Ubuntu自带驱动
编辑配置文件:sudo vim /etc/modprobe.d/blacklist.conf
跳至最后一行添加:blacklist nouveau
完成后执行:sudo update-initramfs -u
重启:reboot
Ctrl+Alt+F1/2/3…” 进入命令行界面
检查自带驱动是否已禁用
:lsmod | grep nouveau无任何提示则禁用成功
安装驱动
关闭图形界面
sudo service lightdm stop
添加可执行权限
进入驱动文件目录sudo chmod a+x NVIDIA-Linux-x86_64-***.**.run
进入驱动所在路径并执行:sudo ./NVIDIA-Linux-x86_64-***.**.run -no-x-check -no-nouveau-check -no-opengl-files
-no-x-check:安装时关闭X服务
-no-nouveau-check:安装时禁用nouveau
-no-opengl-files:仅安装驱动,不安装OpenGL等文件
选项
Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?
选择 No 继续。
Install NVIDIA's 32-bit compatibility libraries?
选择 No 继续。
“Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that…”,
选择"Yes",切记!!
安装完成后打开X图形界面服务:sudo service lightdm start
Failed to start Light Display Manager!
搜索service lightdm start失败
systemctl status lightdm.service查看信息
看到是failed to start light display manager
sudo apt remove lightdm
sudo apt install lightdm
选择 lightdm
运行service lightdm start没有报错
换成 gdm3 启动
可以是另一种方法,但是没有尝试
吐槽:lightdm的登录桌面和gdm不一样吓我一跳
闭内核自动更新
打开“Software & Updates (软件和更新)”,将“更新”修改如下:
检查一下CUDA 版本和驱动对不对
其实这里不用检查,就是我自己想看看驱动装的时候CUDA 是不是自己装了
对装驱动具体装哪些东西还是有点模糊,今天下午好好看一看了解一下