使用 NVIDIA X Server 同时使用笔记本电脑和外接显示器

使用 NVIDIA X Server 同时使用笔记本电脑和外接显示器

我设法通过xorg.conf文件设置显示器的显示属性,但我似乎找不到同时使用外部和内置笔记本电脑显示器的方法。这是我的xorg.conf

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 390.42  (buildd@lcy01-amd64-029)  Thu Mar 22 17:34:03 UTC 2018

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 390.48  (buildmeister@swio-display-x86-rhel47-07)  Thu Mar 22 01:07:32 PDT 2018

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" Below "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
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 "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 960M"
    Screen         0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "intel"
    Option         "AccelMethod" "sna"
    BusID          "PCI:0:2:0"
    Screen         1
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "SAMSUNG"
    HorizSync       26.0 - 81.0
    VertRefresh     24.0 - 75.0
    Option         "DPMS"
    Option         "DPI" "96 x 96"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    HorizSync       26.0 - 81.0
    VertRefresh     24.0 - 75.0
    Option         "DPMS"
    Option         "DPI" "96 x 96"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "UseEdidDpi" "False"
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "1680x1050 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "UseEdidDpi" "False"
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "1680x1050 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

通过此设置,只有外接显示器可以工作,但是如果我在两者之间切换线路Screen 0和 ,则只有笔记本电脑显示器可以工作。Screen 1Section "Device"

答案1

类似的问题在这里:只有 HDMI 外接显示器可以工作,笔记本电脑屏幕不能工作。使用 Fedora 32。

经过许多测试选项后,我设法让它与以下 /etc/X11/xorg.conf 一起工作。请注意,这里的关键是允许 NVIDIAGPU 屏幕选项。为此,您需要支持 Prime 渲染卸载的显卡(我的是 Nvidia GeForce RTX 2060):

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

Section "Files"
EndSection

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

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

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "dpms"   "on"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "dpms"   "on"
EndSection

Section "Device"    # This is the cool NVIDIA GPU
    Identifier     "Device0"
    Driver         "nvidia"
    BusID          "PCI:1:0:0"
    VendorName     "NVIDIA Corporation"
    Screen         0
EndSection

Section "Device"   # This is the built-in GPU
    Identifier     "Device1"
    Driver         "modesetting"
    BusID          "PCI:0:2:0"
    Screen         1
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
EndSection

相关内容