Skip to content
SlackBuilds (Slackware build scripts) for Bumblebee and related dependencies
Branch: master
Clone or download
Pull request Compare This branch is 145 commits ahead, 10 commits behind jgeboski:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Bumblebee Slackbuilds

This set of SlackBuilds should get Bumblebee up and running on a Slackware based NVIDIA Optimus setup.

Slackbuilds HowTo:

If you have never used a SlackBuild before, please refer to the HowTo on

All the Slackbuild scripts were designed to be run as root, with root's environment. ( i.e. su - )


Several of these SlackBuilds support a COMPAT32 option which allows 32-bit binaries to be built and packaged. This does require that the system is multilib, otherwise the SlackBuilds will fail.

For more information on slackware multilib, visit AlienBOB's wiki:

As of this time, the nouveau drivers are still pretty poor substitutes for the Nvidia binaries. Performance in 3D games will likely be worse and less stable than the intel drivers and card provide. However, installing the bumblebee and bbswitch will allow the nvidia card to at least be disabled when not in use, saving you power, even if you do not use the closed source nvidia drivers.

Building and Installing


Note that this script runs as root, and will exit if you already have the repo downloaded.


If you modify the builds in any way this script IS NOT FOR YOU.

This script will (in addition to downloading & installing everything in order):

  • Detect Multilib
  • Create the necessary /etc/rc.d/rc.local* entries
  • Create the bumblebee group and add all normal users to it
  • Add a copy of crazybee inside of ~/Bumblebee-SlackBuilds/ for reinstalls

Simply run this as root:


curl | sh


curl | STABLE=yes sh

P.S. This script uses upgradepkg --reinstall --install-new, so you can use it after kernel upgrades.

For reinstalls, run:


sh ~/Bumblebee-SlackBuilds/


STABLE=yes sh ~/Bumblebee-SlackBuilds/

The MANUAL way:

1. Download the sources:


2. Create group bumblebee:

    su -
    groupadd bumblebee

Add users to the group:

    usermod -G bumblebee -a USERNAME

Note: you will need to re-login as the user for this to take effect.

3. Build and install libbsd:

    cd libbsd  
    upgradepkg --install-new /tmp/libbsd-<ver-arch-build>_bbsb.txz  
    cd ..

4. Build and install bumblebee:

    cd bumblebee  
    upgradepkg --install-new /tmp/bumblebee-<ver-arch-build>_bbsb.txz  
    cd ..  

5. Build and install bbswitch (Optional but recommended):

    cd bbswitch  
    upgradepkg --install-new /tmp/bbswitch-<ver-arch-build>_bbsb.txz  
    cd ..  
  • Note: This in an optional requirement. This is the kernel module that allows the Nvidia card to be turned off, potentially saving you power. If you do not need power management or the ability to turn off the nVidia chip, you can skip this.
  • Note: This will need to be rebuilt when you upgrade the kernel.

6. Build and install primus:

    cd primus

For pure 32 or 64 bit systems, build via:


If the system is x86_64 based, 32-bit compatible binaries and libraries can be built via:

    COMPAT32=yes ./primus.SlackBuild  

Then install:

    upgradepkg --install-new /tmp/primus-<ver-arch-build>_bbsb.txz  
    cd ..  
  • Note: due to the sync between framerate and refresh rate, you may not see any difference between primusrun and the intel card in glxgears, although you will see drastic differences playing high end games. In the past the vblank_mode set to 0 improved framerates and helped with screen tearing, now tho this should only be used for benchmarks or tests:
      vblank_mode=0 primusrun

7. Blacklist nouveau (or skip steps 8, 9, 10):

    cd nouveau-blacklist
    upgradepkg xf86-video-nouveau-blacklist-noarch-1.txz
    cd ..
  • Note: This will blacklist / remove the conflicting nouveau driver from slackware, it will however come back unless you add xf86-video-nouveau to /etc/slackpkg/blacklist

