Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Lenovo P50 (4k) Thread
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
rico666
n00b
n00b


Joined: 03 May 2016
Posts: 5

PostPosted: Sat May 07, 2016 12:57 pm    Post subject: Lenovo P50 (4k) Thread Reply with quote

Phew! After nearly 3 days of hard installation work, I'm finally able to write this on my new Lenovo P50 (4k display). I'd like to share some of my experiences for those who might want to install Gentoo (or linux in general) on this machine and maybe even get some answers myself to some of the still persisting issues.

The hardware is still quite new (Xeon 1505 v5, Intel P530 GFX, Nvidia Quadro M2000M, Samsung 950 NVMe) and as for basic functionality (It boots :wink: , has - most of the time - ethernet network, X works somehow and one can even hear sounds) it works quite ok.
I'm running a fairly new 4.5.2 kernel, so AFAIK much of the hardware should actually be supported already.

Booting:

I have it in a Win10/Gentoo Dual-Boot configuration and somehow I do manage to win over the horror that is EFI. You must know, my previous Thinkpad was a W500 and it worked like a charm with lilo - after I kicked grub off-disk. Now EFI is what I would call a reference example of 2nd system syndrome. Good intentions, but bloaty, quirky and - for a very special definition of engineering - over-engineered.

To install Gentoo I ended up using about 5 USB sticks. Original plan was 2: One to hold the Win10 recovery and one with a AMD64 Gentoo minimal install. After the win recovery was done and AMD64 minimal install was on the USB, I tried to boot from the Gentoo stick and ... failed.
It didn't boot in EFI (only) mode at all. It would boot in Compatibility mode, but I didn't want that as it seems EFI loaders have trouble with mixed mode OS booting.

I then put Systemrescuecd on a (3rd) USB stick and as that didn't boot also, I put Arch Linux on a (4th) USB stick and a stage3/portage on yet another (5th) stick. The Arch did boot in EFI only, so I used that to create a partition (/dev/nvme0n1p5), unpacked the stage3 and portage on it and rebooted with that being my root.

From then on it was the classical emerge orgy that is Gentoo. Some hundreds of emerged packages later, I'm writing this in an weird Google Chrome (with gargantuan font for URL, window header etc.) running in xfce4 environment on xorg - running probably the Intel P530 gfx.

I have compiled most of the packages with the basic "-O2 -pipe" CFLAGS, but right now I'm getting more bold so I've added the "-march=core-avx2" to CFLAGS. It's suboptimal, because it still doesn't enable the AVX512 optimizations, which would be with "-march=skylake-avx512" or something like that, but gcc 5.3.0 seems unaware of that.

I've set xfce font management manually to 282dpi - with the help of https://www.sven.de/dpi/, but my xorg is still telling me

Code:

screen #0:
  dimensions:    3840x2160 pixels (1016x571 millimeters)
  resolution:    96x96 dots per inch


lol. No matter what I do. I mean I do have

Code:

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
    Option         "DPI" "282 x 282"
    DisplaySize    345 194
EndSection


but X still tells me on startup

Code:

[     6.832] (==) intel(0): DPI set to (96, 96)
...
[     6.858] (II) intel(0): switch to mode 3840x2160@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
[     6.858] (II) intel(0): Setting screen physical size to 1016 x 571


right. Let's take a step back and look at the hardware in general.

Code:

# lspci
00:00.0 Host bridge: Intel Corporation Skylake Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation Skylake PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics P530 (rev 06)
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)
00:16.3 Serial controller: Intel Corporation Sunrise Point-H KT Redirection (rev 31)
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] (rev 31)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #3 (rev f1)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #9 (rev f1)
00:1d.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #13 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M2000M] (rev a2)
04:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)
3e:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller (rev 01)
3f:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader (rev 01)


I've not managed yet to get the SD-Card reader working. Inserting a SD card does not even show up in some dmesg-event, so probably I have not even the correct driver in kernel for that.
The I219-LM ethernet works good (so far) with the e1000 driver in 4.5.2. I've had one or two hiccups where I hadn't connectivity, there was no uplink or dmesg said something of 10MBps, but I'd like to believe these were exceptions.

The builtin-USB Devices present are

Code:

# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 138a:0090 Validity Sensors, Inc.
Bus 001 Device 003: ID 04f2:b52c Chicony Electronics Co., Ltd
Bus 001 Device 007: ID 8087:0a2b Intel Corp.
Bus 001 Device 006: ID 0765:5010 X-Rite, Inc.
Bus 001 Device 005: ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


I've managed to get the builtin cam working with the regular uvcvideo driver. For fingerprint and X-Rite (color calibration) I have not high hopes at the moment, so I didn't even try.

For sound and cam to work I had to add the user to the "audio" and "video" group.

I would like to add my kernel config, Xorg config etc. as attachments but am not sure how to do that in this forum without exploding the size of a posting.


Update 2016-05-09:

* running 4.5.3 now

* Wireless (Intel 8260) works now. I had to enable the "Intel Wireless WiFi MVM Firmware support" and did download the iwlwifi-8000C-*.ucode package directly from intel, although probably just emerging "sys-kernel/linux-firmware" would have done the job too.

* The SD card reader works too:

Code:

[62109.436176] mmc0: new ultra high speed SDR104 SDXC card at address 0007
[62109.438696] mmcblk0: mmc0:0007 SD64G 58.1 GiB


and a SDXC class 10 card gives some 30MB/s

Code:

# hdparm -t /dev/mmcblk0

/dev/mmcblk0:
 Timing buffered disk reads:  98 MB in  3.02 seconds =  32.43 MB/sec


* I did some battery benchmarks. Normal work, with the occasional compile, web browsing, screen full brightness on and heavy shell hacking will result in about 5-6 hours of battery life.

* A fully charged battery should be able to hold the notebook in suspend-to-ram for 120-130 hours.

* Most of the time, the sucker just doesn't spin the fans :D

Code:

# cat /proc/acpi/ibm/fan
status:         enabled
speed:          0
level:          auto


It doesn't need to, the machine is cool. And I'm ok with that.

* The function keys are still not working, but you can do stuff like
Code:
echo 1 > /proc/acpi/ibm/kbdlight
so I guess it's only a matter of time until I figure out how to translate that to a keypress.



Rico


Last edited by rico666 on Mon May 09, 2016 2:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat May 07, 2016 4:34 pm    Post subject: Re: Lenovo P50 (4k) Thread Reply with quote

rico666 wrote:
I have compiled most of the packages with the basic "-O2 -pipe" CFLAGS, but right now I'm getting more bold so I've added the "-march=core-avx2" to CFLAGS. It's suboptimal, because it still doesn't enable the AVX512 optimizations, which would be with "-march=skylake-avx512" or something like that, but gcc 5.3.0 seems unaware of that.

Why not -march=native?
Back to top
View user's profile Send private message
rico666
n00b
n00b


Joined: 03 May 2016
Posts: 5

PostPosted: Sat May 07, 2016 4:39 pm    Post subject: Re: Lenovo P50 (4k) Thread Reply with quote

Ant P. wrote:

Why not -march=native?


Two reasons:
First, because it seems also not to get Skylake options right with Gcc 5.3.0

Code:

gcc -c -Q -march=native --help=target


yields

Code:

...
  -mavx                                 [enabled]
  -mavx2                                [enabled]
  -mavx256-split-unaligned-load         [disabled]
  -mavx256-split-unaligned-store        [disabled]
  -mavx512bw                            [disabled]
  -mavx512cd                            [disabled]
  -mavx512dq                            [disabled]
  -mavx512er                            [disabled]
  -mavx512f                             [disabled]
  -mavx512ifma                          [disabled]
  -mavx512pf                            [disabled]
  -mavx512vbmi                          [disabled]
  -mavx512vl                            [disabled]
...


The avx/avx2 is ok, why it doesn't enable the avx512 is unknown to me.

Second, march=native is evil when you do distcc and I didn't want to block that path.


Rico
Back to top
View user's profile Send private message
alexcortes
Apprentice
Apprentice


Joined: 18 Dec 2011
Posts: 205
Location: Rio de Janeiro, Brazil

PostPosted: Tue May 31, 2016 2:56 pm    Post subject: Reply with quote

Hi,

X-Lite will probably work very well.
Take a look at:

Code:
http://www.argyllcms.com
Back to top
View user's profile Send private message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 237
Location: Toronto, ON, Canada

PostPosted: Wed Jun 01, 2016 11:41 am    Post subject: Reply with quote

