Thinkpad P70 and P50 Withlinux

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Thinkpad P70 (and P50) with Linux

(comments are enabled if you want to correct stuff, add info, or answer questions I asked)
PLEASE DO NOT TYPE CRAP IN THIS DOC (including typing in this window by mistake), or Ill have to
reject all your comments and possibly ban you due to the notification spam this generates for me.

By Marc MERLIN http://marc.merlins.org/linux/ (2016/03/12)

For detailled hardware info and professional review on windows, see this page:
http://www.notebookcheck.net/Lenovo-ThinkPad-P70-Workstation-Review.158308.0.html

P50 vs P70:
They are mostly the same laptop, except for:
P70 is obviously a bigger and heavier laptop with a 17 screen (very nice to enjoy 4K)
P50 supports either 2x 2.5 HDDs, or 1 HDD + 2 M2 drives, while the P70 offers 2x
2.5HDD and 2 M2 drives on top of that.
But I wont lie, the P70 is big and heavy. My laptop bag is already super big and heavy
anyway, so I personally didnt care too much, but be ready for that.

Anyway, both laptops being very similar, this page pertains to both.
You can also refer to my page on the T540 here:
https://docs.google.com/document/d/1hFTArhNbmpmEBRkwRg0DMbEzLBCl43F1HXoXtJ8cm0
k/edit which will likely include some bits stlil relevant to the P50/P70

Size comparison with T540 (The P70 weighs 1.2kg more, which is definitely noticeable. The
P50 should only weigh a tiny bit more than the T540).
Good Points:
The Lenovo bios still lets you keep UEFI but with secure boot disabled if you wish. It also
has a legacy/LBR mode so that you can run things the old known working way (which I
do). I can boot windows 8 from a secondary drive with secure boot disabled just fine and
legacy boot enabled first, with UEFI as second/fallback.
However the bios does not support MBR boot from an NVMe M2 drive
Panel quality is great, sharp, clear. 17 for that resolution is very nice, small fonts are
readable for my good eyes.
Keyboard is just as good as the T540
And now you get LEDs and proper mouse buttons back. Im so happy that I finally have
my 3 mouse buttons back. The lack of mouse buttons on the T540 was horrible. I had to
put silly putty on the mousepad to make clicking zones and emulate the buttons. It was
sad See picture on my T540 report:
https://docs.google.com/document/d/1hFTArhNbmpmEBRkwRg0DMbEzLBCl43F1HXoX
tJ8cm0k/edit
Bad Points:
No Charging whatsoever from a 90W power supply. This means a typical lenovo power
supply will stop the battery from discharging, but it will not charge it either, even if the
laptop is sleeping or off. Thats very bad lenovo!
Nvidia graphics cannot be disabled in the bios ( you get nvidia or hybrid intel+nvidia).
Thankfully it can be disabled with the bbswitch module (more or this below)
Intel graphics cannot access the displayport or HDMI ports, so you get no video
out from IGP. You can use a somewhat complicated trick, called reverse prime to send
intel graphics output to the nvidia chip for display on external outputs. It worked with
nouveau for me, but youll have to restart the X server to turn the nvidia chip on and off.
Weight (3.7Kg with big battery, vs 2.5kg with big battery on T540p). When carrying the
laptop with one hand, itll definitely feel heavy. The screen lid will also tend to swing full
open because its hinges arent strong enough to hold the weight when the laptop is
being moved.
Despite the size, you can only use a 96Wh battery. It would have been great to be able
to add more battery in the DVD slot (each battery is limited to 100Wh due to airline
regulations)
Lenovo does (or did) not sell a hard drive caddy for the P70 (you can only get it at
configuration time with an overpriced hard drive you didnt want). I had to make my own
with one from a T540 (more on this below). Apparently you can finally order this as a kit
now, but way too late for my laptop purchase.

Linux Config bits:


