Yes, found out !
To activate VIRTUAL output of the intel driver, you need to create a 20-intel.conf
file in the Xorg configuration directory (/usr/share/X11/xorg.conf.d
under Debian stretch, found out by reading /var/log/Xorg.0.log
)
Section "Device"
Identifier "intelgpu0"
Driver "intel"
Option "VirtualHeads" "2"
EndSection
My /etc/bumblebee/xorg.conf.nvidia is as follows:
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
Some explanations: it needs a "Screen" section, else it tries to use the Intel device declared in 20-intel.conf (that we just added before, oh my...). It also needs "AllowEmptyInitialConfiguration" to remain able to start with optirun when no external monitor is attached.
With this configuration and starting intel-virtual-output
, I was able to access my HDMI port. Yeehaa !!!
Troubleshooting: if optirun
or intel-virtual-output
do not work, take a look at /var/log/Xorg.8.log
(bumblebee creates an X server with display :8 used internally).
Notes I read at several places that KeepUnusedXServer
should be set to true
and PMMethod
to none
in /etc/bumblebee/bumblebee.conf
, I did not do that and it works fine. If I do that, it works, but then the discrete GPU remains on even after exiting an optirun-ed application or killing intel-virtual-output, which I did not want.
More notes Something else that made me bang my head on the wall was deactivating Nouveau and starting the Intel X server: it needs to be done by flags passed to the kernel, specified in GRUB parameters. In /etc/defaults/grub
, I have the following line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet blacklist.nouveau=1 i915.modeset=1 gfxpayload=640x480 acpi_backlight=vendor acpi_osi=! acpi_osi=\"Windows 2009\""
(beware the quotes and escaped quotes).
Some explainations: it avoids loading nouveau (that is incompatible with the Nvidia X server), and tells the Intel driver to go to graphics mode right at boot time. If you do not do that, then the Intel X server cannot start, and it falls back to a plain old VESA server with CPU-side 3D rendering. The acpi_xxx
flags are required on this specific machine to overcome a BIOS bug that makes it crashing when going in graphics mode with the discrete GPU off. Note that it is specific to this particular notebook (HP ZBook portable workstation), it may be unnecessary or differ for other laptops.
Update (Dec 6 2017) With the latest Debian distro (Buster), "915.modeset=1 gfxpayload=640x480" is unnecessary. To remove nouveau, I needed also to create a nouveau.conf file in /etc/modprobe.d with "blacklist nouveau" in it, then recreate the ramdisk with "update-initramfs -u". Reboot and make sure "nouveau" is not loaded anymore with "lsmod |grep nouveau".
Update (Dec 17 2016) With the latest xorg-server (1.19), there seems to be a problem in a RandR function that manages Gamma when used with intel-virtual-output
. Here is the procedure to patch the Xserver and get it to work:
sudo apt-get build-dep xserver-xorg-core
apt-get source xorg-server
edit hw/xfree86/modes/xg86RandR12.c
Line 1260, insert "return"
(so that the function xf86RandR12CrtcComputeGamma()
does nothing)
dpkg-buildpackage -rfakeroot -us -uc
cd ..
sudo dpkg -i xserver-xorg-core_n.nn.n-n_amd64.deb
(replace the n.nn.n-n
with the correct version), reboot and Yehaa !! works again ! (but it's a quick and dirty fix)
Update filed a bug report (was already known, and was just fixed):
https://bugs.freedesktop.org/show_bug.cgi?id=99129
How I figured out:
Installed xserver-xorg-core-dbg
and did gdb /usr/lib/xorg/Xorg <xorg pid>
from another machine through ssh.
Update (Jan 11 17) Seems that the bug is now fixed in the latest Debian packages.
Update (Jan 24 18) When you want to plug a beamer for doing a presentation and need to configure everything right before starting (intel-virtual-output + xrandr), it can be stressful. Here is a little script that does the job (disclaimer: a lot of room for improvement, regarding style etc...):
# 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
update (10/07/2019)
A "fix" for the new crash: write what follows in a script (call it bumblebee-startx.sh
for instance):
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/
(replace PCI:nn:nn:n with the address of your NVidia card, obtained with lspci)
Run this script from a terminal window as root (sudo bumblebee-startx.sh
), keep the terminal open, then optirun
and intel-virtual-output
work as expected (note: sometimes I need to run xrandr
in addition to make the screen/videoprojector detected). Now I do not understand why the very same command started from bumblebee crashes, so many mysteries here ... (but at least it gives a temporary fix).
How I figured out: wrote a 'wrapper' script to start the xserver, declared it as XorgBinary in bumblebee.conf, made it save the command line ($*) to a file, tried some stuff involving LD_PRELOADing a patch to the XServer to fix the crash in osLookupColor (did not work), but when I tried to launch the same command line by hand, it worked, and it continued working without my patch (but I still do not understand why).
Update 11/15/2019
After updating, I experienced a lot of flickering, making the system unusable. Fixed by adding kernel parameter i915.enable_psr=0
(in /etc/defaults/grub
, then sudo update-grub
). If you want to now, PSR means 'panel self refresh', a power-saving feature of intel GPUs (that can cause screen flickering).