Ubuntu multi gpu - Tesla K20m for CUDA and Geforce 210 for gui

Hello. I want to use Tesla K20m for CUDA computations and Geforce 210 for gui rendering in my PC.

I installed Ubuntu 20.04 and faced with troubles:

  1. system detects only Tesla K20m in Drivers application but monitor is connected to Geforce 210 and it renders gui in resolution 640x480;
  2. sudo ubuntu-drivers devices also shows only Tesla K20m card;
  3. lspci shows both devices;
  4. nvidia-smi shows only Tesla K20m (if nvidia drivers are installed).

I tried to edit xorg.conf to render gui using Geforce 210 but nothing changed.
The most recent nvidia driver for Geforce 210 is 340 and for Tesla K20m is 470. I tried to specify in xorg.conf nouveau driver for Geforce 210 but nothing changed.

Please tell me can I force my configuration to work as I want?

With a lot of fiddling it may be possible to set up a split nvidia/nouveau kernel driver scenario, but it’s not really worth the hassle. Rather replace the gf210 with some cheap non-nvidia or current nvidia one.
https://forums.developer.nvidia.com/t/split-kernel-driver-working-now-i-need-to-configure-the-monitors-on-second-gpu-im-lost/69329

Thank you for the fast answer. I want to try method which you have offered with Geforce 210, but cannot understand idea.

  1. I created file in /etc/modprobe.d containing
    options nvidia-drm modeset=1
  2. After that I executed command
    sudo update-initramfs -u
  3. After that I executed command
    sudo cat /sys/module/nvidia_drm/parameters/modeset
    and I retrieved Y as expected
  4. I have written xorg.conf with such sections:
Section "ServerLayout"
    Identifier     "layout"
    Screen      0  "gf210" 0 0
    Inactive       "tesla"
EndSection

Section "Device"
    Identifier     "gf210"
    Driver         "modesetting"
    BusID          "PCI:4:0:0"
EndSection

Section "Device"
    Identifier     "tesla"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:3:0:0"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
    Identifier     "gf210"
    Device         "gf210"
    SubSection     "Display"
        Virtual     1920 1080
    EndSubSection
EndSection

But after reboot I retrieved black screen with some boot strings, ending with
[OK] FInished Update UTMP about System Runlevel Changes.
xorg.log (6.6 KB)

  1. xrandr --listproviders shows “Can’t open display” with such settings or 0 without xorg.conf.

You began at the second part which is irrelevant in your case, revert that. The basic steps are

  • blacklist nouveau so it doesn’t autoload
  • use the nvdia module option NVreg_AssignGpus=
    to only assign the tesla to the nvidia driver.
  • load the nouveau module manually so it can bind only to the free gf210
  • start the xserver with a xorg.conf only adding the gf210 using nouveau/modesetting
  • automate loading nouveau before the xserver starts.

I made following steps, but seems it is not sufficient:

  1. sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
  2. sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
  3. sudo update-initramfs -u
  4. sudo reboot
  5. Added to /etc/modprobe.d/nvidia-add.conf
    options nvidia NVreg_AssignGpus="0:03:00.0"
  6. Created the next xorg.conf:
Section "ServerLayout"
    Identifier     "layout"
    Screen      0  "gf210" 0 0
EndSection

Section "Device"
    Identifier     "gf210"
    Driver         "nouveau"
    BusID          "PCI:4:0:0"
EndSection

Section "Screen"
    Identifier     "gf210"
    Device         "gf210"
EndSection

I don’t understand how to implement 3 last steps from your reply:

  • load the nouveau module manually so it can bind only to the free gf210
  • start the xserver with a xorg.conf only adding the gf210 using nouveau/modesetting
  • automate loading nouveau before the xserver starts.
    Can you tell me please what I’m doing wrong?

Please don’t use options nouveau modeset=0, remove that.
For testing that this setup will work at all, you should disable Xserver autostart
sudo systemctl disable display-manager
after reboot, log in on console and check that the nvidia driver is bound only to the tesla and the noveau driver didn’t load
sudo lspci -k -d 10de:*
Then load the nouveau driver
sudo modprobe nouveau
and check that nouveau now is bound to the gf210
sudo lspci -k -d 10de:*
if all is well, try starting the Xserver
sudo systemctl start gdm
If this works, create a systemd unit that loads the nouveau driver before display-manager starts and re-enable the display-manager
sudo dpkg --reconfigure gdm