Got this new XPS 15 9560 and it screams.  Dual booting with Win10 for gaming, and Arch as my daily driver.  I am absolutely loving it.  I really enjoy XFCE, but it has several scaling issues at 4K and I grew tired of it quickly.  Gnome3 is working out much better for me in this case.  Maybe I’ll try XFCE again later.

I found some ways to tweak the battery life that give me a lot more runtime, and reduce the temperature by 10 degrees.  The system has 2 graphics cards; An Intel, and Nvidia 1050.  Since I wont be gaming in Linux on this box, the 1050 can be disabled.  Linux support for Nvidia Optimus is not quite 100%, so I created the tweaks below.

I pulled ideas from the following posts.

https://wiki.archlinux.org/index.php/hybrid_graphics

https://wiki.archlinux.org/index.php/Dell_XPS_15_(9550)

https://bbs.archlinux.org/viewtopic.php?id=223056

I ran into the same issues as the forum post above on the 9560.  Disabling the GPU on boot causes the system to lock up.  I also cannot suspend and therefore resume when the GPU is disabled.  So, I had to hack it together a bit.  I could use bumblebee, but my method is quite simple, and it works with only one package.

[root@host scripts]# yaourt acpi_call
 1 community/acpi_call 1.1.0-60 [installed]
 A linux kernel module that enables calls to ACPI methods through /proc/acpi/call

Tried the others and ran into issues.

The scripts are very simple.  I have a gpu_off.sh and a gpu_on.sh script.

[me@host scripts]$ cat gpu_off.sh
 #!/bin/sh
 sleep 5
 sudo modprobe acpi_call
 sleep 10
 echo '_SB.PCI0.PEG0.PEGP._OFF' | sudo tee --append /proc/acpi/call > /dev/null
[me@host scripts]$ cat gpu_on.sh
 #!/bin/sh
 echo '_SB.PCI0.PEG0.PEGP._ON' | sudo tee --append /proc/acpi/call > /dev/null
 sudo rmmod acpi_call
 sleep 5

 

Before

After

 

 I added the gpu_off.sh script to Gnome startup.
[me@host ~]$ cat .config/autostart/gpu.desktop

[Desktop Entry]
Name=GPUOFF
Comment=Turn NVIDIA off.
Exec=sh /home/me/scripts/gpu_off.sh
NoDisplay=true
Terminal=false
Type=Application
StartupNotify=false
Categories=Utility;
MimeType=application/octet-stream;application/x-shellscript

Next step was to get Gnome to run the “on” script before suspend, and then run the “off” script on resume.

Create a script in /lib/systemd/system-sleep

#!/bin/sh
case $1/$2 in
pre/*)
echo "Going to $2..."
# Place your pre suspend commands here, or `exit 0` if no pre suspend action required
/home/me/scripts/gpu_on.sh
;;
post/*)
echo "Waking up from $2..."
# Place your post suspend (resume) commands here, or `exit 0` if no post suspend action required
/home/me/scripts/gpu_off.sh
;;
esac

This works great and gives me 8 hours of battery life!

Categories: HardwareLinux

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *