![Nvidia 的性能比 Intel UHD 显卡差](https://linux22.com/image/1184835/Nvidia%20%E7%9A%84%E6%80%A7%E8%83%BD%E6%AF%94%20Intel%20UHD%20%E6%98%BE%E5%8D%A1%E5%B7%AE.png)
我已经从“附加驱动程序”安装了专有驱动程序 nvidia-driver-470,并且在 Nvidia 设置应用程序中在 PRIME 配置文件之间切换。
当选择 Nvidia(性能模式)时,我得到的性能比集成 Intel GPU 低得多(渲染时的 FPS 更少)。这与在同一台机器上在 Windows 上进行的相同测试相反(Nvidia 在那里运行非常快)。
我也测试了其他版本的 nvidia-driver-xxx,但结果是一样的。我在系统日志中没有找到任何相关的错误消息。我确实在互联网上搜索了解决方案,但没有找到任何有用的方法。我做了多个不同的测试,结果总是相似的。有没有办法排除故障或修复这个问题?(也许是一些诊断程序,或者一些我不熟悉的日志文件?)
我的配置:
- 操作系统:Ubuntu 20.04.3 LTS x86_64
- 主机:戴尔 Latitude 5401
- 内核:5.11.0-43-generic
- 中央处理器:英特尔 i5-9400H (8) @ 2.500GHz
- GPU1:英特尔 UHD 显卡 630
- GPU2:NVIDIA GeForce MX150
测试:
视窗
- 英特尔:39FPS
- 英伟达:60帧每秒
乌本图:
- 英特尔:43FPS
- 英特尔:28帧每秒
Ubuntu 上的 GLmark 测试:
- 英特尔:glmark2 得分:2796
- Nvidia:glmark2 分数:2051
命令结果ubuntu-drivers devices
:
WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
== /sys/devices/pci0000:00/0000:00:01.1/0000:02:00.0 ==
modalias : pci:v000010DEd00001D10sv00001028sd00000918bc03sc02i00
vendor : NVIDIA Corporation
model : GP108M [GeForce MX150]
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-418-server - distro non-free
driver : nvidia-driver-470 - distro non-free recommended ***THIS IS WHAT I HAVE INSTALLED***
driver : nvidia-driver-450-server - distro non-free
driver : nvidia-driver-495 - distro non-free
driver : nvidia-driver-390 - distro non-free
driver : nvidia-driver-460-server - distro non-free
driver : nvidia-driver-460 - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
内核日志:
$ cat /var/log/kern.log | grep -i -e nvidia -e gpu -e screen
[ 1.833342] nvidia: loading out-of-tree module taints kernel.
[ 1.833353] nvidia: module license 'NVIDIA' taints kernel.
[ 1.845571] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[ 1.855139] input: ELAN900C:00 04F3:2856 Touchscreen as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-1/i2c-ELAN900C:00/0018:04F3:2856.0001/input/input6
[ 1.862141] nvidia-nvlink: Nvlink Core is being initialized, major device number 511
[ 1.862792] nvidia 0000:02:00.0: enabling device (0006 -> 0007)
[ 1.978819] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 470.86 Tue Oct 26 21:55:45 UTC 2021
[ 2.030289] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 470.86 Tue Oct 26 21:46:51 UTC 2021
[ 2.032155] [drm] [nvidia-drm] [GPU ID 0x00000200] Loading driver
[ 2.722302] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:02:00.0 on minor 1
[ 4.242816] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[ 4.246455] nvidia-uvm: Loaded the UVM driver, major device number 509.
[ 4.508402] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
[ 5.471867] audit: type=1400 audit(1640905957.834:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=679 comm="apparmor_parser"
[ 5.471873] audit: type=1400 audit(1640905957.834:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=679 comm="apparmor_parser"
[ 4698.970516] vivaldi-bin[2541]: segfault at f9c ip 00007f9be3706fab sp 00007ffea7b46bc0 error 4 in libGLX_nvidia.so.470.86[7f9be36b9000+b2000]
[ 4699.770153] [drm] [nvidia-drm] [GPU ID 0x00000200] Unloading driver
[ 4699.806052] nvidia-uvm: Unloaded the UVM driver.
[ 4699.839170] nvidia-modeset: Unloading
[ 4699.872240] nvidia-nvlink: Unregistered the Nvlink Core, major device number 511
[ 1.578533] input: ELAN900C:00 04F3:2856 Touchscreen as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-1/i2c-ELAN900C:00/0018:04F3:2856.0001/input/input6
[ 4.109302] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
[ 5.065283] audit: type=1400 audit(1640946397.385:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=650 comm="apparmor_parser"
[ 5.065288] audit: type=1400 audit(1640946397.385:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=650 comm="apparmor_parser"
[19199.281423] nvidia: loading out-of-tree module taints kernel.
[19199.281440] nvidia: module license 'NVIDIA' taints kernel.
[19199.292593] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[19199.305083] nvidia-nvlink: Nvlink Core is being initialized, major device number 509
[19199.305564] nvidia 0000:02:00.0: enabling device (0006 -> 0007)
[19199.421753] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 470.86 Tue Oct 26 21:55:45 UTC 2021
[19199.443171] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 470.86 Tue Oct 26 21:46:51 UTC 2021
[19199.451880] [drm] [nvidia-drm] [GPU ID 0x00000200] Loading driver
[19200.145535] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:02:00.0 on minor 1
[19200.164298] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[19200.166606] nvidia-uvm: Loaded the UVM driver, major device number 507.
当选择 Intel(“省电”)或“按需” PRIME 配置文件时:
$ glxinfo | egrep "direct rendering|OpenGL renderer|vendor"
direct rendering: Yes
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
当选择 Nvidia(“性能”)PRIME 配置文件时:
$ glxinfo | egrep "direct rendering|OpenGL renderer|vendor"
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce MX150/PCIe/SSE2
答案1
之前,我也使用 Nvidia 作为我的主要 GPU,但它并没有给我带来太多性能。一个快速修复方法是禁用并清除所有驱动程序,然后使用以下方法重新安装它们sudo ubuntu-drivers autoinstall
您可以通过以下方式完成上述操作:
sudo apt purge nvidia-* && sudo ubuntu-drivers autoinstall
但是,上述修复并没有持续太久。永久修复是安装系统 76 Vulcan 驱动程序。这些驱动程序确实很好,性能和图形效果更好。
这里是一篇详细的文章,解释如何安装正确的驱动程序。
添加 Apt 首选项文件
如果您运行的是 Ubuntu 19.10 或更高版本,则需要手动添加 apt 首选项文件来“固定”System76 存储库。这将告诉 apt 优先选择 System76 软件包而不是标准 Ubuntu 软件包。在完成此步骤之前,无法安装 System76 驱动程序。
在此处创建 apt 首选项文件:
sudo gedit /etc/apt/preferences.d/system76-apt-preferences
添加以下六行(如果算上中间的空格则为七行):
Package: * Pin: release o=LP-PPA-system76-dev-stable Pin-Priority: 1001 Package: * Pin: release o=LP-PPA-system76-dev-pre-stable Pin-Priority: 1001
保存文件。现在您应该能够按照下面的说明安装 System76 驱动程序。
安装驱动程序
要安装我们的驱动程序,您需要在终端中运行以下命令:
sudo apt-add-repository -y ppa:system76-dev/stable sudo apt-get update sudo apt install system76-driver
这将安装 System76 驱动程序和相关实用程序,它们是您的系统启用全部功能所必需的。
安装 Nvidia 驱动程序
如果您的系统有 NVIDIA 显卡,您将需要继续使用此命令安装内置 NVIDIA 显卡驱动程序的 System76 驱动程序:
sudo apt-get install system76-driver-nvidia
除了标准软件包之外,它还将引入 System76 打包的最新 NVIDIA 驱动程序,以及充分利用专用 NVIDIA 显卡所需的所有相关软件包。
在 Ubuntu 20.04 及以上版本上测试。
注意:- 这些驱动程序可能会自行损坏,因为它们是为 Pop!_OS system76 硬件制作的,但现在它们也可用于 Ubuntu 和其他发行版。它支持几乎所有硬件。