Razer Blade Pro (2019)

This page is a work in progress.

Prologue
This is a quick braindump of what was learned during installation of Gentoo on a mid-2019 Razer Blade Pro 17 FHD. Some of it may be applicable to other Razer laptops from 2018/2019. Some of it may not apply to the reader's situation at all. Some of it may reflect the author's taste and habits.

BIOS/Firmware
If BIOS version 1.02 is installed, hold off upgrading a few seconds. There may exist a possibility to unlock a fair amount of options in the BIOS which may or may not be permanently hidden and locked, with later BIOS versions. This requires installing a modified BIOS, and installing a modified BIOS may or may not break your warranty (and your laptop). This section may possibly be expanded.

Booting the Gentoo Minimal ISO
Some quick notes:

Please disable Fast Boot. First in Windows, then shut down and do the same in the BIOS. (Hit F1 immediately/repeatedly after power on.) This is to limit the possibility that your Windows install becomes corrupted while we play around with stuff.

While in the BIOS, also disable Secure Boot, so booting from USB becomes possible. (If CSM also must be enabled is uncertain. If so, the interesting key to whack during POST becomes F12.)

The RBP17 has a spare M.2 slot. The BIOS will happily list EFI entries from one EFI partition on each boot medium. This permits having an untouched original NVME with the Windows install intact, and another device dedicated to Gentoo on the other. You will need a spare M.2 NVME device and a T5 Torx screwdriver. A heat transfer pad for the new NVME device is recommended, but not strictly required. Have a clean, dry, soft and well lit surface prior to opening the device. Take care not to scratch your brand new laptop, and make sure you know exactly where you put the screws.

The Gentoo Minimal ISO does not (at the time of writing) result in functional networking. (Neither wifi nor ethernet) Boot the installer with a well known usb wifi adapter plugged into the laptop for installing. Then grab a 5.4 kernel or better during installation.

UEFI boot from USB follows the same recipe for partitioning/GRUB as below.

Storage
Block storage is named /dev/nvme*something. No /dev/sda anymore.

Card reader
Unsure if supported by in-kernel driver yet.

Audio
A driver option is required for the HDA audio. Otherwise, the speakers will be mute.

Graphics
There are multiple ways to configure graphics on this system. intel graphics only, nvidia graphics only, intel graphics as primary and graphics offloading to nvidia, nvidia graphics as primary and offloading to intel.

The primary author of this text wants, in prioritized order: low noise, ability to have performant graphics when needed, ability to use external displays when needed. The first and second priority calls for intel graphics and offloading to nvidia. The HDMI output is wired to the nvidia hardware, and the current nvidia driver (440.44) appears unable to act as an xrandr display output sink.

In short: One can have low noise (intel graphics as primary) and performant graphics when needed (offload rendering to nvidia), but the HDMI port becomes unuseable. Razer's own FAQ for this model states that USB-C, TB3 and HDMI all are wired to the Nvidia card. This has been verified with a USB-C port expander.

It appears impossible to have graphics offloading to the Nvidia dGPU *and* external monitors connected to the dGPU at the same time. At least not until Nvidia adds the display output sink feature to their driver.

This is a working /etc/X11/xorg.conf, for use with x11-drivers/nvidia-drivers. intel is primary, render offloading to nvidia is possible.

Hybrid graphics works. I emerge media-libs/mesa, x11-base/xorg-server and x11-drivers/nvidia-drivers with these flags:

Using lightdm as the display manager, add this under [Seat:*] in /etc/lightdm/lightdm.conf: display-setup-script=/usr/local/bin/prepare-optimus.sh

Then create that file with the following content:

After this, you no longer have an opengl eselect. By default, opengl stuff runs on the iGPU. To offload to the dGPU, prefix your command with:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia

HDMI video/audio output not yet verified. At the time of writing, google-chrome-stable does not handle graphics offloading well.

Wifi
Use driver iwlwifi. Make sure latest linux-firmware is installed. Support for AX200 went into the upstream linux kernel around version 5.1.

Ethernet
Realtek 8125 is supported by r8169 in kernel 5.4.0-rc7, possibly a few rcs earlier.

Bluetooth
I believe this is part of the AX200 chip, but requires the btusb driver and appropriate firmware (intel/ibt-20-1-3.sfi, part of linux-firmware). Appears to work.

Keyboard
Audio control keys are exposed as both ACPI events and X11 keys. Ditto display backlight brightness. A Desktop Environment of choice may have prebuilt support for this. Do not make use of both mechanisms at the same time.

ACPI key events works independently of X11, but it is necessary to edit the relevant config file(s) for acpid.

Keyboard backlight keys works with no driver.

If you have the habit of doing 'powertop --auto-tune', be advised that enabling 'Autosuspend for USB device Razer Blade [Razer] ' is a bad move. It results in a very erratic keyboard.

This section to be expanded.

Touchpad
Rumor has it a certain minimum BIOS version for the touchpad is needed to work out of the box. This is a working /etc/X11/xorg.conf.d/70-synaptics.conf :

Sensors
Support for reading NVME temperatures comes in kernel 5.5. For now, use smartmontools or nvme-cli.

GRUB and UEFI
The installation handbook has plenty more details about GRUB and UEFI]]. The tl;dr version below deviates slightly from instructions in the link above.


 * Have a GPT partitioned NVME. (gdisk does the trick)
 * First partition should be of the order 100-200MB, type ef00.
 * Add swap, root (/) and /home partitions according to taste.
 * Format first partition as VFAT. (mkfs.vfat -F 32 /dev/nvme1n1p1verifythis )
 * mkswap for swap partition, mkfs.ext4 or mkfs.somethingelse for root and home.
 * Add partitions to /etc/fstab, first partition as '/boot'.
 * Execute:

Verify that /boot/grub and /boot/EFI got a number of files and directories present.

Add the following lines to /etc/default/grub:

Now build a kernel, place it in /boot/, and ensure it is named vmlinux-*, vmlinux-* or kernel-*. Finally, create the GRUB2-config file:

Select kernel config options for homecooked kernels
For a manual kernel configuration, a likely incomplete selection of relevant kernel config options follows:

To be expanded...