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.
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 one DRI_PRIME=1 yourApps
.
You can try doing test in your terminal using command bellow
DRI_PRIME=1 glxinfo | grep "OpenGL"
This would give you output like this
OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NV108
OpenGL core profile version string: 4.3 (Core Profile) Mesa 17.0.7
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.0.7
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
This mean that you run glxinfo using Nouveau driver
Best Answer
You can switch drivers by running the GUI Additional Drivers from the Software and Update app.
Or you can do it from the terminal commandline by running these commands:
This will show you your available drivers. Then pick the nouveau driver found and switch to it with this command:
The
[xserver-xorg-video-nouveau]
is an example a nouveau driver that might be found.If for some reason you have removed your nouveau drivers, you can reinstall them with (for example):
You can verify the available nouveau drivers from the repository with this command: