
我正在嘗試在具有 Debian (stretch) 的 PC (HP ZBook) 上使用 HDMI 輸出。我已經配置了 Bumblebee,它運行良好(glxinfo 和 optirun glxinfo 報告了預期的信息,並且我測試了複雜的 GLSL 著色器,它們也按預期工作)。
現在我希望能夠在 HDMI 上插入視訊投影機。我在這裡讀到[1],當 HDMI 連接到 NVidia 板上時,可以使用 intel-virtual-output 來配置它(使用可由 xrandr 操作的虛擬輸出)。然而,英特爾虛擬輸出說:
no VIRTUAL outputs on ":0"
當我這樣做時xrandr -q
,沒有列出虛擬輸出,我只有:
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)時,第二個顯示器處於活動狀態時,X 會崩潰。星期六。 2016 年 12 月 17 日:是的,發現了! (更新了答案)。
更新(2017 年 9 月 27 日星期三)該方法適用於 99% 的情況,但上週我嘗試了一個僅接受 50Hz 模式的投影儀,無法獲得除 60Hz 以外的任何模式(因此它不起作用)。有人知道如何強制 50Hz 模式嗎?
更新(2019 年 10 月 1 日星期二)啊!再次損壞:更新 X 和 NVidia 驅動程式後,optirun 現在崩潰(/var/log/Xorg.8.log
在 Xorg 中顯示崩潰,OsLookupColor+0x139)。更新(2019 年 10 月 7 日)找到臨時修復(更新答案)。
[1]https://github.com/Bumblebee-Project/Bumblebee/wiki/Multi-monitor-setup
答案1
是的,發現了!
要啟動intel驅動的VIRTUAL輸出,需要20-intel.conf
在Xorg設定目錄中建立一個檔案(/usr/share/X11/xorg.conf.d
在Debianstretch下,透過閱讀找到/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 設備(我們之前剛剛添加,哦天哪...)。它還需要“AllowEmptyInitialConfiguration”才能在未連接外部顯示器時仍然能夠透過 optirun 啟動。
透過此配置並啟動intel-virtual-output
,我能夠存取我的 HDMI 連接埠。耶哈!
故障排除:如果optirun
或intel-virtual-output
不起作用,請看一下/var/log/Xorg.8.log
(bumblebee 建立一個 X 伺服器,內部使用 display :8)。
筆記KeepUnusedXServer
我在幾個應該設置為true
和PMMethod
to none
in 的地方讀到/etc/bumblebee/bumblebee.conf
,我沒有這樣做,但效果很好。如果我這樣做,它可以工作,但是即使在退出 optirun-ed 應用程式或終止 intel-virtual-output 之後,獨立 GPU 仍保持開啟狀態,這是我不想要的。
更多筆記另一件讓我頭痛的事情是停用 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
標誌來克服 BIOS 錯誤,該錯誤會導致在獨立 GPU 關閉的情況下進入圖形模式時崩潰。請注意,它是特定於該特定筆記型電腦(HP ZBook 便攜式工作站)的,對於其他筆記型電腦可能沒有必要或有所不同。
更新(2017 年 12 月 6 日)使用最新的 Debian 發行版 (Buster),不需要「915.modeset=1 gfxpayload=640x480」。要刪除 nouveau,我還需要在 /etc/modprobe.d 中建立一個 nouveau.conf 文件,其中包含“blacklist nouveau”,然後使用“update-initramfs -u”重新建立 ramdisk。重新啟動並確保“nouveau”不再使用“lsmod |grep 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>
更新(2017年1月11日)看來該錯誤現已在最新的 Debian 軟體包中修復。
更新(18年1月24日)當您想要插入投影機進行演示並需要在開始之前配置所有內容(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
更新(10/07/2019)
新崩潰的「修復」:在腳本中編寫以下內容(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 卡的位址)
以 root ( ) 身份從終端視窗運行此腳本sudo bumblebee-startx.sh
,保持終端機打開,然後按預期optirun
工作intel-virtual-output
(注意:有時我還需要運行xrandr
以檢測到螢幕/視訊投影機)。現在我不明白為什麼同樣的命令從大黃蜂崩潰開始,這裡有很多謎團......(但至少它提供了一個臨時修復)。
我是如何發現的:編寫了一個「包裝器」腳本來啟動xserver,在bumblebee.conf 中將其聲明為XorgBinary,使其將命令列($*) 保存到文件中,嘗試了一些涉及LD_PRELOADing 補丁到XServer 的內容以修復osLookupColor中的崩潰(不起作用),但是當我嘗試手動啟動相同的命令行時,它起作用了,並且在沒有我的補丁的情況下它繼續工作(但我仍然不明白為什麼)。
更新 11/15/2019
更新後,我遇到了很多閃爍,導致系統無法使用。透過新增內核參數i915.enable_psr=0
(在/etc/defaults/grub
,然後sudo update-grub
)來修復。如果您現在想知道的話,PSR 的意思是“面板自刷新”,這是英特爾 GPU 的節能功能(可能會導致螢幕閃爍)。