Nvidia

如何設置帶有 Nvidia 驅動程序和一個旋轉顯示器的雙頭顯示器?

  • April 18, 2019

我有一個集成的 ION GPU,它由專有驅動程序支持,但我一直無法讓開源驅動程序工作。我希望我的左側螢幕正常,但要旋轉右側螢幕。我如何實現這一目標?

我花了一段時間才解決這個問題,所以我想與其他人分享它。我將假設已安裝 nvidia 驅動nvidia-settings程序。(在 Arch 上,執行sudo pacman -S nvidia nvidia-utils。)

首先,我們需要生成一個xorg.confusing nvidia-settings。從 GUI 終端執行sudo nvidia-settings.

  1. 從左側菜單中選擇“X 伺服器顯示配置”。
  2. 在右側,將“配置”更改為“分離 X 螢幕(需要重新啟動 X”。
  3. 選中“啟用 Xinerama”。
  4. 點擊“保存到X配置文件”;/etc/xorg.conf將起作用,或者您可以將其作為新文件添加到/etc/xorg.conf.d- 例如/etc/xorg.conf.d/10-monitors.conf.

現在,我們需要編輯這個文件。在您喜歡的編輯器中將其打開為root. 例如,執行gksu gedit /etc/xorg.confsudo vim /etc/xorg.conf.

找到正確的Section "Screen". 我通過找到正確的Section "Monitor"然後找到相應的Section "Screen".

找到看起來像的線

Option "metamodes" "DFP-1: 1920x1080 +0+0"

並添加{ Rotation=Left },所以它看起來像

Option "metamodes" "DFP-1: 1920x1080 +0+0 { Rotation=Left }".

注意 DFP-1可能是DFP-0,具體取決於您正在旋轉的顯示器;解析度也可能不同。

例子

我的xorg.conf內容如下

Section "ServerLayout"
Identifier     "Layout0"
Screen      0  "Screen0" 0 28
Screen      1  "Screen1" 1280 0
InputDevice    "Keyboard0" "CoreKeyboard"
InputDevice    "Mouse0" "CorePointer"
Option         "Xinerama" "1"
EndSection

Section "Files"
EndSection

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

Section "InputDevice"
Identifier     "Keyboard0"
Driver         "kbd"
EndSection

Section "InputClass"
Identifier         "Keyboard Defaults"
MatchIsKeyboard    "yes"
Option         "XkbLayout" "gb"
EndSection

Section "Monitor"
Identifier     "Monitor1"
VendorName     "Unknown"
ModelName      "HP w2228h"
HorizSync       24.0 - 83.0
VertRefresh     48.0 - 76.0
Option         "DPMS"
EndSection

Section "Monitor"
Identifier     "Monitor0"
VendorName     "Unknown"
ModelName      "DELL 1703FP"
HorizSync       30.0 - 80.0
VertRefresh     56.0 - 76.0
Option         "DPMS"
EndSection

Section "Device"
Identifier     "Device1"
Driver         "nvidia"
VendorName     "NVIDIA Corporation"
BoardName      "ION"
BusID          "PCI:3:0:0"
Screen          1
EndSection

Section "Device"
Identifier     "Device0"
Driver         "nvidia"
VendorName     "NVIDIA Corporation"
BoardName      "ION"
BusID          "PCI:3:0:0"
Screen          0
EndSection

Section "Screen"
Identifier     "Screen1"
Device         "Device1"
Monitor        "Monitor1"
DefaultDepth    24
Option         "TwinView" "On"
Option         "Stereo" "0"
Option         "metamodes" "DFP-1: 1920x1080 +0+0 { Rotation=Left }"
   SubSection     "Display"
   Depth       24
   EndSubSection
EndSection

Section "Screen"
Identifier     "Screen0"
Device         "Device0"
Monitor        "Monitor0"
DefaultDepth    24
Option         "TwinView" "On"
Option         "Stereo" "0"
Option         "nvidiaXineramaInfoOrder" "DFP-0"
Option         "metamodes" "DFP-0: 1280x1024 +0+0"
   SubSection     "Display"
   Depth       24
   EndSubSection
EndSection

Section "Extensions"
Option         "Composite" "Disable"
EndSection

參考

  1. Linux 雙顯示器設置:Nvidia 和 Xinerama 指南:僅旋轉一台顯示器

引用自:https://unix.stackexchange.com/questions/42454