Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto setup bumblebee on a ThinkPad W530
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Latrina
n00b
n00b


Joined: 13 Aug 2017
Posts: 67
Location: Cambridge, UK

PostPosted: Sun Nov 12, 2017 3:49 pm    Post subject: Howto setup bumblebee on a ThinkPad W530 Reply with quote

This wants to be a wrap up knowledge that describes the setup of bumblebee on a ThinkPad W530 laptop, which uses an Nvidia Quadro K1000M / K2000M (discrete) gpu alongside with the integrated Intel HD4000 one.

The scope of bumblebee is fairly simple, disable the nvidia driver to be loaded on boot and only allow the discrete gpu on demand in order to save some juice.

The reason why I have decided to come up with this is because I couldn't actually find a complete guide that described the entire process top to bottom and for Gentoo. Though I am extremely grateful for each and every hints I was able to find on the internet as they all allowed me to pull it together.

Also note that this tutorial uses proprietary nvidia-drivers rather than the open source Nouveau one.

Before we begin with the setup, we would want to start from the kernel side.

Your configuration needs to look like this:

Enable loadable module support
Code:

[*] Enable loadable module support --->


Enable Memory Type Range Register Support
Code:

Processor type and features --->
   [*] MTRR (Memory Type Range Register) support


Enable agpgart support
Code:
Device Drivers --->
   Graphics support --->
      -*- /dev/agpgart (AGP Support) --->


Disable support for the kernel driver
Code:
Device Drivers --->
    Graphics support --->
        Frame buffer Devices --->
            <*> Support for frame buffer
            < >   nVidia Riva support


Make sure Nouveau driver is disabled in the kernel
Code:
Device Drivers  --->
    Graphics support  --->
        < > Nouveau (nVidia) cards


Once done that, you may want to rebuild your kernel as usual.

Now lets move onto the installation and configuration side.

In /etc/portage/make.conf you want to have this
Code:
VIDEO_CARDS="intel i965 nvidia"


Make sure you add the following to /etc/portage/package.use/x11-drivers
Code:
# required by x11-misc/primus-0.2::gentoo
# required by x11-misc/bumblebee-9999::gentoo
# required by bumblebee (argument)
>=x11-drivers/nvidia-drivers-384.90 compat -kms


Now sync up the portage tree and update your world
Code:
# emerge --sync
# emerge -auDN @world


Once done rebuilding xorg's dependecies and installing the nvidia-drivers, we would want to install mainline versions of bumblebee, bbswitch and primus.

Add the following to /etc/portage/package.accept_keywords
Code:
=sys-power/bbswitch-9999 **
=x11-misc/bumblebee-9999 **
=x11-misc/primus-0.2 ~amd64


Code:
# emerge -aN bbswitch primus bumblebee


Now lets add our user to both video and bumblebee groups
Code:
# usermod -a -G video,bumblebee USER


Lets rebuild the modules for the newly built kernel
Code:
# emerge @module-rebuild


Now, we will need to make some changes to /etc/init.d/bumblebee. Basically you would need to remove the following (which should be line 5,6 and 7).
We really shouldn't need vgl since we will be using primus as it is much faster than vgl.
Code:
depend() {
        need xdm vgl
}


Also, make sure the following lines do match your /etc/bumblebee/bumblebee.conf
Code:
KeepUnusedXServer=false
Driver=nvidia
Bridge=primus
KernelDriver=nvidia
PMMethod=bbswitch


Edit /etc/modprobe.d/nvidia-rmmod.conf and make sure it matches the following
Code:
remove nvidia modprobe -r --ignore-remove nvidia


Lets add bumblebee deamon to be executed on each boot
Code:
# rc-update add bumblebee default


This should not be necessary but I am throwing it there anyways. Edit /etc/modprobe.d/blacklist.conf and add
Code:
blacklist nvidia
blacklist nvidiafb


Also add bbswitch to /etc/conf.d/modules in modules=""

Code:
# reboot


If all went well, the nvidia driver should be off on next boot and bbswitch module on, you can look that up with lsmod.

Also by doing cat /proc/acpi/bbswitch you should also see the current status of the nvidia gpu being on or off, like:
Code:
$ cat /proc/acpi/bbswitch
0000:01:00.0 OFF


As ultimate confirmation you can now run a opengl test something to check whether or not the discrete gpu is being activated / deactivated on demand. Also as of now I haven't done any Xorg configuration regarding the discrete gpu. It all works fine with the default Xorg configuration. Not sure if any configuration is needed when using a external monitor, though that goes beyond the scope of this messy tutorial.

If you have another laptop with the same or another Optimus gpu, this tutorial might work but it is more than likely that you will need additional configuration.

Lastly, although there is quite good information regarding bumblebee setup on other distributions, I do hope this will help somebody else with a W530 and Gentoo in the future.
_________________
Enslaved by Systemd and all the linuxisms that come with it. :|
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum