Dell XPS 15z

From Gentoo Wiki
Jump to:navigation Jump to:search


This guide will lead you to the most important configuration to have a working box on your Dell XPS 15z. This article was highly based on Alienware M11xR3, thanks to Philipp Leonhardt.

Hardware

Hardware Manufacturer Model Specification
Processor Intel Core i7 2640M (Sandy Bridge) 2,8 GHz (3,5 GHz Turbo Mode)
Mainboard Chipset Intel HM67 Chipset
RAM by selection on Dell Shop
Graphics Card #1 Intel HD Graphics 3000 (on Sandy Bridge CPU)
Graphics Card #2 nVidia GeForce GT 540M (GF108)
Harddisk by selection on Dell Shop
Display AU Optronics B156HW3 15.6" WLED Glossy 16:9 1080p (1920x1080)
Sound Card Intel ALC269VB 5.1-Channel HDA, 16/20/24-bit PCM, 44.1k/48k/96k192kHz, S/PDIF
Network (LAN) Atheros AR8151 PCI-E Gigabit Ethernet 10/100/1000 Mbit/s
Network (Wireless) Killer (by selection on Dell shop) Wireless-N 1103 (based on Atheros AR9300) 2.4GHz, 5GHz, 3-Stream MIMO, 802.11a/b/g/n, up to 450 Mbps
USB 3.0 Host Controller NEC Corporation uPD720200
FireWire 1394 N/A N/A
Card Reader N/A N/A SD/MMC/xD/MemoryStick(MS)/MS Duo/MS-HG
user $lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 2nd Generation Core Processor Family DRAM Controller [8086:0104] (rev 09)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port [8086:0101] (rev 09)
00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0126] (rev 09)
00:16.0 Communication controller [0780]: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 [8086:1c3a] (rev 04)
00:1a.0 USB controller [0c03]: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 [8086:1c2d] (rev 05)
00:1b.0 Audio device [0403]: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller [8086:1c20] (rev 05)
00:1c.0 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 [8086:1c10] (rev b5)
00:1c.1 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 [8086:1c12] (rev b5)
00:1c.3 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 [8086:1c16] (rev b5)
00:1c.4 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 [8086:1c18] (rev b5)
00:1c.5 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 [8086:1c1a] (rev b5)
00:1d.0 USB controller [0c03]: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 [8086:1c26] (rev 05)
00:1f.0 ISA bridge [0601]: Intel Corporation HM67 Express Chipset Family LPC Controller [8086:1c4b] (rev 05)
00:1f.2 SATA controller [0106]: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller [8086:1c03] (rev 05)
00:1f.3 SMBus [0c05]: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller [8086:1c22] (rev 05)
01:00.0 VGA compatible controller [0300]: nVidia Corporation GF108 [GeForce GT 540M] [10de:0df5] (rev a1)
03:00.0 Network controller [0280]: Intel Corporation Centrino Advanced-N 6230 [8086:0091] (rev 34)
04:00.0 USB controller [0c03]: NEC Corporation uPD720200 USB 3.0 Host Controller [1033:0194] (rev 04)
06:00.0 Ethernet controller [0200]: Atheros Communications Inc. AR8151 v2.0 Gigabit Ethernet [1969:1083] (rev c0)
user $lsusb -nn
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 0c45:642a Microdia 
Bus 002 Device 003: ID 8086:0189 Intel Corp. 
user $cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 800.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5587.06
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 800.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5587.06
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 800.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5587.06
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz         : 800.000
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 2
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5587.06
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

make.conf

FILE /etc/portage/make.conf
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
MAKEOPTS="-j5"

INPUT_DEVICES="evdev synaptics mouse keyboard v4l"    # mouse and keyboard xorg drivers needed for bumblebeed and VirtualGL
VIDEO_CARDS="intel nvidia"                            # both drivers need to be installed so that we can start application with nvidia and bumblebeed
...

NOTUSE="-hal"
NOTEBOOK="laptop dell ieee1394 lcdfilter lm-sensors"
SYSTEM="nvidia opengl threads acpi ssse3 sse4_1 sse4_2 v4l v4l2"
USE="${NOTUSE} ${SYSTEM} ${NOTEBOOK} ..."

GCC CFLAGS and -march=native

Analyzing CLFAGS

GCC Versions before 4.6 will not detect the right CFLAGS for a new Core i7 2nd Gen (Sandy Bridge) CPU with -march=native.