hey OP, sorry to hijack your thread.. how did you configure X to work on this machine?
Are you using nvidia optimus in BIOS or discrete graphics only?
I am using discrete graphics and doesn't work with nouveau driver..

thanks a lot!
Back to top
View user's profile Send private message
alexcortes
Apprentice
Apprentice


Joined: 18 Dec 2011
Posts: 205
Location: Rio de Janeiro, Brazil

PostPosted: Wed Jun 01, 2016 5:14 pm    Post subject: Reply with quote

Quote:
so I guess it's only a matter of time until I figure out how to translate that to a keypress.



x11-apps/xev will give you a hand, but you will need xmodmap and/or xbindkays to archive that:

Quote:
https://wiki.archlinux.org/index.php/Xmodmap

Quote:
https://wiki.archlinux.org/index.php/Xbindkeys

Quote:
http://dev-loki.blogspot.com.br/2006/04/mapping-unsupported-keys-with-xmodmap.html
Back to top
View user's profile Send private message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 237
Location: Toronto, ON, Canada

PostPosted: Wed Jun 01, 2016 5:35 pm    Post subject: Reply with quote

Any help for my question, please ?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Thu Jun 02, 2016 4:35 pm    Post subject: Re: Lenovo P50 (4k) Thread Reply with quote

rico666 wrote:
The avx/avx2 is ok, why it doesn't enable the avx512 is unknown to me.

Second, march=native is evil when you do distcc and I didn't want to block that path.

Oh, good points. I think march=native depends on what the kernel reports via /proc/cpuinfo...
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Thu Jun 16, 2016 11:27 am    Post subject: Re: Lenovo P50 (4k) Thread Reply with quote

rico666 wrote:
I've set xfce font management manually to 282dpi - with the help of https://www.sven.de/dpi/, but my xorg is still telling me

Code:

screen #0:
  dimensions:    3840x2160 pixels (1016x571 millimeters)
  resolution:    96x96 dots per inch


lol. No matter what I do. I mean I do have

Code:

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
    Option         "DPI" "282 x 282"
    DisplaySize    345 194
EndSection


but X still tells me on startup

Code:

[     6.832] (==) intel(0): DPI set to (96, 96)
...
[     6.858] (II) intel(0): switch to mode 3840x2160@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
[     6.858] (II) intel(0): Setting screen physical size to 1016 x 571


right.


This used to work correctly. Then the X devs decided to intentionally stop using the actual DPI and ignore attempts at telling it the DPI via xorg.conf. All in favor of improving compatibility with Window's "96dpi or the highway" mode.

https://bugs.freedesktop.org/show_bug.cgi?id=23705
https://bugs.freedesktop.org/show_bug.cgi?id=41115

You can tell apps to use the proper DPI for fonts in Xfce, as you're doing. If you're doing graphical work with GIMP or such however, this is insufficient. You can use xrandr --dpi 142 to set it. Use xdpyinfo | grep reso to read the currently set DPI.
Back to top
View user's profile Send private message
kaktuspalme
n00b
n00b


Joined: 23 Apr 2006
Posts: 29

PostPosted: Fri Aug 05, 2016 6:36 pm    Post subject: Reply with quote

I also bought a Lenovo P50 with a 4K screen.

I have problems with suspending the notebook or waking up from suspend.
As soon as I wake up the notebook only the hdd led starts blinking but nothing else happens.

I have to power down the notebook by holding the power button.

No one suffering from this problem?

I have the newest UEFI Bios (1.29) and I'm running kernel 4.7.0.
I read elsewhere that boot parameter intel_pstate=no_hwp should help, but nothing changes.
When I set acpi=off to the boot parameter the notebook even doesn't boot completely.

It doesn't matter how I suspend the notebook, by lid closing or via systemctl-suspend it just doesn't work.

For the moment I have to use windows on this notebook but I really hate that.


I configured the kernel using genkernel and made some tweeks by menuconfig (iwlwifi firmware etc.).
Maybe someone could give me the kernel config?
Back to top
View user's profile Send private message
tamiko
Developer
Developer


Joined: 02 Sep 2006
Posts: 96

PostPosted: Mon Aug 08, 2016 5:37 am    Post subject: Reply with quote

kaktuspalme wrote:
I also bought a Lenovo P50 with a 4K screen.

[...]

I have to power down the notebook by holding the power button.

No one suffering from this problem?


This is very likely an issue with a kernel lacking drivers for all relevant hardware. I had the same issue with a Lenovo T540p (wakeup from suspend freezed the system) and back then a missing driver for the TPM chip was the problem.
I can confirm that suspend/resume works on a p50. I have the following tpm related configuration options enabled (for the p50):
Code:
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y


It is also advisable to set the TPM mode to 1.2 within the BIOS/UEFI (because 2.0 isn't really supported by applications yet).
Back to top
View user's profile Send private message
kaktuspalme
n00b
n00b


Joined: 23 Apr 2006
Posts: 29

PostPosted: Mon Aug 08, 2016 6:16 am    Post subject: Reply with quote

Code:

CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y


Thank you very much tamiko. The tpm driver completely solved my problem.
Back to top
View user's profile Send private message
tamiko
Developer
Developer


Joined: 02 Sep 2006
Posts: 96

PostPosted: Sat Aug 13, 2016 8:48 am    Post subject: Reply with quote

I started writing up a short wiki entry for the P50:
https://wiki.gentoo.org/wiki/Lenovo_ThinkPad_P50


Last edited by tamiko on Sat Aug 13, 2016 8:56 am; edited 1 time in total
Back to top
View user's profile Send private message
tamiko
Developer
Developer


Joined: 02 Sep 2006
Posts: 96

PostPosted: Sat Aug 13, 2016 8:55 am    Post subject: Re: Lenovo P50 (4k) Thread Reply with quote

[quote="rico666"]
Ant P. wrote:

[...]

The avx/avx2 is ok, why it doesn't enable the avx512 is unknown to me.

Rico


Because your processor simply doesn't support avx512. For the skylake architecture introduction of avx512 is expected to be with the "Purley" architecture for Skylake Xeons.
Back to top
View user's profile Send private message
rico666
n00b
n00b


Joined: 03 May 2016
Posts: 5

PostPosted: Sat Oct 29, 2016 4:48 pm    Post subject: Re: Lenovo P50 (4k) Thread Reply with quote

tamiko wrote:
rico666 wrote:

The avx/avx2 is ok, why it doesn't enable the avx512 is unknown to me.


Because your processor simply doesn't support avx512. For the skylake architecture introduction of avx512 is expected to be with the "Purley" architecture for Skylake Xeons.


Confirmed. Unfortunately I thought by having a "Skylake Xeon" I'm in the AVX512 game as Intel presented it like that. Well...

Several months in, I'm trying to work out a good working Hybrid graphics configuration and a good OpenCL development environment, but it's not going well.

When working with the notebook in GPU "discrete mode" (set in BIOS), all was ok. Now I am

* hybrid graphics
* kernel 4.8.4 and bleeding edge nvidia-drivers 375

things are gloom. Nvidia OpenGL causes segfaults all the time, but I'll address that later. Right now, I seem to not even be able to get the P530 graphics working ok.
I had a look at https://wiki.gentoo.org/wiki/Lenovo_ThinkPad_P50 (which I hopefully can contribute to at some point), but e.g. video output with fullscreen is not possible

I'm pretty sure I do have quite recent versions:

Code:
# eix -c intel
[I] dev-util/intel-ocl-sdk (4.4.0.117-r1@10/29/2016): Intel's implementation of the OpenCL standard
[I] sys-firmware/intel-microcode (20160714@10/29/2016): Intel IA32/IA64 microcode update data
[I] x11-apps/intel-gpu-tools (1.15@10/29/2016): Intel GPU userland tools
[I] x11-drivers/xf86-video-intel (2.99.917_p20161024@10/29/2016): X.Org driver for Intel cards
[I] x11-libs/libva-intel-driver (1.7.2@10/29/2016): HW video decode support for Intel integrated graphics
[I] sys-kernel/linux-firmware (99999999@10/28/2016): Linux firmware files



Xorg setting for intel as recommended all over the place:

Code:
Section "Device"
    Option "AccelMethod" "uxa"
    Identifier "modesetting"
    Driver "modesetting"
EndSection


But xvinfo sees no adapter:

Code:
$ xvinfo
X-Video Extension version 2.2
screen #0
 no adaptors present


And thus mplayer experience is poor also:

Code:
...
[vdpau] Error when calling vdp_device_create_x11: 1
...


Rico
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum