Thanks, it works great to avoid choosing every time the integrated card when the computer is initiated. So I did:
Originally Posted by paul!
And added the following lines:
$ sudo gedit /etc/rc.d/rc.local
But even though it serves to avoid choosing the initial card configuration, it does not resolve the fan problem. I made some reboots and saw that the fan running at full speed only happens when I turn off the computer (not when rebooting) while having the integrated card ON and functioning, and the discrete card OFF. To avoid this I must be with the integrated card OFF and the discrete ON and functioning, or with both cards ON.
mount -t debugfs none /sys/kernel/debug
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
That is why I still need the script that before turning off the computer checks and turns ON both cards.