如何解决 Ubuntu 18.04 显示问题(滞后、闪烁)?

Ale*_* V. 6 display nvidia graphics drivers 18.04

如何改善 Ubuntu 18.04 上的显示?我尝试了本网站上介绍的许多不同方法,但没有一个奏效。

我有一台集成了 Intel GPU 和 NVIDIA GTX 970M 的 MSI GS60 Ghost Pro,在滚动网页(在 Chrome、Firefox 上)时出现滞后效果,并且在移动窗口时出现非常明显的闪烁效果。

硬件和驱动程序:

alex@alex-ubuntu:~$ lspci | egrep ' VGA|3D' 
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
01:00.0 3D controller: NVIDIA Corporation GM204M [GeForce GTX 970M] (rev a1)
Run Code Online (Sandbox Code Playgroud)

英伟达 GPU:

alex@alex-ubuntu:~$ glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 970M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 390.77
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 390.77
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.77
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:



alex@alex-ubuntu:~$ lsmod | grep drm_kms_helper
drm_kms_helper        172032  2 i915,nvidia_drm
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
drm                   401408  6 i915,nvidia_drm,drm_kms_helper
Run Code Online (Sandbox Code Playgroud)

英特尔 GPU:

alex@alex-ubuntu:~$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2) 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:


alex@alex-ubuntu:~$ lsmod | grep drm_kms_helper
drm_kms_helper        172032  2 nouveau,i915
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
drm                   401408  9 nouveau,i915,ttm,drm_kms_helper
Run Code Online (Sandbox Code Playgroud)

我测试了以下方法:

zwe*_*ets 2

假设 nVidia 导致了该问题,解决方法是仅在 Intel IGD 上运行。以下步骤以“排他性”递增的顺序实现这一点。您可以在每个步骤之后检查是否有改进。

1.配置Xorg优先选择Intel

创建文件/etc/X11/xorg.conf.d/10-intel.conf(这可能需要mkdir /etc/X11/xorg.conf.d),包含:

Section "OutputClass"
   Identifier "Intel"
   MatchDriver "i915"
   Driver "intel"
EndSection
Run Code Online (Sandbox Code Playgroud)

2. 禁用 IGD 之外的模式切换

编辑/etc/default/grub并添加xdg.force_integrated=1GRUB_CMDLINE_LINUX. 完成后,在重新启动之前运行sudo update-grub

3. 将nouveau内核驱动列入黑名单

编辑/etc/default/grub并添加modprobe.blacklist=nouveauGRUB_CMDLINE_LINUX. 完成后,在重新启动之前运行sudo update-grub

4.卸载Xorg nouveau驱动

sudo apt remove xserver-xorg-video-nouveau
Run Code Online (Sandbox Code Playgroud)

这将触发xserver-xorg-video-all默认安装的元包的删除。没关系,只要xserver-xorg-video-intel保持安装状态即可。为了确定:

sudo apt remove xserver-xorg-video-all
sudo apt install xserver-xorg-video-intel
Run Code Online (Sandbox Code Playgroud)