Skip to content

Instantly share code, notes, and snippets.

@gmelikov
Last active January 21, 2018 11:03
Show Gist options
  • Save gmelikov/623879c37ef2aea6baa029360c559cfd to your computer and use it in GitHub Desktop.
Save gmelikov/623879c37ef2aea6baa029360c559cfd to your computer and use it in GitHub Desktop.
Linux: intel GPU as main and nvidia GPUS as CUDA with overclock

Main problem - nvidia-settings needs nvidia GPUs to be started in X.

Workaround - fake displays for nvidia driver in xorg.conf:

  1. nvidia-xconfig --enable-all-gpus

  2. edit /etc/X11/xorg.conf:

...
Section "ServerLayout"
    Identifier     "Layout0"
#Main display for intel
    Screen      0  "Screen0"
#Second display for intel (if you have one)
    Screen      1  "Screen1" RightOf "Screen0"
#Fake displays for nvidia
    Screen      2  "Screen2" RightOf "Screen1"
    Screen      3  "Screen3" RightOf "Screen2"
...

#Fake monitors for each nvidia GPU
Section "Monitor"
    Identifier     "Monitor2"
EndSection

Section "Monitor"
    Identifier     "Monitor3"
EndSection

...

#Intel GPU
Section "Device"
    Identifier     "intel"
    Driver         "intel"
    BusID          "PCI:0:2:0"
EndSection

#You can get these from nvidia-xconfig
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 6GB"
    BusID          "PCI:1:0:0"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 6GB"
    BusID          "PCI:5:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "intel"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "intel"
EndSection

Section "Screen"
    Identifier     "Screen2"
    Device         "Device0"
    Monitor        "Monitor2"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "Coolbits" "28"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen3"
    Device         "Device1"
    Monitor        "Monitor3"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "Coolbits" "28"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment