Fedora 31 使用 llvmpipe 作为默认 OpenGL 渲染器,而不是 Nvidia(nvidia-settings 也不起作用)

Fedora 31 使用 llvmpipe 作为默认 OpenGL 渲染器,而不是 Nvidia(nvidia-settings 也不起作用)

我想在装有 Fedora 31(新安装)的 MSI GL63 8RD 笔记本电脑上仅使用 Nvidia 卡(Optimus Bumblebee 对我来说效果很差)。这是我的卡:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)

因此,我安装了来自 nvidia.com 的驱动程序,删除了 nouveau 并安装了它。这是在多用户模式下完成的(无图形)。现在我已加载此模块:

lsmod | grep nvidia
nvidia_drm             57344  0
nvidia_modeset       1118208  1 nvidia_drm
nvidia              19116032  1 nvidia_modeset
ipmi_msghandler        73728  2 ipmi_devintf,nvidia
drm_kms_helper        212992  2 nvidia_drm,i915
drm                   512000  5 drm_kms_helper,nvidia_drm,i915
lsmod | grep video
uvcvideo              114688  0
videobuf2_vmalloc      20480  1 uvcvideo
videobuf2_memops       20480  1 videobuf2_vmalloc
videobuf2_v4l2         28672  1 uvcvideo
videobuf2_common       57344  2 videobuf2_v4l2,uvcvideo
videodev              237568  3 videobuf2_v4l2,uvcvideo,videobuf2_common
mc                     61440  4 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common
video                  49152  2 msi_wmi,i915

但同时我的 nvidia-settings 出现了这个错误:

nvidia-settings 

ERROR: Unable to load info from any available system

这个 OpenGL 渲染器:

inxi -G
Graphics:  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] driver: nvidia v: 430.50 
           Display: x11 server: Fedora Project X.org 1.20.5 driver: modesetting,nvidia unloaded: fbdev,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: llvmpipe (LLVM 9.0 256 bits) v: 3.3 Mesa 19.2.0 

当我打开 glxgears 时,此 llvmpipe 启动:

glxgears -info
GL_RENDERER   = llvmpipe (LLVM 9.0, 256 bits)
GL_VERSION    = 3.1 Mesa 19.2.0
GL_VENDOR     = VMware, Inc.

我认为我无法启动 Steam 游戏就是因为这个原因(当我打开 bumblebee 时,我可以在 openbox 中使用 nvidia-xrun 脚本启动它)。我的用户在“video”组中,但它不起作用。

UPD:这是 dmesg 所说的内容:

dmesg | grep nvidia
[   22.335524] nvidia: loading out-of-tree module taints kernel.
[   22.335529] nvidia: module license 'NVIDIA' taints kernel.
[   22.341084] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[   22.348074] nvidia-nvlink: Nvlink Core is being initialized, major device number 237
[   22.348359] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[   22.764812] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  430.50  Thu Sep  5 22:39:50 CDT 2019
[   22.805422] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[   22.805428] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1

答案1

感谢好心的先生这篇 Reddit 帖子,我已经设法让这一切工作(本指南对我有用)。

首先,从 nvidia.com 安装错误安装程序构建内核模块,这些模块稍后会与新模块发生冲突(Fedora 有 440.26 模块,而 nvidia.com 有 430.50):

NVRM: loading NVIDIA UNIX x86_64 Kernel Module 430.50 Thu Sep 5 22:36:31 CDT 2019
NVRM: API mismatch: the client has the version 440.26, but
NVRM: this kernel module has the version 430.50. Please
NVRM: make sure that this kernel module and all NVIDIA driver
NVRM: components have the same version.

首先,我重新安装了 Fedora(做了很多调整,显然对系统不利)。

在最新更新的 Fedora 安装中我得到了 fusion repos:

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

然后我安装 nvidia 驱动程序:

dnf install xorg-x11-drv-nvidia

