# Let "nouveau" and "nvidia" cohabit: possible?

## VinzC

Hi all.

Is is possible to configure my system so as to select either nouveau or nvidia for Xorg at boot time using appropriate kernel arguments? (sub-question: which ones?) It could be through the use of an initramfs (which I'm already using since the root filesystem in on LVM) or whatever.

Thanks in advance for any hint or suggestion.

----------

## NeddySeagoon

VinzC,

I think you need two different kernel trees to do this, one set up for niVida, one for nouveau as nVidia will not build against a kernel that has KMS and nouveau.

Now you boot the kernel you want and pass a parameter in the kernel line in grub, which you can parse from /proc/cmdline with a script in /etc/local.d/ to do whatever you want.

Choose a parameter thats easy to parse and that the kernel will ignore. 

Your script can choose the right xorg.conf and anything else you need.

----------

## Anon-E-moose

I used to have my system set up to boot with neither nividia or nouveau.

They were built as modules, with both blacklisted and I just selected one along with copying a preset up xorg conf file for one or the other.

I'm not sure if that is still possible as I haven't kept up with nouveau in the last year or so.

Edit to add:

I had this in /etc/modprobe.d/blacklist.conf

```
blacklist drm

blacklist ttm

blacklist nouveau

blacklist nvidia

```

and this in my .bashrc file

```
nvidia() {

  sudo modprobe -r nouveau

  sudo modprobe nvidia

  sudo eselect opengl set 1

  sudo cp ~/doc/nvidia.conf /etc/X11/xorg.conf.d/30-video.conf

  echo ------> Nvidia drivers loaded <------

}

nouveau() {

  sudo modprobe -r nvidia

  sudo modprobe nouveau

  sudo eselect opengl set 2

  sudo cp ~/doc/nouveau.conf /etc/X11/xorg.conf.d/30-video.conf

  echo ------> Nouveau drivers loaded <------

}

```

This was all pre KMS nouveau days, don't know if it will still work.

Edit to add 2:

I suppose you could build two kernels, one set up for nouveau and the other for nvidia, and boot the appropriate one from grub/lilo.

Edit to add 3:

https://wiki.archlinux.org/index.php/Nouveau

----------

## s4e8

You need to unbind fbcon before rmmod nouveau:

echo 0 > /sys/class/vtconsole/vtcon1/bind

echo 1 > /sys/class/vtconsole/vtcon0/bind

rmmod nouveau

vbetool post

----------

## VinzC

Thanks NeddySeagoon et al.

I'm currently trying to configure my system with both modules in the same kernel tree. Fact is I already installed nvidia proprietary drivers prior to recompiling the kernel with requried modules for nouveau. From your hints I believe it's all possible if I blacklist all modules (nouveau and nvidia). Looks like nvidia gets loaded before running X so it's the easiest part.

In the meantime I'm also trying to keep my bootsplash screen so if nvidia is selected, uvesafb must be loaded. If nouveau is selected, I must update the video=xxx argument accordingly. The tricky part is to write the appropriate xorg configuration file before X starts. I hope local.start is the right place for that.

So thanks for your hints. I'll report here whatever I will have found out.

@s4e8:

I don't really need to unbind in fact for I'll just reboot to switch video drivers. At least in the beginning. Thanks for pointing that anyway.

----------