root #gcc-4.5.3 -march=native -E -v - </dev/null 2>&1 | grep cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1 -E -quiet -v - -D_FORTIFY_SOURCE=2 -march=core2 -mcx16 -msahf -maes -mpclmul -mpopcnt -mavx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=generic
root #gcc-4.6.2 -march=native -E -v - </dev/null 2>&1 | grep cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.2/cc1 -E -quiet -v - -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=corei7-avx

Upgrading GCC

There is no stable version of GCC 4.6, so hopefully soon you will have full core i7 support in your CFLAGS.

Kernel Configuration

Processor Settings

This changes was made under Linux/x86 3.3.3-gentoo-sources, using Genkernel.

KERNEL Processor
Processor type and features  --->
    [*] Idle dynticks system (tickless idle)
    [*] Symmetric multi-processing support
        Processor family (Core 2/newer Xeon)  --->
        Preemption Model (Preemptible Kernel (Low-Latency Desktop))  --->
    [*] Machine Check / overheating reporting
    [*]   Intel MCE features
    < > Dell laptop support
    <*> /dev/cpu/microcode - microcode support
    [*]   Intel microcode patch loading support
    -*- MTRR (Memory Type Range Register) support
    [*]   MTRR cleanup support
    (0)     MTRR cleanup enable value (0-1)
    (1)     MTRR cleanup spare reg num (0-7)
    Timer frequency (1000 HZ)  --->

Power Management

KERNEL Power Management
Power management and ACPI options  --->
    [*] Suspend to RAM and standby
    [*] Run-time PM core functionality
    [*] ACPI (Advanced Configuration and Power Interface) Support  --->
        [*]   Deprecated /proc/acpi files
        [*]   Deprecated power /proc/acpi directories
        [*]   Deprecated /proc/acpi/event support
        <*>   AC Adapter
        <*>   Battery
        -*-   Button
        -*-   Video
        <*>   Fan
        [*]   Dock
        <*>   Processor
        <*>   Processor Aggregator
        <*>   Thermal Zone
    [*] CPU Frequency scaling  --->
        <*>   CPU frequency translation statistics
            Default CPUFreq governor (ondemand)  --->
        -*-   'performance' governor
        <*>   'powersave' governor
        <*>   'userspace' governor for userspace frequency scaling
        -*-   'ondemand' cpufreq policy governor
        <*>   'conservative' cpufreq governor
                x86 CPU frequency scaling drivers  --->
            <*> ACPI Processor P-States driver
    -*- CPU idle PM support
    [*]   Cpuidle Driver for Intel Processors
            Memory power savings  --->
        <*> Intel chipset idle memory power saving driver

PCI Bus Driver

KERNEL PCI Bus Options
Bus options (PCI etc.)  --->
    [*] PCI support
    [*]   Support mmconfig PCI config space access
    [*]   PCI Express support
    [*]     Root Port Advanced Error Reporting support
    [*] Message Signaled Interrupts (MSI and MSI-X)

LAN and Wireless Networking

KERNEL Networking drivers
[*] Networking support  ---> 
    <M>   Bluetooth subsystem support  --->
        <M>   RFCOMM protocol support
        [*]     RFCOMM TTY support
        Bluetooth device drivers  --->
            <M> HCI USB driver 
            <M> HCI SDIO driver
            <M> HCI UART driver 
            [*]   UART (H4) protocol support
            [*]   BCSP protocol support 
            [*]   HCILL protocol support
            <M> HCI BCM203x USB driver
            <M> HCI BPA10x USB driver 
            <M> HCI BlueFRITZ! USB driver 
            <M> HCI VHCI (Virtual HCI device) driver
    -*-   Wireless  --->
        <M>   cfg80211 - wireless configuration API
        [*]     enable powersave by default
        [*]     cfg80211 wireless extensions compatibility
        [*]   Wireless extensions sysfs files
        <M>   Generic IEEE 802.11 Networking Stack (mac80211)
              Default rate control algorithm (Minstrel)  --->
        -*-   Enable LED triggers

Device Drivers  --->
    [*] Network device support  --->
    -*-   Network core driver support
        [*]   Ethernet driver support  --->
            [*]   Atheros devices
            <M>     Atheros L1C Gigabit Ethernet support (EXPERIMENTAL)
        [*]   Wireless LAN  --->
            <M>   Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi)

SATA Controller

KERNEL AHCI Controller driver
Device Drivers  --->
    <*> Serial ATA and Parallel ATA drivers  --->
        [*]   ATA ACPI Support
        <*>   AHCI SATA support

FireWire (IEEE 1394)

KERNEL Firewire driver
Device Drivers  --->
    IEEE 1394 (FireWire) support  --->
        <*> FireWire driver stack
        <M>   OHCI-1394 controllers

I2C / SMBus

