每次重启后 NVIDIA X 服务器设置都会丢失

每次重启后 NVIDIA X 服务器设置都会丢失

我在 Gigabyte Z87 主板上运行 GeForce GTX 770,并双启动 Windows 8.1 Pro 和 Ubuntu 12.04.3 LTS。除了 Ubuntu 中的视频和 3D 性能之外,设置总体运行顺畅。我曾经遇到过臭名昭著的闪烁问题,并找到了解决方法。这与 NVidia 卡进入低功耗模式有关,然后视频和 3D 效果会出现撕裂和卡顿。解决方法是转到 nvidia-settings 并将电源模式从“自动”更改为“首选最大性能”。问题是这只在我重新启动之前有效。重新启动后,设置被清除,问题仍然存在,所以我必须为当前会话手动再次设置它。我尝试使用 gksu 进行设置,但没有用。我尝试编辑 etc/X11/xorg.conf,但是它是空的 - 该文件中没有行...我阅读了所有相关文章,但主要是人们抱怨亮度被重置或双显示器配置,这些解决方案涉及一些对我没有任何帮助的特定应用程序。

TL;DR:NVidia 设置在重启后重置,我尝试了在互联网上找到的所有方法但无济于事。

如果有人知道在这种情况下该怎么做,请分享!

谢谢你!

编辑 [1]:我做了进一步的研究,似乎没有明显或安全的解决方案。有些人尝试手动设置性能级别,但报告称这不安全,可能会损坏 GPU。不过还是有希望的。我认为这可以通过 nvidia-settings 提供的 NVidia 配置文件选项来完成。问题是需要知道相关密钥以及该密钥接受的值。

I could have put a screenshot here, but I need rep => 10...

我找不到可能的键列表或任何键值...我想是没有运气了。

有人可以提供一个链接或者列出一些有用的吗?

谢谢!

编辑 [2]:终于!感谢大家的帮助!在以下人员的帮助下,我找到了解决方案韦加德·托尔文此主题. 感谢Ubuntu Google+ 社区传播这个消息!

答案1

  1. 通过以下方式创建 xorg.conf 文件:

    sudo nvidia-xconfig
    
  2. 在 xorg.conf 文件中查找“Device”部分,并在该部分中添加以下行:

    Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322"
    

保存并重新启动机器。

PS. 如果添加更多参数,请;在0x3322之后添加

答案2

来自官方用户指南

4. 自动加载设置

The NVIDIA X driver does not preserve values set with nvidia-settings
between runs of the X server (or even between logging in and logging
out of X, with xdm, gdm, or kdm).  This is intentional, because
different users may have different preferences, thus these settings
are stored on a per user basis in a configuration file stored in
the user's home directory.

The configuration file is named "~/.nvidia-settings-rc".  You can
specify a different configuration file name with the "--config"
commandline option.

After you have run nvidia-settings once and have generated a
configuration file, you can then run:

    nvidia-settings --load-config-only

at any time in the future to upload these settings to the X
server again.  For example, you might place the above command in
your ~/.xinitrc file so that your settings are applied automatically
when you log in to X.

Your .xinitrc file, which controls what X applications should
be started when you log into X (or startx), might look something
like this:

    nvidia-settings --load-config-only &
    xterm &
    evilwm

or:

    nvidia-settings --load-config-only &
    gnome-session

If you do not already have an ~/.xinitrc file, then chances are that
xinit is using a system-wide xinitrc file.  This system wide file
is typically here:

    /etc/X11/xinit/xinitrc

To use it, but also have nvidia-settings upload your settings,
you could create an ~/.xinitrc with the contents:

    nvidia-settings --load-config-only &
    . /etc/X11/xinit/xinitrc

System administrators may choose to place the nvidia-settings load
command directly in the system xinitrc script.

Please see the xinit(1) manpage for further details of configuring
your ~/.xinitrc file.

答案3

您可以做的是创建一个如下所示的脚本并在启动时运行它。

#!/bin/bash
nvidia-settings --assign CurrentMetaMode=<display_settings>

您用显示设置替换<display_settings>。显示设置可能如下所示:

"DVI-D-0: nvidia-auto-select +0+0, DP-0.1: nvidia-auto-select +1920+0, DP-0.8: nvidia-auto-select +0+0, HDMI-0: nvidia-auto-select +1920+0" 

您可以从‘X 配置文件’中获取显示设置。

您可以通过程序“启动应用程序偏好设置”在启动时运行它。

您可以通过gnome-session-properties终端启动“启动应用程序首选项”。

答案4

在 Linux Mint 18 Cinnamon 上,转到名为监视器的小型配置应用程序。按下“应用”时,将保存一个文件 ~/.config/monitors.xml,其用途与 xfce display.xml 相同 - 它保存所有这些设置,而 nvidia 设置中这些设置不是持久的。如果您恰好在 NVIDIA 图形设置面板中配置了显示布局,则必须尝试更改某些内容(以触发应用按钮的可用性)。我这样做了,并将上面的加载设置添加到 xinitrc。

我将检查屏幕锁定后窗口重新排序问题是否已消失所有窗口重新排序到主监视器

相关内容