使用 nvidia-prime-select 更改为 Nvidia GPU 时出现 Xorg 错误

使用 nvidia-prime-select 更改为 Nvidia GPU 时出现 Xorg 错误

我在配备 Nvidia GeForce MX150 的笔记本电脑上使用 Artix Linux(基于 Arch Linux)。我安装了专有的 nvidia 驱动程序。它是一个 Optimus GPU(至少它是这么认为的),我想让 X-Server 在 GPU 上运行:我切换到 Nvidia nvidia-prime-selectAUR:nvidia-prime-select-git)。之后X-Server就不再启动了。

/etc/X11/xorg.conf 创建者nvidia-prime-select nvidia

Section "Files"
    ModulePath  "/opt/nvidia/xorg/modules"
    ModulePath  "/usr/lib64/xorg/modules"
EndSection

## avoid glamor that prevent nvidia driver to load correctly
Section "Module"
    Disable "glamoregl"
EndSection

## ABI config
Section "ServerFlags"
    Option  "IgnoreABI" "1"
EndSection

Section "ServerLayout"
    Identifier  "layout"
    Screen  0   "nvidia_screen"
    Inactive        "intel"
    Option      "Xinerama" "0"
EndSection

## nvidia xorg conf
Section "Device"
    Identifier  "nvidia"
    Driver      "nvidia"
EndSection

Section "Screen"
    Identifier  "nvidia_screen"
    Device      "nvidia"
EndSection

## intel xorg conf
Section "Device"
    Identifier  "intel"
    Driver      "modesetting"
    BusID           "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier  "intel_screen"
    Device      "intel"
    Option      "AccelMethod"  "sna"
EndSection

/var/log/Xorg.0.log:

[  7197.048] (--) Log file renamed from "/var/log/Xorg.pid-2888.log" to "/var/log/Xorg.0.log"
[  7197.049] 
X.Org X Server 1.21.1.3
X Protocol Version 11, Revision 0
[  7197.049] Current Operating System: Linux Jonas 5.15.12-artix1-1 #1 SMP PREEMPT Thu, 30 Dec 2021 11:24:09 +0000 x86_64
[  7197.049] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=3d98ec6b-0f70-48b2-bf89-d798d47e129b rw loglevel=3 quiet
[  7197.049]  
[  7197.049] Current version of pixman: 0.40.0
[  7197.049]    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[  7197.049] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  7197.049] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Jan 14 19:01:15 2022
[  7197.049] (==) Using config file: "/etc/X11/xorg.conf"
[  7197.049] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  7197.050] (==) ServerLayout "layout"
[  7197.050] (**) |-->Screen "nvidia_screen" (0)
[  7197.050] (**) |   |-->Monitor "<default monitor>"
[  7197.050] (**) |   |-->Device "nvidia"
[  7197.050] (**) |   |-->GPUDevice "intel"
[  7197.050] (==) No monitor specified for screen "nvidia_screen".
    Using a default monitor configuration.
[  7197.050] (**) |-->Inactive Device "intel"
[  7197.050] (**) Option "Xinerama" "0"
[  7197.050] (**) Option "IgnoreABI" "1"
[  7197.050] (**) Ignoring ABI Version
[  7197.050] (==) Automatically adding devices
[  7197.050] (==) Automatically enabling devices
[  7197.050] (==) Automatically adding GPU devices
[  7197.050] (==) Automatically binding GPU devices
[  7197.050] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  7197.050] (WW) The directory "/usr/share/fonts/misc" does not exist.
[  7197.050]    Entry deleted from font path.
[  7197.050] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[  7197.050]    Entry deleted from font path.
[  7197.050] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[  7197.050]    Entry deleted from font path.
[  7197.050] (==) FontPath set to:
    /usr/share/fonts/TTF,
    /usr/share/fonts/100dpi,
    /usr/share/fonts/75dpi
[  7197.050] (**) ModulePath set to "/opt/nvidia/xorg/modules,/usr/lib64/xorg/modules"
[  7197.050] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[  7197.050] (II) Module ABI versions:
[  7197.050]    X.Org ANSI C Emulation: 0.4
[  7197.050]    X.Org Video Driver: 25.2
[  7197.050]    X.Org XInput driver : 24.4
[  7197.050]    X.Org Server Extension : 10.0
[  7197.051] (++) using VT number 7

