cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sk3l
Fanfold Paper
Posts: 6
Registered: ‎01-26-2019
Location: US
Views: 285
Message 1 of 9

Anyone Have Working Hybrid Graphics on Linux?

Hello There,

 

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.

sk3l
Fanfold Paper
Posts: 6
Registered: ‎01-26-2019
Location: US
Views: 281
Message 2 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

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)

dThirteen
Punch Card
Posts: 7
Registered: ‎01-26-2019
Location: AU
Views: 223
Message 3 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

Either update to bios 1.18, or do not disable audio in the bios (bricking issue).

Also, DuckDuckGo NVidia Optimus. I haven't yet had this adventure with my P1, but will before too long.
Matt.
ThinkPad P1: i7-8850H, P2000, FHD, 32GB, 512GB.
sk3l
Fanfold Paper
Posts: 6
Registered: ‎01-26-2019
Location: US
Views: 196
Message 4 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

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.

sk3l
Fanfold Paper
Posts: 6
Registered: ‎01-26-2019
Location: US
Views: 167
Message 5 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

Ok, so now I have upgraded the BIOS to v1.18, but this has not solved anything: still no matter what I do, I cannot get the laptop to reach a functional X session with 'hybrid' selected in the BIOS.

Tonight I also tried a new distro's live USB (Fedora 29), and while I'm able to get normal desktop session using 'discrete' BIOS option, 'hybrid' again does not work. The gdm GNOME desktop manager gets stuck, or at least that's the last thing I see in the boot output. AFAIK Fedora will use a later kernel version (probably at least 4.18) than my Ubuntu 18.04 (4.15), so I've also tried multiple kernel versions now.

I have read that Arch Linux & Mint have had success using Nvidia Optimus and switching hybrid/discrete, but I used Arch before, have no appetite to go back to rolling distro now.

This is very surprising, and frustrating. Not sure where else to go at this point, and not entirely sure if it's due to BIOS, kernel, Nvidia drivers, Xorg....unfortunate really.
dThirteen
Punch Card
Posts: 7
Registered: ‎01-26-2019
Location: AU
Views: 141
Message 6 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

The PSREF site in Documentation -> User Guides has install guides for three flavours of Linux. Perhaps they can be of assistance.

 

http://psref.lenovo.com/Product/ThinkPad/ThinkPad_P1

 

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/

Matt.
ThinkPad P1: i7-8850H, P2000, FHD, 32GB, 512GB.
sk3l
Fanfold Paper
Posts: 6
Registered: ‎01-26-2019
Location: US
Views: 137
Message 7 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

Finally, success!

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.

sk3l
Fanfold Paper
Posts: 6
Registered: ‎01-26-2019
Location: US
Views: 60
Message 8 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

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.

LinuxWerner
Punch Card
Posts: 9
Registered: ‎12-03-2018
Location: US
Views: 42
Message 9 of 9

Re: Anyone Have Working Hybrid Graphics on Linux?

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

 

 

cheers,

Werner

Check out current deals!


Shop current deals

Top Kudoed Authors