謎's キッチン

謎のひとりごと。Amazon欲しい物リストはこちら: https://www.amazon.co.jp/hz/wishlist/ls/CCPOV7C6JTD2

NVIDIAとIntelでマルチディスプレイ

ハマったので書いておく。

BusIDを調べる

$ lspci | grep NVIDIA | grep -v Audio | sed -e "s/^0*\(.\+\):0*\(.\+\)\.\(.\)\ .*$/PCI:\1:\2:\3/"

xorg.confを設定

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "<BusID>"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    # Uncomment this line if your computer has no display devices connected to
    # the NVIDIA GPU.  Leave it commented if you have display devices
    # connected to the NVIDIA GPU that you would like to use.
    #Option "UseDisplayDevice" "none"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

ディスプレイIDを調べる

$ xrandr --setprovideroutputsource 1 0
$ xrandr | grep \ connected | sed -e "s/\ .*$//"

.xsessionrcを設定

xrandr --setprovideroutputsource 1 0
xrandr --auto
xrandr --output <ディスプレイID 1> --right-of <ディスプレイID 2>


補足。nvidia-settingsではIntel側のモニタをPRIME Displayとして表示しているものの、そのレンダリングNVIDIA GPU側で行っているようだ。それは良いとしても、二つのモニタの周波数が異なる場合に、セカンダリ側のアプリケーションのfpsNVIDIA側モニタの周波数に制限されてしまっているように見える (アプリケーションの問題かも?)。

GPU毎にディスプレイを立ち上げて、DISPLAY=:0.1 xfwm4&のようにすればどうかなと思ったけど、何故か上手くいかないので保留。