Compiling - bbswitch kernel module for hybrid GPUs

Bumblebee. The kernel module: - bbswitch

I tried in official Bionic Puppy 64 bit currently with disabled nouveau


A higher kernel version and it's source were nesessary for my hardware: 4.19.25-rt16 x86_64  which here and here can be found. The kernel source sfs is misconfigured so I needed to modify!

For the operation required the kernel source and devx for puppy: devx sfs. For the mentioned kernel I made an sfs which contain the module and the solution: inside this sfs

Load the required sfses and extract bbswitch source downloaded from GitHub eg.: /tmp/any_folder
Rename source's folder to extracted. Navigate there and open a Terminal there. And in that give:


command how described on GitHub.

In our project folder we get a .ko (kernel object) file, called bbswitch.ko . Only this is what we need!

After this process need to load kernel module, but by default it isn't inside the /lib/modules.

So I wrote a start script which load at start process during boot into /root/Startup folder:

In case of only intel GPU to be handled:


insmod /root/bbswitch.ko load_state=0 &

If somebody sure about to place it into /lib/modules then required a conf file in /etc/modprobe.d/bbswitch.conf or an /etc/modules-load.d/bbswitch.conf but for me these took no effect The contents of bbswitch.conf:


options bbswitch load_state=0  

 should be.

I plan to reverse the operation:

At system boot we disbaling the load instead of unload enabling!

For only nvidia option insmod:


insmod /root/bbswitch.ko load_state=1 &

But this is not tested yet!

Tested: It doesn't work!