然后我从 rawhide 安装驱动程序和 xorg 的更新:

dnf copr enable kwizart/xorg-x11-server_nvidia
dnf update xorg-x11-server\*
dnf install rpmfusion-nonfree-release-rawhide
dnf update --enablerepo=rpmfusion-nonfree-rawhide xorg-x11-drv-nvidia\*

此后我进行配置:

cat > /etc/modprobe.d/nvidia.conf <<EOF
# Enable DynamicPwerManagement
# http://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/dynamicpowermanagement.html
options nvidia NVreg_DynamicPowerManagement=0x02
EOF

然后指南说创建 nvidia.conf:

cp -p /usr/share/X11/xorg.conf.d/nvidia.conf /etc/X11/xorg.conf.d/nvidia.conf

And edit the file to use: Option "PrimaryGPU" "yes" 

但这一步对我来说不起作用。重启后 SDDM 不会启动,并且 SDDM 的 tty 只是一个关闭的屏幕(甚至不是黑屏,而是完全关闭)。但即使没有这个配置,我也可以使用环境变量:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command%

[denis@fedora ~]$ inxi -G
Graphics:  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] driver: nvidia v: 440.26 
           Display: x11 server: Fedora Project X.org 1.20.5 driver: modesetting,nvidia 
           unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel UHD Graphics 630 (Coffeelake 3x8 GT2) v: 4.5 Mesa 19.2.2 

[denis@fedora ~]$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia inxi -G
Graphics:  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] driver: nvidia v: 440.26 
           Display: x11 server: Fedora Project X.org 1.20.5 driver: modesetting,nvidia 
           unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
           OpenGL: renderer: GeForce GTX 1050 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 440.26 

例如,我可以像这样加载 Steam 然后玩游戏。这是我使用 Primusrun 或 Optirun 从未实现过的。我没有找到使用此选项加载整个 SDDM 的方法,但这种解决方法已经比使用 nvidia-xrun 打开新的 xserver 好得多。

我在安装 Steam 时也遇到了问题:

sudo dnf install steam
Ошибка:
Проблема: package libglvnd-glx-1:1.1.1-5.fc31.i686 requires mesa-libGL(x86-32) >= 13.0.4-1, but none of the providers can be installed
- package xorg-x11-drv-nvidia-libs-3:440.26-1.fc32.x86_64 requires (xorg-x11-drv-nvidia-libs(x86-32) = 3:440.26-1.fc32 if mesa-libGL(x86-32)), but none of the providers can be installed
- package libva-2.6.0-0.1.fc31.i686 requires libGL.so.1, but none of the providers can be installed
- package xorg-x11-drv-nvidia-3:440.26-1.fc32.x86_64 requires libnvidia-glcore.so.440.26()(64bit), but none of the providers can be installed
- package xorg-x11-drv-nvidia-3:440.26-1.fc32.x86_64 requires libnvidia-tls.so.440.26()(64bit), but none of the providers can be installed
- package xorg-x11-drv-nvidia-3:440.26-1.fc32.x86_64 requires xorg-x11-drv-nvidia-libs(x86-64) = 3:440.26-1.fc32, but none of the providers can be installed
- package steam-1.0.0.61-4.fc31.i686 requires libva(x86-32), but none of the providers can be installed
- package kmod-nvidia-5.3.7-301.fc31.x86_64-3:440.26-1.fc31.x86_64 requires nvidia-kmod-common >= 3:440.26, but none of the providers can be installed
- conflicting requests
- problem with installed package kmod-nvidia-5.3.7-301.fc31.x86_64-3:440.26-1.fc31.x86_64
(try to add '--skip-broken' to skip uninstallable packages)

这是因为 nvidia 驱动程序是从外部 repo 更新的。要使 Steam 正常工作,您需要添加以下内容:

sudo dnf install steam --enablerepo=rpmfusion-nonfree-rawhide

希望这可以帮助。

相关内容