Linux – How to select which graphics card to use

graphicslinux

I have a desktop machine (running Ubuntu 13.10) with two video outputs (both nVidia):

  1. an integrated graphics card, which I want to use for my desktop display, and
  2. a PCI graphics card, which I would like to use for CUDA based tasks.

Is there a way to select which one to use for the X server and which for CUDA, and make it permanent?

Best Answer

I believe you can follow the directions outlined here in this post titled: Multiple Nvidia Video Cards & Monitors on Linux Mint 15 MATE. Even though the details are targeting Linux Mint they should still be applicable, since the bulk of the tweaking is being done through the NVIDIA drivers.

I would assume that you can do so either through the NVIDIA dialogs or through your xorg.conf file.

dialogs

   ss #1

xorg.conf files

Section "Device"
    Identifier     "Device2"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 610"
    BusID          "PCI:1:0:0"
    Screen          1
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 6200"
    BusID          "PCI:5:4:0"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 610"
    BusID          "PCI:1:0:0"
    Screen          0
EndSection

Then just only assign the displays to the internal "device":

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "CRT-0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

This is just to give you the general approach, see the article for further details.

Related Question