ubuntu 手动安装Nvidia后黑屏左上角光标显示

发布时间 2023-06-10 20:44:17作者: 耿明岩

此解决方法适合Intel 带核显CPU, 也就是双CPU(Intel核显+Nvidia独显).

解决办法是用Intel 核显驱动,Nvidia只用来做计算,不适合用GPU专门做图形渲染目的.

主要是因为Nvidia 修改了Xorg窗口系统配置文件 /etc/X11/xorg.conf,从安装Nvidia驱动前的Intel核显驱动改成了用Nvidia驱动。

主要修改了xorg.conf中的Device项,Device就是表示图形设备描述, 具体每个项代表什么意思参考:https://blog.csdn.net/t812206236/article/details/56670621/

修改Device,改回Intel驱动

1. 获取PCI ID

ming@Dell-G15-5520-cba911be:/etc/X11$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P Integrated Graphics Controller (rev 0c)
01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)

我们想使用Intel核显驱动,那PCI ID就是0:2:0,如果用Nvidia驱动,那PCI ID就是:1:0:0。

2. 编辑xorg.conf改回Intel驱动

使用vi或者其他编辑软件, 修改/etc/X11/xorg.conf,找到Section "Device"位置,改成如下:

Section "Device"
    Identifier     "Device0"
    Driver         "intel"
    VendorName     "Intel Corporation"
    BusID          "PCI:0:2:0"
EndSection
Section "Device": 图形设备描述
Identifier: 唯一标识符,名称随意,注意不能和其他项的Identifier重复
Driver:intel    
VendorName: 供应商名称
BusID : 0:2:0 重要,上边获取的Intel核显驱动的PCI ID