[  7197.051] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[  7197.052] (II) xfree86: Adding drm device (/dev/dri/card0)
[  7197.052] (II) Platform probe for /sys/devices/pci0000:00/0000:00:02.0/drm/card0
[  7197.062] (--) PCI:*(0@0:2:0) 8086:5917:1025:1193 rev 7, Mem @ 0xb2000000/16777216, 0xc0000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/131072
[  7197.062] (--) PCI: (1@0:0:0) 10de:1d10:1025:119a rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00004000/128
[  7197.062] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[  7197.062] (WW) "glamoregl" will not be loaded unless you've specified it to be loaded elsewhere.
[  7197.062] (II) "glx" will be loaded by default.
[  7197.062] (II) LoadModule: "glx"
[  7197.062] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[  7197.064] (II) Module glx: vendor="X.Org Foundation"
[  7197.064]    compiled for 1.21.1.3, module version = 1.0.0
[  7197.064]    ABI class: X.Org Server Extension, version 10.0
[  7197.064] (II) LoadModule: "nvidia"
[  7197.064] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
[  7197.065] (II) Module nvidia: vendor="NVIDIA Corporation"
[  7197.065]    compiled for 1.6.99.901, module version = 1.0.0
[  7197.065]    Module class: X.Org Video Driver
[  7197.065] (II) LoadModule: "modesetting"
[  7197.065] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so
[  7197.071] (II) Module modesetting: vendor="X.Org Foundation"
[  7197.071]    compiled for 1.21.1.3, module version = 1.21.1
[  7197.071]    Module class: X.Org Video Driver
[  7197.071]    ABI class: X.Org Video Driver, version 25.2
[  7197.071] (II) NVIDIA dlloader X Driver  495.46  Wed Oct 27 16:28:42 UTC 2021
[  7197.071] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  7197.071] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[  7197.092] (II) modeset(G0): using drv /dev/dri/card0
[  7197.092] (WW) Falling back to old probe method for modesetting
[  7197.109] (EE) No devices detected.
[  7197.109] (EE) 
Fatal server error:
[  7197.109] (EE) no screens found(EE) 
[  7197.109] (EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
[  7197.109] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[  7197.109] (EE) 
[  7197.187] (EE) Server terminated with error (1). Closing log file.

然后我在终端会话上执行nvidia-prime-select intel,sddm 正常启动(当然是在英特尔 GPU 上)。后来我还删除了创建的/etc/X11/xorg.config nvidia-prime-ui(之前不存在)。

但现在nvidia-settings说:

ERROR: Unable to load info from any available system

在我启动它之前。

我还尝试使用 bumblebee 在 Nvidia GPU 上运行单个程序,但当我使用以下命令时,它会给出类似的错误optirun supertuxkart

[  7011.039] 
X.Org X Server 1.21.1.3
X Protocol Version 11, Revision 0
[  7011.039] Current Operating System: Linux Jonas 5.15.12-artix1-1 #1 SMP PREEMPT Thu, 30 Dec 2021 11:24:09 +0000 x86_64
[  7011.039] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=3d98ec6b-0f70-48b2-bf89-d798d47e129b rw loglevel=3 quiet
[  7011.039]  
[  7011.040] Current version of pixman: 0.40.0
[  7011.040]    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[  7011.040] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  7011.040] (==) Log file: "/var/log/Xorg.8.log", Time: Fri Jan 14 18:58:09 2022
[  7011.042] (++) Using config file: "/etc/bumblebee/xorg.conf.nvidia"
[  7011.042] (++) Using config directory: "/etc/bumblebee/xorg.conf.d"
[  7011.042] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  7011.045] (==) ServerLayout "Layout0"
[  7011.045] (==) No screen section available. Using defaults.
[  7011.045] (**) |-->Screen "Default Screen Section" (0)
[  7011.045] (**) |   |-->Monitor "<default monitor>"
[  7011.046] (==) No device specified for screen "Default Screen Section".
    Using the first device section listed.
[  7011.046] (**) |   |-->Device "DiscreteNvidia"
[  7011.046] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[  7011.046] (**) Option "AutoAddDevices" "false"
[  7011.046] (**) Option "AutoAddGPU" "false"
[  7011.046] (**) Not automatically adding devices
[  7011.046] (==) Automatically enabling devices
[  7011.046] (**) Not automatically adding GPU devices
[  7011.046] (==) Automatically binding GPU devices
[  7011.046] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  7011.046] (WW) The directory "/usr/share/fonts/misc" does not exist.
[  7011.046]    Entry deleted from font path.
[  7011.046] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[  7011.046]    Entry deleted from font path.
[  7011.046] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[  7011.046]    Entry deleted from font path.
[  7011.046] (==) FontPath set to:
    /usr/share/fonts/TTF,
    /usr/share/fonts/100dpi,
    /usr/share/fonts/75dpi
