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.
Had the same problem.
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx
This actually fixed it. Ubuntu 13.10 x64 + nVidia 740M. Thank you very much!
You did not mention your GPU. If you've had that problem on a laptop, I'd suggest its because of the so-called "Fusion" system (which uses your integrated GPU in lieu of discrete one when you don't need it).
Best Answer
Yes you can. By default, the system will be use Intel as primary gfx of your system if you use Nouveau driver. If you want to use your Nvidia gfx you need to add
DRI_PRIME=1
in front of your application launcher or executable like this oneDRI_PRIME=1 yourApps
. You can try doing test in your terminal using command bellowThis would give you output like this
This mean that you run glxinfo using Nouveau driver