Diff PRIME - Ubuntu Doc
diff --git a/Ubuntu-linux-on-Dell-XPS-15-(9560).md b/Ubuntu-linux-on-Dell-XPS-15-(9560).md
index 939305c..a2f0574 100644
--- a/Ubuntu-linux-on-Dell-XPS-15-(9560).md
+++ b/Ubuntu-linux-on-Dell-XPS-15-(9560).md
@@ -164,6 +164,34 @@ Now launching "Additional drivers" from the dash will provide more options, in p
The nVidia driver seems to work fine, and provides GPU acceleration. It also solves the window manager corruption after resuming from suspend caused by previous versions of the driver.
+#### How to use PRIME
+
+When you install the proprietary drivers, Nvidia has put in place PRIME so we can switch graphic cards. However, it isn't perfect. The switch isn't dynamic, you must log out and log back. Log out and back isn't working all the time, you may have to restart your DM (Display Manger - lightdm, gdm or sddm, which depends on the desktop you use) to get out of the lock loop.
+
+If you want to be able to change card dynamically at all cost, we used to have an option which was bumblebee, but this option hasn't been worked on since 2013 and has been considered deprecated by Ubuntu since [16.04](https://askubuntu.com/a/758995).
+
+1. If you want to want to make your computer supports prime
+
+ sudo prime-supported # expected ouput - yes
+
+1. If you wish to use your Intel card
+
+ sudo prime-select intel
+
+1. To complete the switch, you must log out then log back. If you are stuck in a loop you can restart your display manager
+
+ sudo systemctl restart gdm3 # it could be lightdm, sddm or something else.
+ # if it doesn't get you out of the loop
+ sudo reboot
+
+1. If you wish to go back to the Nvidia card
+
+ sudo prime-select nvidia
+
+1. To complete the switch, you must log in then log back. The same thing we did for the intel card.
+
+You could also make the switch using "nvidia-settings". Select and click "PRIME Profiles" then chose the card you want to activate.
+
## Fixing problems
### Touchpad
@@ -188,6 +216,59 @@ After updating Windows, or installing a program, you may lose the dual boot (i.e
This will recover the dual boot. Alternatively, you can boot into the BIOS, and select the boot order as Ubuntu first, Windows second.
+### Issues with Bumblebee
+
+**DISCLAIMER: Installing bumblebee is particularly dangerous, and can corrupt or destroy your system. If you use these instructions, it's really at your own risk.**
+**DEPRECATED: Bumblebee is considered deprecated since 16.04 and its code hasn't been touched since 2013. If you still want to install it, you are most likely going to be on your own to fix any issues you encounter. **
+
+After installing proprietary drivers, you might want to install bumblebee to help you with your battery life. If you install it right away your XPS 15 will most likely freeze and it will difficult to revert the changes unless you want to struggle with the recovery.
+
+1. Install bumblebee
+
+ sudo apt install bumblebee bumblebee-nvidia bbswitch-nvidia
+
+1. Change your bumblebee configuration to your nvidia drivers
+
+ sudo nano /etc/bumblebee/bumblebee.conf
+
+ # Change nvidia-current for nvidia-XXX (Depends on your version)
+ # XXX could be 387 or 390
+
+1. Blacklist other drivers
+
+ sudo nano /etc/modprobe.d/bumblebee.conf
+
+ # Make the following section look like this (the drm line will be added):
+ #387
+ blacklist nvidia-387
+ blacklist nvidia-387-drm
+ blacklist nvidia-387-updates
+ blacklist nvidia-experimental-387
+
+1. Add yourself to the bumblebee group
+
+ sudo usermod -a -G bumblebee $USER
+
+1. Add acpi_rev_override=1 to grub. GRUB_CMDLINE_LINUX_DEFAULT may look like this.
+
+ GRUB_CMDLINE_LINUX_DEFAULT='pcie_port_pm=off acpi_backlight=none acpi_osi=Linux acpi_osi=! acpi_osi="Windows 2009" enable_fbc=1 enable_psr=1 disable_power_well=0 acpi_rev_override=1'
+
+1. Update your grub
+
+ sudo update-grub
+
+1. Make sure you are running on your intel GPU
+
+ cat /proc/acpi/bbswitch # Ouput:0000:01:00.0 OFF if on intel
+ sudo prime-select intel # If ON in previous command
+
+1. Reboot the machine
+
+1. You should be on your Intel GPU and able to call your discrete card (NVIDIA) on demand :
+
+ optirun <your application> #Runs the application with the Nvidia GPU
+
+
## Run your native Windows 10 Pro install as guest on VirtualBox with Ubuntu as host
**DISCLAIMER: The instructions in this section are particularly dangerous, and can corrupt or destroy your system. If you use these instructions, it's really at your own risk.**