HP Zbook Studio G4

Sound card
Be sure to enable (snd-hda-intel) and enable the codecs.

Thunderbolt 3
Thunderbolt 3 is a hot pluggable PCIe port, with USB 3.1 support.

USB
Easy, just enable xHCI.

No need to enable EHCI or OHCI. xHCI is backwards compatible already.

WiFi
Intel Corporation Wireless 8265 / 8275 does not work out of the box.

Look for the iwlwifi firmware in the directory.

The following kernel config is copied from here.

No need to enable DVM:

Hardware WiFi button
To enable the Hardware WiFi button (no LED feedback as of yet):

SD card slot
To enable the PCIe Card Reader:

Webcam
Setting the following kernel parameters should be enough to be able to use the built-in webcam.

NVIDIA Optimus
Configure according to NVIDIA/Optimus & the NVIDIA/nvidia-drivers articles.

This is the necessary Xorg configuration:

Be sure to switch the OpenGL drivers before starting X:

Intel
See the intel page for up-to-date kernel parameter instructions.

Configure Xorg to use  driver.

Rebuild changed packages.

Emerge the dated Intel HD Graphics driver.

Configure Xorg file.

NVIDIA
First off, add  to VIDEO_CARDS in

Update influenced packages

Follow the NVIDIA guide for a (mostly) complete configuration.

Set the following kernel parameters to be able to use

The following configuration enables brightness control, forces full composition pipeline to decrease screen tearing and forces a dpi of 96, which could otherwise give problems in your wm with varying glyph sizes.

Bluetooth
Follow the Bluetooth article on configuring and using Bluetooth.

HP 3D Driveguard
HP 3D Driveguard is a feature of HP laptops that turn off the hard drive when the laptop is falling. To enable HP 3D Driveguard, follow the instructions of the HPfall article.

External DisplayPort monitor does not work on PCIe(Thunderbolt 3) port
When using an adapter to connect a DisplayPort monitor to the PCIe port and the monitor does not get recognized, try:


 * 1) Make sure the adapter is not plugged into the PCIe port;
 * 2) Disconnect the DisplayPort cable from the adapter;
 * 3) Plug the adapter into the PCIe port;
 * 4) Connect the DisplayPort cable.

Now it should work!

NVIDIA brightness control
To enable brightness control, add this line to the conf file

Screen tearing
As the browser is most frequently used: emerge with USE variable. It fixes 99% of smooth scrolling screen tearing. Really a game changer!

For other screen tearing problems, check out.

Keyboard layout
To set the keyboard layout to Dvorak Programmer

tty
For terminal:

Graphical
For X:

Unable to suspend with Nvidia driver
If you have trouble suspending while on, switch to  instead of. This replaces suspend for pm-suspend and should fix the suspend issue. More instructions on switching at Suspend and hibernate.