1. 更新Ubuntu库中的软件包
sudo apt-get update
2. 同步系统时间
sudo apt install ntpdate
sudo ntpdate time .windows.com
sudo hwclock --localtime --systohc
3. 安装NVIDIA驱动
3.1 安装前
- 安装依赖
sudo apt-get update #更新软件列表
#安装编译依赖
sudo apt-get install g++
sudo apt-get install gcc
sudo apt-get install make
- 查看显卡型号
lspci | grep -i vga
或者
lspci | grep -Ei '(vga|display)'
或者
lspci | grep -i nvidia
得到序列号xxxx,打开网站查询下载对应驱动
< 驱动选择生产力分支 >
- 查看NVIDIA显卡驱动安装状态
nvidia-smi
禁用系统显卡驱动
-
- 打开blacklist.conf
sudo gedit /etc/modprobe.d/blacklist.conf
-
- 在blacklist.conf文件最后部分插入以下两行内容
blacklist nouveau
options nouveau modeset=0
-
- 更新系统
sudo update-initramfs -u
-
- 重启
reboot
-
- 验证nouveau是否已禁用
lsmod | grep nouveau
没有显示则说明禁用成功
3.2 安装
手动下载驱动安装
删除以前驱动
sudo apt-get remove --purge nvidia*
驱动下载网站
更改文件权限
sudo chmod a+x NVIDIA-xxx.run
sudo chmod 777 NVIDIA-xxx.run
安装lightdm,用于关闭图形界面安装驱动
sudo apt install lightdm
然后
sudo update-initramfs -u
关掉BIOS安全启动,进入Ubuntu
Ctrl + Alt + F1
sudo service lightdm stop
sudo ./Nvidia-xxx.run --no-opengl-files --no-x-check --no-nouveau-check
1.The distribution-provided pre-install script failed! Are you sure you want to continue?
“Yes”
2.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”
3.Nvidia’s 32-bit compatibility libraries?
“No”
4.Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up.
“Yes”
挂载NVIDIA显卡驱动
modprobe nvidia
最后
sudo service lightdm start
reboot