ノートパソコン(オプティマス/バンブルビー搭載)でHDMIを有効化できない

ノートパソコン(オプティマス/バンブルビー搭載)でHDMIを有効化できない

Debian (stretch) を搭載した PC (HP ZBook) で HDMI 出力を使用しようとしています。Bumblebee を設定しましたが、うまく動作しています (glxinfo と optirun glxinfo は期待どおりの情報を報告し、複雑な GLSL シェーダーもテストしましたが、期待どおりに動作しました)。

今、私はビデオプロジェクターをHDMIに接続できるようにしたいと考えています。ここで[1]で、HDMIがNVidiaボードに接続されているときにintel-virtual-outputを使用して設定できると読みました(xrandrで操作できるVIRTUAL出力を使用)。しかし、intel-virtual-outputには次のように書かれています。

 no VIRTUAL outputs on ":0"

実行するとxrandr -q、VIRTUAL 出力は表示されず、次の内容のみが表示されます。

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 345mm x 194mm
   1920x1080     60.02*+  59.93  
   1680x1050     59.95    59.88  
   1600x1024     60.17  
   ... other video modes ...
   400x300       60.32    56.34  
   320x240       60.05  
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)

私がインストールした xserver-xorg-video-intel のバージョンは、xserver-xorg-video-intel_2.99.917+git20160706-1_amd64.deb です。

更新 (2016年12月9日土曜日)Debian を更新したところ、一部のアプリケーション (たとえば xemacs) を起動しているときに 2 番目のモニターがアクティブになっていると、X がクラッシュするようになりました。2016 年 12 月 17 日 (土): はい、わかりました! (回答を更新しました)。

更新 (2017 年 9 月 27 日水曜日)この方法は 99% のケースで機能しますが、先週、50Hz モードのみを受け入れるプロジェクターを試したところ、60Hz 以外は取得できませんでした (つまり機能しませんでした)。50Hz モードを強制する方法を知っている人はいますか?

更新 (2019 年 10 月 1 日火曜日)ああ! また壊れました: X と NVidia ドライバーを更新した後、optirun がクラッシュするようになりました ( /var/log/Xorg.8.logXorg でクラッシュ、OsLookupColor+0x139 と表示されます)。更新 (2019 年 10 月 7 日)一時的な修正が見つかりました(回答を更新しました)。

[1]https://github.com/Bumblebee-Project/Bumblebee/wiki/マルチモニターセットアップ

答え1

はい、分かりました! IntelドライバのVIRTUAL出力を有効にするには、20-intel.confXorg設定ディレクトリ(/usr/share/X11/xorg.conf.dDebian Stretchの下、読んで調べてください/var/log/Xorg.0.log)にファイルを作成する必要があります。

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

私の /etc/bumblebee/xorg.conf.nvidia は次のとおりです:

Section "ServerLayout"
    Identifier  "Layout0"
    Option      "AutoAddDevices" "true"
    Option      "AutoAddGPU" "false"
EndSection

Section "Device"
    Identifier  "DiscreteNvidia"
    Driver      "nvidia"
    VendorName  "NVIDIA Corporation"
    Option "ProbeAllGpus" "false"
    Option "NoLogo" "true"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "DiscreteNVidia"
EndSection

いくつか説明します。「Screen」セクションが必要です。そうでない場合は、20-intel.conf で宣言されている Intel デバイス (先ほど追加したばかりです) を使用しようとします。また、外部モニターが接続されていないときに optirun で起動できるようにするには、「AllowEmptyInitialConfiguration」も必要です。

この設定と起動によりintel-virtual-output、HDMI ポートにアクセスできるようになりました。イェーハー!!!

トラブルシューティング:optirunまたはが機能しない場合は、 (bumblebee は内部的にディスプレイ :8 を使用して X サーバーを作成します)intel-virtual-outputを確認してください。/var/log/Xorg.8.log

ノートいくつかの場所で、で をとにKeepUnusedXServer設定する必要があると読みましたが、私はそれを行わず、正常に動作しました。それを行うと動作しますが、optirun されたアプリケーションを終了した後や intel-virtual-output を強制終了した後でも、ディスクリート GPU はオンのままになり、これは望ましくありません。truePMMethodnone/etc/bumblebee/bumblebee.conf

その他のメモ私が頭を悩ませたもう 1 つの問題は、Nouveau を無効にして Intel X サーバーを起動することでした。これは、GRUB パラメータで指定されたカーネルに渡されるフラグによって実行する必要があります。 には/etc/defaults/grub、次の行があります。

GRUB_CMDLINE_LINUX_DEFAULT="quiet blacklist.nouveau=1 i915.modeset=1 gfxpayload=640x480 acpi_backlight=vendor acpi_osi=! acpi_osi=\"Windows 2009\""

(引用符とエスケープされた引用符に注意してください)。

いくつか説明しておきます。これは、nouveau (Nvidia X サーバーと互換性がない) のロードを回避し、起動時に Intel ドライバーにグラフィック モードに入るように指示します。これを行わないと、Intel X サーバーは起動できず、CPU 側で 3D レンダリングを行う従来の VESA サーバーにフォールバックします。acpi_xxxこの特定のマシンでは、ディスクリート GPU をオフにしてグラフィック モードに入るとクラッシュする BIOS バグを克服するために、このフラグが必要です。これはこの特定のノートブック (HP ZBook ポータブル ワークステーション) に固有のものであり、他のラップトップでは不要または異なる可能性があることに注意してください。