KERNEL I2C SMBus driver
Device Drivers  --->
    -*- I2C support  --->
        [*]   Enable compatibility bits for old user-space
        <*>   I2C device interface
        [*]   Autoselect pertinent helper modules
            I2C Hardware Bus support  --->
               <M> Intel 82801 (ICH/PCH)

Graphics Card

KERNEL Graphic driver
Device Drivers  --->
    Graphics support  --->
        <*> /dev/agpgart (AGP Support)  --->
            <*>   Intel 440LX/BX/GX, I8xx and E7x05 chipset support
        (2)   Maximum number of GPUs
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
            <*>   Intel 8xx/9xx/G3x/G4x/HD Graphics
            [*]     Enable modesetting on intel by default
        -*- Support for frame buffer devices  --->
            [*]   Enable firmware EDID
            [*]   Enable Video Mode Handling Helpers

Sound Card

KERNEL ALSA Sound Card drivers
Device Drivers  --->
    <*> Sound card support  --->
        <M>   Advanced Linux Sound Architecture  --->
            [*]   PCI sound devices  --->
                <M>   Intel HD Audio  --->
                    (2048) Pre-allocated buffer size for HD-audio driver
                    [*]   Build Realtek HD-audio codec support
                    [*]   Build HDMI/DisplayPort HD-audio codec support
                    [*]   Enable generic HD-audio codec parser
                    [*]   Aggressive power-saving on
                    (3)     Default time-out for HD-audio power-save mode

USB Controller

KERNEL USB Controller driver
Device Drivers  --->
    [*] USB support  --->
        {*}   Support for Host-side USB
        [*]     USB runtime power management (autosuspend) and wakeup
        <*>   xHCI HCD (USB 3.0) support (EXPERIMENTAL)
        <*>   EHCI HCD (USB 2.0) support
        <*>   USB Mass Storage support

Card Reader

KERNEL SD Card driver
Device Drivers  --->
      <M> MMC/SD/SDIO card support  --->
          <M>   MMC block device driver
                [*]     Use bounce buffer for simple hosts
          <M>   SDIO UART/GPS class support
          <M>   Secure Digital Host Controller Interface support
          <M>     SDHCI support on PCI bus
      SCSI device support ---> 
          [*] Probe all LUNs on each SCSI device

To proper provide SD Card reader automount option you must create the following file.

FILE /etc/local.d/20-sdcard.start
echo 1 > /sys/bus/pci/rescan

You must also make it runnable with

root #chmod a+x /etc/local.d/20-sdcard.start

Webcam

KERNEL Webcam driver
Device Drivers  --->
    <M> Multimedia support  --->
            [*]   Media USB Adapters  --->
                  <M>   USB Video Class (UVC)
                  [*]     UVC input events device support
                  <M>   GSPCA based webcams  --->
                        <M>   SN9C20X USB Camera Driver

Test it using mplayer:

root #mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15 -vf screenshot

GRUB Bootloader Config

For GRUB the Sandy Bridge needs some more special kernel parameters to reach the optimal performance and save some battery power. Add this to your kernel command line:

FILE /boot/grub/grub.conf
i915.i915_enable_rc6=1 i915.semaphores=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 pcie_aspm=force

If you enabled Intel IOMMU support in your kernel config you also need to add this to your kernel command line:

FILE /boot/grub/grub.conf
intel_iommu=off

Otherwise bumblebee produces IOMMU Errors on loading the nvidia driver.

Power Management Tweaks

PCI/USB Autosuspend, CPU Scheduler, Intel HDA Powersave

Create in local initscript to turn on all available powersaving options. Edit it to your preferences.

FILE /etc/local.d/10-powermanagement.start
#############################
# Power Aware CPU Scheduler #
#############################


echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

###############################
# Autosuspend for USB devices #
###############################


### Laptop_Integrated_Webcam_2M [CN04MYKF724871AHN1G1A01]
echo auto > /sys/bus/usb/devices/1-1.4/power/control

###############################
# Autosuspend for PCI devices #
###############################


### Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
echo auto > /sys/bus/pci/devices/0000\:00\:00.0/power/control

### PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
echo auto > /sys/bus/pci/devices/0000\:00\:01.0/power/control

### VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
echo auto > /sys/bus/pci/devices/0000\:00\:02.0/power/control

### Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
echo auto > /sys/bus/pci/devices/0000\:00\:16.0/power/control

### USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
echo auto > /sys/bus/pci/devices/0000\:00\:1a.0/power/control

### Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
echo auto > /sys/bus/pci/devices/0000\:00\:1b.0/power/control

### PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
echo auto > /sys/bus/pci/devices/0000\:00\:1c.0/power/control

### PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
echo auto > /sys/bus/pci/devices/0000\:00\:1c.1/power/control

### PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
echo auto > /sys/bus/pci/devices/0000\:00\:1c.3/power/control

### PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
echo auto > /sys/bus/pci/devices/0000\:00\:1c.4/power/control

### PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
echo auto > /sys/bus/pci/devices/0000\:00\:1c.5/power/control

### USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
echo auto > /sys/bus/pci/devices/0000\:00\:1d.0/power/control

### ISA bridge: Intel Corporation HM67 Express Chipset Family LPC Controller (rev 05)
echo auto > /sys/bus/pci/devices/0000\:00\:1f.0/power/control

### SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)
echo auto > /sys/bus/pci/devices/0000\:00\:1f.2/power/control

### SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
echo auto > /sys/bus/pci/devices/0000\:00\:1f.3/power/control

### VGA compatible controller: nVidia Corporation GF108 [GeForce GT 540M] (rev a1)
echo auto > /sys/bus/pci/devices/0000\:01\:00.0/power/control

### Network controller: Intel Corporation Centrino Advanced-N 6230 (rev 34)
echo auto > /sys/bus/pci/devices/0000\:03\:00.0/power/control

### USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
echo auto > /sys/bus/pci/devices/0000\:04\:00.0/power/control

### Ethernet controller: Atheros Communications AR8151 v2.0 Gigabit Ethernet (rev c0)
echo auto > /sys/bus/pci/devices/0000\:06\:00.0/power/control


##########################################
# Intel HDA Audio Codec Power Management #
##########################################


echo 1 > /sys/module/snd_hda_intel/parameters/power_save


##############################
# AHCI Link Power Management #
##############################


echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

After adding the script don't forget to make it executable to run on boot.

root #chmod a+x /etc/local.d/10-powermanagement.start

Bumblebeed and Nvidia Card

Needed things for bumblebeed to run properly:

  • Nvidia graphics driver (alternatively the nouveau driver, but this hasn't much more performance than the Intel driver so forget about it)
  • bbswitch module to disable/enable the Nvidia graphics card
  • nasm to properly compile VirtualGL
  • VirtualGL to stream the window running on nvidia driver to the actual X Session
  • bumblebeed itself for controlling the bbswitch and nvidia module

For further information about Bumblebee Project, visit The Bumblebee Project page or the Gentoo Bumblebee Wiki Page.

Nvidia Graphics Driver

 As of 2020-03-07, the information in this section is probably outdated. You can help the Gentoo community by verifying and updating this section.

The Nvidia graphics driver should already be installed after setting VIDEO_CARDS="intel nvidia" in make.conf. Just be sure to setup the OpenGL extension to work with the Intel driver:

root #eselect opengl list
Available OpenGL implementations:
 [1] nvidia
 [2] xorg-x11 *

Take the correct option for Intel driver

root #eselect opengl set 2

Installing bbswitch module

Note
Installation of the bbswitch module has to be done after every kernel change
root #emerge --ask bbswitch

After that you can test the module by loading it and look into your syslog

root #modprobe bbswitch
root #cat /var/log/messages | grep bbswitch
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
bbswitch: detected an Optimus _DSM function
...
bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on

Get the status of the nvidia card

root #cat /proc/acpi/bbswitch
root #0000:01:00.0 ON

Turn the card off, respectively on:

root #echo OFF > /proc/acpi/bbswitch
root #echo ON > /proc/acpi/bbswitch

You can put this on the initial script created before, to make this change on every bootup.

Note
After turning the nvidia card off your system temparature will decrease, and processor fan could also completely turn off. Don't be scared

Running Optimus

Optimus still give us headakes to configure. I'm still working out to make a fully working box, and Optimus is one of my threads. I know that Asus UL30Jt also has support for Optmus, but I have to make some testes before post it here. I've aready followed the nVidia Optimus guide, but it seems that still there is a missing part of the puzzle.

VGA Switching

I have being trying a lot of solutions to make this thing work on Dell XPS 15z, but none of then was successfuly. There is a guide to VGA Switchroo, but it seems that I can't do this or the hardware of Dell XPS 15z does not suport this resource. After keep looking and googled a lot I found a solution based on synergy and bumblebee with the optimus server. Note that, right now, there is no suppor for VGA switching and this is a workaround that works prety well for those who wants to try the NVIDIA power on their laptops.

NVIDIA Optimus and HDMI Output Configuration

Note
If you experience problems with bumblebee, before looking for a solution, try to upgrade your kernel to a stable 3.5.