The 4.4 kernel gave me AER errors. I have to boot with pci=noaer otherwise the
machine will randomly get into a loop of these:
pcieport 0000:00:1c.4: AER: Corrected error received: id=00e4
ACPI sleep would hang unless I turned off VT-d in the bios (you want to turn on
IVT/VT-x for virtualbox, but VT-d just broke sleep for me on 4.4 kernels).
I did not get S3 sleep/suspend working with kernels 4.5.5 and 4.6.4. Ive had to revert
back to 4.4 for now.
Skylake IGP needs binary firmware to work properly (if you notice your boot hanging one
minute on the i915 driver, thats why). If the firmware files arent available in your initrd or
at boot time, compile them in the kernel with:
CONFIG_EXTRA_FIRMWARE="i915/skl_dmc_ver1.bin i915/skl_guc_ver4.bin"
CONFIG_EXTRA_FIRMWARE_DIR="../linux-firmware/"

Specs/Hardware
CPU: I got the basic one with
Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 cores visible under linux with HT) 32GB of
RAM.
Im not sure how much faster the better CPUs are, but my guess is that theyre not significantly
so.
So, lets talk about CPU speed first, Skylake is no faster than Haswell from 2 years ago. In other
words, my P70 doesnt build the linux kernel any faster than my T540. So, the reason to
upgrade to a P50/P70 is really to get M2/NVMe if thats important to you, or thunderbolt, or (in
my case) a 4K screen with 17 panel (for the P70).
Ted Tso mentions that Skylake has significantly faster AES acceleration which is good for my
dmcrypt usage (especially if on top of something fast like NVMe). Its also supposed to be more
power efficient, but on a big laptop like this, its kind of hard to see.

The memory capacity is also increased to 64GB, which may be important to some.
Wireless just worked:
04:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)
iwlwifi 0000:04:00.0: loaded firmware version 19.277230.0 op_mode iwlmvm
iwlwifi 0000:04:00.0: Detected Intel(R) Dual Band Wireless AC 8260, REV=0x208
Sound: HDA Intel MID and HDA Intel PCH. It works ok
Ethernet still works fine with e1000e module.
Video is complicated, Ill deal with that one last.

Batteries/Charging:
The default 96Wh battery could be bigger given the laptop footprint, but there is a limit of 100Wh
for lithium batteries in planes, so thats all we get
Without powering down nvidia, I can barely get the laptop to idle at 17W with the screen on, and
20W is more typical (actual use, especially if you have chrome browsers running is often 25 to
30W).
With bbswitch to power off the nvidia chip, I can idle at 14W with screen on minimal
brightness and wifi unloaded. This is barely more than my T540 with a smaller screen, so
thats good news.
By being more aggressive in stopping processes Im not using and are causing wakeups, Ive
gotten down to 11.8W with the screen on, and 7W with the screen off.