更新 (2017 年 12 月 6 日)最新の Debian ディストリビューション (Buster) では、「915.modeset=1 gfxpayload=640x480」は不要です。nouveau を削除するには、/etc/modprobe.d に「blacklist nouveau」を含む nouveau.conf ファイルを作成し、「update-initramfs -u」で ramdisk を再作成する必要がありました。再起動し、「lsmod |grep nouveau」で「nouveau」がロードされていないことを確認します。

更新 (2016 年 12 月 17 日)最新の xorg-server (1.19) では、 で使用すると Gamma を管理する RandR 関数に問題があるようですintel-virtual-output。Xserver にパッチを適用して動作させる手順は次のとおりです。

sudo apt-get build-dep xserver-xorg-core
apt-get source xorg-server

hw/xfree86/modes/xg86RandR12.c の 1260 行目を編集し、「return」を挿入します (関数がxf86RandR12CrtcComputeGamma()何もしないようにします)

dpkg-buildpackage -rfakeroot -us -uc
cd ..
sudo dpkg -i xserver-xorg-core_n.nn.n-n_amd64.deb

n.nn.n-n正しいバージョンに置き換えてください)、再起動してイェー!!また動くよ!(ただし、これは手っ取り早い解決策です)

アップデートバグレポートを提出しました(すでに知られており、修正されました): https://bugs.freedesktop.org/show_bug.cgi?id=99129

私がどうやって理解したか:別のマシンから ssh 経由で インストールしxserver-xorg-core-dbgて実行しました。gdb /usr/lib/xorg/Xorg <xorg pid>

更新(1月11日17日)このバグは最新の Debian パッケージで修正されたようです。

更新(1月24日18)プレゼンテーションを行うためにプロジェクターを接続し、開始前にすべてを構成する必要がある場合 (intel-virtual-output + xrandr)、ストレスを感じることがあります。ここでは、この作業を実行する小さなスクリプトを紹介します (免責事項: スタイルなどに関して、改善の余地がかなりあります)。

# beamer.sh: sets Linux display for doing a presentation, 
#  for bumblebee configured on a laptop that has the HDMI
#  plugged on the NVidia board.
#
# Bruno Levy, Wed Jan 24 08:45:45 CET 2018
#
# Usage: 
#    beamer.sh widthxheight
#    (default is 1024x768)


# Note: output1 and output2 are hardcoded below,
#  change according to your configuration.
output1=eDP1
output2=VIRTUAL1

# Note: I think that the following command should have done
# the job, but it does not work. 
#    xrandr --output eDP1 --size 1024x768 --output VIRTUAL1 --size 1024x768 --same-as eDP1
# My guess: --size is not implemented with VIRTUAL devices.
# Thus I try to find a --mode that fits my needs in the list of supported modes.

wxh=$1

if [ -z "$wxh" ]; then
  wxh=1024x768
fi

# Test whether intel-virtual-output is running and start it.
ivo_process=`ps axu |grep 'intel-virtual-output' |egrep -v 'grep'`
if [ -z "$ivo_process" ]; then
   intel-virtual-output
   sleep 3
fi

# Mode names on the primary output are simply wxh (at least on
#  my configuration...)
output1_mode=$wxh

echo Using mode for $output1: $output1_mode

# Mode names on the virtual output are like: VIRTUAL1.ID-wxh
# Try to find one in the list that matches what we want.
output2_mode=`xrandr |grep $output2\\\. |grep $wxh |awk '{print $1}'`
# There can be several modes, take the first one.
output2_mode=`echo $output2_mode |awk '{print $1}'` 

echo Using mode for $output2: $output2_mode

# Showtime !
xrandr --output $output1 --mode $output1_mode --output $output2 --mode $output2_mode --same-as $output1

更新 (2019/10/07)

新しいクラッシュの「修正」: スクリプトに次の内容を記述します (bumblebee-startx.shたとえば次のように呼び出します):

optirun ls # to load kernel driver
/usr/lib/xorg/Xorg :8 -config /etc/bumblebee/xorg.conf.nvidia \
 -configdir /etc/bumblebee/xorg.conf.d -sharevts \
 -nolisten -verbose 3 -isolateDevice PCI:01:00:0 \
 -modulepath /usr/lib/nvidia/nvidia,/usr/lib/xorg/modules/

(PCI:nn:nn:n を lspci で取得した NVidia カードのアドレスに置き換えます)

このスクリプトをターミナル ウィンドウからルート ( sudo bumblebee-startx.sh) として実行し、ターミナルを開いたままにしておくとoptirunintel-virtual-output期待どおりに動作します (注: 画面/ビデオ プロジェクターを検出するために、さらに実行する必要がある場合がxrandrあります)。現在、まったく同じコマンドが bumblebee から開始されてクラッシュする理由がわかりません。ここには多くの謎があります... (ただし、少なくとも一時的な修正は提供されます)。

私がどうやって理解したか:xserver を起動するための「ラッパー」スクリプトを作成し、bumblebee.conf でそれを XorgBinary として宣言し、コマンドライン ($*) をファイルに保存し、XServer にパッチを LD_PRELOAD して osLookupColor のクラッシュを修正するいくつかのことを試しましたが (うまくいきませんでした)、同じコマンドラインを手動で起動しようとするとうまくいき、パッチなしでも動作し続けました (しかし、まだ理由はわかりません)。

2019年11月15日更新 アップデート後、ちらつきがひどくなり、システムが使用できなくなりました。カーネル パラメータi915.enable_psr=0( /etc/defaults/grub、次にsudo update-grub) を追加することで修正されました。PSR は「パネル セルフ リフレッシュ」の略で、Intel GPU の省電力機能です (画面のちらつきの原因になることがあります)。

関連情報