1、切换root用户
sudo su
2、查看显卡
lspci -k |grep -EA3 "3D|VGA|Display"
3、查看建议安装的驱动程序
nvidia-detect
4、安装推荐的驱动程序
apt install nvidia-driver
5、获取设备BusID ,如下例子 01:00.00 填写PCI:1:0:0
lspci | egrep 'VGA|3D'
6、编辑 /etc/X11/xorg.conf
vim /etc/X11/xorg.conf
添加以下内容
Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "Card0"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
7、编辑 /etc/lightdm/display_setup.sh
vim /etc/lightdm/display_setup.sh
添加如下
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
8、赋权
sudo chmod +x /etc/lightdm/display_setup.sh
9、编辑/etc/lightdm/lightdm.conf
vim /etc/lightdm/lightdm.conf
在[Seat:*]行下添加
display-setup-script=/etc/lightdm/display_setup.sh
10、重启
reboot