8. Build and install nvidia-kernel (Optional, not needed if using nouveau):

    cd nvidia-kernel  
    upgradepkg --install-new /tmp/nvidia-kernel-<ver-arch-build>_bbsb.txz
    cd ..  
  • Note: This will need to be rebuilt when you upgrade the kernel.

9. Build and install nvidia-bumblebee (Optional, not needed if using nouveau):

    cd nvidia-bumblebee  

For pure 32 or 64 bit systems, build via:


If the system is x86_64 based, 32-bit compatible binaries and libraries can be built via:

    COMPAT32=yes ./nvidia-bumblebee.SlackBuild  

Then install:

    upgradepkg --install-new /tmp/nvidia-bumblebee-<ver-arch-build>_bbsb.txz  
    cd ..  

10. Run the rc.bumblebee script:

     chmod +x /etc/rc.d/rc.bumblebeed  
     /etc/rc.d/rc.bumblebeed start  
If you'd like to have bumblebee autostart with the system, you will
need to add the following lines to `/etc/rc.d/rc.local`:  
    if [ -x /etc/rc.d/rc.bumblebeed ]; then  
      /etc/rc.d/rc.bumblebeed start  
You can also go a step further by having bumblebeed stop with your
system by adding the following lines to `/etc/rc.d/rc.local_shutdown`:  
    if [ -x /etc/rc.d/rc.bumblebeed ]; then  
      /etc/rc.d/rc.bumblebeed stop  

11. Reboot:

Not really a step, but you need to get all the new goodness started somehow.

12. Now an application can run with primusrun:

    primusrun glxgears  


This package is completely compatible with the Nvidia CUDA drivers (provided you use the nvidia proprietary drivers).

Note that this is not part of the automatic installation script!

1. Load the NVIDIA Unified Memory kernel module nvidia_uvm

This module is required by CUDA to run. If you'd like to have nvidia_uvm be automatically loaded with your system, you will need to add the following line to /etc/rc.d/rc.local:

    /usr/bin/nvidia-modprobe -c 0 -u
  • Note that the nvidia-modprobe script executed with this arguments will load the module and create device communication files /dev/nvidia-uvm and /dev/nvidia-uvm-tools. These files will not be automatically created if you load the module manually via the modprobe command.

2. Install CUDA Toolkit

Install the cudatoolkit package available on Make sure to select the correct Slackware version.

  • Note that the version of the nvidia driver must be the same as the cudatoolkit version or newer

  • Note that the cudatoolkit package has another dependency nvidia-driver also available on You MUST NOT install this dependency as it conflicts with nvidia-bumblebee and will cause problems in your X-server.

3. Configure environment variables

  • Note that the above should be executed from a user shell, not root. If you want, to make it permanent, paste the above in ~/.bashrc

You also need to allow cuda to find the nvidia libraries. Either add /usr/lib64/nvidia-bumblebee to your /etc/ or add it to your $LD_LIBRARY_PATH. For 32-bit compatible systems also add /usr/lib/nvidia-bumblebee. Then update the linker

    ldconfig -v

4. Verify installation

    cd /usr/doc/cudatoolkit-*/NVIDIA_CUDA-8.0_Samples/1_Utilities/deviceQuery
    cd ../../bin/x86*/linux/release

If the the very end of the output is Result = PASS, then the installation was successful. Note that the Nvidia GPU has to be ON and all the kernel modules need to be properly loaded when you run a CUDA program.

Nvidia Proprietary Driver:

nvidia-bumblebee is the package that installs the nvidia proprietary driver. However, only libraries and tools needed for the core purposes above are installed. This might be a source of issues if you are looking to enable additional functionalities. Here is a list of the libraries from the binary driver that currently are not included in nvidia-bumblebee:$VERSION$VERSION **Added** **Added**$VERSION$VERSION$VERSION$VERSION **Added**$VERSION *Added** **Added** **Added**$VERSION$VERSION$VERSION$VERSION$VERSION

And a list of the tools:


For details on the exact functionality of theese libraries and tools, consult the README.txt that becomes available after extracting the driver.

You can’t perform that action at this time.