运行 nvidia-xconfig 会弄乱 X 并阻止其启动

运行 nvidia-xconfig 会弄乱 X 并阻止其启动

我安装nvidia-lts并运行sudo nvidia-xconfig希望它能让 Nvidia 驱动程序工作,但它创建了一个配置文件,其中/etc/X11/xorg.conf阻止我使用startx.

startx ~/.local/share/xorg/Xorg.1.log 生成的日志:

[  3080.730] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[  3080.732]
X.Org X Server 1.20.0
X Protocol Version 11, Revision 0
[  3080.736] Build Operating System: Linux Arch Linux
[  3080.738] Current Operating System: Linux IronPig 4.17.3-1-ARCH #1 SMP PREEMPT Tue Jun 26 04:42:36 UTC 2018 x86_64
[  3080.739] Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=4402f12d-729d-4414-acdf-b83c4b3c505e rw quiet resume=UUID=d456c307-2915-4874-b31c-8fa809199b16
[  3080.741] Build Date: 18 June 2018  03:12:37PM
[  3080.742]
[  3080.743] Current version of pixman: 0.34.0
[  3080.745]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[  3080.745] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  3080.750] (==) Log file: "/home/ironpig/.local/share/xorg/Xorg.1.log", Time: Wed Jul  4 13:49:29 2018
[  3080.751] (==) Using config file: "/etc/X11/xorg.conf"
[  3080.753] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  3080.753] (==) ServerLayout "Layout0"
[  3080.753] (**) |-->Screen "Screen0" (0)
[  3080.753] (**) |   |-->Monitor "Monitor0"
[  3080.753] (**) |   |-->Device "Device0"
[  3080.753] (**) |-->Input Device "Keyboard0"
[  3080.753] (**) |-->Input Device "Mouse0"
[  3080.753] (==) Automatically adding devices
[  3080.753] (==) Automatically enabling devices
[  3080.753] (==) Automatically adding GPU devices
[  3080.753] (==) Automatically binding GPU devices
[  3080.753] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  3080.753] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[  3080.753]    Entry deleted from font path.
[  3080.753] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[  3080.753]    Entry deleted from font path.
[  3080.753] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[  3080.753]    Entry deleted from font path.
[  3080.753] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[  3080.753]    Entry deleted from font path.
[  3080.753] (==) FontPath set to:
        /usr/share/fonts/misc,
        /usr/share/fonts/TTF
[  3080.753] (==) ModulePath set to "/usr/lib/xorg/modules"
[  3080.753] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[  3080.753] (WW) Disabling Keyboard0
[  3080.753] (WW) Disabling Mouse0
[  3080.753] (II) Module ABI versions:
[  3080.753]    X.Org ANSI C Emulation: 0.4
[  3080.753]    X.Org Video Driver: 24.0
[  3080.753]    X.Org XInput driver : 24.1
[  3080.753]    X.Org Server Extension : 10.0
[  3080.754] (++) using VT number 2

[  3080.756] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c2
[  3080.756] (II) xfree86: Adding drm device (/dev/dri/card0)
[  3080.757] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 10 paused 0
[  3080.757] (II) xfree86: Adding drm device (/dev/dri/card1)
[  3080.758] (II) systemd-logind: got fd for /dev/dri/card1 226:1 fd 11 paused 0
[  3080.759] (--) PCI:*(0@0:2:0) 8086:1616:1028:06c1 rev 9, Mem @ 0xf5000000/16777216, 0xd0000000/268435456, I/O @ 0x0000f000/64, BIOS @ 0x????????/131072
[  3080.760] (--) PCI: (8@0:0:0) 10de:1140:1028:06c1 rev 161, Mem @ 0xf6000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000d000/128, BIOS @ 0x????????/524288
[  3080.760] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[  3080.760] (II) LoadModule: "glx"
[  3080.760] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[  3080.761] (II) Module glx: vendor="X.Org Foundation"
[  3080.761]    compiled for 1.20.0, module version = 1.0.0
[  3080.761]    ABI class: X.Org Server Extension, version 10.0
[  3080.761] (II) LoadModule: "nvidia"
[  3080.761] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[  3080.761] (II) Module nvidia: vendor="NVIDIA Corporation"
[  3080.761]    compiled for 4.0.2, module version = 1.0.0
[  3080.761]    Module class: X.Org Video Driver
[  3080.761] (II) NVIDIA dlloader X Driver  396.24  Wed Apr 25 22:53:34 PDT 2018
[  3080.761] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  3080.761] xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)
[  3080.761] (II) systemd-logind: releasing fd for 226:1
[  3080.762] (EE) No devices detected.
[  3080.762] (EE)
Fatal server error:
[  3080.762] (EE) no screens found(EE)
[  3080.762] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[  3080.762] (EE) Please also check the log file at "/home/ironpig/.local/share/xorg/Xorg.1.log" for additional information.
[  3080.762] (EE)
[  3080.774] (EE) Server terminated with error (1). Closing log file.

/etc/X11/xorg.conf (该文件是由 nvidia-xconfig 创建的,删除它使 X 再次工作):

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 396.24  (buildmeister@swio-display-x64-rhel04-13)  Thu Apr 26 01:13:52 PDT 2018

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

输出lspci -k | grep -A 2 -E "(VGA|3D)

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09)
        Subsystem: Dell HD Graphics 5500
        Kernel driver in use: i915
--
08:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] (rev a1)
        Subsystem: Dell GeForce 820M
        Kernel driver in use: nouveau

我现在使用的是 Antergos Linux。

当我使用 Ubuntu 时,只需从存储库安装一个软件包,我就可以让 Nvidia 驱动程序正常工作。

我怎样才能让 Nvidia 驱动程序工作?

相关内容