[  7011.046] (++) ModulePath set to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules"
[  7011.046] (==) |-->Input Device "Mouse0"
[  7011.046] (==) |-->Input Device "Keyboard0"
[  7011.046] (==) The core pointer device wasn't specified explicitly in the layout.
    Using the first mouse device.
[  7011.046] (==) The core keyboard device wasn't specified explicitly in the layout.
    Using the first keyboard device.
[  7011.046] (II) Module ABI versions:
[  7011.046]    X.Org ANSI C Emulation: 0.4
[  7011.046]    X.Org Video Driver: 25.2
[  7011.046]    X.Org XInput driver : 24.4
[  7011.046]    X.Org Server Extension : 10.0
[  7011.048] (--) using VT number 7

[  7011.048] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[  7011.049] (II) xfree86: Adding drm device (/dev/dri/card0)
[  7011.049] (II) Platform probe for /sys/devices/pci0000:00/0000:00:02.0/drm/card0
[  7011.053] (--) PCI: (1@0:0:0) 10de:1d10:1025:119a rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00004000/128
[  7011.054] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[  7011.054] (II) LoadModule: "glx"
[  7011.057] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[  7011.060] (II) Module glx: vendor="X.Org Foundation"
[  7011.060]    compiled for 1.21.1.3, module version = 1.0.0
[  7011.060]    ABI class: X.Org Server Extension, version 10.0
[  7011.060] (II) LoadModule: "nvidia"
[  7011.060] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[  7011.068] (II) Module nvidia: vendor="NVIDIA Corporation"
[  7011.068]    compiled for 1.6.99.901, module version = 1.0.0
[  7011.068]    Module class: X.Org Video Driver
[  7011.069] (II) LoadModule: "mouse"
[  7011.069] (WW) Warning, couldn't open module mouse
[  7011.069] (EE) Failed to load module "mouse" (module does not exist, 0)
[  7011.069] (II) LoadModule: "kbd"
[  7011.069] (WW) Warning, couldn't open module kbd
[  7011.069] (EE) Failed to load module "kbd" (module does not exist, 0)
[  7011.070] (II) NVIDIA dlloader X Driver  495.46  Wed Oct 27 16:28:42 UTC 2021
[  7011.070] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  7011.070] (EE) No devices detected.
[  7011.070] (EE) 
Fatal server error:
[  7011.070] (EE) no screens found(EE) 
[  7011.070] (EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
[  7011.070] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
[  7011.070] (EE) 
[  7011.070] (EE) Server terminated with error (1). Closing log file.

当我运行__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia supertuxkart它时使用 GPU

lspci -k:

...
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
        Subsystem: Acer Incorporated [ALI] Device 1193
        Kernel driver in use: i915
        Kernel modules: i915
...
01:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev a1)
        Subsystem: Acer Incorporated [ALI] Device 119a
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia
...

nvidia-bug-report.sh:https://pastebin.com/HrrEfKrW

问题:

  • 为什么不再nvidia-settings起作用了?
  • 当我使用 nvidia-prime-select 更改为 Nvidia GPU 时,为什么 X-Server 无法启动?
  • 为什么大黄蜂不起作用? -> 解决了

编辑:我添加BusID "PCI:1:0:0"到由 . 创建的 xorg.config 文件中的“设备”部分nvidia-prime-select nvidia。现在 xorg 启动,但 sddm 显示黑屏。新日志:https://pastebin.com/gYUv9tqN,sddm日志:https://pastebin.com/b8ixWMiJ

更新:

  • 我尝试启动 Plasma 和 Gnome (Xorg)。同样的问题。
  • 我添加到BusID "PCI:1:0:0"了 nvidia 设备部分/etc/bumblebee/xorg.conf.nvidia,bumblebee 现在可以工作了!
  • BusID "PCI:1:0:0"我意识到,添加到时会出现不同的错误/etc/X11/xorg.confhttps://pastebin.com/JCNrA6fW

相关内容