# Blacklist module only for certain device

## Kresp

I have two nvidia GPUS, I need to run one with nvidia driver, the other - with nouveau.

How do I blacklist nouveau for one of those? As far as I understand, I can only blacklist it completely, and modprobe afterwards will try loading it for both devices.

When modprobe checks install section, does it pass device ids when it calls those /bin/{true,false} for checking? Is it possible to make a script that will return 1 when called for one GPU, and 0 - for the rest?Last edited by Kresp on Sun Apr 30, 2017 9:11 pm; edited 1 time in total

----------

## Maxxx

Maybe you need to see this link:

https://wiki.gentoo.org/wiki/Nouveau_%26_nvidia-drivers_switching

----------

## krinn

You can blacklist a module as a kernel parameter, making it easy to do two menus

kernel /boot/vmlinuz root=/dev/sd... blacklist=nouveau

kernel /boot/vmlinuz root=/dev/sd... blacklist=nvidia

----------

## Jaglover

I understand Kresp wants two different nVidia cards simultaneously. Interesting problem. Open source driver does not work without KMS and nVidia blob will not work when KMS is loaded (it has its own). Maybe loading nouveau KMS later when the system is already up using blob will work.

----------

## Kresp

Yep, my problem is running those two side by side, not switchign between them.

Currently I have nouveau blacklisted, so xorg only starts on nvidia GPU (my current GPU driver does not support the second card, so it does not load). If I modprobe nouveau after that, than module picks up the second card, but from now on using GLX on nvidia card crashes X server.

If I log into console shell first, do modprobe mouveau, and then startx - then xorg handles both cards, nvidia and nouveau. However, using nvidia implementation of openGL stops working on DISPLAY associated with nvidia card, like openGL is not even supported.

What I wonder about is whether nouveau tries to bind to the first card even though it is already taken by nvidia blob, thus causing problems.

If there is an option to modprobe module only for certain device, I'll be able to look whether there's interference this way. Or, at least, try loading nouveau - first, and nvidia - second.

If ther is no such option, well then I'm out of luck, it seems - unless it's possible to have two different - old, and new - nvidia driver versions installed and running side by side on Gentoo, which does not seem to be the case.

Sigh... Should've bought RX 480.

----------

## Kresp

There's another question, kind of related.

Can I change which GPU linux uses by default when KMS is not set and X is not running?

Use case is following (for VFIO setup (I have options vfio-pci ids=10de:1401,10de:0fba in modprobe.d)):

```

# Ctrl + Alt + F2 to tty2

# login

modprobe vfio-pci # now I'm blind

modprobe nouveau

# Ctrl + D

# Ctrl + Alt + F1 to tty1

# login to DM

# now I have X running of secondary GPU with nouveau

```

It's basically same, but vfio-pci instead of nvidia for main GPU.

----------

