02-11-2019 05:46 PM
I'm the owner of a new P1 Mobile Workstation; just received it at the beginning of February. So far I'm very pleased with the build quality of this machine. I am a software engineer, and my preferred OS is Linux. After receiving my laptop, I /dev/zero'd the drive and installed Ubuntu 18.04. Everything has worked well, in terms of drivers and compatability (not including the fingerprint scanner in this discussion), with the exception of the 'hybrid graphics' BIOS option.
When I set the BIOS option to 'discrete', the device functions normally, with respect to graphic rendering. I can boot the machine, my X session starts fine, laptop can be used via Thunderbolt dock to drive external monitors, and LiveUSB images from other distros boot up and render fine.
When I set the BIOS option to 'hybrid', none of the above holds true. The machine seems to boot ok (I get to passphrase prompt for unencrypting my LUKS volume), but X session doesn't start correctly. I'm confronted with a black screen. Sometimes I can change to run level 1 and enter a shell; other times seemingly not. Docking station doesn't work. Most strangely, I see similar types of misbehavior when using LiveUSB images, a Kubuntu one, a Gnome debian based one.
Does anyone have a functional 'hybrid' graphics install of Linux, if so, what distro, what drivers are you using, are you using prime or bbswitch, basically, how have you reached this functional state? I'm almost wondering if this condition is related to a certain BIOS & kernel compatability issue, given the broken rendering in both my Ubuntu install and other LiveUSBs.
Here are the particulars of my machine configuration:
* BIOS 1.17 (upgraded using Windows before I installed Ubuntu)
* Ubuntu 18.04 LTS, using 4.15 kernel (maybe I need a newer kernel, >= 4.18?)
* Have tried various versions of Nvidia closed source drivers, 390 - 415. The Nvidia proprietary drivers at least seem to let me use the machine ok with 'discrete' BIOS option set.
* Tried Nouveau, but seemed to have less success in getting the machine fully functional, particularly driving external monitors via dock.
* I have created no Xorg.conf, as seems to be the prevailing wisdom now (i.e. let X handle things without explicit config). Could this be it?
* Have both the Intel microcode and xserver-xorg-video-intel package installed (do I need more for Intel to work in hybrid mode?)
Appreciate any guidance to help getting hybrid graphics in a usable state.
Solved! Go to Solution.
02-11-2019 05:56 PM - edited 02-12-2019 06:52 PM
Oh BTW, I have 'secure boot'
enabled DISABLED in BIOS. Have read various posts about that making a difference regarding hybrid graphics.
EDIT for correctness (secure boot is most definitely off)
02-11-2019 11:38 PM
02-12-2019 04:16 AM
Hi thanks for your reply. Can you post a link to this issue about bricking the machine by fiddling with audio in the BIOS? It sounds alarming. I'm aware of the previous issue, 1.15 IIRC that would yield a brick if discrete graphics was set in BIOS, but haven't heard anything relating to audio. It really concerns me that Lenovo laptops are getting bricked by simply toggling BIOS flags.
For upgrading BIOS, how can we do this? Is LVFS viable? Lenovo participation in Linux Vendor Firmware service was a determining factor for me in buying this laptop. I'm hopeful we can make use of LVFS for such things and not go through Windows/USB stick gyrations to do this.
02-12-2019 06:51 PM
02-13-2019 03:43 AM
The PSREF site in Documentation -> User Guides has install guides for three flavours of Linux. Perhaps they can be of assistance.
Also, here is the reference to 1.17 and toggling audio causing bricking: https://www.reddit.com/r/thinkpad/comments/admmkg/warning_thinkpad_p1_bios_117_do_not_disable/
02-13-2019 03:53 AM - edited 02-13-2019 03:55 AM
Was able to at least get X session running (from which I'm typing now) that utlizes the Intel graphics with 'hybrid' graphics set in the BIOS.
The key changes I needed were:
* changing the graphics profile to Intel using the prime-select tool:
sudo prime-select intel
* this is the part that took the longest to figure out: apparently X server /must/ have a .conf file somewhere telling it to try out the Intel graphics driver when it's attempting to set up the display. I put th following in /usr/share/X11/xorg.conf.d/20-intel.conf:
Section "Device" Identifier "Intel Integrated Driver" Driver "intel" EndSection
I had read similar types of suggestions on Arch documentation, but I've also read elsewhere, including on Nvidia forums, that modern X server shouldn't really need manual configuration to detect drivers and set up screens. For whatever reason, X server needs one for this hybrid graphics scenario. Once this .conf is in place, you'll start to see X server detect and try to use the intel driver in /var/log/Xorg.0.log. I'm sort of baffled why this is needed, and how X server, not just on my system but on LiveUSBs for the larger Linux distributions (!!), can't seem to automatically detect and use a system with integrated Intel graphics, which I'm going to guess at least 60-70% of laptops come with now.
In any event, I can now switch graphics using BIOS, and prime-select. Ideally I'd be able to do switching with just leaving BIOS flag on 'hybrid', but still working on that.
Hope this was helpful to someone else.
02-15-2019 02:17 PM
If anyone is interested in getting full, run-time switchable graphics working, the Arch Linux wiki for ThinkPad P1 seems like the best bet, at least in my lengthy testing. I followed the steps in the wiki, and created two different bash scripts (gfxintel, gfxnvidia) to do the switching. Essentially, these scripts simply terminate X, load|unload the Nvidia kernel modules (based on whether you're switching to or from Nvidia or Intel), put the appropriate drivers's xorg.conf in place, then insert the correct text (ON|OFF) into /proc/acpi/bbswitch. Klunky, but works. Make sure you create both an xorg.conf.nvidia, and xorg.conf.intel, and let your bash scripts rename the appropriate driver conf to /etc/X11/xorg.conf.
02-16-2019 09:09 AM - edited 02-16-2019 09:10 AM
I got hybrid graphics working with Debian/Buster on my X1E.
I replaced the disk with a 2TB Samsung SSD. The entire disk is LUKS formatted with detached header. I then configured a USB stick (Samsung BAR Plus 32GB), also with an encrypted LUKS volume. This LUKS volume is the PV for a VG with a small swap volume and a boot volume. I.e., only the EFI system partition is not encrypted on this USB stick. When the system boots from this USB stick, it asks for the password for the USB LUKS volume. After typing in the password, the system boots from the USB boot volume. It then finds the LUKS header and key for the system disk in its initrd file, opens this LUKS system disk and continues booting. A "rc.local" file unmounts the boot devices, closes the LUKS boot volume and ejects the USB stick.
I am using a KDE/Plasma desktop using the Nvidia driver and installed bumblebee. There wasn't much configuration required, it worked pretty much out of the box. After booting (with hybrid graphics) the system is using the Intel graphics only, using just some 12W. When I want an application to use the Nvidia graphics, I start it with optirun, e.g.: "optirun glxgears". Obviously, the power consumption jumps immediately to 90+W.
My system also works with the TB3 dock, connected to a 4k monitor.
What does not (yet?) work:
* The TB3 sound output does not work.
* When setting the BIOS to "discrete graphis", the system boots into a black screen.
What I have not yet tried:
* fingerprint reader
* I ordered the Lenovo Pen Pro, but have not yet received it