For charging, the big problem with this laptop is that it comes with a huge 170W power supply
and it will not charge from any power supply smaller than 135W (itself still big).
This is disappointing if you have plenty of existing 90W power supplies. A 90W power supply
can power the laptop, but it will never charge the laptop, even if its shut off. Sadly the l enovo
engineers did something bad here. There is no excuse for the batteries not charging at a
slower rate from a smaller power supply. Making them not charge at all is just very lame
:(
Now, if you have a 3rd party power supply thats at least 110W (like an iGo), you will need to
make a custom slim tip adapter with a 1000 Ohm resistor to the center pin to trick the laptop into
thinking its connected to a 135W adapter. By doing this, I was able to get the laptop to power
itself and charge, using 5.5A at 20V (exactly 110W). This trick does not work with a 90W power
adapter though, the laptop will try to draw 5.5A, fail, and then refuse to charge.
See this page for more details:
http://marc.merlins.org/perso/linux/post_2016-02-29_Hacking-a-thinkpad-slim-tip-adapter-to-out
put-more-than-90W-_required-to-charge-a-Thinkpad-P70_.html

I should add that during basic use, the laptop is only drawing 2.5A or so, it could totally use 4.5A
form a 20V adapter and charge at 2A while powering itself from a 90W power adapter. Again,
shame on lenovo for not supporting this.
(yes I bought 135W power adapters, but theyre huge to carry around, and I have multiple 3rd
party 90W power adapters I cant use to charge my laptop anymore)

Storage: 2x Sata + 2x M2 = 5TB of storage

Being able to have 2x 2.5 SSD (removing the DVD drive) is great. I have a 2TB SSD
plus a 2TB HDD. In an ideal life, Id be able to stick extra batteries in the spare space,
but oh well...
The M2 slots allow you to add 2 512GB sticks. I tried a Sata one and an NVME one.
Both worked. This gives you a total of 5TB of storage possible.
If you want to boot from NVMe, it must be formatted as EFI/GPT
NVMe is faster than Sata on linux while costing more than twice as much per gigabyte,
but not across the board, see my page below for details
http://marc.merlins.org/perso/linux/post_2016-02-22_Thinkpad-P70-NVME-vs-M2-Sata-vs-2_5in
ch-Sata-SSD.html
Note that Lenovo currently refuses to sell an HDD tray for the P70. This is pretty pathetic.
Thankfully you can hack a T540 tray and make it fit:
https://plus.google.com/u/0/+MarcMERLIN/posts/Wz4LnggrxcK
And lets keep the most complicated bit for last:

Video: Intel Graphics (IGP) + Nvidia:


Video only comes as Intel Graphics + Nvidia. You cannot order without nvidia (which is a pain
because you have to turn off the nvidia chip to save battery, and you cannot turn it off in the
Bios: the bios only gives you the option of Nvidia or hybrid Nvidia+Intel).
legolas:~# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M600M]
(rev a2)

The other bad news is that Lenovo did not wire the external video ports to the intel integrated
graphics. As a result, you cannot use displayport or hdmi out unless youre using the nvidia chip
:(
While I dont want to go down the rabbithole of nvidia binary drivers, there is just enough
nouveau support to allow spinning up the nvidia chip to mirror the intel display on it onto
an external output (called reverse prime, read below). Doing so does require restarting X
though since you have to load/unload the nvidia chip and power the chip on and off, which cant
be done if X is running..

I got the 4K Retina Display panel with 3840x2160 pixels with 17 panel, which is why I upgraded
from my T540 with a 3K 15 panel.
The other option was obviously the thinkpad P50 that also comes with a 4K screen, but:
Despite its size, the P50 only supports one SATA device (the similarly sized T540p takes
2 sata devices, drive + DVD, or 2 drives. I like having a Sata SSD + Sata Hard Drive.
I didnt really see the point of getting 4K on a 15 screen. You get smaller pixels that you
cant see. With 4K on 17, I can get that many more windows and written stuff on a given
screen (with 15 I wouldnt have been able to)

This above screen would not be very readable on a 15 panel :)

Intel Video just worked out of the box in Xorg, no config file required.
H264 acceleration is supported (but nothing more). As a result, you want this in your mplayer
config:
vo=vdpau,gl,
[vo.vdpau]
vc=ffh264vdpau,
# Most video filters do not work with vdpau.
vf-clr=yes

I installed i915-va-driver and vainfo returns:


libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.38 (libva 1.0.15)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 1.6.2

saruman:~# vdpauinfo
display: :0.0 screen: 0
pci id for fd 5: 8086:191b, driver (null)
libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
API version: 1
Information string: OpenGL/VAAPI/libswscale backend for VDPAU

Video surface:

name width height types


-------------------------------------------
420 1920 1080 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8
422 1920 1080 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8
444 1920 1080 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8

Decoder capabilities:

name level macbs width height


----------------------------------------------------
MPEG1 --- not supported ---
MPEG2_SIMPLE --- not supported ---
MPEG2_MAIN --- not supported ---
H264_BASELINE 51 16384 2048 2048
H264_MAIN 51 16384 2048 2048
H264_HIGH 51 16384 2048 2048
VC1_SIMPLE --- not supported ---
VC1_MAIN --- not supported ---
VC1_ADVANCED --- not supported ---
MPEG4_PART2_SP --- not supported ---
MPEG4_PART2_ASP --- not supported ---
DIVX4_QMOBILE --- not supported ---
DIVX4_MOBILE --- not supported ---
DIVX4_HOME_THEATER --- not supported ---
DIVX4_HD_1080P --- not supported ---
DIVX5_QMOBILE --- not supported ---
DIVX5_MOBILE --- not supported ---
DIVX5_HOME_THEATER --- not supported ---
DIVX5_HD_1080P --- not supported ---
H264_CONSTRAINED_BASELINE --- not supported ---
H264_EXTENDED --- not supported ---
H264_PROGRESSIVE_HIGH --- not supported ---
H264_CONSTRAINED_HIGH --- not supported ---
H264_HIGH_444_PREDICTIVE --- not supported ---
HEVC_MAIN --- not supported ---
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported ---

Speed benchmark (I got a glmark2 score of 1294 on my T540)


saruman:~$ glmark2
pci id for fd 4: 8086:191b, driver (null)
=======================================================
glmark2 2012.08
=======================================================
OpenGL Information
GL_VENDOR: Intel Open Source Technology Center
GL_RENDERER: Mesa DRI Intel(R) Skylake Halo GT2
GL_VERSION: 3.0 Mesa 10.6.3
=======================================================
[build] use-vbo=false: FPS: 909 FrameTime: 1.100 ms
[build] use-vbo=true: FPS: 924 FrameTime: 1.082 ms
[texture] texture-filter=nearest: FPS: 533 FrameTime: 1.876 ms
[texture] texture-filter=linear: FPS: 471 FrameTime: 2.123 ms
[texture] texture-filter=mipmap: FPS: 480 FrameTime: 2.083 ms
[shading] shading=gouraud: FPS: 506 FrameTime: 1.976 ms
[shading] shading=blinn-phong-inf: FPS: 511 FrameTime: 1.957 ms
[shading] shading=phong: FPS: 487 FrameTime: 2.053 ms
[bump] bump-render=high-poly: FPS: 631 FrameTime: 1.585 ms
[bump] bump-render=normals: FPS: 485 FrameTime: 2.062 ms
[bump] bump-render=height: FPS: 488 FrameTime: 2.049 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 800 FrameTime: 1.250 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 628 FrameTime: 1.592 ms
[pulsar] light=false:quads=5:texture=false: FPS: 697 FrameTime: 1.435 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 659
FrameTime: 1.517 ms
[desktop] effect=shadow:windows=4: FPS: 784 FrameTime: 1.276 ms
[buffer]
columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-m
ethod=map: FPS: 522 FrameTime: 1.916 ms
[buffer]
columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-m
ethod=subdata: FPS: 574 FrameTime: 1.742 ms
[buffer]
columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-me
thod=map: FPS: 596 FrameTime: 1.678 ms
[ideas] speed=duration: FPS: 936 FrameTime: 1.068 ms
[jellyfish] <default>: FPS: 933 FrameTime: 1.072 ms
[terrain] <default>: FPS: 158 FrameTime: 6.329 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 928 FrameTime: 1.078 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 950 FrameTime: 1.053 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 924 FrameTime: 1.082 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 952 FrameTime: 1.050
ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 961 FrameTime:
1.041 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 935 FrameTime:
1.070 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 950
FrameTime: 1.053 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 971
FrameTime: 1.030 ms
=======================================================
glmark2 Score: 709
=======================================================

Nvidia chip is nvidia-optimus without a hw mux, so no vgaswticheroo


vgaswitcheroo does not work because there is no hardware multiplexer:
saruman:/sys/kernel/debug/vgaswitcheroo# cat switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynPwr:0000:01:00.0
saruman:/sys/kernel/debug/vgaswitcheroo# echo OFF > switch
saruman:/sys/kernel/debug/vgaswitcheroo# cat switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynPwr:0000:01:00.0
saruman:/sys/kernel/debug/vgaswitcheroo# echo DES > switch
saruman:/sys/kernel/debug/vgaswitcheroo# cat switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynPwr:0000:01:00.0
saruman:/sys/kernel/debug/vgaswitcheroo# echo IGD > switch
saruman:/sys/kernel/debug/vgaswitcheroo# cat switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynPwr:0000:01:00.0

Proper ways to control Nvidia optimus:


https://wiki.archlinux.org/index.php/NVIDIA_Optimus
disabling one of the devices in BIOS, which may result in improved battery life if the NVIDIA device is
disabled, but may not be available with all BIOSes and does not allow GPU switching (this doesnt work
on P70, but you can use bbswitch below to turn off the card from linux)
using the official Optimus support included with the proprietary NVIDIA driver, which offers the best
NVIDIA performance but does not allow GPU switching and can be more buggy than the open-source
driver
using the PRIME functionality of the open-source nouveau driver, which allows GPU switching but offers
poor performance compared to the proprietary NVIDIA driver and does not currently implement any
powersaving (Im going to go this route, I only need to turn on the nvidia chip to display on external
outputs, and I wont use it as a faster GPU)
using the third-party Bumblebee program to implement Optimus-like functionality, which offers GPU
switching and powersaving but requires extra configuration (this requires the nvidia binary driver which
Im not interested in depending on)

Nvidia chip can be turned off with bbswitch


I verified power use goes down after I disable the card (5W saved)
http://linux-hybrid-graphics.blogspot.com/
https://github.com/Bumblebee-Project/bbswitch
saruman:~# cat /proc/acpi/bbswitch
0000:01:00.0 ON
saruman:~# rmmod nouveau
Mar 12 22:14:07 saruman kernel: [ 4054.364394] [TTM] Finalizing pool allocator
Mar 12 22:14:07 saruman kernel: [ 4054.364509] [TTM] Finalizing DMA pool allocator
Mar 12 22:14:07 saruman kernel: [ 4054.371040] [TTM] Zone kernel: Used memory at
exit: 0 kiB
Mar 12 22:14:07 saruman kernel: [ 4054.371080] [TTM] Zone dma32: Used memory at
exit: 0 kiB
Mar 12 22:14:07 saruman kernel: [ 4054.371115] vga_switcheroo: disabled
Mar 12 22:14:07 saruman kernel: [ 4054.372440] [drm] Module unloaded
saruman:~# tee /proc/acpi/bbswitch <<<OFF
OFF
Mar 12 22:14:16 saruman kernel: [ 4063.552027] bbswitch: disabling discrete graphics
Mar 12 22:14:16 saruman kernel: [ 4063.552110] ACPI Warning:
\_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires
[Package] (20150930/nsarguments-95)
Mar 12 22:14:16 saruman kernel: [ 4063.566490] pci 0000:01:00.0: Refused to change
power state, currently in D0
saruman:~# tee /proc/acpi/bbswitch <<<OFF
OFF
saruman:~# cat /proc/acpi/bbswitch
0000:01:00.0 OFF
I can get power down to 9W if the screen is turned off, and 14W with the screen on and Xorg
running (wifi off, rfkill block bluetooth)

Using nvidia binary drivers to switch to nvidia GPU for higher performance if
needed:
Using nvidia binary drivers for high power stuff: new nvidia drivers support nvidia-prime, but
bumblebee still better apparently. Im not planning on using this since I dont want to use the
binary drivers:
https://swapniel99.wordpress.com/2014/05/31/bumblebee-or-nvidia-prime/ says When I
was chatting with one of the mint developers and he said bumblebee is phased out.
https://www.reddit.com/r/linux_gaming/comments/3fxv0k/20151404_nvidiaprime_or_bum
blebee/ says that bumblebee seems to work better than nvidia-prime (6 months ago)
https://wiki.archlinux.org/index.php/Bumblebee : how to install the switching driver and
optirun

I gave bumblebeed a try (using nouveau, not nvidia drivers), but nouveau does not seem to
work on this card with 4.4.5 kernel and nouveau xorg driver 1 .0.12-1+b1:
bumblebeed[10709]: /usr/sbin/bumblebeed 3.2.1 started
bbswitch: version 0.8
bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.PEGP
ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found
[Buffer], ACPI requires [Package] (20150930/nsarguments-95)
bbswitch: detected an Optimus _DSM function
bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on
bbswitch: disabling discrete graphics

Need to apt-get install primusrun


But nouveau X driver isnt really working?
Source: xserver-xorg-video-nouveau (1:1.0.12-1)
Version: 1:1.0.12-1+b1
[ 4985.203] (II) NOUVEAU driver Date: Tue Dec 8 15:52:25 2015 +1000
[ 4985.203] (II) NOUVEAU driver for NVIDIA chipset families :
[ 4985.203] RIVA TNT (NV04)
[ 4985.203] RIVA TNT2 (NV05)
[ 4985.203] GeForce 256 (NV10)
[ 4985.203] GeForce 2 (NV11, NV15)
[ 4985.203] GeForce 4MX (NV17, NV18)
[ 4985.203] GeForce 3 (NV20)
[ 4985.203] GeForce 4Ti (NV25, NV28)
[ 4985.203] GeForce FX (NV3x)
[ 4985.203] GeForce 6 (NV4x)
[ 4985.203] GeForce 7 (G7x)
[ 4985.203] GeForce 8 (G8x)
[ 4985.203] GeForce GTX 200 (NVA0)
[ 4985.203] GeForce GTX 400 (NVC0)
[ 4985.256] (II) [drm] nouveau interface version: 1.3.1
[ 4985.256] (EE) Unknown chipset: NV117
[ 4985.256] (EE) No devices detected.
I gave up there since I didnt really need nouveau working on the nvidia chip for faster GPU
computation anyway (Im guessing that nouveau is likely slower than intel graphics)

However, the nouveau X driver seems to work well enough to allow reverse prime (see below)

Displaying on the nvidia GPU to access outside ports (HDMI + DP)


https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T420s#Using_multiple_monitors_
with_NVIDIA-Optimus
https://wiki.archlinux.org/index.php/PRIME

Basically you setup nouveau (kernel module and X driver) just so that xrandr can see the nvidia
card, and send the intel graphics output to the nvidia card for display to an outside port.

Patrick says that this whole dance is not needed with newer kernels (4.8+)
Doing reverse prime:
First load the nouveau kernel module
Then turn on card with tee /proc/acpi/bbswitch <<<ON
Then start X, and tell the intel driver to send data to the nvidia chip:
saruman:~# xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7c cap: 0xb, Source Output, Sink Output, Sink Offload crtcs:
4 outputs: 2 associated providers: 0 name:Intel
Provider 1: id: 0x46 cap: 0x2, Sink Output crtcs: 4 outputs: 3 associated
providers: 0 name:modesetting
saruman:~# xrandr --setprovideroutputsource modesetting Intel
saruman:~# xrandr |grep connected
eDP1 connected 2880x1620+0+0 (normal left inverted right x axis y axis) 380mm x
210mm
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
DisplayPort-1-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1-1 connected (normal left inverted right x axis y axis)
DisplayPort-1-2 disconnected (normal left inverted right x axis y axis)

Initially I got no output on HDMI, but later I realized that the nouveau xorg driver wasnt installed
(and yet I was able to do all the above steps, but just got no video in the end). Now I have this in
my Xorg.log:
[ 41.923] (II) modeset(G0): [DRI2] DRI driver: nouveau
[ 41.923] (II) modeset(G0): [DRI2] VDPAU driver: nouveau
And I now can get output on HDMI!
Note that I was getting a mouse trail and some display artifacts. I fixed them by changing
enlightenment (e18) compositing from software to OpenGL. The other fix is:
https://wiki.archlinux.org/index.php/PRIME#Glitches.2FGhosting_synchronization_problem_on_
second_monitor_when_using_reverse_PRIME
# If not using opengl compositing in enlightenment
#CLUTTER_PAINT=disable-clipped-redraws:disable-culling
#CLUTTER_VBLANK=True

Note that my screen flashes many times after I plug HDMI and sometimes keeps flashing
without anything going to the external HDMI, or only for a fleeting second.
Ive found that running xrandr --auto a few times seems to fix it (but you need to type it blindly)
For good measure, I also got displayport output with a DVI converter, to work (I had to restart X
though, going from HDMI to DP didnt quite work).
I also got a DP to VGA converter to work (this one:
http://www.amazon.com/gp/product/B00DRK73IM Cable Matters Mini DisplayPort
(Thunderbolt 2 port Compatible) to VGA Male to Female Adapter in Black)

While I got HDMI, DVI, and VGA output working (the last 2 using a converter to the
displayport connector), I sometimes have had to restart X to switch from HDMI to DP/DVI
or back (and other times, Ive not needed to). Ive also had luck getting things to work by
going to S3 sleep and coming back (as a way to reset things when theyre not working).
Ive also crashed the system by switching too many times and got a flashing Caps Lock LED to
show me the system was wedged.

Switching from a DP/DVI to DP/VGA adapter actually seems to require a reboot. When I
connected my DP to DVI converter after the DP to VGA one, I couldnt get it to show as
connected under xrandr | grep connected

As a side note, going through the nvidia chip to use external display ports seems to use 35W of
power instead of a 20W. Its not cheap (and nouveau is likely to blame for lack of power
management). When unplug HDMI, I still see a 35W use.
After stopping X, unloading nouveau, and running
tee /proc/acpi/bbswitch <<<OFF
battery use falls back to 14-15W.
Sadly, doing all these steps is almost equivalent to a reboot for me, but better than nothing.

I use these scripts:


saruman:/var/local/scr# cat /var/local/scr/nouveau_remove
#!/bin/bash
service kdm stop
rmmod nouveau
tee /proc/acpi/bbswitch <<<OFF
dmesg --color=always | tail -n 10

saruman:/var/local/scr# cat nouveau_add


#!/bin/bash
tee /proc/acpi/bbswitch <<<ON
modprobe nouveau
dmesg --color=always | tail -n 10

saruman:~$ cat /var/local/scr/nouveau_display


#!/bin/bash
#https://docs.google.com/document/d/1GnyBE1xc4qx3EF-IcUOwr7d9D8Npzy63
Pwj-joOw86o/edit#
echo "This is for debugging if modesetting isnt working. On my
laptop Fn-F7 runs an acpi script that does this automatically"
xrandr --listproviders
xrandr |grep connected
grep modeset /var/log/Xorg.0.log |grep driver:
echo "enable modesetting routing"
xrandr --setprovideroutputsource modesetting Intel
xrandr |grep connected

Display Cookbook
1) If you are using HDMI, nouveau_add, restart X should just work, and then:
xrandr --setprovideroutputsource modesetting Intel; xrandr --auto
2) Using DisplayPort with VGA or DVI is more finicky in my experience. It looks like it works
but you get no output. In the end if that happens, I just plug in the monitor, reboot, run
nouveau_add, restart X, and try again as above
More dual graphics reading
http://hybrid-graphics-linux.tuxfamily.org/index.php?title=Main_Page
http://www.thinkwiki.org/wiki/Switchable_Graphics
http://www.junauza.com/2014/03/how-to-get-nvidia-optimus-working-on-ubuntu-linux.htm
l
http://askubuntu.com/questions/36930/is-a-nvidia-geforce-with-optimus-technology-supp
orted-by-ubuntu
Says You'd better look for another laptop without Optimus. Optimus is crap and Nvidia refuses to provide
better support for Linux. If you are adventurous and buy such a notebook, visit the Linux Hybrid Graphics
blog and subscribe to its Launchpad mailing list. Visit their wiki for various ways to get such a card
(hopefully) working. One method is called Bumblebee which allows you to render programs on your nvidia
card. I currently recommend it over other solutions (disclosure: I'm a developer of it).
Brian Ballsun-Stanton posted later Just as an aside here, with the very latest drivers (but not using xorg
edgers ppa because that way spells doom) nvidia optimus support in ubuntu is "not bad". the nvidia driver
allows toggling between intel and nvidia with a relog, and it actually works. (4 years later than this answer
was posted, but still.)
Ubuntu 12.10 Quantal will be shipped with the first bits for real support for hybrid graphics laptops, called
PRIME. This is highly experimental and in development and probably not stable enough for many people.
Only the open-source graphics drivers support this, though Nvidia may release support in the future too if it
is not too much work for them. This page tracks hybrid graphics support for Quantal, these are the blueprints
for Raring.
Using acpi_call manually is deprecated. By default, it won't survive suspend.
With Bumblebee 3.0, the card can now be disabled using bbswitch

TODO:
Can't get some hotkeys like Fn-F4 to return useful codes (either in xev or acpid)
echo 0xffffffff > /proc/acpi/ibm/hotkey
and
echo reset > /proc/acpi/ibm/hotkey
did not work for me in enabling F4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy