Fedora 32+Gnome+Wayland 上 GLX 与 Nvidia/Optimus 的请求失败

Fedora 32+Gnome+Wayland 上 GLX 与 Nvidia/Optimus 的请求失败

至少一年来,我一直在尝试使用 gnome shell 和 wayland 在我的 Fedora 笔记本电脑上使用 optimus 和 Geforce MX150 GPU 来运行 optimus。在早期版本中,我尝试过 bumblebee,但遇到了麻烦(虽然有一段时间我认为它已经运行了很长时间,但至少在 F31 中没有)。现在我升级到了 F32,我读到 optimus/nvidia gpu 不再需要 bumblebee,我只需使用环境变量即可__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia。所以我想试一试。我查看了https://rpmfusion.org/Howto/NVIDIA#Optimus还是没运气。在 Windows(双启动)下,它运行良好,所以这不是硬件问题。

如果我运行 glxinfo,我会收到以下错误:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  150 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  39
  Current serial number in output stream:  40

不过,该卡似乎在那里,并且驱动程序已加载:

nvidia-smi
Wed May 20 10:25:44 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce MX150       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   44C    P8    N/A /  N/A |      0MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
uname -a
Linux matebook-x-pro 5.6.12-300.fc32.x86_64 #1 SMP Mon May 11 16:47:13 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
lsmod|grep -e"nvidia\|nouveau"
nvidia_drm             57344  1
nvidia_modeset       1118208  1 nvidia_drm
nvidia_uvm           1093632  0
nvidia              20512768  17 nvidia_uvm,nvidia_modeset
ipmi_msghandler       118784  2 ipmi_devintf,nvidia
drm_kms_helper        241664  2 nvidia_drm,i915
drm                   598016  16 drm_kms_helper,nvidia_drm,i915

这是已安装的内容和配置文件:

dnf list "*nvidia*" --installed
Installed Packages
akmod-nvidia.x86_64                                                       3:440.82-1.fc32                                 @rpmfusion-nonfree
kmod-nvidia-5.6.11-200.fc31.x86_64.x86_64                                 3:440.82-1.fc31                                 @@commandline
kmod-nvidia-5.6.12-300.fc32.x86_64.x86_64                                 3:440.82-1.fc32                                 @@commandline
kmod-nvidia-5.6.8-200.fc31.x86_64.x86_64                                  3:440.82-1.fc31                                 @@commandline
nvidia-persistenced.x86_64                                                3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                                    3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
nvidia-texture-tools.x86_64                                               2.0.8-22.fc32                                   @fedora
nvidia-xconfig.x86_64                                                     3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                                                3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64                                           3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.i686                                        3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64                                      3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64                                        3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686                                             3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64                                           3:440.82-1.fc32                                 @rpmfusion-nonfree-nvidia-driver

内核参数:

rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1
cat /etc/X11/xorg.conf.d/nvidia.conf
Section "Module"
        Load "modesetting"
EndSection

Section "OutputClass"
        Identifier "nvidia"
        MatchDriver "nvidia-drm"
        Driver "nvidia"
        Option "AllowEmptyInitialConfiguration"
        Option "SLI" "Auto"
        Option "BaseMosaic" "on"
        Option "PrimaryGPU" "yes"
EndSection

Section "ServerLayout"
        Identifier "layout"
        Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
        Identifier "iGPU"
        Driver "modesetting"
        BusID "PCI:0:2:0"
EndSection

Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:1:0:0"
EndSection
lspci|grep -i "vga\|nvidia"
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
01:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev a1)
cat /etc/modprobe.d/nvidia.conf
options nvidia NVreg_DynamicPowerManagement=0x02
cat /usr/lib/udev/rules.d/61-gdm.rules
# disable Wayland on Hi1710 chipsets
#ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="/usr/libexec/gdm-disable-wayland"
# disable Wayland when using the proprietary nvidia driver
#DRIVER=="nvidia", RUN+="/usr/libexec/gdm-disable-wayland"
# disable Wayland if modesetting is disabled
#IMPORT{cmdline}="nomodeset", RUN+="/usr/libexec/gdm-disable-wayland"

答案1

更新:恐怕我宁愿在 F32 上避免这种情况。

F34- 可以使用 nvidia + wayland,但需要更改配置:

编辑文件 /lib/udev/rules.d/61-gdm.rules 注释掉此行:DRIVER=="nvidia", RUN+="/usr/libexec/gdm-disable-wayland"

F35

注释掉此行(上面提到的文件):SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_NVIDIA_DRIVER}=="1", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false" ACTION=="add", SUBSYSTEM=="module", KERNEL=="nvidia_drm", ATTR{parameters/modeset}=="N", RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"

F35 自gnome-session-40.1.1-3.fc35- 它应该可以与二进制驱动程序很好地配合。

相关内容