0

Lower Heat/Power Consumption on Dell 15z in Ubuntu

Posted (Updated ) in Linux

For users not running Bumblebee or Ironhide, you’ve probably noticed alot of heat, low battery life and a roaring fan even when idle. This is almost entirely due to the nVidia graphics card. If you’re like me and don’t need that card at all, you have the option of disabling it entirely. To do so you’ll need to install acpi_call as a kernel module and use it to shut the GPU down.

Note: To test current power usage, when on battery use the following command:

1
grep rate /proc/acpi/battery/BAT0/state

Compiling and Installing acpi_call

To quote tuxfamily:

  1. Install dkms and some useful packages:
    1
    2
    
    sudo apt-get install dkms git build-essential
    sudo apt-get install linux-headers-$(uname -r)
  2. Clone the acpi_call repository from git and copy it to where dkms will look for it. We’ll call it version 0.0.1 for now:and paste this into it and save it:
    1
    2
    3
    
    git clone http://github.com/mkottman/acpi_call.git
    sudo mkdir /usr/src/acpi_call-0.0.1
    sudo cp -rp acpi_call/* /usr/src/acpi_call-0.0.1
  3. Create a file dkms.conf for it:
    1
    
    sudo gedit /usr/src/acpi_call-0.0.1/dkms.conf

    and paste this into it and save it:

    1
    2
    3
    4
    5
    6
    7
    8
    
    PACKAGE_NAME="acpi_call"
    PACKAGE_VERSION="0.0.1"
    CLEAN="make clean"
    BUILT_MODULE_NAME[0]="acpi_call"
    DEST_MODULE_NAME[0]="acpi_call"
    MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir PWD=$dkms_tree/acpi_call/0.0.1/build"
    DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
    AUTOINSTALL="yes"
  4. Edit the makefile
    1
    
    sudo gedit /usr/src/acpi_call-0.0.1/Makefile

    and paste this into it and save it:

    1
    2
    3
    4
    5
    6
    7
    
    obj-m := acpi_call.o
     
    default:
    	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
     
    clean:
    	rm acpi_call.mod.o acpi_call.o acpi_call.ko

    Editors Note: Just replace the Makefile with the above

  5. Add the module to dkms and build and install it:If all went well, you should now be able to load the module with:and this will give some information about it:
    1
    2
    3
    
    sudo dkms add -m acpi_call -v 0.0.1
    sudo dkms build -m acpi_call -v 0.0.1
    sudo dkms install -m acpi_call -v 0.0.1

    If all went well, you should now be able to load the module with:

    1
    
    sudo modprobe acpi_call

    and this will give some information about it:

    1
    
    modinfo acpi_call

Notes:

  • The AUTOINSTALL=”yes” line in dkms.conf is supposed to tell dkms to automatically build and install the module if you upgrade the kernel, but if it doesn’t work you can manually execute the dkms build and install commands in the new kernel.
  • If you want to remove the module (eg from all kernels), do:
    1
    
    sudo dkms remove -m acpi_call -v 0.0.1 --all

Disabling the nVidia GPU

Acpi_call can now be used to shut down the GPU. We’ll create 2 files. One to turn the GPU off, and one to turn it back on again should you need to.

In ~/cardoff.sh add the following:

1
2
3
modprobe acpi_call
echo "\_SB.PCI0.PEG0.PEGP._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}" > /proc/acpi/call
echo "\_SB.PCI0.PEG0.PEGP._PS3" > /proc/acpi/call

and in ~/cardon.sh:

1
2
modprobe acpi_call
echo "\_SB.PCI0.PEG0.PEGP._PS0" > /proc/acpi/call

Remember to add execute permissions to the 2 files:

1
chmod +x ~/cardon.sh ~/cardoff.sh

That should be all there is to it. You can now turn your GPU off with sudo ~/cardoff.sh and back on again with sudo ~/cardon.sh. Note that doing so will only affect that boot and you’ll need to do it again after a reboot. Also the above ACPI call works for my GPU but if you find it doesn’t work for yours try checking here for updated information.

To turn the card off automatically each boot add

1
sudo /home/username/cardoff.sh

to /etc/rc.local.

Minor Intel GPU Tweaks

There are a few GRUB options that can be applied for the Intel GPU to increase battery life. I’ve been using them for a couple of hours as of the time of writing and haven’t noticed any negative affects so I’ll quote them below:

  1. i915.i915_enable_rc6=1 – RC6 was enabled by default for a while, but then it ended up being too buggy for some hardware configuration so it had to be disabled. For affected systems on the current code-base, enabling RC6 can cause GPU hangs. The Intel RC6 feature allows the GPU to enter a lower power state when the GPU is idling.
  2. i915.i915_enable_fbc=1 – This kernel option enables FBC (frame-buffer compression) for the Intel graphics driver. Frame-buffer compression is not enabled by default since for some systems when frame-buffer compression is active there is a bug where the screen is not being properly repainted when using a compositing window manager. As implied by the name, frame-buffer compression will compress the buffer of what’s to be drawn to the screen so that less memory bandwidth is used on screen refreshes, and as a result, less memory being confused.
  3. i915.lvds_downclock=1 – This kernel option will down-clock the LVDS refresh rate, which can increase power savings as a result. However, for systems that do not properly support LVDS down-clocking, the screen can begin to flicker during use.

 

Add them to your GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub. Mine now looks like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force acpi=noirq i915.semaphores=1 i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1"

Remember to do an update-grub when you’re finished!

Thanks to user welfare of Ubuntu Forums for his posts in this thread.

Other Tweaks

Firstly and most importantly, all 15z users should already be familiar with this page but if you’re not the Ubuntu Wiki has THE goto page for information on getting the various hardware components of the 15z working. Check it out if you haven’t already. Topics include:

  • Fixing black screen on installation issue
  • Using Bumblebee/Ironhide to get nVidia Optimus working
  • Getting the 9-in-1 card reader working (This one didn’t work for me but I left a message on the forum pointed to)
  • Getting the trackpad working
  • Various GRUB tweaks