Is it possible to switch between Nvidia's BLOB and Nouveau video drivers on-the-fly?
I think I need to be able to:
- [✓] Unload nvidia
- [✓] Unload nouveau
- [✕] Restore the console after unloading nouveau*
- [✓] Swap xorg.conf files
- [✓] Take care of blacklisting
- [✓] Deal with libglx.so
*) After a bit of talk with the guys at #nouveau, it seems to be difficult or even impossible with the current Ubuntu setup (builtin vesafb). I'm trying to get it to work with uvesafb, but for now the scripts in the answer do what I was looking for.
I now have two scripts that switch drivers, xorg.conf, take care of blacklisting and the libglx, so the answer is: yes, it is possible.
Blacklisting works with one file in
/etc/modprobe.d/
containing eitherblacklist nvidia
orblacklist nouveau
. I also replaced/lib/nvidia-current/modprobe.conf
with a dummy, else the nvidia driver would always create a link in/etc/modprobe.d/
that blacklists nouveau.Switch to nouveau:
After executing that, I have nouveau running and a working console (nouveaufb).
Switch to nvidia:
→ Nvidia driver is working, only problem: after unloading the nouveau driver, the console is unusable. I need a way to reset it or load another framebuffer, but since vesafb is compiled into the kernel I don't know what to do.
I don't believe it's possible to do, not only is the nouvou driver kernel mode setting and the nvidia one not, but the nvidia driver uses a hacked xorg library which makes even using the same install on a machine requiring the intel driver a problem. (see upside down elements bugs and questions)
http://nouveau.freedesktop.org/wiki/KernelModeSetting/ suggests running /etc/init.d/consolefont restart after rmmod-ing nouevau to restore the text mode. Note that it has been renamed to console-font on more recent systems and in Ubuntu 13.10 it can not be called this way at all, but like this: service console-font restart
Also, it does not work always. In some cases starting X (service lightdm start - or whatever DM you are using) will start gfx mode and also give a working text mode when switching to vt1 (ctrl-alt-f1).
(I use this to install the nvidia driver into a live CD session)