使用当前设置重新生成 xorg.conf

Hon*_*hen 10 shell xorg graphics nvidia hybrid-graphics

很多人都在讨论这个问题,但我没有找到满意的答案。

我在 debian jessie 上。目前我已经尝试过nvidia-driver作为驱动程序,但它导致系统崩溃;所以我已经清除了所有的nvidia包裹。但问题是/etc/X11/xorg.conf已经被NVidia设置替换了,备份xorg.conf.backup也被删除了。

NVidia设置的相关配置为:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection
Run Code Online (Sandbox Code Playgroud)

我曾经尝试更改nvidiaintel(也NVidia-> Intel),但分辨率要低得多(我的笔记本电脑有Intel Corporation Haswell-ULT Integrated Graphics Controller列出的lspci)。所以我可能需要nouveau用作驱动程序;但是简单地更改nvidianouveau不起作用。

最近的X系统好像不用xorg.conf(by rm /etc/X11/xorg.conf)也能启动,但是比较慢。所以我仍然更喜欢 xorg.conf 与我当前的设置。

的版本Xorg

X.Org X Server 1.16.0
Release Date: 2014-07-16
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.14-1-amd64 x86_64 Debian
Current Operating System: Linux debian 3.14-1-amd64 #1 SMP Debian 3.14.9-1 (2014-06-30) x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.14-1-amd64 root=UUID=e9341749-9dee-4cc9-878e-3b59ed1906b2 ro quiet
Build Date: 17 July 2014  10:22:36PM
xorg-server 2:1.16.0-1 (http://www.debian.org/support)
Current version of pixman: 0.32.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Run Code Online (Sandbox Code Playgroud)

那么有没有什么办法可以重新生成配置文件呢?

Wya*_*ard 5

Xorg -configure 虽然 X 没有运行是为我做的 - 我在 Debian Sid(不稳定)上。

执行此操作时不得让 X 运行,并且必须在控制台 TTY 中。(ctrl-alt-f1/f2/f3/f4/f5/f6)

要停止您的 X 服务器(如果正在运行),您可能必须停止桌面管理器/登录管理器(例如,xdmgdmlightdmkdm,但还有其他的)。

如果您在没有登录管理器的情况下运行 X,我假设您已经知道自己在做什么以及如何停止 X。

否则,停止您的经理的“首选”方法可能会因您的初始化系统而异,但这里有几种常见的方法。以 root 身份运行这些命令xdm,如果合适,替换为您的桌面管理器。

系统 V 初始化(sysvinit):

# /etc/init.d/xdm stop
Run Code Online (Sandbox Code Playgroud)

Systemd init(现在大多数发行版默认使用 Systemd):

# service xdm stop
Run Code Online (Sandbox Code Playgroud)

作为一个可以在许多系统上运行的包罗万象的东西(至少是 Linux 发行版;我认为 FreeBSD 没有pidof在基本安装中):

# kill `pidof xdm`
Run Code Online (Sandbox Code Playgroud)

如果执行此操作后 Xorg.conf 没有更改,并且程序没有返回错误而是将 Xorg.conf 配置文件打印到屏幕,请执行Xorg -configure > /etc/xorg.conf将输出通过管道传输到文件中。

但是我最终让官方 Nvidia 驱动程序工作的方式是卸载包管理器的版本并从 Nvidia 的站点下载安装程序。从那以后它一直在完美地工作。有一次它不起作用(当我尝试运行 Minecraft 时),我设置了变量LD_PRELOAD=/usr/lib/libGL.so.1并运行了 - lwjgl 在检测要使用的正确 libGL 版本时遇到问题。

  • 谢谢,我认为这就是问题所在:我一直在 X 启动后尝试使用 `Xorg -configure`;当我回到笔记本电脑时,我会尝试。顺便说一句,`nvidia-detect`(来自 debian 包)甚至报告 **没有** Nvidia 显卡可用于笔记本电脑,[官方驱动程序](http://www.nvidia.com/Download/index)也是如此.aspx)工作?你有类似的问题吗? (2认同)
  • 似乎`Xorg -configure` 适用于我的 Xorg(X.Org X Server `1.16.0` 和 `1.15.1`)。我尝试从官方网站下载 nvidia 驱动程序,但在使用 `nvidia-xconfig`(黑屏)更新 `xorg.conf` 时仍然无法使用该驱动程序。奇怪的是,我发现 nvidia 相关模块没有与 `lsmod` 一起列出。至于答案本身,我想我应该将其标记为正确,因为它确实回答了我的问题(但是,该配置有一个黑屏)。 (2认同)