Switch between nvidia-current and nouveau without a reboot?
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 either blacklist nvidia
or blacklist 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:
#!/bin/bash
stop gdm
rmmod nvidia
sed -i "s/nouveau/nvidia/" /etc/modprobe.d/blacklist-nvidia-nouveau.conf
update-alternatives --set gl_conf /usr/lib/mesa/ld.so.conf
ldconfig
modprobe nouveau
cp /etc/X11/xorg.conf{.nouveau,}
start gdm
After executing that, I have nouveau running and a working console (nouveaufb).
Switch to nvidia:
#!/bin/bash
stop gdm
echo 0 > /sys/class/vtconsole/vtcon1/bind
rmmod nouveau
rmmod ttm
rmmod drm_kms_helper
rmmod drm
sed -i "s/nvidia/nouveau/" /etc/modprobe.d/blacklist-nvidia-nouveau.conf
update-alternatives --set gl_conf /usr/lib/nvidia-current/ld.so.conf
ldconfig
modprobe nvidia-current
cp /etc/X11/xorg.conf{.nvidia,}
start gdm
→ 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.