Choose which gpu to use on Dual graphics laptops

Miscellaneous tools
Post Reply
Message
Author
stemsee

Choose which gpu to use on Dual graphics laptops

#1 Post by stemsee »

I found the following line of code here
https://docs.slackware.com/howtos:hardw ... ia_optimus
which works for slackware to install bumblebee and bbswitch with all dependencies to give you control over which gpu you use on your intel/nvidia laptop.

Code: Select all

curl https://raw.githubusercontent.com/ryanpcmcquen/linuxTweaks/master/slackware/crazybee.sh | sh

User avatar
nocsak
Posts: 6
Joined: Tue 23 Jan 2018, 17:30
Location: Hungary

Choose which gpu to use on Dual graphics laptops

#2 Post by nocsak »

Hi!

I've discovered some problems around bbswitch.ko kernel module what I've previously compiled under official BionicPup64 8.0 with that's default kernel. After succesfully compiled the module I remade the pupsfs with the module inside /root directory and made an rc.bumble script to load module at boot in /etc/init.d/rc.bumble with syntax as it needed. The script executes successfully the module at boot with the following command:

Code: Select all

insmod /root/bbswitch.ko load_state=1 unload_state=0 &
There is a LED on the machine which indicate which gpu in use currently the nvidia or intel with different color. And my problem is the following:

When I start the puppy with default kernel parameters but with pfix=nox to check in console before X starts if the module is loaded. Yes it is loaded and the adequate LED is lighting. But if I give xwin then some initial texts run and after freezes the system.

And when I give in grub.cfg to the kernel line: nouveau.modeset=0 pfix=nox then from console xwin, then the system starts with intel GPU, I checked it in hardinfo.

So the question is:

Is bbswitch drive the ACPI separately the GPUs, or it drives them together. Or:

Why freezes the puppy with loading the nvidia GPU with load_state=1 and keeping it loaded with unload_state=0.

I mean: If this problem could be solved maybe a correct init script would be enough with a correct command to bbswitch.ko kernel module when loading it at boot.

I don't know the nouveau is the problem or the bbswitch mechanism.

Thanks for answering this question in advance!

I read this before I did anything:
https://github.com/Bumblebee-Project/bbswitch

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#3 Post by bigpup »

I Do not have a laptop with this feature, so I am only giving ideas.

I wonder if a Nvidia manufacture, Nvidia driver, has to be installed and be the driver that is used by the Nvidia hardware.
I think the Nouveau driver is not built to support GPU switching.

I do know, that the Nouveau driver, has to be unloaded, not used, to get a Nvidia driver to load and be used.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
nocsak
Posts: 6
Joined: Tue 23 Jan 2018, 17:30
Location: Hungary

#4 Post by nocsak »

Thanks for your reply!

Yes I read somewhere that nouveau have to be unloaded or blacklisted when installing clean nvidia driver even from .run file or getnvidia. I've tried with required devx and kernel sources with nvidia driver from console on the same way but without any success.

This method worked me on desktop machines with nvidia cards both getnvidia or .run file install but in this case I have no chance to bypass this gpu switching with puppy.

With load_state=0 alone the GPU is intel and it works as I want, but with previous settings I can't got work with only nvidia gpu and nouveau driver. I think the nouveau should work but when bbswitch load only the gpu1 and while it is loaded, the intel gpu should be not accessible.

Anyway thanks again for reply, and I hope later will be a solution for this dualGPU switch mechanism for puppy linux as well!

Bye!

User avatar
nocsak
Posts: 6
Joined: Tue 23 Jan 2018, 17:30
Location: Hungary

#5 Post by nocsak »

Hi all!

I have good news today!
For those who are also having dual graphics intel nvidia, there is a solution to get it work, but only intel side. I have this machine with GPT nvme drive and made a pendrive with EFI loader and grub.cfg and placing inside boot parameters for puppy to boot up with:

Code: Select all

nouveau.modeset=0
in every 4 cases (normal; ram; nox and ram,nox) after the kernel line. With this I disabled nouveau at boot. Now this is only the first step. After this I found kernel for puppy upupbb which I guessed matching with my woof-ce built NOSpup which is a customized bionic 1903 32bit puppy. So the kernel is a rockedge variant 5.6.4 rt3 which can be found here: http://rockedge.org/kernels/. So I replaced the kernel (zdrv and vmlinuz) and made for this an fdrv by popOS's firmware placed here: https://github.com/pop-os/linux-firmware
and by this firmware I can use the intel wireless card as well.

By the first tests I recognized unkillable freezes by mplayer and gnome-mplayer, so I've cleared them from the main sfs, created an adrv which inside I've placed the mpv instead and some settings in it. After I resqaushfs-ed the main sfs without mplayer, gnome-mplayer and it's desktop file, then no more problem found by this setup. So the last test was the pupX which is set up to blank the screen after 600 seconds by default. And before this procedure earlier there was no way to boot into puppy and after 600 seconds the screensaver activated, the ACPI switch mechanism killed the X server suddenly. Now with this kernel I can boot into, and didn't shut down the X server because of the dual GPU. So the good news these are. Now I can use well the intel GPU without bbswitch and X server crush, and true I gave up on nvidia but I can work now without bbswitch and I'm far enough with intel beacuse at this moment I don't using 3D applications which needs power of more then the intel GPU.

So thanks to rockedge for the kernel experiments!

Post Reply