Sunday, May 8, 2016

This post is all about setting up Bumblebee on MSI GP62 6QE Leopard Pro. I personally don't find many tutorials on the internet that address this problem while there are many who seem to be stuck with it.
Disclaimer: I take absolutely no responsibility if you manage to somehow screw your system. Although, I'd be happy to help if you encounter any problems. ^_^
Note 1: Please make sure that you have the latest kernel installed. It is advised that you run
dnf update
before proceeding.
Note 2: This method has been verified to work on the above mentioned laptop. It has a core i5-6300HQ processor with nvidia gtx950m. So, this may work on any other machine with similar specifications.
Note 3: Try this method only if the regular method doesn't work out for you.
Note 4: I use xfce. Neither gnome nor kde are working at the moment. So make sure you install dnf install @xfce-desktop before proceeding.
Note 5: I assume that you want to switch to the intel IGP to save battery life and are not going to frequently switch between the cards. Although, It can be done easily, I will not be covering that in this blog post.

So, Let's get started.

  1. Install the kde display manager.
    dnf install kdm
    For some reasons GDM is currently not working. Then, reboot the system.
  2. Make kdm the default login manager.
    Assuming that you're using GDM.
    systemclt disable gdm.service
    systemctl enable kdm.service
  3. Now move over to this site: https://fedoraproject.org/wiki/Bumblebee and setup the "Free or Open Source" option.
  4. Next move over to this website: http://negativo17.org/nvidia-driver/ and setup the repository. Then install the NVIDIA drivers from there. Although the bumblebee wiki says not to set it up using this but I've found that the bumblebee-nvidia driver makes the system unbootable. If that works for you, then no need of setting up this repo.
  5. You need to change the contents of /etc/bumblebee/bumblebee.conf slightly.
    The line where it says Driver=nouveau just change that to Driver=nvidia
  6. Now make sure that under the [driver-nvidia] section KernelDriver=nvidia is present.
  7. Now move over change the contents of /etc/modprobe.d/bbswitch.conf
    Change
    options bbswitch load_state=0
    to
    options bbswitch load_state=1
  8. Now you need to edit the contents of /boot/grub2/grub.cfg
    make sure you have idle=nomwait option present under the kernel version you are booting. It needs to be present at the spot where other options like "rhgb" etc. are present. The order of these options doesn't matter in this case. Also, I'd advice that you remove the rhgb and nomodeset options from that list. Sometimes the system freezes even before the login manager starts and hence I prefer not having the rhgb option.
  9. create a script in your home directory and save it by the name, say, bumblebee.sh with the following code.
    #!/bin/bash
    sudo rmmod nvidia_drm nvidia_modeset nvidia
    sudo echo "OFF" > /proc/acpi/bbswitch

    then make that script executable(and readable and writable) for all the users using the command
    chmod 777 bumblebee.sh
    Replace bumblebee.sh by the actual path of the script if you did not save it in the home directory.
  10. create a file on the desktop by the name, say, bumblebee.desktop with the following code
    Type=Application
    Name=Bumblebee
    Exec=sudo /home/*YOUR_USERNAME*/bumblebee.sh
    Terminal=true

    Replace *YOUR_USERNAME* by your username, of course :-P
  11. Now Add an entry in the "Session and Startup" (which you can find under settings manager) with a command
    sudo /home/*YOUR_USERNAME*/Desktop/bumblebee.desktop
  12. Finally, Reboot the system.

Any comments, suggestions or corrections are welcomed.
Note 6:If the bumblebee daemon is not running properly or /proc/acpi/bbswitch is not present then remove the packages bbswitch-dkms and bumblebee and then reinstall. Don't forget to verify that bumblebee.conf is set up as mentioned above.

Edit 1: Here's the sequel to this post: http://bumblebeesky.blogspot.com/2017/02/sequel-switching-graphics-on-msi-gp62.html